Talk:Oolite JavaScript Reference: Shipdata scripts

From Elite Wiki
Revision as of 14:04, 9 October 2009 by Pmw57 (talk | contribs) (Comments from Thargoid)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Thargoid comments that there is some room for expansion:

  • this.shipSpawnedAsEscort might also be worth mentioning.
  • this.shipDied also triggers when a ship is removed by script.
  • This is an ideal place to include a brief tutorial about linking such a ship script to the ships AI plist too (AI - sendScriptMessage: , js - this.ship.AIState, this.ship.reactToAIMessage). Advanced player stuff but a fair few examples around (some of mine and some of Erics for example, plus several others).
  • script_action is more than shipDockedWithStation and Oolite shipWasScooped, it can be any of the worldScript events. Certainly valid examples thereof, but people might take it as indicative of all that can be done.
  • The script is unique for that given ship (if you spawn two ships of that particular type, they will both run the same script but independent examples thereof).
  • It is possible to pass parameters from the shipdata.plist to the script (via the script_info key). Again advanced-player stuff but not so difficult.

Pmw57 14:04, 9 October 2009 (BST)