<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://backup.witchspacewiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dajt</id>
	<title>Elite Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://backup.witchspacewiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dajt"/>
	<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php/Special:Contributions/Dajt"/>
	<updated>2026-04-12T00:18:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_OM_Specification&amp;diff=5896</id>
		<title>Oolite JavaScript OM Specification</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_OM_Specification&amp;diff=5896"/>
		<updated>2007-03-25T07:48:44Z</updated>

		<summary type="html">&lt;p&gt;Dajt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Use this page to define the object model exposed by Oolite to the JavaScript interpreter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
class Vector3&lt;br /&gt;
{&lt;br /&gt;
	float x, z, y;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Quaternion&lt;br /&gt;
{&lt;br /&gt;
	float x, y, z, w;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Commodity&lt;br /&gt;
{&lt;br /&gt;
	readonly string Name;&lt;br /&gt;
	readonly integer unitofMass; // grams, kgs, tons&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Consignment&lt;br /&gt;
{&lt;br /&gt;
	Commodity commodity;&lt;br /&gt;
	float quantity;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Entity&lt;br /&gt;
{&lt;br /&gt;
	readonly integer ID;&lt;br /&gt;
	readonly Entity[] subentities;&lt;br /&gt;
	Vector3 position;&lt;br /&gt;
	Vector3 velocity;&lt;br /&gt;
	Quaternion rotation;&lt;br /&gt;
	// some property to set change in rotation per second?&lt;br /&gt;
&lt;br /&gt;
	static Entity getEntityWithID(integer ID);&lt;br /&gt;
	&lt;br /&gt;
	void setAI(string AIName);&lt;br /&gt;
	void pushAI(string AIName);&lt;br /&gt;
	void popAI();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Note all methods which take an Entity as an argument can also accept an entity ID instead.&lt;br /&gt;
class Vessel&lt;br /&gt;
{&lt;br /&gt;
	float foreShieldStrength;&lt;br /&gt;
	float aftShieldStrength;&lt;br /&gt;
	float energy;&lt;br /&gt;
&lt;br /&gt;
	float foreShieldMaxStrength;&lt;br /&gt;
	float aftShieldMaxStrength;&lt;br /&gt;
	float maxEnergy;&lt;br /&gt;
&lt;br /&gt;
	// something measure of max and current hull integrity?&lt;br /&gt;
&lt;br /&gt;
	// need to represent docking ports somehow&lt;br /&gt;
&lt;br /&gt;
	float cabinTemperature;&lt;br /&gt;
	integer maxCargoCapacity;&lt;br /&gt;
	integer freeCargoCapacity;&lt;br /&gt;
&lt;br /&gt;
	Consignment[] cargo;&lt;br /&gt;
&lt;br /&gt;
	Entity currentTarget;&lt;br /&gt;
	Entity[] escorts;&lt;br /&gt;
&lt;br /&gt;
	string roleName;&lt;br /&gt;
	string commanderName;&lt;br /&gt;
	&lt;br /&gt;
	// short form of getScanClassRelativeTo(0) - ie the player&lt;br /&gt;
	integer getScanClass();&lt;br /&gt;
	integer getScanClassRelativeTo(Entity other);&lt;br /&gt;
&lt;br /&gt;
	float getDistanceFrom(Entity other);&lt;br /&gt;
	void Goto(Vector3 destination);&lt;br /&gt;
	void GotoEntity(Entity other, integer minimumDistance);&lt;br /&gt;
&lt;br /&gt;
	// These methods return the ID of the launched entity, or -1 on error or if the target vessel cannot&lt;br /&gt;
	// launch other vessels.&lt;br /&gt;
	integer launchVesselWithRole(string role);&lt;br /&gt;
	integer launchVesselWithName(string name);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/tt&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_OM_Specification&amp;diff=5895</id>
		<title>Oolite JavaScript OM Specification</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_OM_Specification&amp;diff=5895"/>
		<updated>2007-03-25T03:27:47Z</updated>

		<summary type="html">&lt;p&gt;Dajt: New page: Use this page to define the object model exposed by Oolite to the JavaScript interpreter.  The syntax used should be obvious to anyone with some OO programming experience.  &amp;lt;tt&amp;gt;&amp;lt;pre&amp;gt; class...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Use this page to define the object model exposed by Oolite to the JavaScript interpreter.&lt;br /&gt;
&lt;br /&gt;
The syntax used should be obvious to anyone with some OO programming experience.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
class Vector3&lt;br /&gt;
{&lt;br /&gt;
	float x, z, y;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Quaternion&lt;br /&gt;
{&lt;br /&gt;
	float x, y, z, w;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Commodity&lt;br /&gt;
{&lt;br /&gt;
	readonly string Name;&lt;br /&gt;
	readonly integer unitofMass; // grams, kgs, tons&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Consignment&lt;br /&gt;
{&lt;br /&gt;
	Commodity commodity;&lt;br /&gt;
	float quantity;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Entity&lt;br /&gt;
{&lt;br /&gt;
	readonly integer ID;&lt;br /&gt;
	readonly Entity[] subentities;&lt;br /&gt;
	Vector3 position;&lt;br /&gt;
	Vector3 velocity;&lt;br /&gt;
	Quaternion rotation;&lt;br /&gt;
	// some property to set change in rotation per second?&lt;br /&gt;
&lt;br /&gt;
	static Entity getEntityWithID(integer ID);&lt;br /&gt;
	&lt;br /&gt;
	void setAI(string AIName);&lt;br /&gt;
	void pushAI(string AIName);&lt;br /&gt;
	void popAI();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Note all methods which take an Entity as an argument can also accept an entity ID instead.&lt;br /&gt;
class Vessel&lt;br /&gt;
{&lt;br /&gt;
	float foreShieldStrength;&lt;br /&gt;
	float aftShieldStrength;&lt;br /&gt;
	float energy;&lt;br /&gt;
&lt;br /&gt;
	float foreShieldMaxStrength;&lt;br /&gt;
	float aftShieldMaxStrength;&lt;br /&gt;
	float maxEnergy;&lt;br /&gt;
&lt;br /&gt;
	// something measure of max and current hull integrity?&lt;br /&gt;
&lt;br /&gt;
	// need to represent docking ports somehow&lt;br /&gt;
&lt;br /&gt;
	float cabinTemperature;&lt;br /&gt;
	integer maxCargoCapacity;&lt;br /&gt;
	integer freeCargoCapacity;&lt;br /&gt;
&lt;br /&gt;
	Consignment[] cargo;&lt;br /&gt;
&lt;br /&gt;
	Entity currentTarget;&lt;br /&gt;
	Entity[] escorts;&lt;br /&gt;
&lt;br /&gt;
	string roleName;&lt;br /&gt;
	string commanderName;&lt;br /&gt;
	&lt;br /&gt;
	// short form of getScanClassRelativeTo(0) - ie the player&lt;br /&gt;
	integer getScanClass();&lt;br /&gt;
	integer getScanClassRelativeTo(Entity other);&lt;br /&gt;
&lt;br /&gt;
	float getDistanceFrom(Entity other);&lt;br /&gt;
	void Goto(Vector3 destination);&lt;br /&gt;
	void GotoEntity(Entity other, integer minimumDistance);&lt;br /&gt;
&lt;br /&gt;
	// These methods return the ID of the launched entity, or -1 on error or if the target vessel cannot&lt;br /&gt;
	// launch other vessels.&lt;br /&gt;
	integer launchVesselWithRole(string role);&lt;br /&gt;
	integer launchVesselWithName(string name);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/tt&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=OXP_howto&amp;diff=5894</id>
		<title>OXP howto</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=OXP_howto&amp;diff=5894"/>
		<updated>2007-03-25T03:18:17Z</updated>

		<summary type="html">&lt;p&gt;Dajt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:oolite-oxp-icon.png|100px|right|OXP icon]]&lt;br /&gt;
An '''Oolite Expansion Pack''' can cause many big changes or additions to Oolite's gameplay, or it may represent just a small, subtle alteration. By appearances, there is no way to tell what is inside, as it's merely a folder with the added extention '''.oxp'''. Inside, it will at least contain a folder named ''Config'', and possibly other folders such as ''AIs'', ''Models'', ''Textures'', ''Sounds'', etc.  It is down to the goal of the OXP, which ways to combine elements to the OXP's contents.&lt;br /&gt;
&lt;br /&gt;
=== AIs ===&lt;br /&gt;
&lt;br /&gt;
The folder named AIs would contain any AI.plist additions the OXP might use. &lt;br /&gt;
&lt;br /&gt;
* [[OXP howto AI|Making Oolite AI]]&lt;br /&gt;
&lt;br /&gt;
=== Config===&lt;br /&gt;
&lt;br /&gt;
This folder contains [[Property lists]] such as:&lt;br /&gt;
&lt;br /&gt;
* ''[[shipdata.plist]]'' that introduces any new entity (ships, stations, objects etc.) to Oolite.&lt;br /&gt;
* ''[[shipyard.plist]]'' that introduces new ships available for player purchase.&lt;br /&gt;
* ''[[script.plist]]'' or ''[[script.oos]]'' that plots conditional ''script actions''. script.oos will be loaded in preference to script.plist if both exist.&lt;br /&gt;
* ''[[planetinfo.plist]]'' that plots system specific changes from the default. may also contain ''script actions''.&lt;br /&gt;
* ''[[commodities.plist]]'' that contains information for each commodity in a market.&lt;br /&gt;
* ''[[misc plists|descriptions.plist]]'' that adds vocabulary to Oolite texts.&lt;br /&gt;
* ''[[hud.plist]]'' that allows for changes or a radically new ''Head-Up Display''.&lt;br /&gt;
* ''[[characters.plist]]'' that adds non-player characters to Oolite.&lt;br /&gt;
* ''[[missiontext.plist]]'', ''[[misc plists|demoships.plist]]'', ''[[speech_pronunciation_guide.plist]]'' are some of the other custom methods.&lt;br /&gt;
&lt;br /&gt;
All plist files except for those introducing new AI, belong in Config.&lt;br /&gt;
&lt;br /&gt;
In its simplest form, an OXP could contain only a Config with an altering ''script.plist'' or ''planetinfo.plist''.  An OXP that adds a new ship needs a ''shipdata.plist'' entry, and unless it is based entirely on existing Oolite data, would include a model and texture. &lt;br /&gt;
&lt;br /&gt;
* [[OXP howto plist|Making Oolite plists]]&lt;br /&gt;
&lt;br /&gt;
=== Models===&lt;br /&gt;
&lt;br /&gt;
Oolite models need to be in the '''.dat''' format. There are utilities available that convert models made in Wings 3D (.obj) and Meshwork (.mesh) into this. A .dat file can be opened in a plain text editor to view the object's assigned texture names and see that they correspond with the actual file names in the Textures folder. The .dat file must be named exactly as it is referenced in the shipdata ''model'' entry.&lt;br /&gt;
&lt;br /&gt;
* [[OXP howto model|Making Oolite models]]&lt;br /&gt;
&lt;br /&gt;
=== Textures===&lt;br /&gt;
&lt;br /&gt;
Oolite's textures are in the '''.png''' format, usually at a standard 512x512 size, and must be named exactly as they are named in the .dat file. &lt;br /&gt;
&lt;br /&gt;
* [[OXP howto texture|Making Oolite textures]]&lt;br /&gt;
&lt;br /&gt;
=== A preview of things to come ===&lt;br /&gt;
&lt;br /&gt;
The scripting environment is being reworked to use JavaScript as the core scripting language. See what is available in the current implementation of the JavaScript branch at [[Oolite JavaScript ObjectModel]], and a proposed object model for the trunk [[Oolite JavaScript OM Specification]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
*[http://oolite.aegidian.org/cyoship/ Oolite Tutorial-Meshwork Shipbuilding]&lt;br /&gt;
*[http://oolite.aegidian.org/cyoship2/ Oolite Tutorial-Wings 3D Shipbuilding]&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=5169</id>
		<title>Scripting Oolite with JavaScript</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=5169"/>
		<updated>2007-02-02T04:46:38Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* KeyPressed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== JavaScript file format ==&lt;br /&gt;
&lt;br /&gt;
To use JavaScript for an OXP, place a file script.js in the OXP's Config directory. Do not also include a script.plist or script.oos file.&lt;br /&gt;
&lt;br /&gt;
OXP scripts written in JavaScript are &amp;quot;event driven&amp;quot; - different functions of the script are called in response to state changes in the game, or when other events of interest happen.&lt;br /&gt;
&lt;br /&gt;
Sometimes the event function will be called periodically, such as &amp;lt;tt&amp;gt;STATUS_DOCKED&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;STATUS_IN_FLIGHT&amp;lt;/tt&amp;gt;. These functions will be called about every 10 seconds as long as the game is in that state.&lt;br /&gt;
&lt;br /&gt;
Other event functions will only be called when that state becomes true, like &amp;lt;tt&amp;gt;KeyPressed&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;STATUS_EXITING_WITCHSPACE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== script.js File Template ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste this template into a file called script.js in the OXP Config directory. Ensure you change at least the Name value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.Name = &amp;quot;OXPName&amp;quot;&lt;br /&gt;
this.Description = &amp;quot;A description of what the OXP does.&amp;quot;&lt;br /&gt;
this.Version = &amp;quot;1.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// You can copy and paste this function and just change the &amp;quot;Initialise&amp;quot;&lt;br /&gt;
// to another event name to handle other OXP events (eg &amp;quot;STATUS_DOCKED&amp;quot;,&lt;br /&gt;
// &amp;quot;AlertConditionChanged&amp;quot;, etc).&lt;br /&gt;
//&lt;br /&gt;
this.Initialise = function () {&lt;br /&gt;
    Log(&amp;quot;Initialising OXP &amp;quot; + Name)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scripting Events ===&lt;br /&gt;
&lt;br /&gt;
The following events are available to OXP scripts written in JavaScript.&lt;br /&gt;
&lt;br /&gt;
==== Initialise ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Initialise&amp;lt;/tt&amp;gt; event is called after all OXPs have been loaded. It can be used to do once-off initialisation such as registering to listen for certain keystrokes etc.&lt;br /&gt;
&lt;br /&gt;
 this.Initialise = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== KeyPressed ====&lt;br /&gt;
&lt;br /&gt;
''' Broken due to merge from trunk '''&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;KeyPressed&amp;lt;/tt&amp;gt; event is called when a key the OXP is listening for has been pressed. It will be called once for each time the key is pressed, and will not be called again until the key is released and then pressed again.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;keycode&amp;lt;/tt&amp;gt; argument gives the keycode of the key that was pressed. This can be used to determine which key was pressed if the OXP is listening for more than one key.&lt;br /&gt;
&lt;br /&gt;
 this.KeyPressed = function (keycode) {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== AlertConditionChanged ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;AlertConditionChanged&amp;lt;/tt&amp;gt; event is called when the alert condition changes. The current alert condition can be read from &amp;lt;tt&amp;gt;Player.AlertCondition&amp;lt;/tt&amp;gt; and the current alert flags can be read from &amp;lt;tt&amp;gt;Player.AlertFlags&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 this.AlertConditionChanged = function (keycode) {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_DOCKED ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_DOCKED&amp;lt;/tt&amp;gt; event is called periodically while the player is docked at a station or other entity with a docking port.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_DOCKED = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_IN_FLIGHT ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_IN_FLIGHT&amp;lt;/tt&amp;gt; event is called periodically while the player is flying in normal space or interstellar space (due to a misjump).&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_IN_FLIGHT = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_LAUNCHING ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_LAUNCHING&amp;lt;/tt&amp;gt; event is called once when the player has launched from a dock.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_LAUNCHING = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_EXITING_WITCHSPACE ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_EXITING_WITCHSPACE&amp;lt;/tt&amp;gt; event is called once when the player arrives in a new system.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_EXITING_WITCHSPACE = function () {&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=5014</id>
		<title>Scripting Oolite with JavaScript</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=5014"/>
		<updated>2007-01-16T03:42:01Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* script.js File Template */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== JavaScript file format ==&lt;br /&gt;
&lt;br /&gt;
To use JavaScript for an OXP, place a file script.js in the OXP's Config directory. Do not also include a script.plist or script.oos file.&lt;br /&gt;
&lt;br /&gt;
OXP scripts written in JavaScript are &amp;quot;event driven&amp;quot; - different functions of the script are called in response to state changes in the game, or when other events of interest happen.&lt;br /&gt;
&lt;br /&gt;
Sometimes the event function will be called periodically, such as &amp;lt;tt&amp;gt;STATUS_DOCKED&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;STATUS_IN_FLIGHT&amp;lt;/tt&amp;gt;. These functions will be called about every 10 seconds as long as the game is in that state.&lt;br /&gt;
&lt;br /&gt;
Other event functions will only be called when that state becomes true, like &amp;lt;tt&amp;gt;KeyPressed&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;STATUS_EXITING_WITCHSPACE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== script.js File Template ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste this template into a file called script.js in the OXP Config directory. Ensure you change at least the Name value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.Name = &amp;quot;OXPName&amp;quot;&lt;br /&gt;
this.Description = &amp;quot;A description of what the OXP does.&amp;quot;&lt;br /&gt;
this.Version = &amp;quot;1.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// You can copy and paste this function and just change the &amp;quot;Initialise&amp;quot;&lt;br /&gt;
// to another event name to handle other OXP events (eg &amp;quot;STATUS_DOCKED&amp;quot;,&lt;br /&gt;
// &amp;quot;AlertConditionChanged&amp;quot;, etc).&lt;br /&gt;
//&lt;br /&gt;
this.Initialise = function () {&lt;br /&gt;
    Log(&amp;quot;Initialising OXP &amp;quot; + Name)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scripting Events ===&lt;br /&gt;
&lt;br /&gt;
The following events are available to OXP scripts written in JavaScript.&lt;br /&gt;
&lt;br /&gt;
==== Initialise ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Initialise&amp;lt;/tt&amp;gt; event is called after all OXPs have been loaded. It can be used to do once-off initialisation such as registering to listen for certain keystrokes etc.&lt;br /&gt;
&lt;br /&gt;
 this.Initialise = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== KeyPressed ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;KeyPressed&amp;lt;/tt&amp;gt; event is called when a key the OXP is listening for has been pressed. It will be called once for each time the key is pressed, and will not be called again until the key is released and then pressed again.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;keycode&amp;lt;/tt&amp;gt; argument gives the keycode of the key that was pressed. This can be used to determine which key was pressed if the OXP is listening for more than one key.&lt;br /&gt;
&lt;br /&gt;
 this.KeyPressed = function (keycode) {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== AlertConditionChanged ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;AlertConditionChanged&amp;lt;/tt&amp;gt; event is called when the alert condition changes. The current alert condition can be read from &amp;lt;tt&amp;gt;Player.AlertCondition&amp;lt;/tt&amp;gt; and the current alert flags can be read from &amp;lt;tt&amp;gt;Player.AlertFlags&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 this.AlertConditionChanged = function (keycode) {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_DOCKED ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_DOCKED&amp;lt;/tt&amp;gt; event is called periodically while the player is docked at a station or other entity with a docking port.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_DOCKED = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_IN_FLIGHT ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_IN_FLIGHT&amp;lt;/tt&amp;gt; event is called periodically while the player is flying in normal space or interstellar space (due to a misjump).&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_IN_FLIGHT = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_LAUNCHING ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_LAUNCHING&amp;lt;/tt&amp;gt; event is called once when the player has launched from a dock.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_LAUNCHING = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_EXITING_WITCHSPACE ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_EXITING_WITCHSPACE&amp;lt;/tt&amp;gt; event is called once when the player arrives in a new system.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_EXITING_WITCHSPACE = function () {&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=5011</id>
		<title>Scripting Oolite with JavaScript</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=5011"/>
		<updated>2007-01-16T01:59:37Z</updated>

		<summary type="html">&lt;p&gt;Dajt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== JavaScript file format ==&lt;br /&gt;
&lt;br /&gt;
To use JavaScript for an OXP, place a file script.js in the OXP's Config directory. Do not also include a script.plist or script.oos file.&lt;br /&gt;
&lt;br /&gt;
OXP scripts written in JavaScript are &amp;quot;event driven&amp;quot; - different functions of the script are called in response to state changes in the game, or when other events of interest happen.&lt;br /&gt;
&lt;br /&gt;
Sometimes the event function will be called periodically, such as &amp;lt;tt&amp;gt;STATUS_DOCKED&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;STATUS_IN_FLIGHT&amp;lt;/tt&amp;gt;. These functions will be called about every 10 seconds as long as the game is in that state.&lt;br /&gt;
&lt;br /&gt;
Other event functions will only be called when that state becomes true, like &amp;lt;tt&amp;gt;KeyPressed&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;STATUS_EXITING_WITCHSPACE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== script.js File Template ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste this template into a file called script.js in the OXP Config directory. Ensure you change at least the Name value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.Name = &amp;quot;OXPName&amp;quot;&lt;br /&gt;
this.Descriptipn = &amp;quot;A description of what the OXP does.&amp;quot;&lt;br /&gt;
this.Version = &amp;quot;1.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// You can copy and paste this function and just change the &amp;quot;Initialise&amp;quot;&lt;br /&gt;
// to another event name to handle other OXP events (eg &amp;quot;STATUS_DOCKED&amp;quot;,&lt;br /&gt;
// &amp;quot;AlertConditionChanged&amp;quot;, etc).&lt;br /&gt;
//&lt;br /&gt;
this.Initialise = function () {&lt;br /&gt;
    Log(&amp;quot;Initialising OXP &amp;quot; + Name)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Scripting Events ===&lt;br /&gt;
&lt;br /&gt;
The following events are available to OXP scripts written in JavaScript.&lt;br /&gt;
&lt;br /&gt;
==== Initialise ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;Initialise&amp;lt;/tt&amp;gt; event is called after all OXPs have been loaded. It can be used to do once-off initialisation such as registering to listen for certain keystrokes etc.&lt;br /&gt;
&lt;br /&gt;
 this.Initialise = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== KeyPressed ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;KeyPressed&amp;lt;/tt&amp;gt; event is called when a key the OXP is listening for has been pressed. It will be called once for each time the key is pressed, and will not be called again until the key is released and then pressed again.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;keycode&amp;lt;/tt&amp;gt; argument gives the keycode of the key that was pressed. This can be used to determine which key was pressed if the OXP is listening for more than one key.&lt;br /&gt;
&lt;br /&gt;
 this.KeyPressed = function (keycode) {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== AlertConditionChanged ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;AlertConditionChanged&amp;lt;/tt&amp;gt; event is called when the alert condition changes. The current alert condition can be read from &amp;lt;tt&amp;gt;Player.AlertCondition&amp;lt;/tt&amp;gt; and the current alert flags can be read from &amp;lt;tt&amp;gt;Player.AlertFlags&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 this.AlertConditionChanged = function (keycode) {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_DOCKED ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_DOCKED&amp;lt;/tt&amp;gt; event is called periodically while the player is docked at a station or other entity with a docking port.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_DOCKED = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_IN_FLIGHT ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_IN_FLIGHT&amp;lt;/tt&amp;gt; event is called periodically while the player is flying in normal space or interstellar space (due to a misjump).&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_IN_FLIGHT = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_LAUNCHING ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_LAUNCHING&amp;lt;/tt&amp;gt; event is called once when the player has launched from a dock.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_LAUNCHING = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_EXITING_WITCHSPACE ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;STATUS_EXITING_WITCHSPACE&amp;lt;/tt&amp;gt; event is called once when the player arrives in a new system.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_EXITING_WITCHSPACE = function () {&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=5009</id>
		<title>Scripting Oolite with JavaScript</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=5009"/>
		<updated>2007-01-16T00:37:16Z</updated>

		<summary type="html">&lt;p&gt;Dajt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== JavaScript file format ==&lt;br /&gt;
&lt;br /&gt;
To use JavaScript for an OXP, place a file script.js in the OXP's Config directory. Do not also include a script.plist or script.oos file.&lt;br /&gt;
&lt;br /&gt;
=== script.js File Template ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Copy and paste this template into a file called script.js in the OXP Config directory&lt;br /&gt;
//&lt;br /&gt;
this.Name = &amp;quot;OXPName&amp;quot;&lt;br /&gt;
this.Descriptipn = &amp;quot;A description of what the OXP does.&amp;quot;&lt;br /&gt;
this.Version = &amp;quot;1.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// You can copy and paste this function and just change the &amp;quot;Initialise&amp;quot;&lt;br /&gt;
// to another event name to handle other OXP events (eg &amp;quot;STATUS_DOCKED&amp;quot;,&lt;br /&gt;
// &amp;quot;AlertConditionChanged&amp;quot;, etc).&lt;br /&gt;
//&lt;br /&gt;
this.Initialise = function () {&lt;br /&gt;
    Log(&amp;quot;Initialising OXP &amp;quot; + Name)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Scripting Events ===&lt;br /&gt;
&lt;br /&gt;
The following events are available to OXP scripts written in JavaScript.&lt;br /&gt;
&lt;br /&gt;
==== Initialise ====&lt;br /&gt;
&lt;br /&gt;
The initialise event is called after all OXPs have been loaded. It can be used to do once-off initialisation such as registering to listen for certain keystrokes etc.&lt;br /&gt;
&lt;br /&gt;
 this.Initialise = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== KeyPressed ====&lt;br /&gt;
&lt;br /&gt;
The KeyPressed event is called when a key the OXP is listening for has been pressed. It will be called once for each time the key is pressed, and will not be called again until the key is released and then pressed again.&lt;br /&gt;
&lt;br /&gt;
The keycode argument gives the keycode of the key that was pressed. This can be used to determine which key was pressed if the OXP is listening for more than one key.&lt;br /&gt;
&lt;br /&gt;
 this.KeyPressed = function (keycode) {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== AlertConditionChanged ====&lt;br /&gt;
&lt;br /&gt;
The AlertConditionChanged event is called when the alert condition changes. The current alert condition can be read from Player.AlertCondition and the current alert flags can be read from Player.AlertFlags.&lt;br /&gt;
&lt;br /&gt;
 this.AlertConditionChanged = function (keycode) {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_DOCKED ====&lt;br /&gt;
&lt;br /&gt;
The STATUS_DOCKED event is called periodically while the player is docked at a station or other entity with a docking port.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_DOCKED = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_IN_FIGHT ====&lt;br /&gt;
&lt;br /&gt;
The STATUS_IN_FIGHT event is called periodically while the player is flying in normal space or interstellar space (due to a misjump).&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_IN_FIGHT = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_LAUNCHING ====&lt;br /&gt;
&lt;br /&gt;
The STATUS_LAUNCHING event is called once when the player has launched from a dock.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_LAUNCHING = function () {&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== STATUS_EXITING_WITCHSPACE ====&lt;br /&gt;
&lt;br /&gt;
The STATUS_EXITING_WITCHSPACE event is called once when the player arrives in a new system.&lt;br /&gt;
&lt;br /&gt;
 this.STATUS_EXITING_WITCHSPACE = function () {&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Windows&amp;diff=4848</id>
		<title>Running Oolite-Windows</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Windows&amp;diff=4848"/>
		<updated>2006-10-20T06:06:07Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Building Oolite from source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
The Windows port of Oolite is built from the same source as the Linux and OS-X versions, and has all the features of those versions.&lt;br /&gt;
&lt;br /&gt;
All OXPs should be compatible with the Windows port.&lt;br /&gt;
&lt;br /&gt;
==Getting and installing the game==&lt;br /&gt;
The game may be downloaded from [http://oolite-pc.berlios.de the BerliOS project page] for Oolite-PC. The installer is also mirrored at ftp://ftp.alioth.net/oolite&lt;br /&gt;
&lt;br /&gt;
To install, run the executable that you have just downloaded. You will get the familiar Windows installer.&lt;br /&gt;
&lt;br /&gt;
A regular build of changes from the SVN source is being carried out on a regular basis. The complete installer above must be installed before any of the updates will work. The update filename changes with each build, so get the latest update file by following the link here: [http://aegidian.org/bb/viewtopic.php?t=1529].&lt;br /&gt;
&lt;br /&gt;
The game has been tested on Windows XP and Windows 2000. '''It will not run on the DOS-extender versions of Windows''' such as Windows 95, 98 or ME. It is expected it will run with Vista, so long as drivers are available for the hardware you have. You are advised to run the latest 3D graphics drivers from your 3D card manufacturer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Errata===&lt;br /&gt;
There was a problem in the 1.62 build that caused memory exhaustion. [http://www.aegidian.org/bb/viewtopic.php?t=1416 Please read this page] to find out how to manually patch the Windows installation. Users of later builds (for example, the current -344 build on the BerliOS site) will not suffer from this issue.&lt;br /&gt;
&lt;br /&gt;
==Running the game==&lt;br /&gt;
Find the Oolite icon in the Start -&amp;gt; Programs menu and click on it. Alternatively double click the Oolite program icon on the desktop. Note that the following key combination will get you out of 'graphics related trouble':&lt;br /&gt;
&lt;br /&gt;
Shift-Escape: Quit Oolite immediately&lt;br /&gt;
&lt;br /&gt;
===Installing OXPs===&lt;br /&gt;
You will need to find where the oolite.app folder is placed: it should be in C:\Program Files\Oolite. Create an AddOns folder beside the oolite.app folder. Put OXPs in here. Note that some OXPs when unzipped contain a folder with a README file and then the OXP - in this case, it's best to unzip the OXP somewhere other than AddOns and copy the OXP folder once unpacked into AddOns.&lt;br /&gt;
&lt;br /&gt;
===Notes for amd64 users===&lt;br /&gt;
No builds for 64-bit versions of Windows have yet been made, however, given the proper availability of graphics and sound drivers, the 32-bit version should run on 64-bit Windows. 32 bit Windows running on amd64 hardware should not have an issue.&lt;br /&gt;
&lt;br /&gt;
==Building Oolite from source==&lt;br /&gt;
# Download and install the necessary software&lt;br /&gt;
## Download and install svn for Windows: [http://subversion.tigris.org/project_packages.html#binary-packages]. Accept all defaults given by the installer.&lt;br /&gt;
## Download and install GNUstep for windows: [ftp://ftp.gnustep.org/pub/gnustep/binaries/windows/base-1.11.1-gui-0.10.1/GNUstep-base-1.11.1-gui-0.10.1-3.exe]. Accept all defaults given by the installer.&lt;br /&gt;
## Download the SDL files required to build Oolite: [http://prdownload.berlios.de/oolite-pc/Local.zip]&lt;br /&gt;
## Unzip this file to &amp;lt;code&amp;gt;c:\GNUstep\Local&amp;lt;/code&amp;gt;&lt;br /&gt;
# Get the source and build it (note, the source comes from the oolite-linux project)&lt;br /&gt;
## Start the GNUstep command line (&amp;lt;i&amp;gt;Start -&amp;gt; Programs -&amp;gt; GNUstep Development -&amp;gt; MSYS for GNUstep&amp;lt;/i&amp;gt;) and issue the following commands:&lt;br /&gt;
## &amp;lt;code&amp;gt;cd $GNUSTEP_LOCAL_ROOT&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;export PATH=$PATH:$GNUSTEP_LOCAL_ROOT/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;mkdir oolite&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;cd oolite&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;svn checkout svn://svn.berlios.de/oolite-linux/trunk&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;cd trunk&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;&lt;br /&gt;
# To run the game in the build environment:&lt;br /&gt;
## Before running the first time: &amp;lt;code&amp;gt;cp $GNUSTEP_LOCAL_ROOT/bin/*.dll oolite.app&amp;lt;/code&amp;gt;&lt;br /&gt;
## &amp;lt;code&amp;gt;openapp oolite.app&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming you have installed one of Nic's releases as detailed above, you can easily keep updating the installation from the latest source. In the &amp;lt;code&amp;gt;$GNUSTEP_LOCAL_ROOT/oolite/trunk&amp;lt;/code&amp;gt; directory, issue the commands:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;export PATH=$PATH:$GNUSTEP_LOCAL_ROOT/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;svn up&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;rm -rf oolite.app/Resources; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You only need to issue the export PATH command when you first start the command line. The rm -rf command before make is required because GNUstep for Windows cannot parse the XML plist file format, and the build fails when it tries to read one of these generated each time the build is performed. This failure is not important, and the process still works, but it is annoying.&lt;br /&gt;
&lt;br /&gt;
Then use the following script to copy the new files over the existing installation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OA=&amp;quot;/c/Program Files/Oolite/oolite.app&amp;quot;&lt;br /&gt;
cd $GNUSTEP_LOCAL_ROOT/oolite/trunk&lt;br /&gt;
if [ oolite.app/oolite.exe -nt &amp;quot;$OA/oolite.exe&amp;quot; ]; then&lt;br /&gt;
    echo &amp;quot;Updating oolite.exe&amp;quot;&lt;br /&gt;
    cp oolite.app/oolite.exe &amp;quot;$OA/oolite.exe&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
for a in AIs Config Images Models Music Sounds Textures; do&lt;br /&gt;
    for b in Resources/$a/*; do&lt;br /&gt;
        c=`basename $b`&lt;br /&gt;
        if [ $b -nt &amp;quot;$OA/Contents/Resources/$a/$c&amp;quot; ]; then&lt;br /&gt;
            echo &amp;quot;Updating with $b&amp;quot;&lt;br /&gt;
            cp $b &amp;quot;$OA/Contents/Resources/$a/$c&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to edit the source, Notepad++ has good Objective-C support and is free: [http://notepad-plus.sourceforge.net/]&lt;br /&gt;
&lt;br /&gt;
Also see the Oolite-PC forum: [http://www.aegidian.org/bb/viewforum.php?f=8]&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Shipdata.plist&amp;diff=4033</id>
		<title>Shipdata.plist</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Shipdata.plist&amp;diff=4033"/>
		<updated>2006-04-21T04:12:02Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* smooth */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''shipdata.plist''' will provide Oolite with all the definitions necessary to include it as an entity in the game, be it ship, station, freak object or sub-entity [[shipdata_structure|(extra)]]. The following (property) entries are, for order's sake, listed alphabetically:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== aft_eject_position ==&lt;br /&gt;
Determines the XYZ point on the model from which cargo is ejected.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;aft_eject_position&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 -4.5 -23.0&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ai_type ==&lt;br /&gt;
Assigns an AI to the entity. This may be a previously existing AI, or one custom made for the occasion.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;ai_type&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;pirateAI.plist&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== beacon ==&lt;br /&gt;
A special feature for beacons and navigation aids.&lt;br /&gt;
The string can be anything - the first letter is what's displayed in the advanced space compass.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
 &amp;lt;key&amp;gt;beacon&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;X-code&amp;lt;/string&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== bounty ==&lt;br /&gt;
Sets a Cr. reward on the NPC's head, and is bound to give it trouble with the law .&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;bounty&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;50&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== cargo_carried ==&lt;br /&gt;
Determines the type of cargo carried as described in [[commodities.plist]], only one type can be specified. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;cargo_carried&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;Gold&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== cargo_type ==&lt;br /&gt;
Determines if object is indeed cargo (CARGO_RANDOM, CARGO_SLAVES, CARGO_THARGOID) or a ship, as below, which is not cargo. Another notable type of cargo is the scripted item (CARGO_SCRIPTED_ITEM), as examplified by the cloacking device. Only works for randomly generated cargopods. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;cargo_type&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;CARGO_NOT_CARGO&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In v1.63, more controll will be available through the CARGO_CARRIED string. (see also discussion)&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;cargo_type&amp;lt;/key&amp;gt; &lt;br /&gt;
 &amp;lt;string&amp;gt;CARGO_CARRIED&amp;lt;/string&amp;gt; &lt;br /&gt;
 &amp;lt;key&amp;gt;cargo_carried&amp;lt;/key&amp;gt; &lt;br /&gt;
 &amp;lt;string&amp;gt;4 Gold&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== death_actions ==&lt;br /&gt;
Gives an oportunity to have a ship do something special as it's dying.  &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;death_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;spawn: explosive_shrapnel 1&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_defense_ships ==&lt;br /&gt;
Designates how many ships a dockable entity (station, carrier) can launch in defense.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== defense_ship_role ==&lt;br /&gt;
Gives an oportunity to designate a particular (group of) ships that will defend a station/carrier. This has to be specified in the [[Shipdata.plist#roles|roles]] of the ship(s) that are assigned to defend.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt; defense_ship_role &amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;carrier_defenders&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== energy_recharge_rate ==&lt;br /&gt;
The rate at which energy is replenished.  Stations are at 100, Adders at 2..&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;energy_recharge_rate&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;4.5&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== escorts ==&lt;br /&gt;
Determines how many escorts an NPC shall have.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;escorts&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;4&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== escort-role ==&lt;br /&gt;
Assigns the specific ship type to be the escort, by the ship's role&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;escort-role&amp;lt;/key&amp;gt; &lt;br /&gt;
 &amp;lt;string&amp;gt;my_custom_escort_role&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== escort-ship ==&lt;br /&gt;
Assigns the specific ship type to be the escort, by the ship's name.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;escort-ship&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;cobramk1&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== exhaust ==&lt;br /&gt;
The XYZ position(s) of exhaust plume(s), and the XYZ of the plume shape, ergo&lt;br /&gt;
&lt;br /&gt;
 x y z width height length&lt;br /&gt;
&lt;br /&gt;
'''x y z''' is the position relative to the origin of the main model. &lt;br /&gt;
&lt;br /&gt;
'''width''' in metres, how wide a plume is on x axis. &lt;br /&gt;
&lt;br /&gt;
'''height''' in metres, how tall a plume is on y axis.&lt;br /&gt;
&lt;br /&gt;
'''length''' in metres, how long a plume is on z axis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are 2 assigned plumes at coords 5, 0, -25 and -5, 0, -25, and each plume is 6 m wide, 4 m tall and m 10 long&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;exhaust&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;5 0.0 -25 6.0 4.0 10.0&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;-5 0.0 -25 6.0 4.0 10.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== extra_cargo ==&lt;br /&gt;
New in version 1.62rc3&lt;br /&gt;
Cargobay extension size can now be customised.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;extra_cargo&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;value&amp;lt;/integer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== forward_weapon_type ==&lt;br /&gt;
Assigns the ship's laser. &lt;br /&gt;
Any weapon type from the [[equipment.plist]] can be used (and WEAPON_NONE). &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;forward_weapon_type&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;WEAPON_BEAM_LASER&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== frangible ==&lt;br /&gt;
Determines if eventual sub-entities are &amp;quot;loose&amp;quot;. By default any given object is already frangible, so the use of this line must be to negate that. &lt;br /&gt;
If set to false, the object plus subentities will be regarded as a single object.&lt;br /&gt;
If set to true, sub entities can be destroyed seperately from the main object.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;frangible&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;false/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== fuel ==&lt;br /&gt;
Determines an NPC ship's fuel storage, which will affect how it uses its Fuel Injectors.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;fuel&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;70&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_ecm ==&lt;br /&gt;
Determines if a ship has the E.C.M system installed.  By chance factor, or true/false.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;has_ecm&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;0.5&amp;lt;/real&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
 &amp;lt;key&amp;gt;has_ecm&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;false/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_escape_pod ==&lt;br /&gt;
Determines if a ship has an escape pod.&lt;br /&gt;
&lt;br /&gt;
Example:		&lt;br /&gt;
 &amp;lt;key&amp;gt;has_escape_pod&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;false/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_fuel_injection ==&lt;br /&gt;
Determines if a ship has the witchdrive fuel injector.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;has_fuel_injection &amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;0.99&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_scoop ==&lt;br /&gt;
Determines if a ship has a fuel/cargo scoop.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;has_scoop&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;false/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_shield_enhancer ==&lt;br /&gt;
Determines if a ship has the coveted shield enhancer.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;has_shield_enhancer&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;0.45000000000000001&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== hud ==&lt;br /&gt;
Used for a playership, to assign another HUD than the default one.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;hud&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;specialhud.plist&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== laser_color ==&lt;br /&gt;
Determines a ship's laser colour. NPCs that is, not the player's laser.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;laser_color&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;pinkColor&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== like_ship ==&lt;br /&gt;
Allows a shipdata entry (of a ship with many matching characteristics to another) to be short and sweet, adopting data of stated ship (name), and allowing for any differences between these ships that will be listed. (It is best not to refer to other references.)&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;like_ship&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;adder&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;max_flight_speed&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;700&amp;lt;/real&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;name&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;Freak Turbo Adder&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== likely_cargo ==&lt;br /&gt;
Sets a probable number of tons cargo carried by an NPC, as something else than the stated maximum cargo limit.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;likely_cargo&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;2&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_cargo ==&lt;br /&gt;
Sets the ship's cargo limit.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_cargo&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;5&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_energy ==&lt;br /&gt;
Sets the ship's energy value.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_energy&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;300&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_flight_pitch ==&lt;br /&gt;
Sets pitch factor. Will usually range from a sluggish 0.6 to a very sensitive 3.0&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_flight_pitch&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;2.2&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_flight_roll ==&lt;br /&gt;
Sets roll factor. Will usually range from 0.8 to 4.6.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_flight_roll&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;4.2000000000000002&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_flight_speed ==&lt;br /&gt;
Sets the model's top speed. Interceptors fly at 520 (0.52 LM), Shuttles at 80.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_flight_speed&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;320&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_missiles ==&lt;br /&gt;
Sets a ship's missile limit.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_missiles&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;1&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== missile_launch_position ==&lt;br /&gt;
Determines the XYZ point on the model from which a missile is launched.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;missile_launch_position&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 -2.25 10.0&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== missiles ==&lt;br /&gt;
Sets a ship's probable number of missiles.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;missiles&amp;lt;/key&amp;gt;&lt;br /&gt;
  &amp;lt;integer&amp;gt;0&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== model ==&lt;br /&gt;
Assigns the entity's corresponding '''.dat''' file that will be found with the exact same name in the ''Models'' folder.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;model&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;example_ship.dat&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== name ==&lt;br /&gt;
States the model's name as it will be known to the ID computer.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;name&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;ExampleShip Mark IX&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== roles ==&lt;br /&gt;
Assigns which [[role]](s) the entity should have, that can correspond to one specific, exclusive use, or several.&lt;br /&gt;
&lt;br /&gt;
In the example below the ship in question will be considered twice as often (2.0) when a trader is called for, only one quarter as often (0.25) when looking for a hunter, and as often as any other pirate ships when looking for a pirate.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;roles&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;hunter(0.25) trader(2.0) pirate&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or simply&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;key&amp;gt;roles&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;just_custom_role&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== rotational_velocity ==&lt;br /&gt;
May be applied to a sub-entity, like the following entry to the [[Weeviloid 2]]s spines.&lt;br /&gt;
Takes the form of [[Quaternions]], below example enables rotation around the Z-axis.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;rotational_velocity&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.707 0.0 0.0 0.707&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== scanClass ==&lt;br /&gt;
Will alter the model's appearance on the [[IFF system]].  If this line is omitted, it will become by default a standard ship entity, appearing as yellow flag on the radar.  There are other options.&lt;br /&gt;
* CLASS_BUOY&lt;br /&gt;
* CLASS_CARGO&lt;br /&gt;
* CLASS_MILITARY&lt;br /&gt;
* CLASS_MISSILE&lt;br /&gt;
* CLASS_POLICE&lt;br /&gt;
* CLASS_ROCK&lt;br /&gt;
* CLASS_STATION&lt;br /&gt;
* CLASS_THARGOID&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Developer Note ====&lt;br /&gt;
Oolite uses scanClass internally to determine the behaviour of some ships (particularly with regard to who may shoot whom without incurring legal penatlties). Bear this in mind and don't allocate CLASS_POLICE or CLASS_THARGOID to ships lightly!&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;scanClass&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;CLASS_ROCK&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== script_actions ==&lt;br /&gt;
Gives an oportunity to insert events such as in [[script.plist]], to involve a specific shipdata entity.  As seen in the following example, this particular object checks if Player has a cloaking device, and if not, will award it.  Should Player already have it, the gift will be in gold.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;script_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;debugOn&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;testForEquipment: EQ_CLOAKING_DEVICE&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;conditions&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;array&amp;gt;&lt;br /&gt;
           &amp;lt;string&amp;gt;foundEquipment_bool equal NO&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;/array&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;do&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;array&amp;gt;&lt;br /&gt;
           &amp;lt;string&amp;gt;awardEquipment: EQ_CLOAKING_DEVICE&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;/array&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;else&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;array&amp;gt;&lt;br /&gt;
           &amp;lt;string&amp;gt;awardCargo: 100 Gold&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;/array&amp;gt;&lt;br /&gt;
     &amp;lt;/dict&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;debugOff&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup_actions ==&lt;br /&gt;
Arranges a process that may be necessary for some objects, like ball turrets..&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;setup_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;initialiseTurret&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== smooth ==&lt;br /&gt;
Determines if the model will have magic smoothing method applied (very rare).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;smooth&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;true/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== subentities ==&lt;br /&gt;
Can assign other objects, lights and turrets, to be associated with the model.  The first three numbers are XYZ positions, however, controlling positioning of enslaved objects is done by means of [[quaternions]].  &lt;br /&gt;
&lt;br /&gt;
Lights follow their own recipe.&lt;br /&gt;
 *FLASHER* x y z hue speed offset size&lt;br /&gt;
&lt;br /&gt;
'''x y z''' is the position relative to the origin of the main model. &lt;br /&gt;
&lt;br /&gt;
'''hue''' describes the colour of the light as a position on a color wheel. &lt;br /&gt;
&lt;br /&gt;
'''speed''' describes how fast the light pulses (on a sine wave) in Hertz (at 0 the light constantly lit)&lt;br /&gt;
&lt;br /&gt;
'''offset''' is the offset to the sine wave (0..1) to time-shift each light &lt;br /&gt;
&lt;br /&gt;
'''size''' is the size of the light's corona in metres&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;subentities&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;mySubEntity 0 -5 10 1 0 0 0&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;*FLASHER* 0 5.5 10 30.0 1 0.0 12&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
note: armed subentities always fire along their Z-axis. When rotating along the Z(t=0)-axis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== thrust ==&lt;br /&gt;
Gives the entity an 'inertia' value, translating size and speed into a form of velocity. 0 for rocks and cargo, 50 for a very fast ship, 100 for a station..&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;thrust&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;25&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== view_position_.. ==&lt;br /&gt;
Sets the ship's 4 point-of-view positions in XYZ relative to the model.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;view_position_aft&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 5.0 -20.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;view_position_forward&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 1.9375 5.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;view_position_port&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;-11.85 2.825 -3.5&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;view_position_starboard&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;11.85 2.825 -3.5&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== weapon_energy ==&lt;br /&gt;
Gives a weapon energy value to the ship's laser that is different than the default.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_energy&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;15&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== weapon_offset ==&lt;br /&gt;
must ask Aegidian. does it make a poor shot?&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_offset_x&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;10&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== weapon_position_.. ==&lt;br /&gt;
Plots the 'gunmouth' points of the model's 4 potential lasers.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_position_aft&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 -5.0 -20.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_position_forward&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 0.0417 16.6667&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_position_port&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;-13.75 -2.0625 -1.875&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_position_starboard&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;13.75 -2.0625 -1.875&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Shipdata.plist&amp;diff=4032</id>
		<title>Shipdata.plist</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Shipdata.plist&amp;diff=4032"/>
		<updated>2006-04-21T04:11:35Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* script_actions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''shipdata.plist''' will provide Oolite with all the definitions necessary to include it as an entity in the game, be it ship, station, freak object or sub-entity [[shipdata_structure|(extra)]]. The following (property) entries are, for order's sake, listed alphabetically:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== aft_eject_position ==&lt;br /&gt;
Determines the XYZ point on the model from which cargo is ejected.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;aft_eject_position&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 -4.5 -23.0&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ai_type ==&lt;br /&gt;
Assigns an AI to the entity. This may be a previously existing AI, or one custom made for the occasion.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;ai_type&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;pirateAI.plist&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== beacon ==&lt;br /&gt;
A special feature for beacons and navigation aids.&lt;br /&gt;
The string can be anything - the first letter is what's displayed in the advanced space compass.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
 &amp;lt;key&amp;gt;beacon&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;X-code&amp;lt;/string&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== bounty ==&lt;br /&gt;
Sets a Cr. reward on the NPC's head, and is bound to give it trouble with the law .&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;bounty&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;50&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== cargo_carried ==&lt;br /&gt;
Determines the type of cargo carried as described in [[commodities.plist]], only one type can be specified. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;cargo_carried&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;Gold&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== cargo_type ==&lt;br /&gt;
Determines if object is indeed cargo (CARGO_RANDOM, CARGO_SLAVES, CARGO_THARGOID) or a ship, as below, which is not cargo. Another notable type of cargo is the scripted item (CARGO_SCRIPTED_ITEM), as examplified by the cloacking device. Only works for randomly generated cargopods. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;cargo_type&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;CARGO_NOT_CARGO&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In v1.63, more controll will be available through the CARGO_CARRIED string. (see also discussion)&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;cargo_type&amp;lt;/key&amp;gt; &lt;br /&gt;
 &amp;lt;string&amp;gt;CARGO_CARRIED&amp;lt;/string&amp;gt; &lt;br /&gt;
 &amp;lt;key&amp;gt;cargo_carried&amp;lt;/key&amp;gt; &lt;br /&gt;
 &amp;lt;string&amp;gt;4 Gold&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== death_actions ==&lt;br /&gt;
Gives an oportunity to have a ship do something special as it's dying.  &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;death_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;spawn: explosive_shrapnel 1&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_defense_ships ==&lt;br /&gt;
Designates how many ships a dockable entity (station, carrier) can launch in defense.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== defense_ship_role ==&lt;br /&gt;
Gives an oportunity to designate a particular (group of) ships that will defend a station/carrier. This has to be specified in the [[Shipdata.plist#roles|roles]] of the ship(s) that are assigned to defend.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt; defense_ship_role &amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;carrier_defenders&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== energy_recharge_rate ==&lt;br /&gt;
The rate at which energy is replenished.  Stations are at 100, Adders at 2..&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;energy_recharge_rate&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;4.5&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== escorts ==&lt;br /&gt;
Determines how many escorts an NPC shall have.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;escorts&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;4&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== escort-role ==&lt;br /&gt;
Assigns the specific ship type to be the escort, by the ship's role&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;escort-role&amp;lt;/key&amp;gt; &lt;br /&gt;
 &amp;lt;string&amp;gt;my_custom_escort_role&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== escort-ship ==&lt;br /&gt;
Assigns the specific ship type to be the escort, by the ship's name.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;escort-ship&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;cobramk1&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== exhaust ==&lt;br /&gt;
The XYZ position(s) of exhaust plume(s), and the XYZ of the plume shape, ergo&lt;br /&gt;
&lt;br /&gt;
 x y z width height length&lt;br /&gt;
&lt;br /&gt;
'''x y z''' is the position relative to the origin of the main model. &lt;br /&gt;
&lt;br /&gt;
'''width''' in metres, how wide a plume is on x axis. &lt;br /&gt;
&lt;br /&gt;
'''height''' in metres, how tall a plume is on y axis.&lt;br /&gt;
&lt;br /&gt;
'''length''' in metres, how long a plume is on z axis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are 2 assigned plumes at coords 5, 0, -25 and -5, 0, -25, and each plume is 6 m wide, 4 m tall and m 10 long&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;exhaust&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;5 0.0 -25 6.0 4.0 10.0&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;-5 0.0 -25 6.0 4.0 10.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== extra_cargo ==&lt;br /&gt;
New in version 1.62rc3&lt;br /&gt;
Cargobay extension size can now be customised.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;extra_cargo&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;value&amp;lt;/integer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== forward_weapon_type ==&lt;br /&gt;
Assigns the ship's laser. &lt;br /&gt;
Any weapon type from the [[equipment.plist]] can be used (and WEAPON_NONE). &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;forward_weapon_type&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;WEAPON_BEAM_LASER&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== frangible ==&lt;br /&gt;
Determines if eventual sub-entities are &amp;quot;loose&amp;quot;. By default any given object is already frangible, so the use of this line must be to negate that. &lt;br /&gt;
If set to false, the object plus subentities will be regarded as a single object.&lt;br /&gt;
If set to true, sub entities can be destroyed seperately from the main object.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;frangible&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;false/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== fuel ==&lt;br /&gt;
Determines an NPC ship's fuel storage, which will affect how it uses its Fuel Injectors.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;fuel&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;70&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_ecm ==&lt;br /&gt;
Determines if a ship has the E.C.M system installed.  By chance factor, or true/false.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;has_ecm&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;0.5&amp;lt;/real&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
 &amp;lt;key&amp;gt;has_ecm&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;false/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_escape_pod ==&lt;br /&gt;
Determines if a ship has an escape pod.&lt;br /&gt;
&lt;br /&gt;
Example:		&lt;br /&gt;
 &amp;lt;key&amp;gt;has_escape_pod&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;false/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_fuel_injection ==&lt;br /&gt;
Determines if a ship has the witchdrive fuel injector.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;has_fuel_injection &amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;0.99&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_scoop ==&lt;br /&gt;
Determines if a ship has a fuel/cargo scoop.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;has_scoop&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;false/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== has_shield_enhancer ==&lt;br /&gt;
Determines if a ship has the coveted shield enhancer.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;has_shield_enhancer&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;0.45000000000000001&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== hud ==&lt;br /&gt;
Used for a playership, to assign another HUD than the default one.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;hud&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;specialhud.plist&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== laser_color ==&lt;br /&gt;
Determines a ship's laser colour. NPCs that is, not the player's laser.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;laser_color&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;pinkColor&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== like_ship ==&lt;br /&gt;
Allows a shipdata entry (of a ship with many matching characteristics to another) to be short and sweet, adopting data of stated ship (name), and allowing for any differences between these ships that will be listed. (It is best not to refer to other references.)&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;like_ship&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;adder&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;max_flight_speed&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;700&amp;lt;/real&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;name&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;Freak Turbo Adder&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== likely_cargo ==&lt;br /&gt;
Sets a probable number of tons cargo carried by an NPC, as something else than the stated maximum cargo limit.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;likely_cargo&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;2&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_cargo ==&lt;br /&gt;
Sets the ship's cargo limit.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_cargo&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;5&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_energy ==&lt;br /&gt;
Sets the ship's energy value.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_energy&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;300&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_flight_pitch ==&lt;br /&gt;
Sets pitch factor. Will usually range from a sluggish 0.6 to a very sensitive 3.0&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_flight_pitch&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;2.2&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_flight_roll ==&lt;br /&gt;
Sets roll factor. Will usually range from 0.8 to 4.6.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_flight_roll&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;4.2000000000000002&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_flight_speed ==&lt;br /&gt;
Sets the model's top speed. Interceptors fly at 520 (0.52 LM), Shuttles at 80.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_flight_speed&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;320&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== max_missiles ==&lt;br /&gt;
Sets a ship's missile limit.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;max_missiles&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;integer&amp;gt;1&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== missile_launch_position ==&lt;br /&gt;
Determines the XYZ point on the model from which a missile is launched.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;missile_launch_position&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 -2.25 10.0&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== missiles ==&lt;br /&gt;
Sets a ship's probable number of missiles.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;missiles&amp;lt;/key&amp;gt;&lt;br /&gt;
  &amp;lt;integer&amp;gt;0&amp;lt;/integer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== model ==&lt;br /&gt;
Assigns the entity's corresponding '''.dat''' file that will be found with the exact same name in the ''Models'' folder.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;model&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;example_ship.dat&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== name ==&lt;br /&gt;
States the model's name as it will be known to the ID computer.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;name&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;ExampleShip Mark IX&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== roles ==&lt;br /&gt;
Assigns which [[role]](s) the entity should have, that can correspond to one specific, exclusive use, or several.&lt;br /&gt;
&lt;br /&gt;
In the example below the ship in question will be considered twice as often (2.0) when a trader is called for, only one quarter as often (0.25) when looking for a hunter, and as often as any other pirate ships when looking for a pirate.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;roles&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;hunter(0.25) trader(2.0) pirate&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or simply&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;key&amp;gt;roles&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;just_custom_role&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== rotational_velocity ==&lt;br /&gt;
May be applied to a sub-entity, like the following entry to the [[Weeviloid 2]]s spines.&lt;br /&gt;
Takes the form of [[Quaternions]], below example enables rotation around the Z-axis.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;rotational_velocity&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.707 0.0 0.0 0.707&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== scanClass ==&lt;br /&gt;
Will alter the model's appearance on the [[IFF system]].  If this line is omitted, it will become by default a standard ship entity, appearing as yellow flag on the radar.  There are other options.&lt;br /&gt;
* CLASS_BUOY&lt;br /&gt;
* CLASS_CARGO&lt;br /&gt;
* CLASS_MILITARY&lt;br /&gt;
* CLASS_MISSILE&lt;br /&gt;
* CLASS_POLICE&lt;br /&gt;
* CLASS_ROCK&lt;br /&gt;
* CLASS_STATION&lt;br /&gt;
* CLASS_THARGOID&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Developer Note ====&lt;br /&gt;
Oolite uses scanClass internally to determine the behaviour of some ships (particularly with regard to who may shoot whom without incurring legal penatlties). Bear this in mind and don't allocate CLASS_POLICE or CLASS_THARGOID to ships lightly!&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;scanClass&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;CLASS_ROCK&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== script_actions ==&lt;br /&gt;
Gives an oportunity to insert events such as in [[script.plist]], to involve a specific shipdata entity.  As seen in the following example, this particular object checks if Player has a cloaking device, and if not, will award it.  Should Player already have it, the gift will be in gold.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;script_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;debugOn&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;testForEquipment: EQ_CLOAKING_DEVICE&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;conditions&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;array&amp;gt;&lt;br /&gt;
           &amp;lt;string&amp;gt;foundEquipment_bool equal NO&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;/array&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;do&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;array&amp;gt;&lt;br /&gt;
           &amp;lt;string&amp;gt;awardEquipment: EQ_CLOAKING_DEVICE&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;/array&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;else&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;array&amp;gt;&lt;br /&gt;
           &amp;lt;string&amp;gt;awardCargo: 100 Gold&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;/array&amp;gt;&lt;br /&gt;
     &amp;lt;/dict&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;debugOff&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== setup_actions ==&lt;br /&gt;
Arranges a process that may be necessary for some objects, like ball turrets..&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;setup_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;initialiseTurret&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== smooth ==&lt;br /&gt;
Determines if the model will have magic smoothening method applied (very rare).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;smooth&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;true/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== subentities ==&lt;br /&gt;
Can assign other objects, lights and turrets, to be associated with the model.  The first three numbers are XYZ positions, however, controlling positioning of enslaved objects is done by means of [[quaternions]].  &lt;br /&gt;
&lt;br /&gt;
Lights follow their own recipe.&lt;br /&gt;
 *FLASHER* x y z hue speed offset size&lt;br /&gt;
&lt;br /&gt;
'''x y z''' is the position relative to the origin of the main model. &lt;br /&gt;
&lt;br /&gt;
'''hue''' describes the colour of the light as a position on a color wheel. &lt;br /&gt;
&lt;br /&gt;
'''speed''' describes how fast the light pulses (on a sine wave) in Hertz (at 0 the light constantly lit)&lt;br /&gt;
&lt;br /&gt;
'''offset''' is the offset to the sine wave (0..1) to time-shift each light &lt;br /&gt;
&lt;br /&gt;
'''size''' is the size of the light's corona in metres&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;subentities&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;mySubEntity 0 -5 10 1 0 0 0&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;*FLASHER* 0 5.5 10 30.0 1 0.0 12&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
note: armed subentities always fire along their Z-axis. When rotating along the Z(t=0)-axis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== thrust ==&lt;br /&gt;
Gives the entity an 'inertia' value, translating size and speed into a form of velocity. 0 for rocks and cargo, 50 for a very fast ship, 100 for a station..&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;thrust&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;25&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== view_position_.. ==&lt;br /&gt;
Sets the ship's 4 point-of-view positions in XYZ relative to the model.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;view_position_aft&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 5.0 -20.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;view_position_forward&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 1.9375 5.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;view_position_port&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;-11.85 2.825 -3.5&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;view_position_starboard&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;11.85 2.825 -3.5&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== weapon_energy ==&lt;br /&gt;
Gives a weapon energy value to the ship's laser that is different than the default.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_energy&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;15&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== weapon_offset ==&lt;br /&gt;
must ask Aegidian. does it make a poor shot?&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_offset_x&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;real&amp;gt;10&amp;lt;/real&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== weapon_position_.. ==&lt;br /&gt;
Plots the 'gunmouth' points of the model's 4 potential lasers.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_position_aft&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 -5.0 -20.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_position_forward&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;0.0 0.0417 16.6667&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_position_port&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;-13.75 -2.0625 -1.875&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;weapon_position_starboard&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;string&amp;gt;13.75 -2.0625 -1.875&amp;lt;/string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3956</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3956"/>
		<updated>2006-04-05T06:54:27Z</updated>

		<summary type="html">&lt;p&gt;Dajt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
This format cannot be used in other plist files such as planetinfo.plist. It can only be used to replace script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line. Nested &amp;quot;if/then/else/endif&amp;quot; clauses may also be included in the actions.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of a nested if statement:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station, now checking mission variable.&lt;br /&gt;
    if mission_started undefined then&lt;br /&gt;
        set: mission_started YES&lt;br /&gt;
        // you would probably put up a mission page here&lt;br /&gt;
    else&lt;br /&gt;
        // the mission has already been started, do some stuff here&lt;br /&gt;
    endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool, or a set of one or more words&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;&amp;amp;lt;&amp;quot; or &amp;quot;&amp;amp;gt;&amp;quot; then Y should only be a single value and both X and Y are converted to numbers and compared.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;=&amp;quot; then a string comparison is performed between X and Y. This is the only valid value for op when X is a function_bool and in this case Y must be one of &amp;quot;YES&amp;quot; or &amp;quot;NO&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;undefined&amp;quot; then X must be a mission_var or local_var and Y is ignored. The condition is true if the mission or local variable has not yet been defined, or false if it has.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;oneof&amp;quot; then Y is considered to be a list of values separated by commas and the condition is true if X is equal to any one of them.&lt;br /&gt;
&lt;br /&gt;
Each condition is terminated by the word &amp;quot;and&amp;quot; or &amp;quot;then&amp;quot; and each condition can be on a separate line, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if mission_x = A and&lt;br /&gt;
   mission_y = B then&lt;br /&gt;
        // some actions here&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Actions ===&lt;br /&gt;
&lt;br /&gt;
If all the conditions in an &amp;quot;if&amp;quot; statement are met then the actions bounded by the &amp;quot;then&amp;quot; and the &amp;quot;else&amp;quot; or &amp;quot;endif&amp;quot; statement are executed. If any of the conditions in an &amp;quot;if&amp;quot; statement are not met and there is an &amp;quot;else&amp;quot; clause then the actions between the &amp;quot;else&amp;quot; and &amp;quot;endif&amp;quot; statement are executed.&lt;br /&gt;
&lt;br /&gt;
Each action takes one line, and if finished by the end-of-line character(s).&lt;br /&gt;
&lt;br /&gt;
The first word on an action line specifies the action to be performed. Some actions do not require any parameters, so the action line is a single word - &amp;quot;debugOn&amp;quot; for example. If the action requires any parameters, they are specified after a &amp;quot;:&amp;quot;. There are examples of this above - &amp;quot;set&amp;quot; and &amp;quot;debugMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Any word in the set of parameters surrounded by square brakets is assumed to be either a variable or the name of a function. If the word '''''starts''''' with mission_, local_, or commander_ it is assumed to be a variable and the variable's value replaces the variable name and the square brackets before the action is executed. If the word '''''ends''''' with _string, _number, or _bool it is assumed to be a function and the function's return value replaces the function name and the square brackets before the action is executed.&lt;br /&gt;
&lt;br /&gt;
Some examples of actions with replacements:&lt;br /&gt;
&lt;br /&gt;
 // set the script local variable local_x to a number between 1 and 100&lt;br /&gt;
 set: local_x [d100_number]&lt;br /&gt;
 &lt;br /&gt;
 // then set the script local variable local_y to a number between 1 and 100&lt;br /&gt;
 set: local_y [d100_number]&lt;br /&gt;
 &lt;br /&gt;
 // and add local_x to it - notice local_y isn't in brackets because the first word has&lt;br /&gt;
 // to be the name of the variable to be acted upon, not it's value&lt;br /&gt;
 add: local_y [local_x]&lt;br /&gt;
 &lt;br /&gt;
 // print a message to the log&lt;br /&gt;
 debugMessage: Commander [commander_name] has [local_x] widgets and [local_y] twigs&lt;br /&gt;
&lt;br /&gt;
Here is the longway.oxp script converted to oos format, with comments added:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Giles Williams' LongWay mission converted to oos format&lt;br /&gt;
//&lt;br /&gt;
long_way_round&lt;br /&gt;
&lt;br /&gt;
// This is a pretty fast way to ensure no unnecessary processing is performed.&lt;br /&gt;
// This single condition can avoid all the other conditions getting evaluated&lt;br /&gt;
// if the player isn't in galaxy 0&lt;br /&gt;
//&lt;br /&gt;
if galaxy_number equal 0 then&lt;br /&gt;
&lt;br /&gt;
        // As above, this one condition can save evaluating the three enclosed conditions&lt;br /&gt;
        // while the player is in space.&lt;br /&gt;
        //&lt;br /&gt;
	if dockedAtMainStation_bool equal YES then&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station at XXX then start the&lt;br /&gt;
                // mission. Doesn't seem to be a way to refuse to do the mission.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround undefined and planet_number equal 3 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Biarge_briefing&lt;br /&gt;
			set: mission_longwayround STAGE1&lt;br /&gt;
			setMissionDescription: em1_short_desc1&lt;br /&gt;
		endif&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station of YYY and they're doing&lt;br /&gt;
                // the longway mission then reward them for partially completing it and&lt;br /&gt;
                // send them on the next step.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround equal STAGE1 and plaent_number equal 248 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Soladies_briefing&lt;br /&gt;
			awardCredits: 500&lt;br /&gt;
			set: mission_longwayround STAGE2&lt;br /&gt;
			setMissionDescription: em1_short_desc2&lt;br /&gt;
		endif&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station of ZZZ and they're on the&lt;br /&gt;
                // 2nd step of the mission, mark it complete and reward the player again.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround equal STAGE2 and planet_number equal 233 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setMissionImage: loyalistflag.png&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Qubeen_briefing&lt;br /&gt;
			awardCredits: 2000&lt;br /&gt;
			setMissionImage: none&lt;br /&gt;
			set: mission_longwayround MISSION_COMPLETE&lt;br /&gt;
			clearMissionDescription&lt;br /&gt;
		endif&lt;br /&gt;
	endif&lt;br /&gt;
&lt;br /&gt;
        // If the player is on the second step of the mission and jumps in system ZZZ&lt;br /&gt;
        // to complete the mission, ambush them with a couple of rebel ships!&lt;br /&gt;
        //&lt;br /&gt;
	if mission_longwayround equal STAGE2 and&lt;br /&gt;
	   planet_number equal 233 and&lt;br /&gt;
	   status_string equal STATUS_EXITING_WITCHSPACE then&lt;br /&gt;
		addShips: rebel 2&lt;br /&gt;
	endif&lt;br /&gt;
&lt;br /&gt;
        // Continually harass the player while they're in system ZZZ trying to finish&lt;br /&gt;
        // the mission.&lt;br /&gt;
        //&lt;br /&gt;
	if mission_longwayround equal STAGE2 and&lt;br /&gt;
	   status_string equal STATUS_IN_FLIGHT and&lt;br /&gt;
	   planet_number equal 233 and&lt;br /&gt;
	   scriptTimer_number lessthan 60 then&lt;br /&gt;
		checkForShips: rebel&lt;br /&gt;
		if shipsFound_number lessthan 5 and d100_number lessthan 50 then&lt;br /&gt;
			addShips: rebel 1&lt;br /&gt;
		endif&lt;br /&gt;
	endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Methods&amp;diff=3955</id>
		<title>Methods</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Methods&amp;diff=3955"/>
		<updated>2006-04-05T06:53:23Z</updated>

		<summary type="html">&lt;p&gt;Dajt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Methods'''&lt;br /&gt;
&lt;br /&gt;
Methods are the actions that are performed when conditions (defined in a script) are met, or when a particular set of actions (like ''[[Shipdata.plist#death_actions|death_actions]]'' or ''[[Shipdata.plist#script_actions|script_actions]]'') are called for, or when an AI calls for a script action to be performed.&lt;br /&gt;
&lt;br /&gt;
All methods are stored in plists as strings (in XML this means between a &amp;lt;string&amp;gt; tag and a &amp;lt;/string&amp;gt; closing tag). If they take any parameters then these follow a colon and a space (''': ''') after the 'command' part of the method.&lt;br /&gt;
&lt;br /&gt;
For example: if the ship containing this ''death_actions'' entry is destroyed - the player gets a message and the sun goes Nova two seconds later!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;key&amp;gt;death_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
 	&amp;lt;string&amp;gt;commsMessage: Oh dear [commander_name]!&amp;lt;/string&amp;gt;&lt;br /&gt;
 	&amp;lt;string&amp;gt;setSunNovaIn: 2.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Mission Screen ==&lt;br /&gt;
&lt;br /&gt;
 '''setGuiToMissionScreen'''&lt;br /&gt;
 // opens the mission screen&lt;br /&gt;
 &lt;br /&gt;
 '''addMissionText: &amp;lt;[[missiontext.plist]] key&amp;gt; '''&lt;br /&gt;
 // adds text to the mission screen from an entry in [[missiontext.plist]]&lt;br /&gt;
 // with the given key&lt;br /&gt;
 &lt;br /&gt;
 '''showShipModel: &amp;lt;role&amp;gt;'''&lt;br /&gt;
 // shows a rotating model of a ship with the role given&lt;br /&gt;
 // role refers to a value in one of [[shipdata.plist]]'s entries'&lt;br /&gt;
 // ''roles'' key value pair&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionMusic: &amp;lt;filename&amp;gt;'''&lt;br /&gt;
 // plays the music file given&lt;br /&gt;
 // if it exists within any OXP's ''Music'' folder&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionImage: &amp;lt;filename&amp;gt;'''&lt;br /&gt;
 // displays the picture file given&lt;br /&gt;
 // if it exists within any OXP's ''Images'' folder&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionChoices: &amp;lt;[[missiontext.plist]] key&amp;gt;'''&lt;br /&gt;
 // sets the array of choices presented at the bottom of the mission page to those described in the&lt;br /&gt;
 // entry in missiontext.plist that corresponds to the key given&lt;br /&gt;
 &lt;br /&gt;
 '''resetMissionChoice'''&lt;br /&gt;
 // makes missionChoice ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionDescription: &amp;lt;[[missiontext.plist]] key&amp;gt;'''&lt;br /&gt;
 // sets the short description given on the player's manifest screen&lt;br /&gt;
 &lt;br /&gt;
 '''clearMissionDescription'''&lt;br /&gt;
 // clears the short description&lt;br /&gt;
&lt;br /&gt;
 '''resetScriptTimer'''&lt;br /&gt;
 // resets a timer for scripting purposes '''deprecated - do not use''&lt;br /&gt;
&lt;br /&gt;
== Star charts ==&lt;br /&gt;
&lt;br /&gt;
 '''addMissionDestination: &amp;lt;pnum&amp;gt;'''&lt;br /&gt;
 // causes the given planets to be marked on the short and long range star charts&lt;br /&gt;
 // multiple planet numbers may be supplied separated by spaces&lt;br /&gt;
 &lt;br /&gt;
 '''removeMissionDestination: &amp;lt;pnum&amp;gt;'''&lt;br /&gt;
 // causes the given planets to have their marks remove from the short and long range star charts&lt;br /&gt;
 // multiple planet numbers may be supplied separated by spaces&lt;br /&gt;
&lt;br /&gt;
== Looking for, and adding ships ==&lt;br /&gt;
&lt;br /&gt;
 '''checkForShips: &amp;lt;role&amp;gt;'''&lt;br /&gt;
 // returns the number of ships found in the current system that match the role&lt;br /&gt;
 // this number can be queried with [[Methods#Results_from_other_methods|'''shipsFound_number''']]&lt;br /&gt;
 &lt;br /&gt;
 '''addShips: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear near the withpoint&lt;br /&gt;
 &lt;br /&gt;
 '''addSystemShips: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;position&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear near a point&lt;br /&gt;
 // on a line from the witchpoint to the planet's station. &amp;lt;position&amp;gt; should be a floating point&lt;br /&gt;
 // number where 0.0  represents the witchpoint and 1.0 represents the station&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsAt: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate scheme&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear ''near'' a point&lt;br /&gt;
 // defined by the &amp;lt;coordinate scheme&amp;gt; and the floating point coordinates x,y and z&lt;br /&gt;
 // &amp;lt;coordinate scheme&amp;gt; consists of a three letter code:&lt;br /&gt;
 // &lt;br /&gt;
 // The first letter indicates the feature that is the origin of the coordinate system.&lt;br /&gt;
 // w =&amp;gt; witchpoint&lt;br /&gt;
 // s =&amp;gt; sun&lt;br /&gt;
 // p =&amp;gt; planet&lt;br /&gt;
 // &lt;br /&gt;
 // The next letter indicates the feature on the 'z' axis of the coordinate system.&lt;br /&gt;
 // w =&amp;gt; witchpoint&lt;br /&gt;
 // s =&amp;gt; sun&lt;br /&gt;
 // p =&amp;gt; planet&lt;br /&gt;
 // &lt;br /&gt;
 // Then the 'y' axis of the system is normal to the plane formed by the planet, sun and witchpoint.&lt;br /&gt;
 // And the 'x' axis of the system is normal to the y and z axes.&lt;br /&gt;
 // So:&lt;br /&gt;
 // ps:  z axis = (planet -&amp;gt; sun)  y axis = normal to (planet - sun - witchpoint)  x axis = normal to y and z axes&lt;br /&gt;
 // pw:  z axis = (planet -&amp;gt; witchpoint)  y axis = normal to (planet - witchpoint - sun)  x axis = normal to y and z axes&lt;br /&gt;
 // sp:  z axis = (sun -&amp;gt; planet)  y axis = normal to (sun - planet - witchpoint)  x axis = normal to y and z axes&lt;br /&gt;
 // sw:  z axis = (sun -&amp;gt; witchpoint)  y axis = normal to (sun - witchpoint - planet)  x axis = normal to y and z axes&lt;br /&gt;
 // wp:  z axis = (witchpoint -&amp;gt; planet)  y axis = normal to (witchpoint - planet - sun)  x axis = normal to y and z axes&lt;br /&gt;
 // ws:  z axis = (witchpoint -&amp;gt; sun)  y axis = normal to (witchpoint - sun - planet)  x axis = normal to y and z axes&lt;br /&gt;
 // &lt;br /&gt;
 // The third letter denotes the units used:&lt;br /&gt;
 // m:  meters&lt;br /&gt;
 // p:  planetary radii&lt;br /&gt;
 // s:  solar radii&lt;br /&gt;
 // u:  distance between first two features indicated (eg. spu means that u = distance from sun to the planet)&lt;br /&gt;
 // &lt;br /&gt;
 // in witchspace (== no sun) coordinates are absolute irrespective of the system used&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsAtPrecisely: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate scheme&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt;'''&lt;br /&gt;
 // This adds the ships as close as possible to the specified point&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsWithinRadius: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate-system&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt; &amp;lt;radius in metres&amp;gt;'''&lt;br /&gt;
 // Example:&lt;br /&gt;
 // &amp;quot;addShipsWithinRadius: asteroid 48 wpm 0 0 15000 5000&amp;quot;&lt;br /&gt;
 // would add a 5km-wide asteroid field with 48 asteroids at a position roughly 15000m towards&lt;br /&gt;
 // the planet from the witchpoint.&lt;br /&gt;
 &lt;br /&gt;
 '''spawn: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // adds a number of ships matching &amp;lt;role&amp;gt; near the ship&lt;br /&gt;
 // that's the target of this script (as [[Shipdata.plist#script_actions|script_actions]] or [[Shipdata.plist#death_actions|death_actions]])&lt;br /&gt;
 &lt;br /&gt;
 '''spawnShip: &amp;lt;[[shipdata.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a ship with the unique [[shipdata.plist]] key given&lt;br /&gt;
 // the position and facing of the ship are determined by a ''spawn'' dictionary in the&lt;br /&gt;
 // ship's shipdata.plist entry with ''position'' and ''facing_position'' as strings describing&lt;br /&gt;
 // coordinates according to one of the schemes above&lt;br /&gt;
&lt;br /&gt;
== Changing the universe ==&lt;br /&gt;
&lt;br /&gt;
 '''setSunNovaIn: &amp;lt;seconds&amp;gt;'''&lt;br /&gt;
 // Sets the sun to go nova after the given time in seconds&lt;br /&gt;
 &lt;br /&gt;
 '''sendAllShipsAway'''&lt;br /&gt;
 // Makes all the ships in the system hyperspace away&lt;br /&gt;
 &lt;br /&gt;
 '''setPlanetinfo: &amp;lt;key&amp;gt;=&amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets an override to the [[planetinfo.plist]] entry for the current system&lt;br /&gt;
 // the value for the given key is set to match the value&lt;br /&gt;
 // (see [[planetinfo.plist]])&lt;br /&gt;
 //&lt;br /&gt;
 // eg '''setPlanetinfo: description=a very dull planet'''&lt;br /&gt;
 // (Note the '=' is required)&lt;br /&gt;
 &lt;br /&gt;
 '''setSpecificPlanetInfo: &amp;lt;gnum&amp;gt;=&amp;lt;pnum&amp;gt;=&amp;lt;key&amp;gt;=&amp;lt;value&amp;gt;&lt;br /&gt;
 // sets an override to the [[planetinfo.plist]] entry for the system&lt;br /&gt;
 // specified by galaxy gnum and planet pnum&lt;br /&gt;
 //&lt;br /&gt;
 // eg '''setSpecificPlanetInfo: 0=7=description=Lave is not a very dull planet'''&lt;br /&gt;
 // (Note the '=' is required between all 4 values)&lt;br /&gt;
 &lt;br /&gt;
 '''addPlanet: &amp;lt;[[planetinfo.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a planet to the universe from data in [[planetinfo.plist]].&lt;br /&gt;
 &lt;br /&gt;
 '''addMoon: &amp;lt;[[planetinfo.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a moon to the universe from data in [[planetinfo.plist]].&lt;br /&gt;
 // (Moons do not get an atmosphere or clouds like planets).&lt;br /&gt;
&lt;br /&gt;
== Mission Variables ==&lt;br /&gt;
&lt;br /&gt;
As of 1.65? these methods can also be used with script local variables by suppling a&lt;br /&gt;
&amp;quot;local_&amp;quot; variable rather than a &amp;quot;mission_&amp;quot; varaible.&lt;br /&gt;
&lt;br /&gt;
 '''set: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets the [[mission_variable]] to the value given&lt;br /&gt;
 // the value can be a particular string or numeric value,&lt;br /&gt;
 // or a queriable state&lt;br /&gt;
 &lt;br /&gt;
 '''reset: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets the [[mission_variable]] to be ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 '''increment: [[mission_variable]]'''&lt;br /&gt;
 // increases the mission variable's value by 1.0&lt;br /&gt;
 &lt;br /&gt;
 '''decrement: [[mission_variable]]'''&lt;br /&gt;
 // decreases the mission variable's value by 1.0&lt;br /&gt;
 &lt;br /&gt;
 '''add: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // adds the value given to the [[mission_variable]]&lt;br /&gt;
 // the value can be a number or a queriable state&lt;br /&gt;
 // like ''shipsFound_number''&lt;br /&gt;
 &lt;br /&gt;
 '''subtract: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // subtracts the value given from the [[mission_variable]]&lt;br /&gt;
 // the value can be a number or a queriable state&lt;br /&gt;
 // like ''shipsFound_number''&lt;br /&gt;
&lt;br /&gt;
== Player rewards and penalties==&lt;br /&gt;
These methods work on the player, not any other ship.&lt;br /&gt;
&lt;br /&gt;
 '''awardCredits: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // awards number of tenths of credits.&lt;br /&gt;
 &lt;br /&gt;
 '''awardShipKills: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // Adds to the number of kills accredited to the player&lt;br /&gt;
 &lt;br /&gt;
 '''setLegalStatus: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // Sets the bounty on the player's head.&lt;br /&gt;
 &lt;br /&gt;
 '''setFuelLeak: &amp;lt;amount&amp;gt;'''&lt;br /&gt;
 // removes this amount from the fuel tank every second&lt;br /&gt;
 // until the tanks drain and self-seal&lt;br /&gt;
 &lt;br /&gt;
 '''awardFuel: &amp;lt;amount&amp;gt;'''&lt;br /&gt;
 // The amount can be positive or negative, expressed in LY of range&lt;br /&gt;
 // the fuel level is adjusted to a maximum of 7.0LY and minimum of 0.0.&lt;br /&gt;
&lt;br /&gt;
=== Equipment ===&lt;br /&gt;
&lt;br /&gt;
 '''awardEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // if the player doesn't have the equipment already&lt;br /&gt;
 // and their ship can be equipped witth it then this fits the&lt;br /&gt;
 // player's ship with the equipment given&lt;br /&gt;
 // valid keys can be found in [[equipment.plist]] (they all begin '''EQ_'''):-&lt;br /&gt;
 //	EQ_FUEL&lt;br /&gt;
 //	EQ_MISSILE&lt;br /&gt;
 //	EQ_CARGO_BAY&lt;br /&gt;
 //	EQ_ECM&lt;br /&gt;
 //	EQ_FUEL_SCOOPS&lt;br /&gt;
 //	EQ_ESCAPE_POD&lt;br /&gt;
 //	EQ_ENERGY_BOMB&lt;br /&gt;
 //	EQ_ENERGY_UNIT&lt;br /&gt;
 //	EQ_NAVAL_ENERGY_UNIT&lt;br /&gt;
 //	EQ_DOCK_COMP&lt;br /&gt;
 //	EQ_GAL_DRIVE&lt;br /&gt;
 //	EQ_CLOAKING_DEVICE&lt;br /&gt;
 //	EQ_PASSENGER_BERTH&lt;br /&gt;
 //	EQ_HARDENED_MISSILE&lt;br /&gt;
 //	EQ_FUEL_INJECTION&lt;br /&gt;
 //	EQ_SCANNER_SHOW_MISSILE_TARGET&lt;br /&gt;
 //	EQ_MULTI_TARGET&lt;br /&gt;
 //	EQ_ADVANCED_COMPASS&lt;br /&gt;
 //	EQ_QC_MINE&lt;br /&gt;
 //	EQ_SHIELD_BOOSTER&lt;br /&gt;
 //	EQ_NAVAL_SHIELD_BOOSTER&lt;br /&gt;
 //	EQ_WEAPON_TWIN_PLASMA_CANNON&lt;br /&gt;
 //	EQ_MILITARY_JAMMER&lt;br /&gt;
 //	EQ_MILITARY_SCANNER_FILTER&lt;br /&gt;
 &lt;br /&gt;
 '''removeEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // removes the indicated equipment from the player's ship&lt;br /&gt;
 &lt;br /&gt;
 '''testForEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // tests whether the player ship has a piece of equipment installed&lt;br /&gt;
 // returns the result in [[Methods#Results_from_other_methods|'''foundEquipment_bool''']]&lt;br /&gt;
&lt;br /&gt;
=== Cargo ===&lt;br /&gt;
&lt;br /&gt;
 '''awardCargo: &amp;lt;amount&amp;gt; &amp;lt;[[Commodities|Commodity]] name&amp;gt;'''&lt;br /&gt;
 // awards a quantity of the cargo named&lt;br /&gt;
 // the cargo name must match the name in [[commodities.plist]] exactly&lt;br /&gt;
 &lt;br /&gt;
 '''removeAllCargo'''&lt;br /&gt;
 // removes all cargo from the hold with no compensation to the player&lt;br /&gt;
 // any special cargo is also removed (see below) restoring use of the cargo bay&lt;br /&gt;
 // Gold, Platinum, and Gemstones are unaffected (they're in the cabin safe).&lt;br /&gt;
 &lt;br /&gt;
 '''useSpecialCargo: &amp;lt;description of cargo&amp;gt;'''&lt;br /&gt;
 // fills the cargo bay withthe cargo described effectively&lt;br /&gt;
 // disabling the use of the cargo bay until the cargo is removed&lt;br /&gt;
&lt;br /&gt;
=== Special ===&lt;br /&gt;
&lt;br /&gt;
 '''ejectItem: &amp;lt;[[shipdata.plist]] key&amp;gt;'''  &lt;br /&gt;
 // Creates a ship or other entity from [[shipdata.plist]] and ejects from&lt;br /&gt;
 // the ship's aft hatch&lt;br /&gt;
 &lt;br /&gt;
 '''launchFromStation'''&lt;br /&gt;
 // forces the player ship to launch&lt;br /&gt;
&lt;br /&gt;
== Communications ==&lt;br /&gt;
&lt;br /&gt;
 '''commsMessage: ''message'' '''&lt;br /&gt;
 // sends the player a message&lt;br /&gt;
 // if the message contains elements enclosed in square brackets ''[like_this]''&lt;br /&gt;
 // that corresponds to a [[mission_variable]] or keys in [[descriptions.plist]]&lt;br /&gt;
 // or to special expansions like [commander_name] then these are expanded&lt;br /&gt;
 // and substituted into the original message&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Querying states ==&lt;br /&gt;
&lt;br /&gt;
=== Player status ===&lt;br /&gt;
&lt;br /&gt;
 // '''mission_string'''&lt;br /&gt;
 // returns the key for the current mission&lt;br /&gt;
 &lt;br /&gt;
 // '''status_string'''&lt;br /&gt;
 // returns one of:&lt;br /&gt;
 // ''STATUS_AUTOPILOT_ENGAGED''&lt;br /&gt;
 // ''STATUS_DEAD''&lt;br /&gt;
 // ''STATUS_DEMO''&lt;br /&gt;
 // ''STATUS_DOCKING''&lt;br /&gt;
 // ''STATUS_DOCKED''&lt;br /&gt;
 // ''STATUS_EFFECT''&lt;br /&gt;
 // ''STATUS_ENTERING_WITCHSPACE''&lt;br /&gt;
 // ''STATUS_ESCAPE_SEQUENCE''&lt;br /&gt;
 // ''STATUS_EXITING_WITCHSPACE''&lt;br /&gt;
 // ''STATUS_EXPERIMENTAL''&lt;br /&gt;
 // ''STATUS_IN_FLIGHT''&lt;br /&gt;
 // ''STATUS_IN_HOLD''&lt;br /&gt;
 // ''STATUS_INACTIVE''&lt;br /&gt;
 // ''STATUS_LAUNCHING''&lt;br /&gt;
 // ''STATUS_TEST''&lt;br /&gt;
 // ''STATUS_WITCHSPACE_COUNTDOWN''&lt;br /&gt;
 // ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 // '''gui_screen_string'''&lt;br /&gt;
 // returns one of:&lt;br /&gt;
 // ''GUI_SCREEN_EQUIP_SHIP''&lt;br /&gt;
 // ''GUI_SCREEN_INTRO1''&lt;br /&gt;
 // ''GUI_SCREEN_INTRO2''&lt;br /&gt;
 // ''GUI_SCREEN_INVENTORY''&lt;br /&gt;
 // ''GUI_SCREEN_LONG_RANGE_CHART''&lt;br /&gt;
 // ''GUI_SCREEN_MAIN''&lt;br /&gt;
 // ''GUI_SCREEN_MARKET''&lt;br /&gt;
 // ''GUI_SCREEN_MISSION''&lt;br /&gt;
 // ''GUI_SCREEN_OPTIONS''&lt;br /&gt;
 // ''GUI_SCREEN_SHORT_RANGE_CHART''&lt;br /&gt;
 // ''GUI_SCREEN_STATUS''&lt;br /&gt;
 // ''GUI_SCREEN_SYSTEM_DATA''&lt;br /&gt;
 // ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 // '''galaxy_number'''&lt;br /&gt;
 // returns a value between 0 and 7&lt;br /&gt;
 &lt;br /&gt;
 // '''planet_number'''&lt;br /&gt;
 // returns a value between 0 and 255&lt;br /&gt;
 &lt;br /&gt;
 // '''score_number'''&lt;br /&gt;
 // returns the number of the player's current ship kills&lt;br /&gt;
 &lt;br /&gt;
 // '''credits_number'''&lt;br /&gt;
 // returns the player's credits x10&lt;br /&gt;
 &lt;br /&gt;
 // '''legalStatus_number'''&lt;br /&gt;
 // returns the bounty on the players head&lt;br /&gt;
 &lt;br /&gt;
 // '''fuel_level_number'''&lt;br /&gt;
 // returns the fuel level in LY&lt;br /&gt;
 &lt;br /&gt;
 // '''dockedAtMainStation_bool'''&lt;br /&gt;
 // returns ''YES'' if docked at a systems main station, ''NO'' otherwise&lt;br /&gt;
 &lt;br /&gt;
 // '''dockedStationName_string'''&lt;br /&gt;
 // returns ''NONE'' if the player isn't docked, the name of the station (from [[shipdata.plist]]) if it is, ''UNKNOWN'' otherwise&lt;br /&gt;
&lt;br /&gt;
=== Results from other methods ===&lt;br /&gt;
&lt;br /&gt;
 // '''shipsFound_number'''&lt;br /&gt;
 // returns the number of ships found by ''checkForShips:''&lt;br /&gt;
 &lt;br /&gt;
 // '''foundEquipment_bool'''&lt;br /&gt;
 // returns the result of the last ''testForEquipment''&lt;br /&gt;
 // returns ''YES'' if the equipment was found, ''NO'' otherwise&lt;br /&gt;
  &lt;br /&gt;
 // '''missionChoice_string'''&lt;br /&gt;
 // returns the result of the player's selection from a list of missionChoices&lt;br /&gt;
 // returns ''UNDEFINED'' or the key for the chosen option&lt;br /&gt;
&lt;br /&gt;
=== Random numbers ===&lt;br /&gt;
&lt;br /&gt;
 // '''d100_number'''&lt;br /&gt;
 // returns a random value from 0 to 99&lt;br /&gt;
 &lt;br /&gt;
 // '''pseudoFixedD100_number'''&lt;br /&gt;
 // returns a random number from 0 to 99 that will&lt;br /&gt;
 // remain fixed as long as the player remains in this system&lt;br /&gt;
&lt;br /&gt;
=== Time ===&lt;br /&gt;
&lt;br /&gt;
 // '''clock_number'''&lt;br /&gt;
 // returns the game time in seconds&lt;br /&gt;
 // '''clock_secs_number'''&lt;br /&gt;
 // returns the game time in seconds&lt;br /&gt;
 // '''clock_mins_number'''&lt;br /&gt;
 // returns the game time in minutes&lt;br /&gt;
 // '''clock_hours_number'''&lt;br /&gt;
 // returns the game time in hours&lt;br /&gt;
 // '''clock_days_number'''&lt;br /&gt;
 // returns the game time in days&lt;br /&gt;
&lt;br /&gt;
=== System states ===&lt;br /&gt;
&lt;br /&gt;
 // '''sunWillGoNova_bool'''&lt;br /&gt;
 // returns whether the sun is going to go nova, either ''YES'' or ''NO''&lt;br /&gt;
 &lt;br /&gt;
 // '''sunGoneNova_bool'''&lt;br /&gt;
 // returns whether the sun has gone nova, either ''YES'' or ''NO''&lt;br /&gt;
 &lt;br /&gt;
 // '''systemGovernment_string'''&lt;br /&gt;
 // returns one of:-&lt;br /&gt;
 // ''Anarchy''&lt;br /&gt;
 // ''Feudal''&lt;br /&gt;
 // ''Multi-Government''&lt;br /&gt;
 // ''Dictatorship''&lt;br /&gt;
 // ''Communist''&lt;br /&gt;
 // ''Confederacy''&lt;br /&gt;
 // ''Democracy''&lt;br /&gt;
 // ''Corporate State''&lt;br /&gt;
 &lt;br /&gt;
 // '''systemGovernment_number'''&lt;br /&gt;
 // returns a value from 0 to 7&lt;br /&gt;
 &lt;br /&gt;
 // '''systemEconomy_number'''&lt;br /&gt;
 // returns a value from 0 to 7&lt;br /&gt;
 &lt;br /&gt;
 // '''systemTechLevel_number'''&lt;br /&gt;
 // returns a value from 0 to 14&lt;br /&gt;
 &lt;br /&gt;
 // '''systemPopulation_number'''&lt;br /&gt;
 // returns a value representing the system's population&lt;br /&gt;
 &lt;br /&gt;
 // '''systemProductivity_number'''&lt;br /&gt;
 // returns a value representing the system's productivity&lt;br /&gt;
&lt;br /&gt;
 // '''scriptTimer_number'''&lt;br /&gt;
 // returns the script timer's current value in seconds '''(deprecated - do not use)'''&lt;br /&gt;
&lt;br /&gt;
== Debugging scripts ==&lt;br /&gt;
&lt;br /&gt;
 '''debugOn'''&lt;br /&gt;
 // sends script debugging messages to the console.&lt;br /&gt;
 &lt;br /&gt;
 '''debugOff'''&lt;br /&gt;
 // cancels script debugging messages&lt;br /&gt;
 &lt;br /&gt;
 '''debugMessage: &amp;lt;message&amp;gt;'''&lt;br /&gt;
 // sends the given message to the console. The message is written to the console regardless&lt;br /&gt;
 // of whether debugOn has been performed or not. For GNUstep versions of Oolite, the console&lt;br /&gt;
 // is a file called stderr.txt located in the game's installation directory. Mission variables&lt;br /&gt;
 // and queriable states may be included in the message, eg:&lt;br /&gt;
 //&lt;br /&gt;
 // ''debugMessage: current galaxy is galaxy_number''&lt;br /&gt;
&lt;br /&gt;
== AI ==&lt;br /&gt;
&lt;br /&gt;
Note that although most of these methods affect the player, some can also be utilised by an AI. &lt;br /&gt;
*[[OXP howto AI]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Methods&amp;diff=3954</id>
		<title>Methods</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Methods&amp;diff=3954"/>
		<updated>2006-04-05T06:45:15Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Changing the universe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Methods'''&lt;br /&gt;
&lt;br /&gt;
Methods are the actions that are performed when conditions (defined in a script) are met, or when a particular set of actions (like ''[[Shipdata.plist#death_actions|death_actions]]'' or ''[[Shipdata.plist#script_actions|script_actions]]'') are called for, or when an AI calls for a script action to be performed.&lt;br /&gt;
&lt;br /&gt;
All methods are stored in plists as strings (in XML this means between a &amp;lt;string&amp;gt; tag and a &amp;lt;/string&amp;gt; closing tag). If they take any parameters then these follow a colon and a space (''': ''') after the 'command' part of the method.&lt;br /&gt;
&lt;br /&gt;
For example: if the ship containing this ''death_actions'' entry is destroyed - the player gets a message and the sun goes Nova two seconds later!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;key&amp;gt;death_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
 	&amp;lt;string&amp;gt;commsMessage: Oh dear [commander_name]!&amp;lt;/string&amp;gt;&lt;br /&gt;
 	&amp;lt;string&amp;gt;setSunNovaIn: 2.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Mission Screen ==&lt;br /&gt;
&lt;br /&gt;
 '''setGuiToMissionScreen'''&lt;br /&gt;
 // opens the mission screen&lt;br /&gt;
 &lt;br /&gt;
 '''addMissionText: &amp;lt;[[missiontext.plist]] key&amp;gt; '''&lt;br /&gt;
 // adds text to the mission screen from an entry in [[missiontext.plist]]&lt;br /&gt;
 // with the given key&lt;br /&gt;
 &lt;br /&gt;
 '''showShipModel: &amp;lt;role&amp;gt;'''&lt;br /&gt;
 // shows a rotating model of a ship with the role given&lt;br /&gt;
 // role refers to a value in one of [[shipdata.plist]]'s entries'&lt;br /&gt;
 // ''roles'' key value pair&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionMusic: &amp;lt;filename&amp;gt;'''&lt;br /&gt;
 // plays the music file given&lt;br /&gt;
 // if it exists within any OXP's ''Music'' folder&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionImage: &amp;lt;filename&amp;gt;'''&lt;br /&gt;
 // displays the picture file given&lt;br /&gt;
 // if it exists within any OXP's ''Images'' folder&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionChoices: &amp;lt;[[missiontext.plist]] key&amp;gt;'''&lt;br /&gt;
 // sets the array of choices presented at the bottom of the mission page to those described in the&lt;br /&gt;
 // entry in missiontext.plist that corresponds to the key given&lt;br /&gt;
 &lt;br /&gt;
 '''resetMissionChoice'''&lt;br /&gt;
 // makes missionChoice ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionDescription: &amp;lt;[[missiontext.plist]] key&amp;gt;'''&lt;br /&gt;
 // sets the short description given on the player's manifest screen&lt;br /&gt;
 &lt;br /&gt;
 '''clearMissionDescription'''&lt;br /&gt;
 // clears the short description&lt;br /&gt;
&lt;br /&gt;
 '''resetScriptTimer'''&lt;br /&gt;
 // resets a timer for scripting purposes '''deprecated - do not use''&lt;br /&gt;
&lt;br /&gt;
== Looking for, and adding ships ==&lt;br /&gt;
&lt;br /&gt;
 '''checkForShips: &amp;lt;role&amp;gt;'''&lt;br /&gt;
 // returns the number of ships found in the current system that match the role&lt;br /&gt;
 // this number can be queried with [[Methods#Results_from_other_methods|'''shipsFound_number''']]&lt;br /&gt;
 &lt;br /&gt;
 '''addShips: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear near the withpoint&lt;br /&gt;
 &lt;br /&gt;
 '''addSystemShips: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;position&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear near a point&lt;br /&gt;
 // on a line from the witchpoint to the planet's station. &amp;lt;position&amp;gt; should be a floating point&lt;br /&gt;
 // number where 0.0  represents the witchpoint and 1.0 represents the station&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsAt: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate scheme&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear ''near'' a point&lt;br /&gt;
 // defined by the &amp;lt;coordinate scheme&amp;gt; and the floating point coordinates x,y and z&lt;br /&gt;
 // &amp;lt;coordinate scheme&amp;gt; consists of a three letter code:&lt;br /&gt;
 // &lt;br /&gt;
 // The first letter indicates the feature that is the origin of the coordinate system.&lt;br /&gt;
 // w =&amp;gt; witchpoint&lt;br /&gt;
 // s =&amp;gt; sun&lt;br /&gt;
 // p =&amp;gt; planet&lt;br /&gt;
 // &lt;br /&gt;
 // The next letter indicates the feature on the 'z' axis of the coordinate system.&lt;br /&gt;
 // w =&amp;gt; witchpoint&lt;br /&gt;
 // s =&amp;gt; sun&lt;br /&gt;
 // p =&amp;gt; planet&lt;br /&gt;
 // &lt;br /&gt;
 // Then the 'y' axis of the system is normal to the plane formed by the planet, sun and witchpoint.&lt;br /&gt;
 // And the 'x' axis of the system is normal to the y and z axes.&lt;br /&gt;
 // So:&lt;br /&gt;
 // ps:  z axis = (planet -&amp;gt; sun)  y axis = normal to (planet - sun - witchpoint)  x axis = normal to y and z axes&lt;br /&gt;
 // pw:  z axis = (planet -&amp;gt; witchpoint)  y axis = normal to (planet - witchpoint - sun)  x axis = normal to y and z axes&lt;br /&gt;
 // sp:  z axis = (sun -&amp;gt; planet)  y axis = normal to (sun - planet - witchpoint)  x axis = normal to y and z axes&lt;br /&gt;
 // sw:  z axis = (sun -&amp;gt; witchpoint)  y axis = normal to (sun - witchpoint - planet)  x axis = normal to y and z axes&lt;br /&gt;
 // wp:  z axis = (witchpoint -&amp;gt; planet)  y axis = normal to (witchpoint - planet - sun)  x axis = normal to y and z axes&lt;br /&gt;
 // ws:  z axis = (witchpoint -&amp;gt; sun)  y axis = normal to (witchpoint - sun - planet)  x axis = normal to y and z axes&lt;br /&gt;
 // &lt;br /&gt;
 // The third letter denotes the units used:&lt;br /&gt;
 // m:  meters&lt;br /&gt;
 // p:  planetary radii&lt;br /&gt;
 // s:  solar radii&lt;br /&gt;
 // u:  distance between first two features indicated (eg. spu means that u = distance from sun to the planet)&lt;br /&gt;
 // &lt;br /&gt;
 // in witchspace (== no sun) coordinates are absolute irrespective of the system used&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsAtPrecisely: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate scheme&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt;'''&lt;br /&gt;
 // This adds the ships as close as possible to the specified point&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsWithinRadius: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate-system&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt; &amp;lt;radius in metres&amp;gt;'''&lt;br /&gt;
 // Example:&lt;br /&gt;
 // &amp;quot;addShipsWithinRadius: asteroid 48 wpm 0 0 15000 5000&amp;quot;&lt;br /&gt;
 // would add a 5km-wide asteroid field with 48 asteroids at a position roughly 15000m towards&lt;br /&gt;
 // the planet from the witchpoint.&lt;br /&gt;
 &lt;br /&gt;
 '''spawn: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // adds a number of ships matching &amp;lt;role&amp;gt; near the ship&lt;br /&gt;
 // that's the target of this script (as [[Shipdata.plist#script_actions|script_actions]] or [[Shipdata.plist#death_actions|death_actions]])&lt;br /&gt;
 &lt;br /&gt;
 '''spawnShip: &amp;lt;[[shipdata.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a ship with the unique [[shipdata.plist]] key given&lt;br /&gt;
 // the position and facing of the ship are determined by a ''spawn'' dictionary in the&lt;br /&gt;
 // ship's shipdata.plist entry with ''position'' and ''facing_position'' as strings describing&lt;br /&gt;
 // coordinates according to one of the schemes above&lt;br /&gt;
&lt;br /&gt;
== Changing the universe ==&lt;br /&gt;
&lt;br /&gt;
 '''setSunNovaIn: &amp;lt;seconds&amp;gt;'''&lt;br /&gt;
 // Sets the sun to go nova after the given time in seconds&lt;br /&gt;
 &lt;br /&gt;
 '''sendAllShipsAway'''&lt;br /&gt;
 // Makes all the ships in the system hyperspace away&lt;br /&gt;
 &lt;br /&gt;
 '''setPlanetinfo: &amp;lt;key&amp;gt;=&amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets an override to the [[planetinfo.plist]] entry for the current system&lt;br /&gt;
 // the value for the given key is set to match the value&lt;br /&gt;
 // (see [[planetinfo.plist]])&lt;br /&gt;
 //&lt;br /&gt;
 // eg '''setPlanetinfo: description=a very dull planet'''&lt;br /&gt;
 // (Note the '=' is required)&lt;br /&gt;
 &lt;br /&gt;
 '''setSpecificPlanetInfo: &amp;lt;gnum&amp;gt;=&amp;lt;pnum&amp;gt;=&amp;lt;key&amp;gt;=&amp;lt;value&amp;gt;&lt;br /&gt;
 // sets an override to the [[planetinfo.plist]] entry for the system&lt;br /&gt;
 // specified by galaxy gnum and planet pnum&lt;br /&gt;
 //&lt;br /&gt;
 // eg '''setSpecificPlanetInfo: 0=7=description=Lave is not a very dull planet'''&lt;br /&gt;
 // (Note the '=' is required between all 4 values)&lt;br /&gt;
 &lt;br /&gt;
 '''addPlanet: &amp;lt;[[planetinfo.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a planet to the universe from data in [[planetinfo.plist]].&lt;br /&gt;
 &lt;br /&gt;
 '''addMoon: &amp;lt;[[planetinfo.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a moon to the universe from data in [[planetinfo.plist]].&lt;br /&gt;
 // (Moons do not get an atmosphere or clouds like planets).&lt;br /&gt;
&lt;br /&gt;
== Mission Variables ==&lt;br /&gt;
&lt;br /&gt;
 '''set: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets the [[mission_variable]] to the value given&lt;br /&gt;
 // the value can be a particular string or numeric value,&lt;br /&gt;
 // or a queriable state&lt;br /&gt;
 &lt;br /&gt;
 '''reset: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets the [[mission_variable]] to be ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 '''increment: [[mission_variable]]'''&lt;br /&gt;
 // increases the mission variable's value by 1.0&lt;br /&gt;
 &lt;br /&gt;
 '''decrement: [[mission_variable]]'''&lt;br /&gt;
 // decreases the mission variable's value by 1.0&lt;br /&gt;
 &lt;br /&gt;
 '''add: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // adds the value given to the [[mission_variable]]&lt;br /&gt;
 // the value can be a number or a queriable state&lt;br /&gt;
 // like ''shipsFound_number''&lt;br /&gt;
 &lt;br /&gt;
 '''subtract: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // subtracts the value given from the [[mission_variable]]&lt;br /&gt;
 // the value can be a number or a queriable state&lt;br /&gt;
 // like ''shipsFound_number''&lt;br /&gt;
&lt;br /&gt;
== Player rewards and penalties==&lt;br /&gt;
These methods work on the player, not any other ship.&lt;br /&gt;
&lt;br /&gt;
 '''awardCredits: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // awards number of tenths of credits.&lt;br /&gt;
 &lt;br /&gt;
 '''awardShipKills: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // Adds to the number of kills accredited to the player&lt;br /&gt;
 &lt;br /&gt;
 '''setLegalStatus: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // Sets the bounty on the player's head.&lt;br /&gt;
 &lt;br /&gt;
 '''setFuelLeak: &amp;lt;amount&amp;gt;'''&lt;br /&gt;
 // removes this amount from the fuel tank every second&lt;br /&gt;
 // until the tanks drain and self-seal&lt;br /&gt;
 &lt;br /&gt;
 '''awardFuel: &amp;lt;amount&amp;gt;'''&lt;br /&gt;
 // The amount can be positive or negative, expressed in LY of range&lt;br /&gt;
 // the fuel level is adjusted to a maximum of 7.0LY and minimum of 0.0.&lt;br /&gt;
&lt;br /&gt;
=== Equipment ===&lt;br /&gt;
&lt;br /&gt;
 '''awardEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // if the player doesn't have the equipment already&lt;br /&gt;
 // and their ship can be equipped witth it then this fits the&lt;br /&gt;
 // player's ship with the equipment given&lt;br /&gt;
 // valid keys can be found in [[equipment.plist]] (they all begin '''EQ_'''):-&lt;br /&gt;
 //	EQ_FUEL&lt;br /&gt;
 //	EQ_MISSILE&lt;br /&gt;
 //	EQ_CARGO_BAY&lt;br /&gt;
 //	EQ_ECM&lt;br /&gt;
 //	EQ_FUEL_SCOOPS&lt;br /&gt;
 //	EQ_ESCAPE_POD&lt;br /&gt;
 //	EQ_ENERGY_BOMB&lt;br /&gt;
 //	EQ_ENERGY_UNIT&lt;br /&gt;
 //	EQ_NAVAL_ENERGY_UNIT&lt;br /&gt;
 //	EQ_DOCK_COMP&lt;br /&gt;
 //	EQ_GAL_DRIVE&lt;br /&gt;
 //	EQ_CLOAKING_DEVICE&lt;br /&gt;
 //	EQ_PASSENGER_BERTH&lt;br /&gt;
 //	EQ_HARDENED_MISSILE&lt;br /&gt;
 //	EQ_FUEL_INJECTION&lt;br /&gt;
 //	EQ_SCANNER_SHOW_MISSILE_TARGET&lt;br /&gt;
 //	EQ_MULTI_TARGET&lt;br /&gt;
 //	EQ_ADVANCED_COMPASS&lt;br /&gt;
 //	EQ_QC_MINE&lt;br /&gt;
 //	EQ_SHIELD_BOOSTER&lt;br /&gt;
 //	EQ_NAVAL_SHIELD_BOOSTER&lt;br /&gt;
 //	EQ_WEAPON_TWIN_PLASMA_CANNON&lt;br /&gt;
 //	EQ_MILITARY_JAMMER&lt;br /&gt;
 //	EQ_MILITARY_SCANNER_FILTER&lt;br /&gt;
 &lt;br /&gt;
 '''removeEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // removes the indicated equipment from the player's ship&lt;br /&gt;
 &lt;br /&gt;
 '''testForEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // tests whether the player ship has a piece of equipment installed&lt;br /&gt;
 // returns the result in [[Methods#Results_from_other_methods|'''foundEquipment_bool''']]&lt;br /&gt;
&lt;br /&gt;
=== Cargo ===&lt;br /&gt;
&lt;br /&gt;
 '''awardCargo: &amp;lt;amount&amp;gt; &amp;lt;[[Commodities|Commodity]] name&amp;gt;'''&lt;br /&gt;
 // awards a quantity of the cargo named&lt;br /&gt;
 // the cargo name must match the name in [[commodities.plist]] exactly&lt;br /&gt;
 &lt;br /&gt;
 '''removeAllCargo'''&lt;br /&gt;
 // removes all cargo from the hold with no compensation to the player&lt;br /&gt;
 // any special cargo is also removed (see below) restoring use of the cargo bay&lt;br /&gt;
 // Gold, Platinum, and Gemstones are unaffected (they're in the cabin safe).&lt;br /&gt;
 &lt;br /&gt;
 '''useSpecialCargo: &amp;lt;description of cargo&amp;gt;'''&lt;br /&gt;
 // fills the cargo bay withthe cargo described effectively&lt;br /&gt;
 // disabling the use of the cargo bay until the cargo is removed&lt;br /&gt;
&lt;br /&gt;
=== Special ===&lt;br /&gt;
&lt;br /&gt;
 '''ejectItem: &amp;lt;[[shipdata.plist]] key&amp;gt;'''  &lt;br /&gt;
 // Creates a ship or other entity from [[shipdata.plist]] and ejects from&lt;br /&gt;
 // the ship's aft hatch&lt;br /&gt;
 &lt;br /&gt;
 '''launchFromStation'''&lt;br /&gt;
 // forces the player ship to launch&lt;br /&gt;
&lt;br /&gt;
== Communications ==&lt;br /&gt;
&lt;br /&gt;
 '''commsMessage: ''message'' '''&lt;br /&gt;
 // sends the player a message&lt;br /&gt;
 // if the message contains elements enclosed in square brackets ''[like_this]''&lt;br /&gt;
 // that corresponds to a [[mission_variable]] or keys in [[descriptions.plist]]&lt;br /&gt;
 // or to special expansions like [commander_name] then these are expanded&lt;br /&gt;
 // and substituted into the original message&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Querying states ==&lt;br /&gt;
&lt;br /&gt;
=== Player status ===&lt;br /&gt;
&lt;br /&gt;
 // '''mission_string'''&lt;br /&gt;
 // returns the key for the current mission&lt;br /&gt;
 &lt;br /&gt;
 // '''status_string'''&lt;br /&gt;
 // returns one of:&lt;br /&gt;
 // ''STATUS_AUTOPILOT_ENGAGED''&lt;br /&gt;
 // ''STATUS_DEAD''&lt;br /&gt;
 // ''STATUS_DEMO''&lt;br /&gt;
 // ''STATUS_DOCKING''&lt;br /&gt;
 // ''STATUS_DOCKED''&lt;br /&gt;
 // ''STATUS_EFFECT''&lt;br /&gt;
 // ''STATUS_ENTERING_WITCHSPACE''&lt;br /&gt;
 // ''STATUS_ESCAPE_SEQUENCE''&lt;br /&gt;
 // ''STATUS_EXITING_WITCHSPACE''&lt;br /&gt;
 // ''STATUS_EXPERIMENTAL''&lt;br /&gt;
 // ''STATUS_IN_FLIGHT''&lt;br /&gt;
 // ''STATUS_IN_HOLD''&lt;br /&gt;
 // ''STATUS_INACTIVE''&lt;br /&gt;
 // ''STATUS_LAUNCHING''&lt;br /&gt;
 // ''STATUS_TEST''&lt;br /&gt;
 // ''STATUS_WITCHSPACE_COUNTDOWN''&lt;br /&gt;
 // ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 // '''gui_screen_string'''&lt;br /&gt;
 // returns one of:&lt;br /&gt;
 // ''GUI_SCREEN_EQUIP_SHIP''&lt;br /&gt;
 // ''GUI_SCREEN_INTRO1''&lt;br /&gt;
 // ''GUI_SCREEN_INTRO2''&lt;br /&gt;
 // ''GUI_SCREEN_INVENTORY''&lt;br /&gt;
 // ''GUI_SCREEN_LONG_RANGE_CHART''&lt;br /&gt;
 // ''GUI_SCREEN_MAIN''&lt;br /&gt;
 // ''GUI_SCREEN_MARKET''&lt;br /&gt;
 // ''GUI_SCREEN_MISSION''&lt;br /&gt;
 // ''GUI_SCREEN_OPTIONS''&lt;br /&gt;
 // ''GUI_SCREEN_SHORT_RANGE_CHART''&lt;br /&gt;
 // ''GUI_SCREEN_STATUS''&lt;br /&gt;
 // ''GUI_SCREEN_SYSTEM_DATA''&lt;br /&gt;
 // ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 // '''galaxy_number'''&lt;br /&gt;
 // returns a value between 0 and 7&lt;br /&gt;
 &lt;br /&gt;
 // '''planet_number'''&lt;br /&gt;
 // returns a value between 0 and 255&lt;br /&gt;
 &lt;br /&gt;
 // '''score_number'''&lt;br /&gt;
 // returns the number of the player's current ship kills&lt;br /&gt;
 &lt;br /&gt;
 // '''credits_number'''&lt;br /&gt;
 // returns the player's credits x10&lt;br /&gt;
 &lt;br /&gt;
 // '''legalStatus_number'''&lt;br /&gt;
 // returns the bounty on the players head&lt;br /&gt;
 &lt;br /&gt;
 // '''fuel_level_number'''&lt;br /&gt;
 // returns the fuel level in LY&lt;br /&gt;
 &lt;br /&gt;
 // '''dockedAtMainStation_bool'''&lt;br /&gt;
 // returns ''YES'' if docked at a systems main station, ''NO'' otherwise&lt;br /&gt;
 &lt;br /&gt;
 // '''dockedStationName_string'''&lt;br /&gt;
 // returns ''NONE'' if the player isn't docked, the name of the station (from [[shipdata.plist]]) if it is, ''UNKNOWN'' otherwise&lt;br /&gt;
&lt;br /&gt;
=== Results from other methods ===&lt;br /&gt;
&lt;br /&gt;
 // '''shipsFound_number'''&lt;br /&gt;
 // returns the number of ships found by ''checkForShips:''&lt;br /&gt;
 &lt;br /&gt;
 // '''foundEquipment_bool'''&lt;br /&gt;
 // returns the result of the last ''testForEquipment''&lt;br /&gt;
 // returns ''YES'' if the equipment was found, ''NO'' otherwise&lt;br /&gt;
  &lt;br /&gt;
 // '''missionChoice_string'''&lt;br /&gt;
 // returns the result of the player's selection from a list of missionChoices&lt;br /&gt;
 // returns ''UNDEFINED'' or the key for the chosen option&lt;br /&gt;
&lt;br /&gt;
=== Random numbers ===&lt;br /&gt;
&lt;br /&gt;
 // '''d100_number'''&lt;br /&gt;
 // returns a random value from 0 to 99&lt;br /&gt;
 &lt;br /&gt;
 // '''pseudoFixedD100_number'''&lt;br /&gt;
 // returns a random number from 0 to 99 that will&lt;br /&gt;
 // remain fixed as long as the player remains in this system&lt;br /&gt;
&lt;br /&gt;
=== Time ===&lt;br /&gt;
&lt;br /&gt;
 // '''clock_number'''&lt;br /&gt;
 // returns the game time in seconds&lt;br /&gt;
 // '''clock_secs_number'''&lt;br /&gt;
 // returns the game time in seconds&lt;br /&gt;
 // '''clock_mins_number'''&lt;br /&gt;
 // returns the game time in minutes&lt;br /&gt;
 // '''clock_hours_number'''&lt;br /&gt;
 // returns the game time in hours&lt;br /&gt;
 // '''clock_days_number'''&lt;br /&gt;
 // returns the game time in days&lt;br /&gt;
&lt;br /&gt;
=== System states ===&lt;br /&gt;
&lt;br /&gt;
 // '''sunWillGoNova_bool'''&lt;br /&gt;
 // returns whether the sun is going to go nova, either ''YES'' or ''NO''&lt;br /&gt;
 &lt;br /&gt;
 // '''sunGoneNova_bool'''&lt;br /&gt;
 // returns whether the sun has gone nova, either ''YES'' or ''NO''&lt;br /&gt;
 &lt;br /&gt;
 // '''systemGovernment_string'''&lt;br /&gt;
 // returns one of:-&lt;br /&gt;
 // ''Anarchy''&lt;br /&gt;
 // ''Feudal''&lt;br /&gt;
 // ''Multi-Government''&lt;br /&gt;
 // ''Dictatorship''&lt;br /&gt;
 // ''Communist''&lt;br /&gt;
 // ''Confederacy''&lt;br /&gt;
 // ''Democracy''&lt;br /&gt;
 // ''Corporate State''&lt;br /&gt;
 &lt;br /&gt;
 // '''systemGovernment_number'''&lt;br /&gt;
 // returns a value from 0 to 7&lt;br /&gt;
 &lt;br /&gt;
 // '''systemEconomy_number'''&lt;br /&gt;
 // returns a value from 0 to 7&lt;br /&gt;
 &lt;br /&gt;
 // '''systemTechLevel_number'''&lt;br /&gt;
 // returns a value from 0 to 14&lt;br /&gt;
 &lt;br /&gt;
 // '''systemPopulation_number'''&lt;br /&gt;
 // returns a value representing the system's population&lt;br /&gt;
 &lt;br /&gt;
 // '''systemProductivity_number'''&lt;br /&gt;
 // returns a value representing the system's productivity&lt;br /&gt;
&lt;br /&gt;
 // '''scriptTimer_number'''&lt;br /&gt;
 // returns the script timer's current value in seconds '''(deprecated - do not use)'''&lt;br /&gt;
&lt;br /&gt;
== Debugging scripts ==&lt;br /&gt;
&lt;br /&gt;
 '''debugOn'''&lt;br /&gt;
 // sends script debugging messages to the console.&lt;br /&gt;
 &lt;br /&gt;
 '''debugOff'''&lt;br /&gt;
 // cancels script debugging messages&lt;br /&gt;
 &lt;br /&gt;
 '''debugMessage: &amp;lt;message&amp;gt;'''&lt;br /&gt;
 // sends the given message to the console. The message is written to the console regardless&lt;br /&gt;
 // of whether debugOn has been performed or not. For GNUstep versions of Oolite, the console&lt;br /&gt;
 // is a file called stderr.txt located in the game's installation directory. Mission variables&lt;br /&gt;
 // and queriable states may be included in the message, eg:&lt;br /&gt;
 //&lt;br /&gt;
 // ''debugMessage: current galaxy is galaxy_number''&lt;br /&gt;
&lt;br /&gt;
== AI ==&lt;br /&gt;
&lt;br /&gt;
Note that although most of these methods affect the player, some can also be utilised by an AI. &lt;br /&gt;
*[[OXP howto AI]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3953</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3953"/>
		<updated>2006-04-05T06:41:09Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Actions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line. Nested &amp;quot;if/then/else/endif&amp;quot; clauses may also be included in the actions.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of a nested if statement:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station, now checking mission variable.&lt;br /&gt;
    if mission_started undefined then&lt;br /&gt;
        set: mission_started YES&lt;br /&gt;
        // you would probably put up a mission page here&lt;br /&gt;
    else&lt;br /&gt;
        // the mission has already been started, do some stuff here&lt;br /&gt;
    endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool, or a set of one or more words&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;&amp;amp;lt;&amp;quot; or &amp;quot;&amp;amp;gt;&amp;quot; then Y should only be a single value and both X and Y are converted to numbers and compared.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;=&amp;quot; then a string comparison is performed between X and Y. This is the only valid value for op when X is a function_bool and in this case Y must be one of &amp;quot;YES&amp;quot; or &amp;quot;NO&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;undefined&amp;quot; then X must be a mission_var or local_var and Y is ignored. The condition is true if the mission or local variable has not yet been defined, or false if it has.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;oneof&amp;quot; then Y is considered to be a list of values separated by commas and the condition is true if X is equal to any one of them.&lt;br /&gt;
&lt;br /&gt;
Each condition is terminated by the word &amp;quot;and&amp;quot; or &amp;quot;then&amp;quot; and each condition can be on a separate line, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if mission_x = A and&lt;br /&gt;
   mission_y = B then&lt;br /&gt;
        // some actions here&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Actions ===&lt;br /&gt;
&lt;br /&gt;
If all the conditions in an &amp;quot;if&amp;quot; statement are met then the actions bounded by the &amp;quot;then&amp;quot; and the &amp;quot;else&amp;quot; or &amp;quot;endif&amp;quot; statement are executed. If any of the conditions in an &amp;quot;if&amp;quot; statement are not met and there is an &amp;quot;else&amp;quot; clause then the actions between the &amp;quot;else&amp;quot; and &amp;quot;endif&amp;quot; statement are executed.&lt;br /&gt;
&lt;br /&gt;
Each action takes one line, and if finished by the end-of-line character(s).&lt;br /&gt;
&lt;br /&gt;
The first word on an action line specifies the action to be performed. Some actions do not require any parameters, so the action line is a single word - &amp;quot;debugOn&amp;quot; for example. If the action requires any parameters, they are specified after a &amp;quot;:&amp;quot;. There are examples of this above - &amp;quot;set&amp;quot; and &amp;quot;debugMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Any word in the set of parameters surrounded by square brakets is assumed to be either a variable or the name of a function. If the word '''''starts''''' with mission_, local_, or commander_ it is assumed to be a variable and the variable's value replaces the variable name and the square brackets before the action is executed. If the word '''''ends''''' with _string, _number, or _bool it is assumed to be a function and the function's return value replaces the function name and the square brackets before the action is executed.&lt;br /&gt;
&lt;br /&gt;
Some examples of actions with replacements:&lt;br /&gt;
&lt;br /&gt;
 // set the script local variable local_x to a number between 1 and 100&lt;br /&gt;
 set: local_x [d100_number]&lt;br /&gt;
 &lt;br /&gt;
 // then set the script local variable local_y to a number between 1 and 100&lt;br /&gt;
 set: local_y [d100_number]&lt;br /&gt;
 &lt;br /&gt;
 // and add local_x to it - notice local_y isn't in brackets because the first word has&lt;br /&gt;
 // to be the name of the variable to be acted upon, not it's value&lt;br /&gt;
 add: local_y [local_x]&lt;br /&gt;
 &lt;br /&gt;
 // print a message to the log&lt;br /&gt;
 debugMessage: Commander [commander_name] has [local_x] widgets and [local_y] twigs&lt;br /&gt;
&lt;br /&gt;
Here is the longway.oxp script converted to oos format, with comments added:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Giles Williams' LongWay mission converted to oos format&lt;br /&gt;
//&lt;br /&gt;
long_way_round&lt;br /&gt;
&lt;br /&gt;
// This is a pretty fast way to ensure no unnecessary processing is performed.&lt;br /&gt;
// This single condition can avoid all the other conditions getting evaluated&lt;br /&gt;
// if the player isn't in galaxy 0&lt;br /&gt;
//&lt;br /&gt;
if galaxy_number equal 0 then&lt;br /&gt;
&lt;br /&gt;
        // As above, this one condition can save evaluating the three enclosed conditions&lt;br /&gt;
        // while the player is in space.&lt;br /&gt;
        //&lt;br /&gt;
	if dockedAtMainStation_bool equal YES then&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station at XXX then start the&lt;br /&gt;
                // mission. Doesn't seem to be a way to refuse to do the mission.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround undefined and planet_number equal 3 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Biarge_briefing&lt;br /&gt;
			set: mission_longwayround STAGE1&lt;br /&gt;
			setMissionDescription: em1_short_desc1&lt;br /&gt;
		endif&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station of YYY and they're doing&lt;br /&gt;
                // the longway mission then reward them for partially completing it and&lt;br /&gt;
                // send them on the next step.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround equal STAGE1 and plaent_number equal 248 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Soladies_briefing&lt;br /&gt;
			awardCredits: 500&lt;br /&gt;
			set: mission_longwayround STAGE2&lt;br /&gt;
			setMissionDescription: em1_short_desc2&lt;br /&gt;
		endif&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station of ZZZ and they're on the&lt;br /&gt;
                // 2nd step of the mission, mark it complete and reward the player again.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround equal STAGE2 and planet_number equal 233 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setMissionImage: loyalistflag.png&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Qubeen_briefing&lt;br /&gt;
			awardCredits: 2000&lt;br /&gt;
			setMissionImage: none&lt;br /&gt;
			set: mission_longwayround MISSION_COMPLETE&lt;br /&gt;
			clearMissionDescription&lt;br /&gt;
		endif&lt;br /&gt;
	endif&lt;br /&gt;
&lt;br /&gt;
        // If the player is on the second step of the mission and jumps in system ZZZ&lt;br /&gt;
        // to complete the mission, ambush them with a couple of rebel ships!&lt;br /&gt;
        //&lt;br /&gt;
	if mission_longwayround equal STAGE2 and&lt;br /&gt;
	   planet_number equal 233 and&lt;br /&gt;
	   status_string equal STATUS_EXITING_WITCHSPACE then&lt;br /&gt;
		addShips: rebel 2&lt;br /&gt;
	endif&lt;br /&gt;
&lt;br /&gt;
        // Continually harass the player while they're in system ZZZ trying to finish&lt;br /&gt;
        // the mission.&lt;br /&gt;
        //&lt;br /&gt;
	if mission_longwayround equal STAGE2 and&lt;br /&gt;
	   status_string equal STATUS_IN_FLIGHT and&lt;br /&gt;
	   planet_number equal 233 and&lt;br /&gt;
	   scriptTimer_number lessthan 60 then&lt;br /&gt;
		checkForShips: rebel&lt;br /&gt;
		if shipsFound_number lessthan 5 and d100_number lessthan 50 then&lt;br /&gt;
			addShips: rebel 1&lt;br /&gt;
		endif&lt;br /&gt;
	endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3952</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3952"/>
		<updated>2006-04-05T06:40:22Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line. Nested &amp;quot;if/then/else/endif&amp;quot; clauses may also be included in the actions.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of a nested if statement:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station, now checking mission variable.&lt;br /&gt;
    if mission_started undefined then&lt;br /&gt;
        set: mission_started YES&lt;br /&gt;
        // you would probably put up a mission page here&lt;br /&gt;
    else&lt;br /&gt;
        // the mission has already been started, do some stuff here&lt;br /&gt;
    endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool, or a set of one or more words&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;&amp;amp;lt;&amp;quot; or &amp;quot;&amp;amp;gt;&amp;quot; then Y should only be a single value and both X and Y are converted to numbers and compared.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;=&amp;quot; then a string comparison is performed between X and Y. This is the only valid value for op when X is a function_bool and in this case Y must be one of &amp;quot;YES&amp;quot; or &amp;quot;NO&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;undefined&amp;quot; then X must be a mission_var or local_var and Y is ignored. The condition is true if the mission or local variable has not yet been defined, or false if it has.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;oneof&amp;quot; then Y is considered to be a list of values separated by commas and the condition is true if X is equal to any one of them.&lt;br /&gt;
&lt;br /&gt;
Each condition is terminated by the word &amp;quot;and&amp;quot; or &amp;quot;then&amp;quot; and each condition can be on a separate line, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if mission_x = A and&lt;br /&gt;
   mission_y = B then&lt;br /&gt;
        // some actions here&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Actions ===&lt;br /&gt;
&lt;br /&gt;
If all the conditions in an &amp;quot;if&amp;quot; statement are met then the actions bounded by the &amp;quot;then&amp;quot; and the &amp;quot;else&amp;quot; or &amp;quot;endif&amp;quot; statement are executed. If any of the conditions in an &amp;quot;if&amp;quot; statement are not met and there is an &amp;quot;else&amp;quot; clause then the actions between the &amp;quot;else&amp;quot; and &amp;quot;endif&amp;quot; statement are executed.&lt;br /&gt;
&lt;br /&gt;
Each action takes one line, and if finished by the end-of-line character(s).&lt;br /&gt;
&lt;br /&gt;
The first word on an action line specifies the action to be performed. Some actions do not require any parameters, so the action line is a single word - &amp;quot;debugOn&amp;quot; for example. If the action requires any parameters, they are specified after a &amp;quot;:&amp;quot;. There are examples of this above - &amp;quot;set&amp;quot; and &amp;quot;debugMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Any word in the set of parameters surrounded by square brakets is assumed to be either a variable or the name of a function. If the word '''''starts''''' with mission_, local_, or commander_ it is assumed to be a variable and the variable's value replaces the variable name and the square brackets before the action is executed. If the word '''''ends''''' with _string, _number, or _bool it is assumed to be a function and the function's return value replaces the function name and the square brackets before the action is executed.&lt;br /&gt;
&lt;br /&gt;
Some examples of actions with replacements:&lt;br /&gt;
&lt;br /&gt;
 // set the script local variable local_x to a number between 1 and 100&lt;br /&gt;
 set: local_x [d100_number]&lt;br /&gt;
 &lt;br /&gt;
 // then set the script local variable local_y to a number between 1 and 100&lt;br /&gt;
 set: local_y [d100_number]&lt;br /&gt;
 &lt;br /&gt;
 // and add local_x to it - notice local_y isn't in brackets because the first word has&lt;br /&gt;
 // to be the name of the variable to be acted upon, not it's value&lt;br /&gt;
 add: local_y [local_x]&lt;br /&gt;
&lt;br /&gt;
 // print a message to the log&lt;br /&gt;
 debugMessage: Commander [commander_name] has [local_x] widgets and [local_y] twigs&lt;br /&gt;
&lt;br /&gt;
Here is the longway.oxp script converted to oos format, with comments added:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Giles Williams' LongWay mission converted to oos format&lt;br /&gt;
//&lt;br /&gt;
long_way_round&lt;br /&gt;
&lt;br /&gt;
// This is a pretty fast way to ensure no unnecessary processing is performed.&lt;br /&gt;
// This single condition can avoid all the other conditions getting evaluated&lt;br /&gt;
// if the player isn't in galaxy 0&lt;br /&gt;
//&lt;br /&gt;
if galaxy_number equal 0 then&lt;br /&gt;
&lt;br /&gt;
        // As above, this one condition can save evaluating the three enclosed conditions&lt;br /&gt;
        // while the player is in space.&lt;br /&gt;
        //&lt;br /&gt;
	if dockedAtMainStation_bool equal YES then&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station at XXX then start the&lt;br /&gt;
                // mission. Doesn't seem to be a way to refuse to do the mission.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround undefined and planet_number equal 3 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Biarge_briefing&lt;br /&gt;
			set: mission_longwayround STAGE1&lt;br /&gt;
			setMissionDescription: em1_short_desc1&lt;br /&gt;
		endif&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station of YYY and they're doing&lt;br /&gt;
                // the longway mission then reward them for partially completing it and&lt;br /&gt;
                // send them on the next step.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround equal STAGE1 and plaent_number equal 248 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Soladies_briefing&lt;br /&gt;
			awardCredits: 500&lt;br /&gt;
			set: mission_longwayround STAGE2&lt;br /&gt;
			setMissionDescription: em1_short_desc2&lt;br /&gt;
		endif&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station of ZZZ and they're on the&lt;br /&gt;
                // 2nd step of the mission, mark it complete and reward the player again.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround equal STAGE2 and planet_number equal 233 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setMissionImage: loyalistflag.png&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Qubeen_briefing&lt;br /&gt;
			awardCredits: 2000&lt;br /&gt;
			setMissionImage: none&lt;br /&gt;
			set: mission_longwayround MISSION_COMPLETE&lt;br /&gt;
			clearMissionDescription&lt;br /&gt;
		endif&lt;br /&gt;
	endif&lt;br /&gt;
&lt;br /&gt;
        // If the player is on the second step of the mission and jumps in system ZZZ&lt;br /&gt;
        // to complete the mission, ambush them with a couple of rebel ships!&lt;br /&gt;
        //&lt;br /&gt;
	if mission_longwayround equal STAGE2 and&lt;br /&gt;
	   planet_number equal 233 and&lt;br /&gt;
	   status_string equal STATUS_EXITING_WITCHSPACE then&lt;br /&gt;
		addShips: rebel 2&lt;br /&gt;
	endif&lt;br /&gt;
&lt;br /&gt;
        // Continually harass the player while they're in system ZZZ trying to finish&lt;br /&gt;
        // the mission.&lt;br /&gt;
        //&lt;br /&gt;
	if mission_longwayround equal STAGE2 and&lt;br /&gt;
	   status_string equal STATUS_IN_FLIGHT and&lt;br /&gt;
	   planet_number equal 233 and&lt;br /&gt;
	   scriptTimer_number lessthan 60 then&lt;br /&gt;
		checkForShips: rebel&lt;br /&gt;
		if shipsFound_number lessthan 5 and d100_number lessthan 50 then&lt;br /&gt;
			addShips: rebel 1&lt;br /&gt;
		endif&lt;br /&gt;
	endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3951</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3951"/>
		<updated>2006-04-05T06:29:14Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line. Nested &amp;quot;if/then/else/endif&amp;quot; clauses may also be included in the actions.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of a nested if statement:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station, now checking mission variable.&lt;br /&gt;
    if mission_started undefined then&lt;br /&gt;
        set: mission_started YES&lt;br /&gt;
        // you would probably put up a mission page here&lt;br /&gt;
    else&lt;br /&gt;
        // the mission has already been started, do some stuff here&lt;br /&gt;
    endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool, or a set of one or more words&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;&amp;amp;lt;&amp;quot; or &amp;quot;&amp;amp;gt;&amp;quot; then Y should only be a single value and both X and Y are converted to numbers and compared.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;=&amp;quot; then a string comparison is performed between X and Y. This is the only valid value for op when X is a function_bool and in this case Y must be one of &amp;quot;YES&amp;quot; or &amp;quot;NO&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;undefined&amp;quot; then X must be a mission_var or local_var and Y is ignored. The condition is true if the mission or local variable has not yet been defined, or false if it has.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;oneof&amp;quot; then Y is considered to be a list of values separated by commas and the condition is true if X is equal to any one of them.&lt;br /&gt;
&lt;br /&gt;
Each condition is terminated by the word &amp;quot;and&amp;quot; or &amp;quot;then&amp;quot; and each condition can be on a separate line, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if mission_x = A and&lt;br /&gt;
   mission_y = B then&lt;br /&gt;
        // some actions here&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Actions ===&lt;br /&gt;
&lt;br /&gt;
If all the conditions in an &amp;quot;if&amp;quot; statement are met then the actions bounded by the &amp;quot;then&amp;quot; and the &amp;quot;else&amp;quot; or &amp;quot;endif&amp;quot; statement are executed. If any of the conditions in an &amp;quot;if&amp;quot; statement are not met and there is an &amp;quot;else&amp;quot; clause then the actions between the &amp;quot;else&amp;quot; and &amp;quot;endif&amp;quot; statement are executed.&lt;br /&gt;
&lt;br /&gt;
Each action takes one line, and if finished by the end-of-line character(s).&lt;br /&gt;
&lt;br /&gt;
The first word on an action line specifies the action to be performed. Some actions do not require any parameters, so the action line is a single word - &amp;quot;debugOn&amp;quot; for example. If the action requires any parameters, they are specified after a &amp;quot;:&amp;quot;. There are examples of this above - &amp;quot;set&amp;quot; and &amp;quot;debugMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Any word in the set of parameters surrounded by square brakets is assumed to be either a variable or the name of a function. If the word '''''starts''''' with mission_, local_, or commander_ it is assumed to be a variable and the variable's value replaces the variable name and the square brackets before the action is executed. If the word '''''ends''''' with _string, _number, or _bool it is assumed to be a function and the function's return value replaces the function name and the square brackets before the action is executed.&lt;br /&gt;
&lt;br /&gt;
Here is the longway.oxp script converted to oos format, with comments added:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Giles Williams' LongWay mission converted to oos format&lt;br /&gt;
//&lt;br /&gt;
long_way_round&lt;br /&gt;
&lt;br /&gt;
// This is a pretty fast way to ensure no unnecessary processing is performed.&lt;br /&gt;
// This single condition can avoid all the other conditions getting evaluated&lt;br /&gt;
// if the player isn't in galaxy 0&lt;br /&gt;
//&lt;br /&gt;
if galaxy_number equal 0 then&lt;br /&gt;
&lt;br /&gt;
        // As above, this one condition can save evaluating the three enclosed conditions&lt;br /&gt;
        // while the player is in space.&lt;br /&gt;
        //&lt;br /&gt;
	if dockedAtMainStation_bool equal YES then&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station at XXX then start the&lt;br /&gt;
                // mission. Doesn't seem to be a way to refuse to do the mission.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround undefined and planet_number equal 3 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Biarge_briefing&lt;br /&gt;
			set: mission_longwayround STAGE1&lt;br /&gt;
			setMissionDescription: em1_short_desc1&lt;br /&gt;
		endif&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station of YYY and they're doing&lt;br /&gt;
                // the longway mission then reward them for partially completing it and&lt;br /&gt;
                // send them on the next step.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround equal STAGE1 and plaent_number equal 248 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Soladies_briefing&lt;br /&gt;
			awardCredits: 500&lt;br /&gt;
			set: mission_longwayround STAGE2&lt;br /&gt;
			setMissionDescription: em1_short_desc2&lt;br /&gt;
		endif&lt;br /&gt;
&lt;br /&gt;
                // If the player docks at the main station of ZZZ and they're on the&lt;br /&gt;
                // 2nd step of the mission, mark it complete and reward the player again.&lt;br /&gt;
                //&lt;br /&gt;
		if mission_longwayround equal STAGE2 and planet_number equal 233 then&lt;br /&gt;
			setMissionMusic: none&lt;br /&gt;
			setMissionImage: loyalistflag.png&lt;br /&gt;
			setGuiToMissionScreen&lt;br /&gt;
			addMissionText: long_way_round_Qubeen_briefing&lt;br /&gt;
			awardCredits: 2000&lt;br /&gt;
			setMissionImage: none&lt;br /&gt;
			set: mission_longwayround MISSION_COMPLETE&lt;br /&gt;
			clearMissionDescription&lt;br /&gt;
		endif&lt;br /&gt;
	endif&lt;br /&gt;
&lt;br /&gt;
        // If the player is on the second step of the mission and jumps in system ZZZ&lt;br /&gt;
        // to complete the mission, ambush them with a couple of rebel ships!&lt;br /&gt;
        //&lt;br /&gt;
	if mission_longwayround equal STAGE2 and&lt;br /&gt;
	   planet_number equal 233 and&lt;br /&gt;
	   status_string equal STATUS_EXITING_WITCHSPACE then&lt;br /&gt;
		addShips: rebel 2&lt;br /&gt;
	endif&lt;br /&gt;
&lt;br /&gt;
        // Continually harass the player while they're in system ZZZ trying to finish&lt;br /&gt;
        // the mission.&lt;br /&gt;
        //&lt;br /&gt;
	if mission_longwayround equal STAGE2 and&lt;br /&gt;
	   status_string equal STATUS_IN_FLIGHT and&lt;br /&gt;
	   planet_number equal 233 and&lt;br /&gt;
	   scriptTimer_number lessthan 60 then&lt;br /&gt;
		checkForShips: rebel&lt;br /&gt;
		if shipsFound_number lessthan 5 and d100_number lessthan 50 then&lt;br /&gt;
			addShips: rebel 1&lt;br /&gt;
		endif&lt;br /&gt;
	endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3950</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3950"/>
		<updated>2006-04-05T06:18:49Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line. Nested &amp;quot;if/then/else/endif&amp;quot; clauses may also be included in the actions.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of a nested if statement:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station, now checking mission variable.&lt;br /&gt;
    if mission_started undefined then&lt;br /&gt;
        set: mission_started YES&lt;br /&gt;
        // you would probably put up a mission page here&lt;br /&gt;
    else&lt;br /&gt;
        // the mission has already been started, do some stuff here&lt;br /&gt;
    endif&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool, or a set of one or more words&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;&amp;amp;lt;&amp;quot; or &amp;quot;&amp;amp;gt;&amp;quot; then Y should only be a single value and both X and Y are converted to numbers and compared.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;=&amp;quot; then a string comparison is performed between X and Y. This is the only valid value for op when X is a function_bool and in this case Y must be one of &amp;quot;YES&amp;quot; or &amp;quot;NO&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;undefined&amp;quot; then X must be a mission_var or local_var and Y is ignored. The condition is true if the mission or local variable has not yet been defined, or false if it has.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;oneof&amp;quot; then Y is considered to be a list of values separated by commas and the condition is true if X is equal to any one of them.&lt;br /&gt;
&lt;br /&gt;
Each condition is terminated by the word &amp;quot;and&amp;quot; or &amp;quot;then&amp;quot; and each condition can be on a separate line, for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if mission_x = A and&lt;br /&gt;
   mission_y = B then&lt;br /&gt;
        // some actions here&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Actions ===&lt;br /&gt;
&lt;br /&gt;
If all the conditions in an &amp;quot;if&amp;quot; statement are met then the actions bounded by the &amp;quot;then&amp;quot; and the &amp;quot;else&amp;quot; or &amp;quot;endif&amp;quot; statement are executed. If any of the conditions in an &amp;quot;if&amp;quot; statement are not met and there is an &amp;quot;else&amp;quot; clause then the actions between the &amp;quot;else&amp;quot; and &amp;quot;endif&amp;quot; statement are executed.&lt;br /&gt;
&lt;br /&gt;
Each action takes one line, and if finished by the end-of-line character(s).&lt;br /&gt;
&lt;br /&gt;
The first word on an action line specifies the action to be performed. Some actions do not require any parameters, so the action line is a single word - &amp;quot;debugOn&amp;quot; for example. If the action requires any parameters, they are specified after a &amp;quot;:&amp;quot;. There are examples of this above - &amp;quot;set&amp;quot; and &amp;quot;debugMessage&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Any word in the set of parameters surrounded by square brakets is assumed to be either a variable or the name of a function. If the word '''''starts''''' with mission_, local_, or commander_ it is assumed to be a variable and the variable's value replaces the variable name and the square brackets before the action is executed. If the word '''''ends''''' with _string, _number, or _bool it is assumed to be a function and the function's return value replaces the variable name and the square brackets before the action is executed.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3949</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3949"/>
		<updated>2006-04-05T06:06:39Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line. Nested &amp;quot;if/then/else/endif&amp;quot; clauses may also be included in the actions.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool, or a set of one or more words&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;&amp;amp;lt;&amp;quot; or &amp;quot;&amp;amp;gt;&amp;quot; then Y should only be a single value and both X and Y are converted to numbers and compared.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;=&amp;quot; then a string comparison is performed between X and Y. This is the only valid value for op when X is a function_bool and in this case Y must be one of &amp;quot;YES&amp;quot; or &amp;quot;NO&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;undefined&amp;quot; then X must be a mission_var or local_var and Y is ignored. The condition is true if the mission or local variable has not yet been defined, or false if it has.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;oneof&amp;quot; then Y is considered to be a list of values separated by commas and the condition is true if X is equal to any one of them.&lt;br /&gt;
&lt;br /&gt;
=== do ===&lt;br /&gt;
&lt;br /&gt;
'''do''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;do&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: asp-cloaked 1&amp;lt;/string&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: pirate 12&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== else ===&lt;br /&gt;
&lt;br /&gt;
'''else''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are NOT met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;else&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: super-pirate 1&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3948</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3948"/>
		<updated>2006-04-05T06:05:40Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Specifying &amp;quot;if&amp;quot; conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool, or a set of one or more words&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;&amp;amp;lt;&amp;quot; or &amp;quot;&amp;amp;gt;&amp;quot; then Y should only be a single value and both X and Y are converted to numbers and compared.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;=&amp;quot; then a string comparison is performed between X and Y. This is the only valid value for op when X is a function_bool and in this case Y must be one of &amp;quot;YES&amp;quot; or &amp;quot;NO&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;undefined&amp;quot; then X must be a mission_var or local_var and Y is ignored. The condition is true if the mission or local variable has not yet been defined, or false if it has.&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;oneof&amp;quot; then Y is considered to be a list of values separated by commas and the condition is true if X is equal to any one of them.&lt;br /&gt;
&lt;br /&gt;
=== do ===&lt;br /&gt;
&lt;br /&gt;
'''do''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;do&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: asp-cloaked 1&amp;lt;/string&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: pirate 12&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== else ===&lt;br /&gt;
&lt;br /&gt;
'''else''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are NOT met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;else&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: super-pirate 1&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3947</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3947"/>
		<updated>2006-04-05T05:37:48Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Specifying &amp;quot;if&amp;quot; conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool, or a set of one or more words&lt;br /&gt;
&lt;br /&gt;
If op is &amp;quot;&amp;amp;lt;&amp;quot; or &amp;quot;&amp;amp;gt;&amp;quot; then Y should only be a single value and both X and Y are converted to numbers and compared.&lt;br /&gt;
If op is &amp;quot;=&amp;quot; then a string comparison is performed between X and Y.&lt;br /&gt;
If op is &amp;quot;undefined&amp;quot; then X must be a mission_var or local_var and Y is ignored. The condition is true if the mission or local variable has not yet been defined, or false if it has.&lt;br /&gt;
If op is &amp;quot;oneof&amp;quot; then Y is considered to be a list of values separated by commas and the condition is true if X is equal to any one of them.&lt;br /&gt;
&lt;br /&gt;
=== do ===&lt;br /&gt;
&lt;br /&gt;
'''do''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;do&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: asp-cloaked 1&amp;lt;/string&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: pirate 12&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== else ===&lt;br /&gt;
&lt;br /&gt;
'''else''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are NOT met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;else&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: super-pirate 1&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3946</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3946"/>
		<updated>2006-04-05T05:29:04Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Specifying &amp;quot;if&amp;quot; conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if X op Y [ and X op Y ] then&lt;br /&gt;
    actions&lt;br /&gt;
else&lt;br /&gt;
    actions&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* X is one of mission_var, local_var, function_string, function_number, function_bool&lt;br /&gt;
* op is one of &amp;amp;lt;, =, &amp;amp;gt;, undefined, oneof&lt;br /&gt;
* Y is one of function_string, function_number, function_bool&lt;br /&gt;
&lt;br /&gt;
=== do ===&lt;br /&gt;
&lt;br /&gt;
'''do''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;do&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: asp-cloaked 1&amp;lt;/string&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: pirate 12&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== else ===&lt;br /&gt;
&lt;br /&gt;
'''else''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are NOT met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;else&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: super-pirate 1&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3945</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3945"/>
		<updated>2006-04-05T02:18:30Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Specifying &amp;quot;if&amp;quot; conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist|conditions]], except that &amp;amp;lt;, &amp;amp;gt;, and = are used in place of the words lessthan, greaterthan, and equal.&lt;br /&gt;
&lt;br /&gt;
=== do ===&lt;br /&gt;
&lt;br /&gt;
'''do''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;do&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: asp-cloaked 1&amp;lt;/string&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: pirate 12&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== else ===&lt;br /&gt;
&lt;br /&gt;
'''else''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are NOT met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;else&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: super-pirate 1&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3944</id>
		<title>Script.oos</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Script.oos&amp;diff=3944"/>
		<updated>2006-04-05T02:16:58Z</updated>

		<summary type="html">&lt;p&gt;Dajt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''script.oos''' Used by [[OXP]]'s to check [[conditions]] and perform scripted [[methods|actions]] accordingly.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;oos&amp;quot; file format allows scripts to be written using a more BASIC-like syntax than the plist file format permits. Scripts in &amp;quot;oos&amp;quot; format&lt;br /&gt;
have all the same features available as the plist scripts, except only one script per file can be defined.&lt;br /&gt;
&lt;br /&gt;
If both script.plist and script.oos files exist in an OXP's Config directory, script.oos is loaded in preference to script.plist.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
A script.oos file consists of the script name on the first non-comment, non-blank line, followed by one or more &amp;quot;if/then/else/endif&amp;quot; clauses.&lt;br /&gt;
&lt;br /&gt;
Blank lines, leading and trailing whitespace, and lines starting with &amp;quot;//&amp;quot; are ignored.&lt;br /&gt;
&lt;br /&gt;
The body of an &amp;quot;if/then&amp;quot; or &amp;quot;else&amp;quot; consists of one or more [[methods|actions]], one per line.&lt;br /&gt;
&lt;br /&gt;
A trivial script is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
testscript&lt;br /&gt;
if dockedAtMainStation_bool = YES then&lt;br /&gt;
    debugMessage: Player is docked at the main station.&lt;br /&gt;
else&lt;br /&gt;
    debugMessage: Player is not docked at the main station.&lt;br /&gt;
endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Specifying &amp;quot;if&amp;quot; conditions ===&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;if&amp;quot; statement must be followed by one or more conditions. If multiple conditions are required they must be separated by the keyword &amp;quot;and&amp;quot;. There is no option for an &amp;quot;or&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Where multiple conditions are specified they must all be true for the actions following &amp;quot;then&amp;quot; to be executed.&lt;br /&gt;
&lt;br /&gt;
If any of the conditions of an &amp;quot;if&amp;quot; are false and an &amp;quot;else&amp;quot; clause is present, the actions given in the &amp;quot;else&amp;quot; clause are executed.&lt;br /&gt;
&lt;br /&gt;
The form of the conditions is the same as for [[script.plist]]&lt;br /&gt;
&lt;br /&gt;
=== do ===&lt;br /&gt;
&lt;br /&gt;
'''do''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;do&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: asp-cloaked 1&amp;lt;/string&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: pirate 12&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== else ===&lt;br /&gt;
&lt;br /&gt;
'''else''' consists of an array of actions (and further conditional statements if required), executed if the '''conditions''' are NOT met.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;key&amp;gt;else&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
     &amp;lt;array&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;addShips: super-pirate 1&amp;lt;/string&amp;gt;&lt;br /&gt;
     &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=OXP_howto&amp;diff=3943</id>
		<title>OXP howto</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=OXP_howto&amp;diff=3943"/>
		<updated>2006-04-04T23:34:41Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Config */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:oolite-oxp-icon.png|100px|right|OXP icon]]&lt;br /&gt;
An '''Oolite Expansion Pack''' can cause many big changes or additions to Oolite's gameplay, or it may represent just a small, subtle alteration. By appearances, there is no way to tell what is inside, as it's merely a folder with the added extention '''.oxp'''. Inside, it will at least contain a folder named ''Config'', and possibly other folders such as ''AIs'', ''Models'', ''Textures'', ''Sounds'', etc.  It is down to the goal of the OXP, which ways to combine elements to the OXP's contents.&lt;br /&gt;
&lt;br /&gt;
=== AIs ===&lt;br /&gt;
&lt;br /&gt;
The folder named AIs would contain any AI.plist additions the OXP might use. &lt;br /&gt;
&lt;br /&gt;
* [[OXP howto AI|Making Oolite AI]]&lt;br /&gt;
&lt;br /&gt;
=== Config===&lt;br /&gt;
&lt;br /&gt;
This folder contains Property Lists such as:&lt;br /&gt;
&lt;br /&gt;
* ''[[shipdata.plist]]'' that introduces any new entity (ships, stations, objects etc.) to Oolite.&lt;br /&gt;
* ''[[misc plists|shipyard.plist]]'' that introduces new ships available for player purchase.&lt;br /&gt;
* ''[[script.plist]]'' or ''[[script.oos]]'' that plots conditional ''script actions''. script.oos will be loaded in preference to script.plist if both exist.&lt;br /&gt;
* ''[[planetinfo.plist]]'' that plots system specific changes from the default. may also contain ''script actions''.&lt;br /&gt;
* ''[[commodities.plist]]'' that contains information for each commodity in a market.&lt;br /&gt;
* ''[[misc plists|descriptions.plist]]'' that adds vocabulary to Oolite texts.&lt;br /&gt;
* ''[[hud.plist]]'' that allows for changes or a radically new ''Head-Up Display''.&lt;br /&gt;
* ''[[missiontext.plist]]'', ''[[misc plists|demoships.plist]]'', ''[[speech_pronunciation_guide.plist]]'' are some of the other custom methods.&lt;br /&gt;
&lt;br /&gt;
All plist files except for those introducing new AI, belong in Config.&lt;br /&gt;
&lt;br /&gt;
In its simplest form, an OXP could contain only a Config with an altering ''script.plist'' or ''planetinfo.plist''.  An OXP that adds a new ship needs a ''shipdata.plist'' entry, and unless it is based entirely on existing Oolite data, would include a model and texture. &lt;br /&gt;
&lt;br /&gt;
* [[OXP howto plist|Making Oolite plists]]&lt;br /&gt;
&lt;br /&gt;
=== Models===&lt;br /&gt;
&lt;br /&gt;
Oolite models need to be in the '''.dat''' format. There are utilities available that convert models made in Wings 3D (.obj) and Meshwork (.mesh) into this. A .dat file can be opened in a plain text editor to view the object's assigned texture names and see that they correspond with the actual file names in the Textures folder. The .dat file must be named exactly as it is referenced in the shipdata ''model'' entry.&lt;br /&gt;
&lt;br /&gt;
* [[OXP howto model|Making Oolite models]]&lt;br /&gt;
&lt;br /&gt;
=== Textures===&lt;br /&gt;
&lt;br /&gt;
Oolite's textures are in the '''.png''' format, usually at a standard 512x512 size, and must be named exactly as they are named in the .dat file. &lt;br /&gt;
&lt;br /&gt;
* [[OXP howto texture|Making Oolite textures]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
*[http://oolite.aegidian.org/cyoship/ Oolite Tutorial-Meshwork Shipbuilding]&lt;br /&gt;
*[http://oolite.aegidian.org/cyoship2/ Oolite Tutorial-Wings 3D Shipbuilding]&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Methods&amp;diff=3898</id>
		<title>Methods</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Methods&amp;diff=3898"/>
		<updated>2006-03-27T05:29:05Z</updated>

		<summary type="html">&lt;p&gt;Dajt: /* Changing the universe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Methods'''&lt;br /&gt;
&lt;br /&gt;
Methods are the actions that are performed when conditions (defined in a script) are met, or when a particular set of actions (like ''[[Shipdata.plist#death_actions|death_actions]]'' or ''[[Shipdata.plist#script_actions|script_actions]]'') are called for, or when an AI calls for a script action to be performed.&lt;br /&gt;
&lt;br /&gt;
All methods are stored in plists as strings (in XML this means between a &amp;lt;string&amp;gt; tag and a &amp;lt;/string&amp;gt; closing tag). If they take any parameters then these follow a colon and a space (''': ''') after the 'command' part of the method.&lt;br /&gt;
&lt;br /&gt;
For example: if the ship containing this ''death_actions'' entry is destroyed - the player gets a message and the sun goes Nova two seconds later!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;key&amp;gt;death_actions&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
 	&amp;lt;string&amp;gt;commsMessage: Oh dear [commander_name]!&amp;lt;/string&amp;gt;&lt;br /&gt;
 	&amp;lt;string&amp;gt;setSunNovaIn: 2.0&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Mission Screen ==&lt;br /&gt;
&lt;br /&gt;
 '''setGuiToMissionScreen'''&lt;br /&gt;
 // opens the mission screen&lt;br /&gt;
 &lt;br /&gt;
 '''addMissionText: &amp;lt;[[missiontext.plist]] key&amp;gt; '''&lt;br /&gt;
 // adds text to the mission screen from an entry in [[missiontext.plist]]&lt;br /&gt;
 // with the given key&lt;br /&gt;
 &lt;br /&gt;
 '''showShipModel: &amp;lt;role&amp;gt;'''&lt;br /&gt;
 // shows a rotating model of a ship with the role given&lt;br /&gt;
 // role refers to a value in one of [[shipdata.plist]]'s entries'&lt;br /&gt;
 // ''roles'' key value pair&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionMusic: &amp;lt;filename&amp;gt;'''&lt;br /&gt;
 // plays the music file given&lt;br /&gt;
 // if it exists within any OXP's ''Music'' folder&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionImage: &amp;lt;filename&amp;gt;'''&lt;br /&gt;
 // displays the picture file given&lt;br /&gt;
 // if it exists within any OXP's ''Images'' folder&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionChoices: &amp;lt;[[missiontext.plist]] key&amp;gt;'''&lt;br /&gt;
 // sets the array of choices presented at the bottom of the mission page to those described in the&lt;br /&gt;
 // entry in missiontext.plist that corresponds to the key given&lt;br /&gt;
 &lt;br /&gt;
 '''resetMissionChoice'''&lt;br /&gt;
 // makes missionChoice ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 '''setMissionDescription: &amp;lt;[[missiontext.plist]] key&amp;gt;'''&lt;br /&gt;
 // sets the short description given on the player's manifest screen&lt;br /&gt;
 &lt;br /&gt;
 '''clearMissionDescription'''&lt;br /&gt;
 // clears the short description&lt;br /&gt;
&lt;br /&gt;
 '''resetScriptTimer'''&lt;br /&gt;
 // resets a timer for scripting purposes '''deprecated - do not use''&lt;br /&gt;
&lt;br /&gt;
== Looking for, and adding ships ==&lt;br /&gt;
&lt;br /&gt;
 '''checkForShips: &amp;lt;role&amp;gt;'''&lt;br /&gt;
 // returns the number of ships found in the current system that match the role&lt;br /&gt;
 // this number can be queried with [[Methods#Results_from_other_methods|'''shipsFound_number''']]&lt;br /&gt;
 &lt;br /&gt;
 '''addShips: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear near the withpoint&lt;br /&gt;
 &lt;br /&gt;
 '''addSystemShips: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;position&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear near a point&lt;br /&gt;
 // on a line from the witchpoint to the planet's station. &amp;lt;position&amp;gt; should be a floating point&lt;br /&gt;
 // number where 0.0  represents the witchpoint and 1.0 represents the station&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsAt: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate scheme&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt;'''&lt;br /&gt;
 // causes a number of ships matching the given role to appear ''near'' a point&lt;br /&gt;
 // defined by the &amp;lt;coordinate scheme&amp;gt; and the floating point coordinates x,y and z&lt;br /&gt;
 // &amp;lt;coordinate scheme&amp;gt; consists of a three letter code:&lt;br /&gt;
 // &lt;br /&gt;
 // The first letter indicates the feature that is the origin of the coordinate system.&lt;br /&gt;
 // w =&amp;gt; witchpoint&lt;br /&gt;
 // s =&amp;gt; sun&lt;br /&gt;
 // p =&amp;gt; planet&lt;br /&gt;
 // &lt;br /&gt;
 // The next letter indicates the feature on the 'z' axis of the coordinate system.&lt;br /&gt;
 // w =&amp;gt; witchpoint&lt;br /&gt;
 // s =&amp;gt; sun&lt;br /&gt;
 // p =&amp;gt; planet&lt;br /&gt;
 // &lt;br /&gt;
 // Then the 'y' axis of the system is normal to the plane formed by the planet, sun and witchpoint.&lt;br /&gt;
 // And the 'x' axis of the system is normal to the y and z axes.&lt;br /&gt;
 // So:&lt;br /&gt;
 // ps:  z axis = (planet -&amp;gt; sun)  y axis = normal to (planet - sun - witchpoint)  x axis = normal to y and z axes&lt;br /&gt;
 // pw:  z axis = (planet -&amp;gt; witchpoint)  y axis = normal to (planet - witchpoint - sun)  x axis = normal to y and z axes&lt;br /&gt;
 // sp:  z axis = (sun -&amp;gt; planet)  y axis = normal to (sun - planet - witchpoint)  x axis = normal to y and z axes&lt;br /&gt;
 // sw:  z axis = (sun -&amp;gt; witchpoint)  y axis = normal to (sun - witchpoint - planet)  x axis = normal to y and z axes&lt;br /&gt;
 // wp:  z axis = (witchpoint -&amp;gt; planet)  y axis = normal to (witchpoint - planet - sun)  x axis = normal to y and z axes&lt;br /&gt;
 // ws:  z axis = (witchpoint -&amp;gt; sun)  y axis = normal to (witchpoint - sun - planet)  x axis = normal to y and z axes&lt;br /&gt;
 // &lt;br /&gt;
 // The third letter denotes the units used:&lt;br /&gt;
 // m:  meters&lt;br /&gt;
 // p:  planetary radii&lt;br /&gt;
 // s:  solar radii&lt;br /&gt;
 // u:  distance between first two features indicated (eg. spu means that u = distance from sun to the planet)&lt;br /&gt;
 // &lt;br /&gt;
 // in witchspace (== no sun) coordinates are absolute irrespective of the system used&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsAtPrecisely: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate scheme&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt;'''&lt;br /&gt;
 // This adds the ships as close as possible to the specified point&lt;br /&gt;
 &lt;br /&gt;
 '''addShipsWithinRadius: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt; &amp;lt;coordinate-system&amp;gt; &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt; &amp;lt;radius in metres&amp;gt;'''&lt;br /&gt;
 // Example:&lt;br /&gt;
 // &amp;quot;addShipsWithinRadius: asteroid 48 wpm 0 0 15000 5000&amp;quot;&lt;br /&gt;
 // would add a 5km-wide asteroid field with 48 asteroids at a position roughly 15000m towards&lt;br /&gt;
 // the planet from the witchpoint.&lt;br /&gt;
 &lt;br /&gt;
 '''spawn: &amp;lt;role&amp;gt; &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // adds a number of ships matching &amp;lt;role&amp;gt; near the ship&lt;br /&gt;
 // that's the target of this script (as [[Shipdata.plist#script_actions|script_actions]] or [[Shipdata.plist#death_actions|death_actions]])&lt;br /&gt;
 &lt;br /&gt;
 '''spawnShip: &amp;lt;[[shipdata.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a ship with the unique [[shipdata.plist]] key given&lt;br /&gt;
 // the position and facing of the ship are determined by a ''spawn'' dictionary in the&lt;br /&gt;
 // ship's shipdata.plist entry with ''position'' and ''facing_position'' as strings describing&lt;br /&gt;
 // coordinates according to one of the schemes above&lt;br /&gt;
&lt;br /&gt;
== Changing the universe ==&lt;br /&gt;
&lt;br /&gt;
 '''setSunNovaIn: &amp;lt;seconds&amp;gt;'''&lt;br /&gt;
 // Sets the sun to go nova after the given time in seconds&lt;br /&gt;
 &lt;br /&gt;
 '''sendAllShipsAway'''&lt;br /&gt;
 // Makes all the ships in the system hyperspace away&lt;br /&gt;
 &lt;br /&gt;
 '''setPlanetinfo: &amp;lt;key&amp;gt;=&amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets an override to the [[planetinfo.plist]] entry for the current system&lt;br /&gt;
 // the value for the given key is set to match the value&lt;br /&gt;
 // (see [[planetinfo.plist]])&lt;br /&gt;
 //&lt;br /&gt;
 // eg '''setPlanetinfo: description=a very dull planet'''&lt;br /&gt;
 // (Note the '=' is required and no variable expansion is performed on &amp;lt;value&amp;gt;)&lt;br /&gt;
 &lt;br /&gt;
 '''addPlanet: &amp;lt;[[planetinfo.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a planet to the universe from data in [[planetinfo.plist]].&lt;br /&gt;
 &lt;br /&gt;
 '''addMoon: &amp;lt;[[planetinfo.plist]] key&amp;gt;'''&lt;br /&gt;
 // adds a moon to the universe from data in [[planetinfo.plist]].&lt;br /&gt;
 // (Moons do not get an atmosphere or clouds like planets).&lt;br /&gt;
&lt;br /&gt;
== Mission Variables ==&lt;br /&gt;
&lt;br /&gt;
 '''set: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets the [[mission_variable]] to the value given&lt;br /&gt;
 // the value can be a particular string or numeric value,&lt;br /&gt;
 // or a queriable state&lt;br /&gt;
 &lt;br /&gt;
 '''reset: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // sets the [[mission_variable]] to be ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 '''increment: [[mission_variable]]'''&lt;br /&gt;
 // increases the mission variable's value by 1.0&lt;br /&gt;
 &lt;br /&gt;
 '''decrement: [[mission_variable]]'''&lt;br /&gt;
 // decreases the mission variable's value by 1.0&lt;br /&gt;
 &lt;br /&gt;
 '''add: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // adds the value given to the [[mission_variable]]&lt;br /&gt;
 // the value can be a number or a queriable state&lt;br /&gt;
 // like ''shipsFound_number''&lt;br /&gt;
 &lt;br /&gt;
 '''subtract: [[mission_variable]] &amp;lt;value&amp;gt;'''&lt;br /&gt;
 // subtracts the value given from the [[mission_variable]]&lt;br /&gt;
 // the value can be a number or a queriable state&lt;br /&gt;
 // like ''shipsFound_number''&lt;br /&gt;
&lt;br /&gt;
== Player rewards and penalties==&lt;br /&gt;
These methods work on the player, not any other ship.&lt;br /&gt;
&lt;br /&gt;
 '''awardCredits: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // awards number of tenths of credits.&lt;br /&gt;
 &lt;br /&gt;
 '''awardShipKills: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // Adds to the number of kills accredited to the player&lt;br /&gt;
 &lt;br /&gt;
 '''setLegalStatus: &amp;lt;number&amp;gt;'''&lt;br /&gt;
 // Sets the bounty on the player's head.&lt;br /&gt;
 &lt;br /&gt;
 '''setFuelLeak: &amp;lt;amount&amp;gt;'''&lt;br /&gt;
 // removes this amount from the fuel tank every second&lt;br /&gt;
 // until the tanks drain and self-seal&lt;br /&gt;
 &lt;br /&gt;
 '''awardFuel: &amp;lt;amount&amp;gt;'''&lt;br /&gt;
 // The amount can be positive or negative, expressed in LY of range&lt;br /&gt;
 // the fuel level is adjusted to a maximum of 7.0LY and minimum of 0.0.&lt;br /&gt;
&lt;br /&gt;
=== Equipment ===&lt;br /&gt;
&lt;br /&gt;
 '''awardEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // if the player doesn't have the equipment already&lt;br /&gt;
 // and their ship can be equipped witth it then this fits the&lt;br /&gt;
 // player's ship with the equipment given&lt;br /&gt;
 // valid keys can be found in [[equipment.plist]] (they all begin '''EQ_'''):-&lt;br /&gt;
 //	EQ_FUEL&lt;br /&gt;
 //	EQ_MISSILE&lt;br /&gt;
 //	EQ_CARGO_BAY&lt;br /&gt;
 //	EQ_ECM&lt;br /&gt;
 //	EQ_FUEL_SCOOPS&lt;br /&gt;
 //	EQ_ESCAPE_POD&lt;br /&gt;
 //	EQ_ENERGY_BOMB&lt;br /&gt;
 //	EQ_ENERGY_UNIT&lt;br /&gt;
 //	EQ_NAVAL_ENERGY_UNIT&lt;br /&gt;
 //	EQ_DOCK_COMP&lt;br /&gt;
 //	EQ_GAL_DRIVE&lt;br /&gt;
 //	EQ_CLOAKING_DEVICE&lt;br /&gt;
 //	EQ_PASSENGER_BERTH&lt;br /&gt;
 //	EQ_HARDENED_MISSILE&lt;br /&gt;
 //	EQ_FUEL_INJECTION&lt;br /&gt;
 //	EQ_SCANNER_SHOW_MISSILE_TARGET&lt;br /&gt;
 //	EQ_MULTI_TARGET&lt;br /&gt;
 //	EQ_ADVANCED_COMPASS&lt;br /&gt;
 //	EQ_QC_MINE&lt;br /&gt;
 //	EQ_SHIELD_BOOSTER&lt;br /&gt;
 //	EQ_NAVAL_SHIELD_BOOSTER&lt;br /&gt;
 //	EQ_WEAPON_TWIN_PLASMA_CANNON&lt;br /&gt;
 //	EQ_MILITARY_JAMMER&lt;br /&gt;
 //	EQ_MILITARY_SCANNER_FILTER&lt;br /&gt;
 &lt;br /&gt;
 '''removeEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // removes the indicated equipment from the player's ship&lt;br /&gt;
 &lt;br /&gt;
 '''testForEquipment: &amp;lt;equipment key&amp;gt;'''&lt;br /&gt;
 // tests whether the player ship has a piece of equipment installed&lt;br /&gt;
 // returns the result in [[Methods#Results_from_other_methods|'''foundEquipment_bool''']]&lt;br /&gt;
&lt;br /&gt;
=== Cargo ===&lt;br /&gt;
&lt;br /&gt;
 '''awardCargo: &amp;lt;amount&amp;gt; &amp;lt;[[Commodities|Commodity]] name&amp;gt;'''&lt;br /&gt;
 // awards a quantity of the cargo named&lt;br /&gt;
 // the cargo name must match the name in [[commodities.plist]] exactly&lt;br /&gt;
 &lt;br /&gt;
 '''removeAllCargo'''&lt;br /&gt;
 // removes all cargo from the hold with no compensation to the player&lt;br /&gt;
 // any special cargo is also removed (see below) restoring use of the cargo bay&lt;br /&gt;
 // Gold, Platinum, and Gemstones are unaffected (they're in the cabin safe).&lt;br /&gt;
 &lt;br /&gt;
 '''useSpecialCargo: &amp;lt;description of cargo&amp;gt;'''&lt;br /&gt;
 // fills the cargo bay withthe cargo described effectively&lt;br /&gt;
 // disabling the use of the cargo bay until the cargo is removed&lt;br /&gt;
&lt;br /&gt;
=== Special ===&lt;br /&gt;
&lt;br /&gt;
 '''ejectItem: &amp;lt;[[shipdata.plist]] key&amp;gt;'''  &lt;br /&gt;
 // Creates a ship or other entity from [[shipdata.plist]] and ejects from&lt;br /&gt;
 // the ship's aft hatch&lt;br /&gt;
 &lt;br /&gt;
 '''launchFromStation'''&lt;br /&gt;
 // forces the player ship to launch&lt;br /&gt;
&lt;br /&gt;
== Communications ==&lt;br /&gt;
&lt;br /&gt;
 '''commsMessage: ''message'' '''&lt;br /&gt;
 // sends the player a message&lt;br /&gt;
 // if the message contains elements enclosed in square brackets ''[like_this]''&lt;br /&gt;
 // that corresponds to a [[mission_variable]] or keys in [[descriptions.plist]]&lt;br /&gt;
 // or to special expansions like [commander_name] then these are expanded&lt;br /&gt;
 // and substituted into the original message&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Querying states ==&lt;br /&gt;
&lt;br /&gt;
=== Player status ===&lt;br /&gt;
&lt;br /&gt;
 // '''mission_string'''&lt;br /&gt;
 // returns the key for the current mission&lt;br /&gt;
 &lt;br /&gt;
 // '''status_string'''&lt;br /&gt;
 // returns one of:&lt;br /&gt;
 // ''STATUS_AUTOPILOT_ENGAGED''&lt;br /&gt;
 // ''STATUS_DEAD''&lt;br /&gt;
 // ''STATUS_DEMO''&lt;br /&gt;
 // ''STATUS_DOCKING''&lt;br /&gt;
 // ''STATUS_DOCKED''&lt;br /&gt;
 // ''STATUS_EFFECT''&lt;br /&gt;
 // ''STATUS_ENTERING_WITCHSPACE''&lt;br /&gt;
 // ''STATUS_ESCAPE_SEQUENCE''&lt;br /&gt;
 // ''STATUS_EXITING_WITCHSPACE''&lt;br /&gt;
 // ''STATUS_EXPERIMENTAL''&lt;br /&gt;
 // ''STATUS_IN_FLIGHT''&lt;br /&gt;
 // ''STATUS_IN_HOLD''&lt;br /&gt;
 // ''STATUS_INACTIVE''&lt;br /&gt;
 // ''STATUS_LAUNCHING''&lt;br /&gt;
 // ''STATUS_TEST''&lt;br /&gt;
 // ''STATUS_WITCHSPACE_COUNTDOWN''&lt;br /&gt;
 // ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 // '''gui_screen_string'''&lt;br /&gt;
 // returns one of:&lt;br /&gt;
 // ''GUI_SCREEN_EQUIP_SHIP''&lt;br /&gt;
 // ''GUI_SCREEN_INTRO1''&lt;br /&gt;
 // ''GUI_SCREEN_INTRO2''&lt;br /&gt;
 // ''GUI_SCREEN_INVENTORY''&lt;br /&gt;
 // ''GUI_SCREEN_LONG_RANGE_CHART''&lt;br /&gt;
 // ''GUI_SCREEN_MAIN''&lt;br /&gt;
 // ''GUI_SCREEN_MARKET''&lt;br /&gt;
 // ''GUI_SCREEN_MISSION''&lt;br /&gt;
 // ''GUI_SCREEN_OPTIONS''&lt;br /&gt;
 // ''GUI_SCREEN_SHORT_RANGE_CHART''&lt;br /&gt;
 // ''GUI_SCREEN_STATUS''&lt;br /&gt;
 // ''GUI_SCREEN_SYSTEM_DATA''&lt;br /&gt;
 // ''UNDEFINED''&lt;br /&gt;
 &lt;br /&gt;
 // '''galaxy_number'''&lt;br /&gt;
 // returns a value between 0 and 7&lt;br /&gt;
 &lt;br /&gt;
 // '''planet_number'''&lt;br /&gt;
 // returns a value between 0 and 255&lt;br /&gt;
 &lt;br /&gt;
 // '''score_number'''&lt;br /&gt;
 // returns the number of the player's current ship kills&lt;br /&gt;
 &lt;br /&gt;
 // '''credits_number'''&lt;br /&gt;
 // returns the player's credits x10&lt;br /&gt;
 &lt;br /&gt;
 // '''legalStatus_number'''&lt;br /&gt;
 // returns the bounty on the players head&lt;br /&gt;
 &lt;br /&gt;
 // '''fuel_level_number'''&lt;br /&gt;
 // returns the fuel level in LY&lt;br /&gt;
 &lt;br /&gt;
 // '''dockedAtMainStation_bool'''&lt;br /&gt;
 // returns ''YES'' if docked at a systems main station, ''NO'' otherwise&lt;br /&gt;
 &lt;br /&gt;
 // '''dockedStationName_string'''&lt;br /&gt;
 // returns ''NONE'' if the player isn't docked, the name of the station (from [[shipdata.plist]]) if it is, ''UNKNOWN'' otherwise&lt;br /&gt;
&lt;br /&gt;
=== Results from other methods ===&lt;br /&gt;
&lt;br /&gt;
 // '''shipsFound_number'''&lt;br /&gt;
 // returns the number of ships found by ''checkForShips:''&lt;br /&gt;
 &lt;br /&gt;
 // '''foundEquipment_bool'''&lt;br /&gt;
 // returns the result of the last ''testForEquipment''&lt;br /&gt;
 // returns ''YES'' if the equipment was found, ''NO'' otherwise&lt;br /&gt;
  &lt;br /&gt;
 // '''missionChoice_string'''&lt;br /&gt;
 // returns the result of the player's selection from a list of missionChoices&lt;br /&gt;
 // returns ''UNDEFINED'' or the key for the chosen option&lt;br /&gt;
&lt;br /&gt;
=== Random numbers ===&lt;br /&gt;
&lt;br /&gt;
 // '''d100_number'''&lt;br /&gt;
 // returns a random value from 0 to 99&lt;br /&gt;
 &lt;br /&gt;
 // '''pseudoFixedD100_number'''&lt;br /&gt;
 // returns a random number from 0 to 99 that will&lt;br /&gt;
 // remain fixed as long as the player remains in this system&lt;br /&gt;
&lt;br /&gt;
=== Time ===&lt;br /&gt;
&lt;br /&gt;
 // '''clock_number'''&lt;br /&gt;
 // returns the game time in seconds&lt;br /&gt;
 // '''clock_secs_number'''&lt;br /&gt;
 // returns the game time in seconds&lt;br /&gt;
 // '''clock_mins_number'''&lt;br /&gt;
 // returns the game time in minutes&lt;br /&gt;
 // '''clock_hours_number'''&lt;br /&gt;
 // returns the game time in hours&lt;br /&gt;
 // '''clock_days_number'''&lt;br /&gt;
 // returns the game time in days&lt;br /&gt;
&lt;br /&gt;
=== System states ===&lt;br /&gt;
&lt;br /&gt;
 // '''sunWillGoNova_bool'''&lt;br /&gt;
 // returns whether the sun is going to go nova, either ''YES'' or ''NO''&lt;br /&gt;
 &lt;br /&gt;
 // '''sunGoneNova_bool'''&lt;br /&gt;
 // returns whether the sun has gone nova, either ''YES'' or ''NO''&lt;br /&gt;
 &lt;br /&gt;
 // '''systemGovernment_string'''&lt;br /&gt;
 // returns one of:-&lt;br /&gt;
 // ''Anarchy''&lt;br /&gt;
 // ''Feudal''&lt;br /&gt;
 // ''Multi-Government''&lt;br /&gt;
 // ''Dictatorship''&lt;br /&gt;
 // ''Communist''&lt;br /&gt;
 // ''Confederacy''&lt;br /&gt;
 // ''Democracy''&lt;br /&gt;
 // ''Corporate State''&lt;br /&gt;
 &lt;br /&gt;
 // '''systemGovernment_number'''&lt;br /&gt;
 // returns a value from 0 to 7&lt;br /&gt;
 &lt;br /&gt;
 // '''systemEconomy_number'''&lt;br /&gt;
 // returns a value from 0 to 7&lt;br /&gt;
 &lt;br /&gt;
 // '''systemTechLevel_number'''&lt;br /&gt;
 // returns a value from 0 to 14&lt;br /&gt;
 &lt;br /&gt;
 // '''systemPopulation_number'''&lt;br /&gt;
 // returns a value representing the system's population&lt;br /&gt;
 &lt;br /&gt;
 // '''systemProductivity_number'''&lt;br /&gt;
 // returns a value representing the system's productivity&lt;br /&gt;
&lt;br /&gt;
 // '''scriptTimer_number'''&lt;br /&gt;
 // returns the script timer's current value in seconds '''(deprecated - do not use)'''&lt;br /&gt;
&lt;br /&gt;
== Debugging scripts ==&lt;br /&gt;
&lt;br /&gt;
 '''debugOn'''&lt;br /&gt;
 // sends script debugging messages to the console.&lt;br /&gt;
 &lt;br /&gt;
 '''debugOff'''&lt;br /&gt;
 // cancels script debugging messages&lt;br /&gt;
 &lt;br /&gt;
 '''debugMessage: &amp;lt;message&amp;gt;'''&lt;br /&gt;
 // sends the given message to the console. The message is written to the console regardless&lt;br /&gt;
 // of whether debugOn has been performed or not. For GNUstep versions of Oolite, the console&lt;br /&gt;
 // is a file called stderr.txt located in the game's installation directory. Mission variables&lt;br /&gt;
 // and queriable states may be included in the message, eg:&lt;br /&gt;
 //&lt;br /&gt;
 // ''debugMessage: current galaxy is galaxy_number''&lt;br /&gt;
&lt;br /&gt;
== AI ==&lt;br /&gt;
&lt;br /&gt;
Note that although most of these methods affect the player, some can also be utilised by an AI. &lt;br /&gt;
*[[OXP howto AI]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Dajt</name></author>
		
	</entry>
</feed>