Legacy Scripting

From Elite Wiki
Revision as of 12:07, 5 May 2021 by Cholmondely (talk | contribs) (Page Created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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