Difference between revisions of "Oolite JavaScript Reference: Mission"

From Elite Wiki
(Added mission page)
 
Line 1: Line 1:
==== Properties ====
+
== Properties ==
   
 
'''missionScreenTextKey''' : String (write-only)
 
'''missionScreenTextKey''' : String (write-only)
Line 30: Line 30:
 
Sets the dictionary key of the text to put on the manifest screen (usually short instructions for current missions). When not called from within a worldScript, the script has to be specified.
 
Sets the dictionary key of the text to put on the manifest screen (usually short instructions for current missions). When not called from within a worldScript, the script has to be specified.
   
==== Methods ====
+
== Methods ==
   
 
function '''showMissionScreen'''()
 
function '''showMissionScreen'''()

Revision as of 21:02, 24 June 2008

Properties

missionScreenTextKey : String (write-only)

Sets the dictionary key for the mission screen text. Use the same value you’d give addMissionText:. Important: will be deprecated in Oolite 1.70, replacement mechanism to be determined.


musicFileName : String (write-only)

Sets the file name for the mission music. Only has an effect on Mac OS X at present. Important: will be deprecated in favour of new setMusic() function in Oolite 1.70.


imageFileName : String (write-only)

Sets the filename for an image to be displayed on the mission screen. Important: will be deprecated in favour of new setBackgroundImage() function in Oolite 1.70.


choicesKey : String (write-only)

Sets the dictionary key of the choices on the mission screen. Important: will be deprecated in favour of new setChoicesKey() function in Oolite 1.70.


choice : String (read-only)

The most recently selected choice from the mission screen. The empty string "None" is used for no choice. Important: in future versions, null will be used to indicate no choice.


function setInstructionsKey(descriptionKey: string, [worldScript: string])

Sets the dictionary key of the text to put on the manifest screen (usually short instructions for current missions). When not called from within a worldScript, the script has to be specified.

Methods

function showMissionScreen()

Shows the mission screen. Due to implementation details musicFileName, imageFileName and showShipModel() must be set before this method is called, but missionScreenTextKey and choicesKey must be set after this method is called.


function showShipModel(shipKey : String)

Specifies a ship model to be displayed on the mission screen. Must be called before showMissionScreen. (Open issue: why is this a method rather than a write-only property? --ahruman)


function resetMissionChoice()

After calling this method, the mission.choice property will return "None". (Open issue: why not just make choice read/write? --ahruman)


function markSystem(systemNumbers : Number, ...)

Mark the listed systems on the long range chart; for example, mission.markSystem(4, 54, 222) will mark system numbers 4, 54, and 222. Note: eventually this will be deprecated for syntax along the lines of currentGalaxy.systems[4].marked = false;, but this form should continue to work.


function unmarkSystem(systemNumbers : Number, ...)

Remove the marks from the listed systems on the long range chart; for example, mission.unmarkSystem(4 54) will unmark system numbers 4, and 54.