Jump to content




Upward Compatibilty



6 replies to this topic

#1 MrObsidy

  • Members
  • 63 posts
  • LocationHesse, Germany

Posted 22 June 2015 - 09:20 PM

Hey, dear Community!
Currently I am playing Tekkit Lite (CC1.5) with my friend, programming an os.
But When Coding i came up with the idea to create a script, which replaces the
Startup script (if there is one) with a bootoader, which loads the old Bootloade, AND: Most importantly: go to /bwcompat. In there all API(s) Of versions beyond CC1.5,so Stuff like OneOS can run, and so on. My Question now is, what do you think of that idea? The code should look something like this:

--API LOADER

os.loadAPI("/bwcompat/window")
os.loadAPI("/bwcompat/Whatever APIs will be added into the game")

print ("Running in Upward compatibility!")
Sleep(1)
shell.run("bootloader")

In bwcompat, all APIs of the future versions will be included.

Now, if anybody would be so nice and put all default 1.7 APIs to pastebin


Greeting
~Obby

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 23 June 2015 - 04:15 AM

Moved to Ask a Pro.

Many of the newer APIs rely on functionality that simply doesn't exist in older versions.

#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 23 June 2015 - 05:41 AM

Although, most can be re-written to work anyway. They simply won't be anywhere near as efficient. We're talking about a lot of re-writing, though - it'd probably be less work to re-write all the scripts you're wanting to use, to operate with the old APIs. Yes, all of them!

A brief overview of some of the more notable hurdles:

  • term.native used to point to a system's native terminal. Now it's a function, which has to be called to get that table. Having "both" versions is problematic; it's a "one or the other" deal.
  • In regards to turtles, turtle.inspect() and turtle.getItemDetail() simply cannot be reproduced. turtle_inventory events can, but I can't imagine a pretty solution.
  • Updates to rednet would require what's commonly called in these parts a "top level coroutine override" (TLCO).
  • Changes to some peripherals would require overriding of peripheral.wrap and peripheral.call to handle certain updated peripheral functions in a special way (eg monitor.blit, modem.transmit).

These are some of the less obvious and more difficult points to deal with. There are a large number of other changes that'd need to be made across the board, some of which can be implemented by dropping in files from later ComputerCraft builds (and some of those may need modifications), some of which can't (eg fs.find, which has no official Lua source available; implementations of os.cancelTimer/Alarm, which'd involve overriding os.pullEvent(); etc).

In short, most of it can be done, but not all of it, and it'd be a fair bit of work to even do what's possible. It's probably best to ask yourself - would you still be interested in this project if your server were updated to the latest version of MineCraft/ComputerCraft possible tomorrow?

#4 jerimo

  • Members
  • 74 posts

Posted 23 June 2015 - 04:24 PM

View PostBomb Bloke, on 23 June 2015 - 05:41 AM, said:

[list][*]term.native used to point to a system's native terminal. Now it's a function, which has to be called to get that table. Having "both" versions is problematic; it's a "one or the other" deal.
That one is an easy fix if you set term.native to the table of the native terminal as it used to be and set the metatable's __call to the term.native function that is now in use

Not saying the rest would be easy just that this one is

#5 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 23 June 2015 - 11:56 PM

Tekkit is really getting outdated

Its probably a good time to look into updating your server to a newer mod pack, like one from the FTB or AT Launchers

#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 24 June 2015 - 12:56 AM

View Postjerimo, on 23 June 2015 - 04:24 PM, said:

That one is an easy fix if you set term.native to the table of the native terminal as it used to be and set the metatable's __call to the term.native function that is now in use

Not saying the rest would be easy just that this one is

Ooh, that works quite well. I'd hoped metatables would offer an easy solution, but hadn't actually let myself believe that they did.

#7 jerimo

  • Members
  • 74 posts

Posted 24 June 2015 - 01:43 AM

View PostBomb Bloke, on 24 June 2015 - 12:56 AM, said:

View Postjerimo, on 23 June 2015 - 04:24 PM, said:

That one is an easy fix if you set term.native to the table of the native terminal as it used to be and set the metatable's __call to the term.native function that is now in use

Not saying the rest would be easy just that this one is

Ooh, that works quite well. I'd hoped metatables would offer an easy solution, but hadn't actually let myself believe that they did.
I was in the same boat til I ventured into the tutorial section out of boredom and read up on them
Glad to help





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users