Difference between revisions of "Legacy Scripting"

From Elite Wiki
m (Links: A little more...)
(Tagged as Legacy scripting)
Line 34: Line 34:
 
If you need more information, you can navigate to a relevant page and then inspect the original 2006 version (if there was one) by clicking on the ''history'' tab at the top of the page and comparing the early version with the current one. Ahruman started introducing Javascript after he took over from Aegidian which was in early/mid 2007. Since then, the relevant pages have been edited, replacing the legacy script with the newer Javascript. ''History'' restores the originals. Note that in a few cases (eg: Commodities.plist) the original legacy script no longer works.
 
If you need more information, you can navigate to a relevant page and then inspect the original 2006 version (if there was one) by clicking on the ''history'' tab at the top of the page and comparing the early version with the current one. Ahruman started introducing Javascript after he took over from Aegidian which was in early/mid 2007. Since then, the relevant pages have been edited, replacing the legacy script with the newer Javascript. ''History'' restores the originals. Note that in a few cases (eg: Commodities.plist) the original legacy script no longer works.
  
[[Category:Oolite scripting]][[Category:Factual]]
+
[[Category:Oolite scripting]] [[Category:Legacy scripting]]
 +
[[Category:Factual]]

Revision as of 09:41, 9 August 2021

XML (left) & OpenStep (right)

Older OXPs (from Aegidian's day) were written in Legacy Script. So if you look, for example, at the innards of Charlie's Benulobiweed oxp's from 2006-7 they are all written in the legacy scripts. When Aegidian started writing Oolite it was purely for the AppleMac, hence the ability to overwrite portions of the vanilla game code in OpenStep (the Windows and Linux ports were written later by David Taylor & Dylan Smith). XML was also included as a valid OXP language.

Legacy script thus comes in two versions: XML & OpenStep.

  • See Methods for more technical information on legacy scripting
  • Commander Jettison wrote 2 small programmes for translating the more opaque XML into OpenStep which you can find here (2011-17). The older version is on the first page, the newer on the third page of the thread.
  • The commodities coding in the older OXPs is particularly obscure. See Commodity Calculator for a helpful download for interpreting it.

Javascript

Ahruman (2006-13) started introducing Javascript for OXPs when he took over from Aegidian as Lead Designer. But it took 4 years to create a stable new game with Javascript, shaders and his other modernizations. Cim (2013-15) then started changing some of the coding - for example for commodities & AI's.

Modern OXPs are written in JavaScript. Specifically oolite.jsVersion 185, an Oolite specific variant of ECMAv5. It is the same Spidermonkey version (1.8.5 - March 2011) that Firefox 4 shipped with many years ago, but it is a special build for Oolite. This is the version that we have almost always had and it has not changed between versions of the game since Ahruman's day. It is unlikely to change in the future (due to the immense amount of work involved in tampering with it!).

  • See OXP howto for an introduction to current scripting with Javascript

Updating old OXPs

Rather than delve into the intricacies of legacy scripting, it might be easier to write an over-ride OXP in javascript. See Sothis & SothisTC for an example. KillerWolf wrote Sothis in a mix of XML legacy script & javascript in 2010. Spara wrote a javascript override (improving the markets) which is currently (May 2021) being updated (reintroducing dockability etc, which were all lost as Oolite changed).

Links

If you need more information, you can navigate to a relevant page and then inspect the original 2006 version (if there was one) by clicking on the history tab at the top of the page and comparing the early version with the current one. Ahruman started introducing Javascript after he took over from Aegidian which was in early/mid 2007. Since then, the relevant pages have been edited, replacing the legacy script with the newer Javascript. History restores the originals. Note that in a few cases (eg: Commodities.plist) the original legacy script no longer works.