<?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=Ahruman</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=Ahruman"/>
	<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php/Special:Contributions/Ahruman"/>
	<updated>2026-04-16T09:08:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Material_Test_Suite_OXP&amp;diff=38854</id>
		<title>Material Test Suite OXP</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Material_Test_Suite_OXP&amp;diff=38854"/>
		<updated>2014-01-04T23:06:14Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Added link for test suite version 1.3.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Material Test Suite''' is an expansion pack which tests Oolite’s [[Materials in Oolite|material model]] and built-in shaders. It was created during the testing phase before version 1.76 to test material functionality across different platforms and hardware. It may be useful in diagnosing some rendering problems.&lt;br /&gt;
&lt;br /&gt;
To run the test suite:&lt;br /&gt;
* Download the test suite and install it. (Oolite test release 1.75 or later required. For information on installing expansion packs, see [[OXP#Installing an OXP&amp;quot;|the “OXP” article]].)&lt;br /&gt;
** For Oolite 1.75–1.77: [http://jens.ayton.se/oolite/files/material-test-suite-1.2.oxp.zip Material Test Suite 1.2]&lt;br /&gt;
** For Oolite test release 1.79 (January 2014) or later: [http://jens.ayton.se/oolite/files/material-test-suite-1.3.oxz Material Test Suite 1.3]&lt;br /&gt;
* Run Oolite, and decline when asked whether you want to load a game. (If you are using Strict Mode, disable it and restart Oolite.)&lt;br /&gt;
* You should now be presented with an information screen and the options “Run test suite” and “Cancel”. Select “Run test suite”.&lt;br /&gt;
* You will now be shown a series of spinning cubes. The precise number shown depends on your system’s capabilities. A successful test shows a grey box with a number on it (see [[#Sample Images|sample images]] below). A failed test will show something else, typically a solid black box.&lt;br /&gt;
* Please take a note of any failed tests, writing down the label shown on the left of the screen (such as “simple: 3”). If it is something other than a solid black or red box, please also take a screen shot (“'''*'''” key).&lt;br /&gt;
* While you’re at it, we’d appreciate if you tested dust rendering. When the test suite is complete, leave the station and fly away until you are no longer mass locked. Fly at normal speed and at hyperspeed (default: “'''J'''” key). Note whether you see dust particles flying past. Test this in every available shader mode (to change shader mode, pause, press “'''2'''” or “'''F2'''”, and select “Game Options…”).&lt;br /&gt;
&lt;br /&gt;
If all the tests work and dust is nicely dusty, we’re done. You can throw out the Material Test Suite expansion pack and get back to playing the game. Otherwise, please report the problem:&lt;br /&gt;
* Quit Oolite and open the log file. (To locate the log file, see [[Oolite FAQ#Diagnosing Problems|the FAQ entry on diagnosing problems]].)&lt;br /&gt;
* Copy the lines between “&amp;lt;code&amp;gt;========== [Marker 1] ==========&amp;lt;/code&amp;gt;” and “&amp;lt;code&amp;gt;========== [Marker 2] ==========&amp;lt;/code&amp;gt;”. Paste them into an e-mail to [mailto:bugs@oolite.org bugs@oolite.org] or [http://www.aegidian.org/bb/viewtopic.php?t=8038 this forum thread] (or send the whole log as an attachment). Don’t forget to specify which tests failed!&lt;br /&gt;
&lt;br /&gt;
If your tests passed, feel free to report anyway. Confirmation that we’re doing something right is good for our egos. But if they failed, we really need to know. We can’t fix problems we don’t know about.&lt;br /&gt;
&lt;br /&gt;
== Sample Images ==&lt;br /&gt;
Click the images for a bigger view. Note that tests 8–16 will not be shown on systems without GLSL shader support.&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 1.png|160px|left|thumb]] Test 1: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; only.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 2.png|160px|left|thumb]] Test 2: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''2''' glows green in the dark.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 3.png|160px|left|thumb]] Test 3: &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''3''' and the ring both glow green in the dark.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 4.png|160px|left|thumb]] Test 4: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that number '''4''' is illuminated as though by a spotlight (with a slightly blue tint).&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 5.png|160px|left|thumb]] Test 5: &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''5''' and the ring both glow with a dull blue tint.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 6.png|160px|left|thumb]] Test 6: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''6''' is illuminated as in test 4, and the ring glows with a slight green tint.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 7.png|160px|left|thumb]] Test 7: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;emission_and_illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When rendered correctly, the effects should be the same as in test 6.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 8.png|160px|left|thumb]] Test 8: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note the shadows and highlights around the inside of the ring, which conform to the main light source, producing the effect of an indentation containing the number '''8'''.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 9.png|160px|left|thumb]] Test 9: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This should look similar to test 8, but with slightly better perspective. If you noticed a “creeping” effect in test 8, it should be alleviated in test 9. This is more noticeable if you look at the tests again.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 10.png|160px|left|thumb]] Test 10: &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The number '''10''' and the ring glow as in test 3, and the interior of the ring is indented as in test 9.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 11.png|160px|left|thumb]] Test 11: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The ring is white and the number '''11''' glows green, as in test 2, and the interior of the ring is indented.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 12.png|160px|left|thumb]] Test 12: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The ring glows and the indented area around the number is illuminated as though by a spotlight, as in tests 6 and 7.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 13.png|160px|left|thumb]] Test 13: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''13''' is only visible as a variation in the glossiness of the surface, and completely invisible in shadow.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 14.png|160px|left|thumb]] Test 14: &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''14''' and the ring are only visible as a variation in the glossiness of the surface, and the cube is uniformly grey in shadow.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 15.png|160px|left|thumb]] Test 15: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A shiny surface as in tests 13 and 14, but width a glowing number '''15'''.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 16.png|160px|left|thumb]] Test 16: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Everything all at once: like test 12, but with the varying shininess from tests 13–15.&lt;br /&gt;
&lt;br /&gt;
'''Bug:''' For unknown reasons, the shininess of test 16 does not match that of tests 13–15.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite expansion packs]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=File:Oolite-oxp-icon.png&amp;diff=38065</id>
		<title>File:Oolite-oxp-icon.png</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=File:Oolite-oxp-icon.png&amp;diff=38065"/>
		<updated>2013-11-02T13:53:25Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: uploaded a new version of &amp;amp;quot;File:Oolite-oxp-icon.png&amp;amp;quot;: Updated to “new” icon from early 2011.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;illustration for OXP_howto&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=37625</id>
		<title>Debug OXP</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=37625"/>
		<updated>2013-10-01T07:35:47Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Update for 1.77.1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Debug.oxp''' is a special OXP that enables JavaScript console support in Oolite (1.70 and later). It also adds a menu with various debug facilities under Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
[http://oolite.org/releases/debug-oxp-1.77.1.zip Debug OXP for Oolite 1.77.1]&lt;br /&gt;
&lt;br /&gt;
== External JavaScript console support ==&lt;br /&gt;
On all platforms, installing Debug.oxp enables support for external console applications using the [[Oolite debug console TCP protocol]]. By default, it will attempt to connect to a console running on the same computer, but this can be changed by specifying a different &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; (and, optionally, &amp;lt;code&amp;gt;console-port&amp;lt;/code&amp;gt;) in ''debugConfig.plist''. For external console support on the same computer under Mac OS X, &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; must be explicitly set to “127.0.0.1”; if this is not done, the [[#Integrated JavaScript console|integrated JavaScript console]] will be used instead. For information on using a console (integrated or external), see [[#Using the JavaScript console|Using the JavaScript console]] below.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' A cross-platform, python based, external console application is available in the [http://developer.berlios.de/project/showfiles.php?group_id=3577 Berlios Oolite files] area.&lt;br /&gt;
&lt;br /&gt;
It contains a precompiled console for windows based computers, and the original python based console for Linux and Posix compliant computers.&lt;br /&gt;
&lt;br /&gt;
On Debian or Ubuntu Linux you will need python 2.6.x installed and (at least) the packages &amp;lt;code&amp;gt;blt python-tk tk8.5&amp;lt;/code&amp;gt; (or the equivalents in other distros.)&lt;br /&gt;
&lt;br /&gt;
== Mac OS X-specific features ==&lt;br /&gt;
Under Mac OS X, the Debug OXP provides a menu with various debugging options and an integrated JavaScript console, as well as enabling external console support as on all platforms.&lt;br /&gt;
&lt;br /&gt;
=== Debug menu (Mac OS X only) ===&lt;br /&gt;
[[Image:Oolite-debug-menu.png|494px]]&lt;br /&gt;
&lt;br /&gt;
The Debug menu provides options to&lt;br /&gt;
* Show the Oolite run log in the standard Console application.&lt;br /&gt;
* Enable or disable various classes of log message at runtime (like editing ''logcontrol.plist'', without the need to restart Oolite).&lt;br /&gt;
* Enable various testing features, such as drawing of bounding boxes.&lt;br /&gt;
* Show the JavaScript console, and specify when it should be shown automatically. (This may not have any effect with external consoles, depending on the external console implementation.)&lt;br /&gt;
* Create a ship of any role near the main station (equivalent to the &amp;lt;code&amp;gt;:spawn&amp;lt;/code&amp;gt; [[#Macros|macro]]).&lt;br /&gt;
Note: some of these features are implemented by sending JavaScript messages to the [[#The console script|console script]]. If the script has been modified, some features may not work properly.&lt;br /&gt;
&lt;br /&gt;
The Log Message Classes submenu can be modified by editing ''debugLogMessageClassesMenu.plist'', found inside the OXP. This is merged from Config directories in the usual fashion.&lt;br /&gt;
&lt;br /&gt;
=== Integrated JavaScript console (Mac OS X only) ===&lt;br /&gt;
[[Image:Oolite debug protocol example 1.png|594px]]&lt;br /&gt;
&lt;br /&gt;
The integrated JavaScript console provides a window within Oolite which acts as a [[#Using the JavaScript console|JavaScript console]]. It can be shown using the Show JavaScript Console command in the Debug menu, unless external console mode has been enabled by setting &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; in ''debugConfig.plist''.&lt;br /&gt;
&lt;br /&gt;
The integrated console has a 100-line memory. To see previous commands, press ⇞ (Page Up) or ⌥↑ (Option-Up Arrow). You can go the other way in the obvious manner.&lt;br /&gt;
&lt;br /&gt;
== Using the JavaScript console ==&lt;br /&gt;
The JavaScript console, whether integrated or external, provides a powerful mechanism for interactively manipulating the game world. It can be used to issue simple commands, like &amp;lt;code&amp;gt;player.ship.awardEquipment(&amp;quot;EQ_FUEL_INJECTION&amp;quot;)&amp;lt;/code&amp;gt;. It can be used to inspect properties of entities in the game world. And it can be used to develop scripts, by rewriting and testing methods of live ship scripts and world scripts.&lt;br /&gt;
&lt;br /&gt;
=== Macros ===&lt;br /&gt;
Macros are a special type of command prefixed with a colon. Instead of being interpreted as a JavaScript command, a macro is looked up in a dictionary, and the result is used as the “real” command. For instance, if you enter the command &amp;lt;code&amp;gt;:listM&amp;lt;/code&amp;gt; (short for “list macros”), the macro dictionary is queried for the string “listM”, and (by default) the code &amp;lt;code&amp;gt;for (let prop in macros) { ConsoleMessage('macro-list', ':' + prop) }&amp;lt;/code&amp;gt; is found and executed. This code is called the ''expansion'' of the macro. The result is a list of macros being printed:&lt;br /&gt;
 :clr&lt;br /&gt;
 :clear&lt;br /&gt;
 :spawn&lt;br /&gt;
 :bgColor&lt;br /&gt;
 :showM&lt;br /&gt;
 :rmFgColor&lt;br /&gt;
 ::&lt;br /&gt;
 :d&lt;br /&gt;
 :ds&lt;br /&gt;
 :listM&lt;br /&gt;
 :setM&lt;br /&gt;
 :delM&lt;br /&gt;
 :fgColor&lt;br /&gt;
 :rmBgColor&lt;br /&gt;
 :resetM&lt;br /&gt;
&lt;br /&gt;
As you can see in the example, To see the expansion of a macro without executing it, use &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt;:&lt;br /&gt;
 &amp;gt; :showM :delM&lt;br /&gt;
 :delM = deleteMacro(PARAM)&lt;br /&gt;
&lt;br /&gt;
When a macro with the word &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is executed, &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is replaced with any text following the macro name, surrounded in quotation marks. This is how &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt; functions, for example; the string “:showM :delM” is expanded to “showMacro(&amp;quot;:delM&amp;quot;)”, causing the JavaScript function &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt;, which is part of the [[#The console script|console script]], to be called. You can see the implementation of &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt; by entering &amp;lt;code&amp;gt;showMacro&amp;lt;/code&amp;gt; – without any parentheses – into the console.&lt;br /&gt;
&lt;br /&gt;
An initial set of macros is loaded from ''debugConfig.plist''. If you edit any macros, using &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;:delM&amp;lt;/code&amp;gt;, all macros are saved in Oolite’s preferences from that point forwards. This means that you don’t have to re-enter any macros you write with &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; after restarting Oolite.&lt;br /&gt;
&lt;br /&gt;
The following example creates a simple :msg macro:&lt;br /&gt;
 &amp;gt; :setM msg ConsoleMessage(' ',PARAM)&lt;br /&gt;
If you then type:&lt;br /&gt;
 &amp;gt; :msg Hello World&lt;br /&gt;
The macro will be expanded, and you'll see “Hello World” on the console. However, macros are not functions, so you cannot use macros in the middle of javascript, or as part of another macro.&lt;br /&gt;
&lt;br /&gt;
=== Console Properties ===&lt;br /&gt;
&lt;br /&gt;
The console has several properties. They are accessible with &amp;quot;console.Foo&amp;quot;:&lt;br /&gt;
 debugFlags (r/w)&lt;br /&gt;
 shaderMode (r/w)&lt;br /&gt;
 maximumShaderMode (read only)&lt;br /&gt;
 reducedDetailMode (r/w)&lt;br /&gt;
 displayFPS (r/w)&lt;br /&gt;
 platformDescription (read only)&lt;br /&gt;
 pedanticMode (r/w)&lt;br /&gt;
 ignoreDroppedPackets (r/w)&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;debugFlags&amp;lt;/code&amp;gt; you can selective set/disable debugging options. Every debugging option is activated by setting a corresponding bit in the &amp;lt;code&amp;gt;debugFlags&amp;lt;/code&amp;gt;:&lt;br /&gt;
 Linked Lists                = 0x00000001&lt;br /&gt;
 Collisions                  = 0x00000004&lt;br /&gt;
 Docking                     = 0x00000008&lt;br /&gt;
 Octrees - Verbose Logging   = 0x00000010&lt;br /&gt;
 Bounding Boxes              = 0x00000040&lt;br /&gt;
 Octrees - Draw              = 0x00000080&lt;br /&gt;
 Normals                     = 0x00000100&lt;br /&gt;
 Hide Dust		    = 0x00000200&lt;br /&gt;
 disable Shader Fallback	    = 0x00000400&lt;br /&gt;
 Extra Shader Validation	    = 0x00000800&lt;br /&gt;
 Miscellaneous	            = 0x10000000&lt;br /&gt;
&lt;br /&gt;
=== The console script ===&lt;br /&gt;
While an external or integrated console is required to provide a means of user interaction, most of the actual behaviour of the console is implemented in JavaScript, in a script called ''oolite-debug-console.js''. Input typed into the console is passed to the console script, which then generates output. The console script is also informed of log messages and JavaScript errors, and provides a global function, &amp;lt;code&amp;gt;ConsoleMessage(colorCode: String, message: String)&amp;lt;/code&amp;gt;, to write messages to the console using its background colour support. Lastly, the console script implements the entire macro system.&lt;br /&gt;
&lt;br /&gt;
This means that the console’s behaviour can be extensively customized, for instance, by replacing the macro system with something more powerful. There are two basic approaches to doing this:&lt;br /&gt;
* Creating a custom script (or a copy) with the same name, in an OXP which loads later than Debug.oxp (e.g., one which has a name which comes later in alphabetical order).&lt;br /&gt;
* Using a normal world script, and changing the console script object at startup.&lt;br /&gt;
The latter approach has the advantage that it can continue to work with future versions of the console script, and multiple patches can coexist. For example, a modification to supplement the macro system with a better one might look as follows:&lt;br /&gt;
 this.name = &amp;quot;my-super-console-macros&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 this.startUp = function()&lt;br /&gt;
 {&lt;br /&gt;
     // Ensure debug console is installed&lt;br /&gt;
     if (!debugConsole)  return&lt;br /&gt;
     &lt;br /&gt;
     // Save original implementation of consolePerformJSCommand&lt;br /&gt;
     // Note the prefix, used to ensure uniqueness. If several scripts patch&lt;br /&gt;
     // the same method, it's important that they use different names.&lt;br /&gt;
     debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand = debugConsole.consolePerformJSCommand&lt;br /&gt;
     &lt;br /&gt;
     // Replace debugConsole.consolePerformJSCommand with custom function&lt;br /&gt;
     debugConsole.consolePerformJSCommand = function(command)&lt;br /&gt;
     {&lt;br /&gt;
         // Note that in this function &amp;quot;this&amp;quot; will refer to debugconsole, not&lt;br /&gt;
         // my-super-console-macros, since the function will be called as a&lt;br /&gt;
         // method of debugConsole.&lt;br /&gt;
         &lt;br /&gt;
         // Strip leading spaces, same code as original function.&lt;br /&gt;
         while (command.charAt(0) == &amp;quot; &amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             command = command.substring(1)&lt;br /&gt;
         }&lt;br /&gt;
         &lt;br /&gt;
         if (command.charAt(0) == &amp;quot;!&amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             // Super macro call detected.&lt;br /&gt;
             // Insert super macro system here.&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
             // Otherwise, call through to original method.&lt;br /&gt;
             debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand(command)&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
This same patching technique, incidentally, can be used to modify scripts at runtime, either from the console or from other scripts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{misc-OXP}}&lt;br /&gt;
[[Category:Oolite utilities]]&lt;br /&gt;
[[Category:Oolite scripting]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_FAQ&amp;diff=36796</id>
		<title>Oolite FAQ</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_FAQ&amp;diff=36796"/>
		<updated>2013-05-12T22:02:48Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Diagnosing Problems */ Updated log-finding info for Mac OS X.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Where do I get the program? And what about the different versions that exist?|answer= The latest recommended release is 1.77-test, and the latest 'official' stable release is version 1.76.1, both available on the [http://oolite.org/download.shtml oolite.org download page] for OS X, Windows, and Linux(x86). The last stable release made by the original programmer, Giles Williams (a.k.a. Aegidian) was 1.65 and is best available from his website [http://oolite.aegidian.org/ oolite.aegidian.org]. The latest test releases/development versions can be [http://developer.berlios.de/project/showfiles.php?group_id=3577 downloaded from BerliOS] with installers also available for OS X, Windows and Linux. More detailed information can be found on the [http://aegidian.org/bb/index.php Oolite Bulletin Board], in the respective sections for [http://aegidian.org/bb/viewforum.php?f=10 Oolite-Mac], [http://aegidian.org/bb/viewforum.php?f=9 Oolite-Linux] and [http://aegidian.org/bb/viewforum.php?f=8 Oolite-PC].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=What's the point of the game?|answer=To fly from planet to planet, buying and selling goods, shooting pirates or committing acts of piracy. There's no goal other than perhaps to achieve the rank of ELITE.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I'm still confused, how do I play?|answer=It's a good idea to start with the [http://svn.berlios.de/svnroot/repos/oolite-linux/tags/1.77/Doc/OoliteReadMe.pdf Oolite ReadMe] file for some basic information. For further information you may wish to consult the [http://wiki.alioth.net/index.php/Oolite_Instruction_Manual Oolite Instruction Manual] here on the wiki. A load of helpful information can be obtained from [http://wiki.alioth.net/index.php/Mr_Gimlet Mr Gimlet], the quite talkative dockmaster on Lave Station. If you're a fresh graduate from the Flight Academy on the way to your first ship, you should see him. It's also a good idea to have a look at Ian Bell's [http://www.iancgbell.clara.net/elite/manual.htm Flight Training Manual] for the original BBC Elite, although some of Oolite's control keys are different from the original, so be careful.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=How do I configure my joystick or gamepad for Oolite in Linux?|answer=See [[Linux Joysticks and Gamepads]].}}&lt;br /&gt;
&lt;br /&gt;
== Gameplay ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=What do the various colors represent on the radar?|answer=White - unpowered items that can't mass-lock the in-system drive (jumpdrive). Green/Yellow - navigation buoys. Yellow - powered craft. Red - powered craft identified as hostile. Green - space stations. Green/Red - thargoids. Purple - police. Blue/Red - police on intercept. Red/Yellow - active mine (about to detonate). Blue/Cyan - witchspace wormhole.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I keep crashing when trying to dock. How do I dock manually?|answer=Many young Jamesons have met a sticky end and had to be scraped from the docking port of Lave Station whilst attempting docking. It's fairly easy once you get the hang of it. Check the [[How_to_Dock|How to Dock]] guide from the Galactic Navy Flight Manual. Or you can get the [[Traffic_Control_OXP|Traffic Control OXP]] for friendly instructions given by the station crew as you try to dock.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=How do I make decent profits?|answer=Trade between a Poor or Average Agricultural and a Rich or Average Industrial planet. Write down the prices for everything on both planets and find out where you make the most profit per ton. You can also download the [http://svn.berlios.de/svnroot/repos/oolite-linux/tags/1.77/Doc/OoliteRS.pdf Oolite Reference Sheet], which features a table with the average prices. From there you can figure out whether you're on a buyers' or a sellers' market. The [http://wiki.alioth.net/images/9/9e/OoliteTradingChart2.zip Trading Chart] allows you to create your own statistics along your way.  [http://www.box.net/shared/bchkkloi32 This spreadsheet] highlights Poor Agricultural and Rich Industrial planets on a star chart (the spreadsheet is in .xls format and needs the Analysis Toolpak installed).  You can also earn credits by taking cargo contracts - courier goods of varied type and volume between planets near and far.  The spreadsheet helps assess whether you will be be able to complete the contract on time, and so build your reputation as an outstanding courier.  Another option is to fit one or more [http://wiki.alioth.net/index.php/Passenger_Berth Passenger Berths] in your ship and earn credits by transporting individuals who, for one reason or another, prefer not to use the commercial Passenger Liners to reach their destination.  As with cargo contracts, you can build your reputation up, which will result in your being offered more lucrative fares.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=It takes so long to get to the station after each jump. Can I do anything to speed the trip up?|answer=Well, space is huge. It is vast. I mean, have you ever imagined a football-field with an orange in one of the goals and a walnut in the other goal? If you haven't, then don't. It takes you nowhere. As will your ship's engine at normal speed. But then that's what your jumpdrive is for. Hit '''J''', and your journey speeds up. Unfortunately your jumpdrive doesn't work when other masses, like ships or planets, are nearby. They will 'lock' it. And in the 'corridor' between the witchpoint and the planet you are very likely to meet other ships. On the other hand there is no rule that you have to stick to the corridor. Just leave it sideways in any direction with your jumpdrive engaged for about 10-15 seconds, and head for the planet then. Makes your voyage much smoother. If you're a bounty-hunter and eager to meet lots of pirates, however, this is not your method of choice.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I have already made my first intergalactic jump to Galaxy 2, but now I remember that I forgot my Zero-G cricket set/food blender/deadly lobstoid/edible arts graduate on Lave/Tionisla/Xeesle/Reesdice! Or I just found out that there are some more missions I'd like to do in the first galaxy. So how can I jump back to Galaxy 1?|answer=You can't. Unfortunately due to their very physical nature intergalactic wormholes allow for one-way travel only. Fortunately, though, the intergalactic wormhole in Galaxy 8 connects back to Galaxy 1. So you can go full circle. And you have to, if you want to return to the first galaxy. Of course that will cost you another 5000 credits for each galactic hyperjump. So the complete 8-Galaxies-Sightseeing-Tour has a pricetag of a total 40000 credits.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I've got a trumble! First it was cute and fluffy. But then it started to multiply. Even worse, they started to eat everything on board and they are confusing my sights. I don't want them any more! How can I get rid of them? Help!|answer=First of all, don't feel embarrassed. It happens to all commanders sooner or later. I mean, they're really cute and fluffy, aren't they? But seriously, there are several things you could try. E.g. sell them to other unsuspecting noobs. If you don't find enough willing buyers, you could use your escape capsule and abandon your infested ship, hoping that they haven't yet made it into the escape pod, of course. I mean, you can always hope, can't you? If that all doesn't work for you, just remember the old Klingon saying: 'Revenge is a dish that is best served cold.' Now consider that for trumbles it's just the opposite. Want some BBQ-sauce?}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=My keyboard doesn't have a particular key used by Oolite, or I even want to change the keyboard layout completely to my liking. What can I do to change the keys?|answer=Oolite reads a key configuration file called keyconfig.plist that you can find at /AddOns/Config/keyconfig.plist; that is the Config-folder that you find inside your AddOns-folder; which is where you put your OXPs. (PC-users have to create the folder /AddOns/Config/ first and then drop a copy of the keyconfig.plist found in /Oolite.app/Contents/Resources/Config/ to this folder.) You can open this file in any text editor and change the ASCII values of the keys used to suit your own preferences. Information on the default keys is also found in the [http://wiki.alioth.net/index.php/Oolite_Keyboard_Controls Oolite Keybord Controls-documentation] here on the wiki.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I've completed a number of native and OXP missions and my [[Cobra_Mk.3_%28Oolite%29|Cobra Mk. III]] has a number of new and funky pieces of equipment. However, I'm planning a change of ship, what pieces of equipment will I lose as a result?|answer=Many missions award equipment as a result of either accepting or completing them. For the majority of ship equipment, trading ships will result in the equipment being sold as well, with a few exceptions. The '''Cloaking Device''' and the '''Mark Transponder Scanner''', available from the (native) Cloaking Device and (OXP) Assassins missions respectively are transferred to your new ship. The '''Naval Energy Unit''', although awarded with the completion of the (native) Thargoid Plans mission, will be sold when you trade ships. However, completing the mission allows you to buy these units from high TL systems.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I’m using ECM-hardened missiles, but enemies are still able to destroy them! I never seem to be able to destroy enemy hardheads, though. What gives?|answer=ECM-hardened missiles are not ECM-proof. The probability of a hardened missile being destroyed by ECM is 10%–34% depending on range, and if it is destroyed, there’s a 50% chance that it will detonate. This applies equally to hardened missiles fired by computer-controlled ships and those fired by the player. The most effective use of hardened missiles is to use them against relatively slow targets at moderate range, and only use them on nimble ships if you desperately need to force them to break off an attack. Also, don’t use your ECM until a missile is close to blast range (250 metres).&lt;br /&gt;
&lt;br /&gt;
Specifically, the ECM sends out four pulses with different ranges, at half-second intervals. Each pulse has a 10% chance of destroying each hardhead it encounters. For a missile fired at close range, that’s 1 - 0.9&amp;lt;small&amp;gt;&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;&amp;lt;/small&amp;gt; = 34.39% chance of being destroyed within two seconds.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=If I believe that sizes and distances in Oolite are given in meters, it is so ''unrealistic''. The planets have a diameter of only 30–50 kilometers, and the suns are only 1000 kilometers away. Can't we get a little more realism in space, please?|answer=First of all, remember that Oolite is a ''game'', not a ''space simulation''. This is because it ''wants to'' be a game, not a sim. So yes, sizes and distances are all messed up. Ships and stations are too big, planets and suns are too small, and too close to each other. But this is ''deliberately'' so, and we are not going to change it.&lt;br /&gt;
&lt;br /&gt;
The reason is simple: Realistic sizes and distances don't make a good game. In reality space is so huge that you never would meet anybody else on your journey. Imagine the dozen or so ships you meet in the 500 or so kilometers between witchpoint and planet spread over the realistic 150 '''million''' kilometers between Sun and Earth. Even if your direction is only one degree off the perfect line, you would miss them all. And how interesting would that be for the gameplay? And finally, if you had a realistically sized station in front of a realistically sized planet, how would you ever even notice it? A grain of sand in front of a, well, '''planet'''. The result would be players in complete loneliness and virtually no interaction with NPCs. An utterly, utterly boring game. Therefore it was the right decision to screw realism in the layout of the planetary systems in Elite and Oolite.}}&lt;br /&gt;
&lt;br /&gt;
== Expanding the Game ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Speaking of OXPs, I've heard a lot about them. What are they? And where do I find them?|answer=OXP stands for 'Oolite eXpansion Pack'. As the name suggests, an OXP is an expansion to the game. It can contain virtually everything: new graphics for your ship, new ships for the player and/or the NPCs, new stations, new missions, new fun. To install an OXP you simply have to drag it into your AddOns-folder (only the OXP itself, not the folder it probably comes in). And as for finding them, you're already at the right place. All OXPs are now (or will become) accessible through the [[OXP|OXP-page of the wiki]]. Just follow the link. And if you fancy trying to create an OXP, the modifying Oolite FAQ can be found [[Modifying Oolite Informal FAQ|here]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Are there any OXPs that are highly recommended? Or can I get a list of 'must-have' OXPs?|answer=This is a difficult one to answer, because it depends so much on personal taste. There is no list of 'must-have' or necessary OXPs that could be agreed upon by all—or even most—players or contributers. But if you have a look at the [http://aegidian.org/bb/index.php Oolite Bulletin Board], especially the [http://aegidian.org/bb/viewforum.php?f=2 Discussion]- and the [http://aegidian.org/bb/viewforum.php?f=4 Expansion Pack]-forums, you will surely find some topics about this question, and the personal answers of a couple of board members.}}&lt;br /&gt;
&lt;br /&gt;
== Why does this and that not exist? ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Will there ever be an Oolite Massive Multi-player Online Role-Play Game (MMORPG)?|answer=At present Ahruman and Co. (the developers) have no plans to develop either Oolite or a separate branch to accommodate either an MMORPG or an MOG (Multi-player Online Game). This, however, doesn't mean one of you clever bods out there can't try ;-) We suggest you read [http://aegidian.org/bb/viewtopic.php?t=6173 this Bulletin Board thread] before you commence though, it may save you a lot of hair-tearing!}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Can the range of hyperspace jumps/my fuel capacity be increased?|answer=No. Jump range in Oolite is hard-coded for a reason. The game would become less challenging and thus less fun. (Although I can imagine hacks that give unlimited fuel.) And don't forget that there are already various ways of refuelling while you are in flight.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I want Laser Cooling Boosters!|answer=There are none at the moment and the reason is simple. It would unbalance the game too much. If they were available for the player only, things would get too easy. And if the NPCs could get them, too, things would get too hard. It's all about maintaining a reasonable balance. So the ultimate advice on this is: aim carefully; don't waste your laser fire; prevent overheating.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=The other day I got killed when I launched from a Rock Hermit/Behemoth/whatever, and all the profits/kills that I made before were gone. Why couldn't I save there? Why only on main stations?|answer=First of all, congratulations to you for having internalized the ''Golden Rule'': save early, save often! Unfortunately in Oolite you can save and load a commander only on main stations. That's because they are the only 'fixed' objects in space. The rest of the system is populated anew each time you load a game and is not saved in your savefile. So chances are that the Rock Hermit or Behemoth you docked with when saving simply wouldn't exist when you load again, and you would find yourself in nirvana instead of in a safe haven. To prevent odd behavior like this saving and loading is prohibited anywhere other than in a main station. Alternatively you could install [http://wiki.alioth.net/index.php/Save_Anywhere Save Anywhere.oxp], which does exactly what it says on the tin. Note, however, that it is still in beta state so read the documentation first.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I would like to switch between different ships of mine, e.g. have a nice racer for the weekends, meanwhile leave my freighter docked somewhere and take it back on Monday. Why can't I do this?|answer=It is possible for OXPs to provide this facility in 1.77 or later versions. Check the [[OXP_List|OXP List]] or ask on the forum to find one that suits you.}}&lt;br /&gt;
&lt;br /&gt;
== Known Issues / Bugs ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I am running Oolite on Windows Vista/7 and have installed the game in C:\Program Files\Oolite. I cannot find my saved games, log files, game preferences .GNUstepDefaults file and/or any saved screenshots, although I can see the saved games in the game and use them normally. Where are my files?|answer=You are experiencing file virtualization under Windows. Any application installed in %programfiles%, %systemroot%, %systemdrive% or %programdata that writes files under its folder structure is subject to this. As per Microsoft Support's article KB927387, the resolution for finding your files again is using one of the following methods:&lt;br /&gt;
•Click the Compatibility Files button that appears on the Explorer bar to view virtualized files in the folder. The Compatibility Files button appears only if there are virtualized files in the folder.&lt;br /&gt;
&lt;br /&gt;
•Look in the C:\Users\User_name\AppData\Local\VirtualStore folder to locate files and folders. &lt;br /&gt;
&lt;br /&gt;
•Save your application's data in a folder under your user profile.}}&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Does it work on Mac OS X 10.2 (Jaguar) &amp;amp; 10.3 (Panther)?|answer=Sadly, no. The minimum OS requirement for Oolite on the Mac is now Mac OS X 10.4. The previous stable version (1.65) is however compatible with Mac OS X 10.3.9}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Does it work on both Intel and PPC Macs?|answer=Yes, since 1.65 Oolite has been Universal Binary. It was PPC only in previous versions.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=What's the latest version?|answer=The last stable release is 1.76.1, and the latest test release (recommended) is 1.77. The last stable and latest test versions can be downloaded from [http://oolite.org/download.shtml Oolite's homepage]. More information can be found through the [http://aegidian.org/bb/viewforum.php?f=10 Oolite forums].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Is there a port for the PC or Linux?|answer=Yes. Both ports are stable and are at the same level of development as Oolite for the Mac. You can download Oolite for Windows and for Linux PCs from [http://oolite.org/download.shtml Oolite's homepage] (click on &amp;quot;show all platforms&amp;quot; if you can't see the version you're looking for). Information on test releases can be found through the Oolite forums, for the [http://aegidian.org/bb/viewforum.php?f=9 Linux version], and for the [http://aegidian.org/bb/viewforum.php?f=8 Windows version].}}&lt;br /&gt;
&lt;br /&gt;
== Writing OXPs ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I would like to contribute to Oolite and write my own OXP, but unfortunately my knowledge in scripting/programming is limited. How can I get started?|answer=First of all the Oolite community welcomes all efforts to enhance and enrich their favorite game, so be our guest! Many of us have started with very little knowledge, but over time were able to write and release astonishing OXPs, so why shouldn't you? Anyway, scripting can be learned. Currently there are two scripting languages in use for Oolite, plist-scripting (sometimes referred to as legacy-scripting) and JavaScript. For any serious OXP-plans you will have to learn them. A general starting point is the [http://wiki.alioth.net/index.php/OXP_howto OXP howto]-page, which will link you to further documentation. For plist-scripting you should read the [http://wiki.alioth.net/index.php/OXP_howto_plist OXP howto plist]-page, and also the [http://wiki.alioth.net/index.php/Property_list Property list]-intro. Information on the ongoing implementation of scripting with JavaScript can be found in the [http://wiki.alioth.net/index.php/Category:Oolite_scripting Category page for scripting] (work in progress). If you want to design a new ship, you should have a look at the [http://wiki.alioth.net/index.php/OXP_howto_model OXP howto model]-page and the [http://wiki.alioth.net/index.php/OXP_howto_texture OXP howto texture]-page. And if you want to give it a behavior of its own, you should consult the [http://wiki.alioth.net/index.php/OXP_howto_AI OXP howto AI]-page. I suggest you try to read and understand these first. If you still have questions afterwards, there is always the [http://aegidian.org/bb/index.php Oolite Bulletin Board], where lots of friendly people usually are very willing to lend a helping hand and to answer lots of questions.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I want to write an OXP or add content to the Wiki, but some (or all) of the content was written by another author. What copyright issues do I face?|answer=Anything submitted to the Wiki is on the basis that anyone else may edit or fiddle with it. OXPs are submitted under the creative commons licence. The author (strictly speaking) owns the copyright, but licenses users to use or distribute the OXP as long as they don't sell or charge for it. In practice virtually all OXP authors don't assert copyright and are pleased and flattered that somebody thinks their stuff is worth writing about or pinching to use in another OXP (it is good manners to credit the original author in the readme though). I expect the author will be pleased if you want to add some background, but if you are in doubt, send him or her a PM asking him for permission. At the end of the day, Oolite is a fun project and everybody is doing stuff for it on that basis. (nicked wholesale from [http://aegidian.org/bb/viewtopic.php?p=44813#44813 Little_Bear's] post on the [http://aegidian.org/bb/index.php Oolite Bulletin Board])}}&lt;br /&gt;
&lt;br /&gt;
== Diagnosing Problems ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Someone asked me for my log file. What is that, and where is it?|answer=While Oolite runs, various diagnostic information is written to a file called Latest.log. Where it is depends on your operating system:&lt;br /&gt;
* '''Mac OS X''': Restart Oolite, and select “Show Previous Log” from the “'''Oolite'''” menu in the menu bar. Alternatively, in the Finder, select “Go to Folder…” from the Go menu, and enter “~/Library/Logs/Oolite/”, and find Latest.log.&lt;br /&gt;
* '''Windows''': in Oolite’s folder (typically in C:\''Oolite''), there is a folder called ''oolite.app'', which contains a folder called ''Logs''. A shortcut to this folder is created at Oolite's Start Menu entries during installation. If you have installed the game in a folder subject to file virtualization like C:\Program Files\Oolite and encounter difficulty in locating the log files, then please refer to the Known Issues section of this FAQ for information on how to access them.&lt;br /&gt;
* '''Linux and other Unix-like systems''': ~/.Oolite/Logs (that is, in the hidden folder ''.Oolite'' in your home folder). If you’re using Nautilus or Konqueror—if you’ve never heard of them, you probably are—select Show Hidden Files from the View menu.}}&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Why do none of the OXPs I have installed appear to work in the game?|answer=Check you do not have Oolite in 'Strict Play' mode.  When docked or paused press F2 and if it says 'Reset to Unrestricted Play' then OXPs will not work.  It needs to say 'Reset to Strict Play'. Alternately perhaps you downloaded and extracted an OXP straight to the &amp;quot;add ons&amp;quot; file. Without then checking that the file ending &amp;quot;.oxp&amp;quot; is moved up from any subdirectory folders to the &amp;quot;add ons&amp;quot; folder itself, as Oolite simply ignores folders etc not ending in .OXP in &amp;quot;add ons&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
== Other Questions ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I have a question not answered here, where can I get help?|answer=Post your queries onto [http://aegidian.org/bb/index.php the friendliest board this side of Riedquat™]. Satisfaction is not guaranteed, but then what is, in this mixed-up universe? Help keep the board friendly by making sure your question isn't already answered here!&lt;br /&gt;
&lt;br /&gt;
If you want to report a bug, please read [http://aegidian.org/bb/viewtopic.php?t=3778 this]. Yes, all that work is a drag, but if nobody reports the bug it probably won’t get fixed.&lt;br /&gt;
&lt;br /&gt;
Or join us in #oolite, or #oolite-dev if you're working on Oolite or OXPs, on irc.oftc.net or ipv6.oftc.net.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=36795</id>
		<title>Debug OXP</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=36795"/>
		<updated>2013-05-12T12:33:49Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Undo revision 36794 by Ahruman (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Debug.oxp''' is a special OXP that enables JavaScript console support in Oolite (1.70 and later). It also adds a menu with various debug facilities under Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
[http://jens.ayton.se/oolite/files/debug-oxp-1.76.zip Debug OXP for Oolite 1.76]&lt;br /&gt;
&lt;br /&gt;
== External JavaScript console support ==&lt;br /&gt;
On all platforms, installing Debug.oxp enables support for external console applications using the [[Oolite debug console TCP protocol]]. By default, it will attempt to connect to a console running on the same computer, but this can be changed by specifying a different &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; (and, optionally, &amp;lt;code&amp;gt;console-port&amp;lt;/code&amp;gt;) in ''debugConfig.plist''. For external console support on the same computer under Mac OS X, &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; must be explicitly set to “127.0.0.1”; if this is not done, the [[#Integrated JavaScript console|integrated JavaScript console]] will be used instead. For information on using a console (integrated or external), see [[#Using the JavaScript console|Using the JavaScript console]] below.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' A cross-platform, python based, external console application is available in the [http://developer.berlios.de/project/showfiles.php?group_id=3577 Berlios Oolite files] area.&lt;br /&gt;
&lt;br /&gt;
It contains a precompiled console for windows based computers, and the original python based console for Linux and Posix compliant computers.&lt;br /&gt;
&lt;br /&gt;
On Debian or Ubuntu Linux you will need python 2.6.x installed and (at least) the packages &amp;lt;code&amp;gt;blt python-tk tk8.5&amp;lt;/code&amp;gt; (or the equivalents in other distros.)&lt;br /&gt;
&lt;br /&gt;
== Mac OS X-specific features ==&lt;br /&gt;
Under Mac OS X, the Debug OXP provides a menu with various debugging options and an integrated JavaScript console, as well as enabling external console support as on all platforms.&lt;br /&gt;
&lt;br /&gt;
=== Debug menu (Mac OS X only) ===&lt;br /&gt;
[[Image:Oolite-debug-menu.png|494px]]&lt;br /&gt;
&lt;br /&gt;
The Debug menu provides options to&lt;br /&gt;
* Show the Oolite run log in the standard Console application.&lt;br /&gt;
* Enable or disable various classes of log message at runtime (like editing ''logcontrol.plist'', without the need to restart Oolite).&lt;br /&gt;
* Enable various testing features, such as drawing of bounding boxes.&lt;br /&gt;
* Show the JavaScript console, and specify when it should be shown automatically. (This may not have any effect with external consoles, depending on the external console implementation.)&lt;br /&gt;
* Create a ship of any role near the main station (equivalent to the &amp;lt;code&amp;gt;:spawn&amp;lt;/code&amp;gt; [[#Macros|macro]]).&lt;br /&gt;
Note: some of these features are implemented by sending JavaScript messages to the [[#The console script|console script]]. If the script has been modified, some features may not work properly.&lt;br /&gt;
&lt;br /&gt;
The Log Message Classes submenu can be modified by editing ''debugLogMessageClassesMenu.plist'', found inside the OXP. This is merged from Config directories in the usual fashion.&lt;br /&gt;
&lt;br /&gt;
=== Integrated JavaScript console (Mac OS X only) ===&lt;br /&gt;
[[Image:Oolite debug protocol example 1.png|594px]]&lt;br /&gt;
&lt;br /&gt;
The integrated JavaScript console provides a window within Oolite which acts as a [[#Using the JavaScript console|JavaScript console]]. It can be shown using the Show JavaScript Console command in the Debug menu, unless external console mode has been enabled by setting &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; in ''debugConfig.plist''.&lt;br /&gt;
&lt;br /&gt;
The integrated console has a 100-line memory. To see previous commands, press ⇞ (Page Up) or ⌥↑ (Option-Up Arrow). You can go the other way in the obvious manner.&lt;br /&gt;
&lt;br /&gt;
== Using the JavaScript console ==&lt;br /&gt;
The JavaScript console, whether integrated or external, provides a powerful mechanism for interactively manipulating the game world. It can be used to issue simple commands, like &amp;lt;code&amp;gt;player.ship.awardEquipment(&amp;quot;EQ_FUEL_INJECTION&amp;quot;)&amp;lt;/code&amp;gt;. It can be used to inspect properties of entities in the game world. And it can be used to develop scripts, by rewriting and testing methods of live ship scripts and world scripts.&lt;br /&gt;
&lt;br /&gt;
=== Macros ===&lt;br /&gt;
Macros are a special type of command prefixed with a colon. Instead of being interpreted as a JavaScript command, a macro is looked up in a dictionary, and the result is used as the “real” command. For instance, if you enter the command &amp;lt;code&amp;gt;:listM&amp;lt;/code&amp;gt; (short for “list macros”), the macro dictionary is queried for the string “listM”, and (by default) the code &amp;lt;code&amp;gt;for (let prop in macros) { ConsoleMessage('macro-list', ':' + prop) }&amp;lt;/code&amp;gt; is found and executed. This code is called the ''expansion'' of the macro. The result is a list of macros being printed:&lt;br /&gt;
 :clr&lt;br /&gt;
 :clear&lt;br /&gt;
 :spawn&lt;br /&gt;
 :bgColor&lt;br /&gt;
 :showM&lt;br /&gt;
 :rmFgColor&lt;br /&gt;
 ::&lt;br /&gt;
 :d&lt;br /&gt;
 :ds&lt;br /&gt;
 :listM&lt;br /&gt;
 :setM&lt;br /&gt;
 :delM&lt;br /&gt;
 :fgColor&lt;br /&gt;
 :rmBgColor&lt;br /&gt;
 :resetM&lt;br /&gt;
&lt;br /&gt;
As you can see in the example, To see the expansion of a macro without executing it, use &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt;:&lt;br /&gt;
 &amp;gt; :showM :delM&lt;br /&gt;
 :delM = deleteMacro(PARAM)&lt;br /&gt;
&lt;br /&gt;
When a macro with the word &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is executed, &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is replaced with any text following the macro name, surrounded in quotation marks. This is how &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt; functions, for example; the string “:showM :delM” is expanded to “showMacro(&amp;quot;:delM&amp;quot;)”, causing the JavaScript function &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt;, which is part of the [[#The console script|console script]], to be called. You can see the implementation of &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt; by entering &amp;lt;code&amp;gt;showMacro&amp;lt;/code&amp;gt; – without any parentheses – into the console.&lt;br /&gt;
&lt;br /&gt;
An initial set of macros is loaded from ''debugConfig.plist''. If you edit any macros, using &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;:delM&amp;lt;/code&amp;gt;, all macros are saved in Oolite’s preferences from that point forwards. This means that you don’t have to re-enter any macros you write with &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; after restarting Oolite.&lt;br /&gt;
&lt;br /&gt;
The following example creates a simple :msg macro:&lt;br /&gt;
 &amp;gt; :setM msg ConsoleMessage(' ',PARAM)&lt;br /&gt;
If you then type:&lt;br /&gt;
 &amp;gt; :msg Hello World&lt;br /&gt;
The macro will be expanded, and you'll see “Hello World” on the console. However, macros are not functions, so you cannot use macros in the middle of javascript, or as part of another macro.&lt;br /&gt;
&lt;br /&gt;
=== Console Properties ===&lt;br /&gt;
&lt;br /&gt;
The console has several properties. They are accessible with &amp;quot;console.Foo&amp;quot;:&lt;br /&gt;
 debugFlags (r/w)&lt;br /&gt;
 shaderMode (r/w)&lt;br /&gt;
 maximumShaderMode (read only)&lt;br /&gt;
 reducedDetailMode (r/w)&lt;br /&gt;
 displayFPS (r/w)&lt;br /&gt;
 platformDescription (read only)&lt;br /&gt;
 pedanticMode (r/w)&lt;br /&gt;
 ignoreDroppedPackets (r/w)&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;debugFlags&amp;lt;/code&amp;gt; you can selective set/disable debugging options. Every debugging option is activated by setting a corresponding bit in the &amp;lt;code&amp;gt;debugFlags&amp;lt;/code&amp;gt;:&lt;br /&gt;
 Linked Lists                = 0x00000001&lt;br /&gt;
 Collisions                  = 0x00000004&lt;br /&gt;
 Docking                     = 0x00000008&lt;br /&gt;
 Octrees - Verbose Logging   = 0x00000010&lt;br /&gt;
 Bounding Boxes              = 0x00000040&lt;br /&gt;
 Octrees - Draw              = 0x00000080&lt;br /&gt;
 Normals                     = 0x00000100&lt;br /&gt;
 Hide Dust		    = 0x00000200&lt;br /&gt;
 disable Shader Fallback	    = 0x00000400&lt;br /&gt;
 Extra Shader Validation	    = 0x00000800&lt;br /&gt;
 Miscellaneous	            = 0x10000000&lt;br /&gt;
&lt;br /&gt;
=== The console script ===&lt;br /&gt;
While an external or integrated console is required to provide a means of user interaction, most of the actual behaviour of the console is implemented in JavaScript, in a script called ''oolite-debug-console.js''. Input typed into the console is passed to the console script, which then generates output. The console script is also informed of log messages and JavaScript errors, and provides a global function, &amp;lt;code&amp;gt;ConsoleMessage(colorCode: String, message: String)&amp;lt;/code&amp;gt;, to write messages to the console using its background colour support. Lastly, the console script implements the entire macro system.&lt;br /&gt;
&lt;br /&gt;
This means that the console’s behaviour can be extensively customized, for instance, by replacing the macro system with something more powerful. There are two basic approaches to doing this:&lt;br /&gt;
* Creating a custom script (or a copy) with the same name, in an OXP which loads later than Debug.oxp (e.g., one which has a name which comes later in alphabetical order).&lt;br /&gt;
* Using a normal world script, and changing the console script object at startup.&lt;br /&gt;
The latter approach has the advantage that it can continue to work with future versions of the console script, and multiple patches can coexist. For example, a modification to supplement the macro system with a better one might look as follows:&lt;br /&gt;
 this.name = &amp;quot;my-super-console-macros&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 this.startUp = function()&lt;br /&gt;
 {&lt;br /&gt;
     // Ensure debug console is installed&lt;br /&gt;
     if (!debugConsole)  return&lt;br /&gt;
     &lt;br /&gt;
     // Save original implementation of consolePerformJSCommand&lt;br /&gt;
     // Note the prefix, used to ensure uniqueness. If several scripts patch&lt;br /&gt;
     // the same method, it's important that they use different names.&lt;br /&gt;
     debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand = debugConsole.consolePerformJSCommand&lt;br /&gt;
     &lt;br /&gt;
     // Replace debugConsole.consolePerformJSCommand with custom function&lt;br /&gt;
     debugConsole.consolePerformJSCommand = function(command)&lt;br /&gt;
     {&lt;br /&gt;
         // Note that in this function &amp;quot;this&amp;quot; will refer to debugconsole, not&lt;br /&gt;
         // my-super-console-macros, since the function will be called as a&lt;br /&gt;
         // method of debugConsole.&lt;br /&gt;
         &lt;br /&gt;
         // Strip leading spaces, same code as original function.&lt;br /&gt;
         while (command.charAt(0) == &amp;quot; &amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             command = command.substring(1)&lt;br /&gt;
         }&lt;br /&gt;
         &lt;br /&gt;
         if (command.charAt(0) == &amp;quot;!&amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             // Super macro call detected.&lt;br /&gt;
             // Insert super macro system here.&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
             // Otherwise, call through to original method.&lt;br /&gt;
             debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand(command)&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
This same patching technique, incidentally, can be used to modify scripts at runtime, either from the console or from other scripts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{misc-OXP}}&lt;br /&gt;
[[Category:Oolite utilities]]&lt;br /&gt;
[[Category:Oolite scripting]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=36794</id>
		<title>Debug OXP</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=36794"/>
		<updated>2013-05-12T12:33:21Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* External JavaScript console support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Debug.oxp''' is a special OXP that enables JavaScript console support in Oolite (1.70 and later). It also adds a menu with various debug facilities under Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
[http://jens.ayton.se/oolite/files/debug-oxp-1.76.zip Debug OXP for Oolite 1.76]&lt;br /&gt;
&lt;br /&gt;
== External JavaScript console support ==&lt;br /&gt;
On all platforms, installing Debug.oxp enables support for external console applications using the [[Oolite debug console TCP protocol]]. By default, it will attempt to connect to a console running on the same computer, but this can be changed by specifying a different &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; (and, optionally, &amp;lt;code&amp;gt;console-port&amp;lt;/code&amp;gt;) in ''debugConfig.plist''. For external console support on the same computer under Mac OS X, &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; must be explicitly set to “127.0.0.1”; if this is not done, the [[#Integrated JavaScript console|integrated JavaScript console]] will be used instead. For information on using a console (integrated or external), see [[#Using the JavaScript console|Using the JavaScript console]] below.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' A cross-platform, python based, external console application is available from [https://github.com/OoliteProject/oolite-debug-console the Oolite project on GitHub] (click the ZIP button to download the latest version).&lt;br /&gt;
&lt;br /&gt;
It contains a precompiled console for windows based computers, and the original python based console for Linux and Posix compliant computers.&lt;br /&gt;
&lt;br /&gt;
On Debian or Ubuntu Linux you will need python 2.6.x installed and (at least) the packages &amp;lt;code&amp;gt;blt python-tk tk8.5&amp;lt;/code&amp;gt; (or the equivalents in other distros.)&lt;br /&gt;
&lt;br /&gt;
== Mac OS X-specific features ==&lt;br /&gt;
Under Mac OS X, the Debug OXP provides a menu with various debugging options and an integrated JavaScript console, as well as enabling external console support as on all platforms.&lt;br /&gt;
&lt;br /&gt;
=== Debug menu (Mac OS X only) ===&lt;br /&gt;
[[Image:Oolite-debug-menu.png|494px]]&lt;br /&gt;
&lt;br /&gt;
The Debug menu provides options to&lt;br /&gt;
* Show the Oolite run log in the standard Console application.&lt;br /&gt;
* Enable or disable various classes of log message at runtime (like editing ''logcontrol.plist'', without the need to restart Oolite).&lt;br /&gt;
* Enable various testing features, such as drawing of bounding boxes.&lt;br /&gt;
* Show the JavaScript console, and specify when it should be shown automatically. (This may not have any effect with external consoles, depending on the external console implementation.)&lt;br /&gt;
* Create a ship of any role near the main station (equivalent to the &amp;lt;code&amp;gt;:spawn&amp;lt;/code&amp;gt; [[#Macros|macro]]).&lt;br /&gt;
Note: some of these features are implemented by sending JavaScript messages to the [[#The console script|console script]]. If the script has been modified, some features may not work properly.&lt;br /&gt;
&lt;br /&gt;
The Log Message Classes submenu can be modified by editing ''debugLogMessageClassesMenu.plist'', found inside the OXP. This is merged from Config directories in the usual fashion.&lt;br /&gt;
&lt;br /&gt;
=== Integrated JavaScript console (Mac OS X only) ===&lt;br /&gt;
[[Image:Oolite debug protocol example 1.png|594px]]&lt;br /&gt;
&lt;br /&gt;
The integrated JavaScript console provides a window within Oolite which acts as a [[#Using the JavaScript console|JavaScript console]]. It can be shown using the Show JavaScript Console command in the Debug menu, unless external console mode has been enabled by setting &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; in ''debugConfig.plist''.&lt;br /&gt;
&lt;br /&gt;
The integrated console has a 100-line memory. To see previous commands, press ⇞ (Page Up) or ⌥↑ (Option-Up Arrow). You can go the other way in the obvious manner.&lt;br /&gt;
&lt;br /&gt;
== Using the JavaScript console ==&lt;br /&gt;
The JavaScript console, whether integrated or external, provides a powerful mechanism for interactively manipulating the game world. It can be used to issue simple commands, like &amp;lt;code&amp;gt;player.ship.awardEquipment(&amp;quot;EQ_FUEL_INJECTION&amp;quot;)&amp;lt;/code&amp;gt;. It can be used to inspect properties of entities in the game world. And it can be used to develop scripts, by rewriting and testing methods of live ship scripts and world scripts.&lt;br /&gt;
&lt;br /&gt;
=== Macros ===&lt;br /&gt;
Macros are a special type of command prefixed with a colon. Instead of being interpreted as a JavaScript command, a macro is looked up in a dictionary, and the result is used as the “real” command. For instance, if you enter the command &amp;lt;code&amp;gt;:listM&amp;lt;/code&amp;gt; (short for “list macros”), the macro dictionary is queried for the string “listM”, and (by default) the code &amp;lt;code&amp;gt;for (let prop in macros) { ConsoleMessage('macro-list', ':' + prop) }&amp;lt;/code&amp;gt; is found and executed. This code is called the ''expansion'' of the macro. The result is a list of macros being printed:&lt;br /&gt;
 :clr&lt;br /&gt;
 :clear&lt;br /&gt;
 :spawn&lt;br /&gt;
 :bgColor&lt;br /&gt;
 :showM&lt;br /&gt;
 :rmFgColor&lt;br /&gt;
 ::&lt;br /&gt;
 :d&lt;br /&gt;
 :ds&lt;br /&gt;
 :listM&lt;br /&gt;
 :setM&lt;br /&gt;
 :delM&lt;br /&gt;
 :fgColor&lt;br /&gt;
 :rmBgColor&lt;br /&gt;
 :resetM&lt;br /&gt;
&lt;br /&gt;
As you can see in the example, To see the expansion of a macro without executing it, use &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt;:&lt;br /&gt;
 &amp;gt; :showM :delM&lt;br /&gt;
 :delM = deleteMacro(PARAM)&lt;br /&gt;
&lt;br /&gt;
When a macro with the word &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is executed, &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is replaced with any text following the macro name, surrounded in quotation marks. This is how &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt; functions, for example; the string “:showM :delM” is expanded to “showMacro(&amp;quot;:delM&amp;quot;)”, causing the JavaScript function &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt;, which is part of the [[#The console script|console script]], to be called. You can see the implementation of &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt; by entering &amp;lt;code&amp;gt;showMacro&amp;lt;/code&amp;gt; – without any parentheses – into the console.&lt;br /&gt;
&lt;br /&gt;
An initial set of macros is loaded from ''debugConfig.plist''. If you edit any macros, using &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;:delM&amp;lt;/code&amp;gt;, all macros are saved in Oolite’s preferences from that point forwards. This means that you don’t have to re-enter any macros you write with &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; after restarting Oolite.&lt;br /&gt;
&lt;br /&gt;
The following example creates a simple :msg macro:&lt;br /&gt;
 &amp;gt; :setM msg ConsoleMessage(' ',PARAM)&lt;br /&gt;
If you then type:&lt;br /&gt;
 &amp;gt; :msg Hello World&lt;br /&gt;
The macro will be expanded, and you'll see “Hello World” on the console. However, macros are not functions, so you cannot use macros in the middle of javascript, or as part of another macro.&lt;br /&gt;
&lt;br /&gt;
=== Console Properties ===&lt;br /&gt;
&lt;br /&gt;
The console has several properties. They are accessible with &amp;quot;console.Foo&amp;quot;:&lt;br /&gt;
 debugFlags (r/w)&lt;br /&gt;
 shaderMode (r/w)&lt;br /&gt;
 maximumShaderMode (read only)&lt;br /&gt;
 reducedDetailMode (r/w)&lt;br /&gt;
 displayFPS (r/w)&lt;br /&gt;
 platformDescription (read only)&lt;br /&gt;
 pedanticMode (r/w)&lt;br /&gt;
 ignoreDroppedPackets (r/w)&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;code&amp;gt;debugFlags&amp;lt;/code&amp;gt; you can selective set/disable debugging options. Every debugging option is activated by setting a corresponding bit in the &amp;lt;code&amp;gt;debugFlags&amp;lt;/code&amp;gt;:&lt;br /&gt;
 Linked Lists                = 0x00000001&lt;br /&gt;
 Collisions                  = 0x00000004&lt;br /&gt;
 Docking                     = 0x00000008&lt;br /&gt;
 Octrees - Verbose Logging   = 0x00000010&lt;br /&gt;
 Bounding Boxes              = 0x00000040&lt;br /&gt;
 Octrees - Draw              = 0x00000080&lt;br /&gt;
 Normals                     = 0x00000100&lt;br /&gt;
 Hide Dust		    = 0x00000200&lt;br /&gt;
 disable Shader Fallback	    = 0x00000400&lt;br /&gt;
 Extra Shader Validation	    = 0x00000800&lt;br /&gt;
 Miscellaneous	            = 0x10000000&lt;br /&gt;
&lt;br /&gt;
=== The console script ===&lt;br /&gt;
While an external or integrated console is required to provide a means of user interaction, most of the actual behaviour of the console is implemented in JavaScript, in a script called ''oolite-debug-console.js''. Input typed into the console is passed to the console script, which then generates output. The console script is also informed of log messages and JavaScript errors, and provides a global function, &amp;lt;code&amp;gt;ConsoleMessage(colorCode: String, message: String)&amp;lt;/code&amp;gt;, to write messages to the console using its background colour support. Lastly, the console script implements the entire macro system.&lt;br /&gt;
&lt;br /&gt;
This means that the console’s behaviour can be extensively customized, for instance, by replacing the macro system with something more powerful. There are two basic approaches to doing this:&lt;br /&gt;
* Creating a custom script (or a copy) with the same name, in an OXP which loads later than Debug.oxp (e.g., one which has a name which comes later in alphabetical order).&lt;br /&gt;
* Using a normal world script, and changing the console script object at startup.&lt;br /&gt;
The latter approach has the advantage that it can continue to work with future versions of the console script, and multiple patches can coexist. For example, a modification to supplement the macro system with a better one might look as follows:&lt;br /&gt;
 this.name = &amp;quot;my-super-console-macros&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 this.startUp = function()&lt;br /&gt;
 {&lt;br /&gt;
     // Ensure debug console is installed&lt;br /&gt;
     if (!debugConsole)  return&lt;br /&gt;
     &lt;br /&gt;
     // Save original implementation of consolePerformJSCommand&lt;br /&gt;
     // Note the prefix, used to ensure uniqueness. If several scripts patch&lt;br /&gt;
     // the same method, it's important that they use different names.&lt;br /&gt;
     debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand = debugConsole.consolePerformJSCommand&lt;br /&gt;
     &lt;br /&gt;
     // Replace debugConsole.consolePerformJSCommand with custom function&lt;br /&gt;
     debugConsole.consolePerformJSCommand = function(command)&lt;br /&gt;
     {&lt;br /&gt;
         // Note that in this function &amp;quot;this&amp;quot; will refer to debugconsole, not&lt;br /&gt;
         // my-super-console-macros, since the function will be called as a&lt;br /&gt;
         // method of debugConsole.&lt;br /&gt;
         &lt;br /&gt;
         // Strip leading spaces, same code as original function.&lt;br /&gt;
         while (command.charAt(0) == &amp;quot; &amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             command = command.substring(1)&lt;br /&gt;
         }&lt;br /&gt;
         &lt;br /&gt;
         if (command.charAt(0) == &amp;quot;!&amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             // Super macro call detected.&lt;br /&gt;
             // Insert super macro system here.&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
             // Otherwise, call through to original method.&lt;br /&gt;
             debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand(command)&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
This same patching technique, incidentally, can be used to modify scripts at runtime, either from the console or from other scripts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{misc-OXP}}&lt;br /&gt;
[[Category:Oolite utilities]]&lt;br /&gt;
[[Category:Oolite scripting]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_FAQ&amp;diff=36730</id>
		<title>Oolite FAQ</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_FAQ&amp;diff=36730"/>
		<updated>2013-05-04T20:24:12Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Diagnosing Problems */ Log files aren’t just in test releases any more.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Where do I get the program? And what about the different versions that exist?|answer= The latest recommended release is 1.77-test, and the latest 'official' stable release is version 1.76.1, both available on the [http://oolite.org/download.shtml oolite.org download page] for OS X, Windows, and Linux(x86). The last stable release made by the original programmer, Giles Williams (a.k.a. Aegidian) was 1.65 and is best available from his website [http://oolite.aegidian.org/ oolite.aegidian.org]. The latest test releases/development versions can be [http://developer.berlios.de/project/showfiles.php?group_id=3577 downloaded from BerliOS] with installers also available for OS X, Windows and Linux. More detailed information can be found on the [http://aegidian.org/bb/index.php Oolite Bulletin Board], in the respective sections for [http://aegidian.org/bb/viewforum.php?f=10 Oolite-Mac], [http://aegidian.org/bb/viewforum.php?f=9 Oolite-Linux] and [http://aegidian.org/bb/viewforum.php?f=8 Oolite-PC].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=What's the point of the game?|answer=To fly from planet to planet, buying and selling goods, shooting pirates or committing acts of piracy. There's no goal other than perhaps to achieve the rank of ELITE.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I'm still confused, how do I play?|answer=It's a good idea to start with the [http://svn.berlios.de/svnroot/repos/oolite-linux/tags/1.77/Doc/OoliteReadMe.pdf Oolite ReadMe] file for some basic information. For further information you may wish to consult the [http://wiki.alioth.net/index.php/Oolite_Instruction_Manual Oolite Instruction Manual] here on the wiki. A load of helpful information can be obtained from [http://wiki.alioth.net/index.php/Mr_Gimlet Mr Gimlet], the quite talkative dockmaster on Lave Station. If you're a fresh graduate from the Flight Academy on the way to your first ship, you should see him. It's also a good idea to have a look at Ian Bell's [http://www.iancgbell.clara.net/elite/manual.htm Flight Training Manual] for the original BBC Elite, although some of Oolite's control keys are different from the original, so be careful.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=How do I configure my joystick or gamepad for Oolite in Linux?|answer=See [[Linux Joysticks and Gamepads]].}}&lt;br /&gt;
&lt;br /&gt;
== Gameplay ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=What do the various colors represent on the radar?|answer=White - unpowered items that can't mass-lock the in-system drive (jumpdrive). Green/Yellow - navigation buoys. Yellow - powered craft. Red - powered craft identified as hostile. Green - space stations. Green/Red - thargoids. Purple - police. Blue/Red - police on intercept. Red/Yellow - active mine (about to detonate). Blue/Cyan - witchspace wormhole.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I keep crashing when trying to dock. How do I dock manually?|answer=Many young Jamesons have met a sticky end and had to be scraped from the docking port of Lave Station whilst attempting docking. It's fairly easy once you get the hang of it. Check the [[How_to_Dock|How to Dock]] guide from the Galactic Navy Flight Manual. Or you can get the [[Traffic_Control_OXP|Traffic Control OXP]] for friendly instructions given by the station crew as you try to dock.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=How do I make decent profits?|answer=Trade between a Poor or Average Agricultural and a Rich or Average Industrial planet. Write down the prices for everything on both planets and find out where you make the most profit per ton. You can also download the [http://svn.berlios.de/svnroot/repos/oolite-linux/tags/1.77/Doc/OoliteRS.pdf Oolite Reference Sheet], which features a table with the average prices. From there you can figure out whether you're on a buyers' or a sellers' market. The [http://wiki.alioth.net/images/9/9e/OoliteTradingChart2.zip Trading Chart] allows you to create your own statistics along your way.  [http://www.box.net/shared/bchkkloi32 This spreadsheet] highlights Poor Agricultural and Rich Industrial planets on a star chart (the spreadsheet is in .xls format and needs the Analysis Toolpak installed).  You can also earn credits by taking cargo contracts - courier goods of varied type and volume between planets near and far.  The spreadsheet helps assess whether you will be be able to complete the contract on time, and so build your reputation as an outstanding courier.  Another option is to fit one or more [http://wiki.alioth.net/index.php/Passenger_Berth Passenger Berths] in your ship and earn credits by transporting individuals who, for one reason or another, prefer not to use the commercial Passenger Liners to reach their destination.  As with cargo contracts, you can build your reputation up, which will result in your being offered more lucrative fares.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=It takes so long to get to the station after each jump. Can I do anything to speed the trip up?|answer=Well, space is huge. It is vast. I mean, have you ever imagined a football-field with an orange in one of the goals and a walnut in the other goal? If you haven't, then don't. It takes you nowhere. As will your ship's engine at normal speed. But then that's what your jumpdrive is for. Hit '''J''', and your journey speeds up. Unfortunately your jumpdrive doesn't work when other masses, like ships or planets, are nearby. They will 'lock' it. And in the 'corridor' between the witchpoint and the planet you are very likely to meet other ships. On the other hand there is no rule that you have to stick to the corridor. Just leave it sideways in any direction with your jumpdrive engaged for about 10-15 seconds, and head for the planet then. Makes your voyage much smoother. If you're a bounty-hunter and eager to meet lots of pirates, however, this is not your method of choice.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I have already made my first intergalactic jump to Galaxy 2, but now I remember that I forgot my Zero-G cricket set/food blender/deadly lobstoid/edible arts graduate on Lave/Tionisla/Xeesle/Reesdice! Or I just found out that there are some more missions I'd like to do in the first galaxy. So how can I jump back to Galaxy 1?|answer=You can't. Unfortunately due to their very physical nature intergalactic wormholes allow for one-way travel only. Fortunately, though, the intergalactic wormhole in Galaxy 8 connects back to Galaxy 1. So you can go full circle. And you have to, if you want to return to the first galaxy. Of course that will cost you another 5000 credits for each galactic hyperjump. So the complete 8-Galaxies-Sightseeing-Tour has a pricetag of a total 40000 credits.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I've got a trumble! First it was cute and fluffy. But then it started to multiply. Even worse, they started to eat everything on board and they are confusing my sights. I don't want them any more! How can I get rid of them? Help!|answer=First of all, don't feel embarrassed. It happens to all commanders sooner or later. I mean, they're really cute and fluffy, aren't they? But seriously, there are several things you could try. E.g. sell them to other unsuspecting noobs. If you don't find enough willing buyers, you could use your escape capsule and abandon your infested ship, hoping that they haven't yet made it into the escape pod, of course. I mean, you can always hope, can't you? If that all doesn't work for you, just remember the old Klingon saying: 'Revenge is a dish that is best served cold.' Now consider that for trumbles it's just the opposite. Want some BBQ-sauce?}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=My keyboard doesn't have a particular key used by Oolite, or I even want to change the keyboard layout completely to my liking. What can I do to change the keys?|answer=Oolite reads a key configuration file called keyconfig.plist that you can find at /AddOns/Config/keyconfig.plist; that is the Config-folder that you find inside your AddOns-folder; which is where you put your OXPs. (PC-users have to create the folder /AddOns/Config/ first and then drop a copy of the keyconfig.plist found in /Oolite.app/Contents/Resources/Config/ to this folder.) You can open this file in any text editor and change the ASCII values of the keys used to suit your own preferences. Information on the default keys is also found in the [http://wiki.alioth.net/index.php/Oolite_Keyboard_Controls Oolite Keybord Controls-documentation] here on the wiki.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I've completed a number of native and OXP missions and my [[Cobra_Mk.3_%28Oolite%29|Cobra Mk. III]] has a number of new and funky pieces of equipment. However, I'm planning a change of ship, what pieces of equipment will I lose as a result?|answer=Many missions award equipment as a result of either accepting or completing them. For the majority of ship equipment, trading ships will result in the equipment being sold as well, with a few exceptions. The '''Cloaking Device''' and the '''Mark Transponder Scanner''', available from the (native) Cloaking Device and (OXP) Assassins missions respectively are transferred to your new ship. The '''Naval Energy Unit''', although awarded with the completion of the (native) Thargoid Plans mission, will be sold when you trade ships. However, completing the mission allows you to buy these units from high TL systems.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I’m using ECM-hardened missiles, but enemies are still able to destroy them! I never seem to be able to destroy enemy hardheads, though. What gives?|answer=ECM-hardened missiles are not ECM-proof. The probability of a hardened missile being destroyed by ECM is 10%–34% depending on range, and if it is destroyed, there’s a 50% chance that it will detonate. This applies equally to hardened missiles fired by computer-controlled ships and those fired by the player. The most effective use of hardened missiles is to use them against relatively slow targets at moderate range, and only use them on nimble ships if you desperately need to force them to break off an attack. Also, don’t use your ECM until a missile is close to blast range (250 metres).&lt;br /&gt;
&lt;br /&gt;
Specifically, the ECM sends out four pulses with different ranges, at half-second intervals. Each pulse has a 10% chance of destroying each hardhead it encounters. For a missile fired at close range, that’s 1 - 0.9&amp;lt;small&amp;gt;&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;&amp;lt;/small&amp;gt; = 34.39% chance of being destroyed within two seconds.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=If I believe that sizes and distances in Oolite are given in meters, it is so ''unrealistic''. The planets have a diameter of only 30–50 kilometers, and the suns are only 1000 kilometers away. Can't we get a little more realism in space, please?|answer=First of all, remember that Oolite is a ''game'', not a ''space simulation''. This is because it ''wants to'' be a game, not a sim. So yes, sizes and distances are all messed up. Ships and stations are too big, planets and suns are too small, and too close to each other. But this is ''deliberately'' so, and we are not going to change it.&lt;br /&gt;
&lt;br /&gt;
The reason is simple: Realistic sizes and distances don't make a good game. In reality space is so huge that you never would meet anybody else on your journey. Imagine the dozen or so ships you meet in the 500 or so kilometers between witchpoint and planet spread over the realistic 150 '''million''' kilometers between Sun and Earth. Even if your direction is only one degree off the perfect line, you would miss them all. And how interesting would that be for the gameplay? And finally, if you had a realistically sized station in front of a realistically sized planet, how would you ever even notice it? A grain of sand in front of a, well, '''planet'''. The result would be players in complete loneliness and virtually no interaction with NPCs. An utterly, utterly boring game. Therefore it was the right decision to screw realism in the layout of the planetary systems in Elite and Oolite.}}&lt;br /&gt;
&lt;br /&gt;
== Expanding the Game ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Speaking of OXPs, I've heard a lot about them. What are they? And where do I find them?|answer=OXP stands for 'Oolite eXpansion Pack'. As the name suggests, an OXP is an expansion to the game. It can contain virtually everything: new graphics for your ship, new ships for the player and/or the NPCs, new stations, new missions, new fun. To install an OXP you simply have to drag it into your AddOns-folder (only the OXP itself, not the folder it probably comes in). And as for finding them, you're already at the right place. All OXPs are now (or will become) accessible through the [[OXP|OXP-page of the wiki]]. Just follow the link. And if you fancy trying to create an OXP, the modifying Oolite FAQ can be found [[Modifying Oolite Informal FAQ|here]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Are there any OXPs that are highly recommended? Or can I get a list of 'must-have' OXPs?|answer=This is a difficult one to answer, because it depends so much on personal taste. There is no list of 'must-have' or necessary OXPs that could be agreed upon by all—or even most—players or contributers. But if you have a look at the [http://aegidian.org/bb/index.php Oolite Bulletin Board], especially the [http://aegidian.org/bb/viewforum.php?f=2 Discussion]- and the [http://aegidian.org/bb/viewforum.php?f=4 Expansion Pack]-forums, you will surely find some topics about this question, and the personal answers of a couple of board members.}}&lt;br /&gt;
&lt;br /&gt;
== Why does this and that not exist? ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Will there ever be an Oolite Massive Multi-player Online Role-Play Game (MMORPG)?|answer=At present Ahruman and Co. (the developers) have no plans to develop either Oolite or a separate branch to accommodate either an MMORPG or an MOG (Multi-player Online Game). This, however, doesn't mean one of you clever bods out there can't try ;-) We suggest you read [http://aegidian.org/bb/viewtopic.php?t=6173 this Bulletin Board thread] before you commence though, it may save you a lot of hair-tearing!}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Can the range of hyperspace jumps/my fuel capacity be increased?|answer=No. Jump range in Oolite is hard-coded for a reason. The game would become less challenging and thus less fun. (Although I can imagine hacks that give unlimited fuel.) And don't forget that there are already various ways of refuelling while you are in flight.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I want Laser Cooling Boosters!|answer=There are none at the moment and the reason is simple. It would unbalance the game too much. If they were available for the player only, things would get too easy. And if the NPCs could get them, too, things would get too hard. It's all about maintaining a reasonable balance. So the ultimate advice on this is: aim carefully; don't waste your laser fire; prevent overheating.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=The other day I got killed when I launched from a Rock Hermit/Behemoth/whatever, and all the profits/kills that I made before were gone. Why couldn't I save there? Why only on main stations?|answer=First of all, congratulations to you for having internalized the ''Golden Rule'': save early, save often! Unfortunately in Oolite you can save and load a commander only on main stations. That's because they are the only 'fixed' objects in space. The rest of the system is populated anew each time you load a game and is not saved in your savefile. So chances are that the Rock Hermit or Behemoth you docked with when saving simply wouldn't exist when you load again, and you would find yourself in nirvana instead of in a safe haven. To prevent odd behavior like this saving and loading is prohibited anywhere other than in a main station. Alternatively you could install [http://wiki.alioth.net/index.php/Save_Anywhere Save Anywhere.oxp], which does exactly what it says on the tin. Note, however, that it is still in beta state so read the documentation first.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I would like to switch between different ships of mine, e.g. have a nice racer for the weekends, meanwhile leave my freighter docked somewhere and take it back on Monday. Why can't I do this?|answer=It is possible for OXPs to provide this facility in 1.77 or later versions. Check the [[OXP_List|OXP List]] or ask on the forum to find one that suits you.}}&lt;br /&gt;
&lt;br /&gt;
== Known Issues / Bugs ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I am running Oolite on Windows Vista/7 and have installed the game in C:\Program Files\Oolite. I cannot find my saved games, log files, game preferences .GNUstepDefaults file and/or any saved screenshots, although I can see the saved games in the game and use them normally. Where are my files?|answer=You are experiencing file virtualization under Windows. Any application installed in %programfiles%, %systemroot%, %systemdrive% or %programdata that writes files under its folder structure is subject to this. As per Microsoft Support's article KB927387, the resolution for finding your files again is using one of the following methods:&lt;br /&gt;
•Click the Compatibility Files button that appears on the Explorer bar to view virtualized files in the folder. The Compatibility Files button appears only if there are virtualized files in the folder.&lt;br /&gt;
&lt;br /&gt;
•Look in the C:\Users\User_name\AppData\Local\VirtualStore folder to locate files and folders. &lt;br /&gt;
&lt;br /&gt;
•Save your application's data in a folder under your user profile.}}&lt;br /&gt;
&lt;br /&gt;
== System Requirements ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Does it work on Mac OS X 10.2 (Jaguar) &amp;amp; 10.3 (Panther)?|answer=Sadly, no. The minimum OS requirement for Oolite on the Mac is now Mac OS X 10.4. The previous stable version (1.65) is however compatible with Mac OS X 10.3.9}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Does it work on both Intel and PPC Macs?|answer=Yes, since 1.65 Oolite has been Universal Binary. It was PPC only in previous versions.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=What's the latest version?|answer=The last stable release is 1.76.1, and the latest test release (recommended) is 1.77. The last stable and latest test versions can be downloaded from [http://oolite.org/download.shtml Oolite's homepage]. More information can be found through the [http://aegidian.org/bb/viewforum.php?f=10 Oolite forums].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Is there a port for the PC or Linux?|answer=Yes. Both ports are stable and are at the same level of development as Oolite for the Mac. You can download Oolite for Windows and for Linux PCs from [http://oolite.org/download.shtml Oolite's homepage] (click on &amp;quot;show all platforms&amp;quot; if you can't see the version you're looking for). Information on test releases can be found through the Oolite forums, for the [http://aegidian.org/bb/viewforum.php?f=9 Linux version], and for the [http://aegidian.org/bb/viewforum.php?f=8 Windows version].}}&lt;br /&gt;
&lt;br /&gt;
== Writing OXPs ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I would like to contribute to Oolite and write my own OXP, but unfortunately my knowledge in scripting/programming is limited. How can I get started?|answer=First of all the Oolite community welcomes all efforts to enhance and enrich their favorite game, so be our guest! Many of us have started with very little knowledge, but over time were able to write and release astonishing OXPs, so why shouldn't you? Anyway, scripting can be learned. Currently there are two scripting languages in use for Oolite, plist-scripting (sometimes referred to as legacy-scripting) and JavaScript. For any serious OXP-plans you will have to learn them. A general starting point is the [http://wiki.alioth.net/index.php/OXP_howto OXP howto]-page, which will link you to further documentation. For plist-scripting you should read the [http://wiki.alioth.net/index.php/OXP_howto_plist OXP howto plist]-page, and also the [http://wiki.alioth.net/index.php/Property_list Property list]-intro. Information on the ongoing implementation of scripting with JavaScript can be found in the [http://wiki.alioth.net/index.php/Category:Oolite_scripting Category page for scripting] (work in progress). If you want to design a new ship, you should have a look at the [http://wiki.alioth.net/index.php/OXP_howto_model OXP howto model]-page and the [http://wiki.alioth.net/index.php/OXP_howto_texture OXP howto texture]-page. And if you want to give it a behavior of its own, you should consult the [http://wiki.alioth.net/index.php/OXP_howto_AI OXP howto AI]-page. I suggest you try to read and understand these first. If you still have questions afterwards, there is always the [http://aegidian.org/bb/index.php Oolite Bulletin Board], where lots of friendly people usually are very willing to lend a helping hand and to answer lots of questions.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I want to write an OXP or add content to the Wiki, but some (or all) of the content was written by another author. What copyright issues do I face?|answer=Anything submitted to the Wiki is on the basis that anyone else may edit or fiddle with it. OXPs are submitted under the creative commons licence. The author (strictly speaking) owns the copyright, but licenses users to use or distribute the OXP as long as they don't sell or charge for it. In practice virtually all OXP authors don't assert copyright and are pleased and flattered that somebody thinks their stuff is worth writing about or pinching to use in another OXP (it is good manners to credit the original author in the readme though). I expect the author will be pleased if you want to add some background, but if you are in doubt, send him or her a PM asking him for permission. At the end of the day, Oolite is a fun project and everybody is doing stuff for it on that basis. (nicked wholesale from [http://aegidian.org/bb/viewtopic.php?p=44813#44813 Little_Bear's] post on the [http://aegidian.org/bb/index.php Oolite Bulletin Board])}}&lt;br /&gt;
&lt;br /&gt;
== Diagnosing Problems ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Someone asked me for my log file. What is that, and where is it?|answer=While Oolite runs, various diagnostic information is written to a file called Latest.log. Where it is depends on your operating system:&lt;br /&gt;
* '''Mac OS X''': ~/Library/Logs/Oolite/Latest.log (that is, in your home folder, open the folder named ''Library'', then ''Logs'', then ''Oolite''). Alternatively, select “Show Previous Log” from the “'''Oolite'''” menu in the menu bar when running Oolite.&lt;br /&gt;
* '''Windows''': in Oolite’s folder (typically in C:\''Oolite''), there is a folder called ''oolite.app'', which contains a folder called ''Logs''. A shortcut to this folder is created at Oolite's Start Menu entries during installation. If you have installed the game in a folder subject to file virtualization like C:\Program Files\Oolite and encounter difficulty in locating the log files, then please refer to the Known Issues section of this FAQ for information on how to access them.&lt;br /&gt;
* '''Linux and other Unix-like systems''': ~/.Oolite/Logs (that is, in the hidden folder ''.Oolite'' in your home folder). If you’re using Nautilus or Konqueror—if you’ve never heard of them, you probably are—select Show Hidden Files from the View menu.}}&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=Why do none of the OXPs I have installed appear to work in the game?|answer=Check you do not have Oolite in 'Strict Play' mode.  When docked or paused press F2 and if it says 'Reset to Unrestricted Play' then OXPs will not work.  It needs to say 'Reset to Strict Play'. Alternately perhaps you downloaded and extracted an OXP straight to the &amp;quot;add ons&amp;quot; file. Without then checking that the file ending &amp;quot;.oxp&amp;quot; is moved up from any subdirectory folders to the &amp;quot;add ons&amp;quot; folder itself, as Oolite simply ignores folders etc not ending in .OXP in &amp;quot;add ons&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
== Other Questions ==&lt;br /&gt;
&lt;br /&gt;
{{FAQ|question=I have a question not answered here, where can I get help?|answer=Post your queries onto [http://aegidian.org/bb/index.php the friendliest board this side of Riedquat™]. Satisfaction is not guaranteed, but then what is, in this mixed-up universe? Help keep the board friendly by making sure your question isn't already answered here!&lt;br /&gt;
&lt;br /&gt;
If you want to report a bug, please read [http://aegidian.org/bb/viewtopic.php?t=3778 this]. Yes, all that work is a drag, but if nobody reports the bug it probably won’t get fixed.&lt;br /&gt;
&lt;br /&gt;
Or join us in #oolite, or #oolite-dev if you're working on Oolite or OXPs, on irc.oftc.net or ipv6.oftc.net.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Materials_in_Oolite&amp;diff=36729</id>
		<title>Materials in Oolite</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Materials_in_Oolite&amp;diff=36729"/>
		<updated>2013-05-04T18:55:17Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traditionally, the surface appearance of ships in Oolite has been defined entirely by textures specified in the ship’s model file and the ''[[#smooth|smooth]]'' attribute. Test release 1.67 added support for [[Shaders in Oolite|shaders]], and test release 1.69 expanded this to a more flexible '''material model'''. Under the new model, the texture file names in model files have been repurposed as '''material keys'''. A material key specifies an entry in the ship’s '''material dictionary''', specified in the ship’s ''[[shipdata.plist]]'' entry. For backwards compatibility, if no material of a given name is found, a material is generated using the material key as a diffuse texture name – providing the same functionality as previous versions of Oolite.&lt;br /&gt;
&lt;br /&gt;
This page documents the material model as of Oolite test release 1.74, and applies to stable release 1.76 and later.&lt;br /&gt;
&lt;br /&gt;
== Important concepts ==&lt;br /&gt;
The following concepts are important in understanding how materials work and how they interact with lights.&lt;br /&gt;
* '''Colour''': Oolite uses a basic low dynamic range lighting model. Colours are considered to be lists of three values, representing red, green and blue colours, each ranging from 0 to 1. These are often encoded as integers ranging from 0 to 255 for technical reasons, but 0 to 1 is the true range of values. There may also be an associated ''alpha channel'', which is traditionally used for blending effects. In shaders, any colour channel can be used for any purpose, and textures often encode values that are not treated as colours.&lt;br /&gt;
* '''Fragment''': roughty speaking, an on-screen pixel. When objects are rendered, their geometry is used to generate a fragments, which are then coloured based on lighting and materials.&lt;br /&gt;
* '''Modulation''': multiplying two colours together, by channel. For instance, if the calculated light colour for a given fragment is pale yellow – [1, 1, 0.8] – and the corresponding part of the diffuse map is turquoise – [0.2, 0.8, 0.8] – the ''diffuse contribution'' is [0.2, 0.8, 0.64] (a greenish tint). In graphics programs, this blending mode is usually called ''Multiply''.&lt;br /&gt;
* '''Additive blending''': adding two colours together, by channel. In Oolite’s low dynamic range lighting model, the result is always clipped to the range 0..1. In graphics programs, this blending mode is usually called ''Lighten''.&lt;br /&gt;
* '''Normals''': All lighting calculations require a concept of the orientation of a surface relative to a light and, for reflections, relative to the camera. A surface oriented towards the light will be lighter than a surface oriented away from it. The ''normal'' for any given point on a surface is a vector pointing straight out, which for our purposes ''defines'' the concept of “straight out”.&amp;lt;br /&amp;gt;By default, Oolite models have constant normals across each face. By setting the &amp;lt;code&amp;gt;smooth&amp;lt;/code&amp;gt; attribute in [[shipdata.plist]], normals are instead interpolated across each face, with each vertex having a normal that is a weighted average of surounding faces’ normals, and each point on a surface getting a weighted average of the normals at the corners of the face. Using ''smooth groups'', a model can be divided into regions which are smoothed but have sharp boundaries between them. As of Oolite 1.74, models can also include explicit per-vertex normals instead of having Oolite calculate them – most 3D modellers export this information.&amp;lt;br /&amp;gt;When using smoothing, it is important to understand that Oolite does not add any geometry,and will result in each vertex being lit as if it is locally flat. This is generally inappropriate for any sharp corner. If you set &amp;lt;code&amp;gt;smooth&amp;lt;/code&amp;gt; on a basic cube, the result will be badly lit.&lt;br /&gt;
* '''Diffuse reflection''': light that is reflected evenly in all directions. A “dull” surface primarily reflects diffusely. Because the light is reflected evenly in all directions, the diffuse term is independent of the camera position; it is a function of the light and the surface normal. The standard diffuse reflection term is the cosine of the angle between the direction to the light and the normal, or zero if this is negative – this is known as the [http://en.wikipedia.org/wiki/Lambertian_reflectance Lambertian reflectance model]. This value is then modulated with the material’s diffuse colour and diffuse map.&lt;br /&gt;
* '''Specular reflection''': light that is reflected in a particular direction, producing a shiny effect. In real life, this is simply a mirror reflection which is generally darkened and blurred, leaving an enlarged, blurry reflection of bright light sources, with other objects being washed out so they aren’t noticeable. In Oolite, a simpler mathematical model called the [http://en.wikipedia.org/wiki/Blinn–Phong_shading_model Blinn-Phong shading model] is used.&amp;lt;br /&amp;gt;[http://www.youtube.com/watch?v=76jvMmV1ih0 This video] demonstrates the effects of specular lighting and specular mapping on the built-in scarred alloy model.&lt;br /&gt;
&lt;br /&gt;
== The material dictionary ==&lt;br /&gt;
The '''material dictionary''' is actually specified as two separate dictionaries in the ''shipdata.plist'' entry. The first is called ''materials'', the second ''shaders''. If [[Shaders in Oolite|shader support]] is available and enabled, the entries in ''shaders'' are used in preference to those in ''materials''. Otherwise, ''shaders'' is ignored. The entries in the two dictionaries take exactly the same form, however; it is possible to specify a shader in the ''materials'' dictionary, and it will simply be ignored if shader support is not available. The ''materials'' and ''shaders'' dictionaries, merged together, are known as a ''material dictionary''.&lt;br /&gt;
&lt;br /&gt;
=== Material specifiers ===&lt;br /&gt;
The material dictionary is a [[property list]] dictionary whose keys are ''material keys'' as defined below, and whose values are '''material specifiers''', which are either dictionaries or strings. When a string is used as a material specifier, it is equivalent to a dictionary with that string as the value for '''diffuse_map''', and no other properties. Currently-supported material specifier keys are listed here; “texture specifier” and similar are defined below.&lt;br /&gt;
&lt;br /&gt;
Most of these keys have no effect when a custom shader is in effect.&lt;br /&gt;
&lt;br /&gt;
When shaders are disabled or not available, emission and illumination maps are supported only if reduced detail is disabled and the graphics hardware supports multi-texturing. If '''emission_modulate_color''', '''illumination_map''', or '''emission_and_illumination_map''' are used, Oolite must combine them into a single emission map. It is generally preferable to do this in advance (by modulating the illumination map with the diffuse map and blending it additively with the emission map, after applying any colouring). This is more efficient when using shaders, too.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ General material attribues&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''ambient_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || The ambient colour of the entity, that is, the colour reflected evenly in all directions by starlight. If there is a '''diffuse_map''', the '''ambient_color''' is modulated by the '''diffuse_map'''. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''diffuse_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || Overall diffuse colour of the entity; that is, the colour reflected in a “non-shiny” way on the sunlit side of the entity. If there is a '''diffuse_map''', the '''diffuse_color''' is modulated by the '''diffuse_map'''. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''diffuse_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture specifying the basic colour of the material. This is a “normal” texture, the same as you get without a material dictionary. If not specified, the material key will be used. To specify no texture, use an empty string for '''diffuse_map'''. Ignored when using shaders.&lt;br /&gt;
|-&lt;br /&gt;
| '''emission_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || The emitted (glow) colour of the material. This is ignored when '''emission_map''' is in use (but see also: '''emission_modulate_color'''). Default: black (0.0, 0.0, 0.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''emission_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture specifying emission (glow) colours. This is blended additively with all other colour terms. If '''emission_modulate_color''' is specified, the emission map is modulated by the modulate colour. Emission maps are used when shaders are active, and without shaders on supported hardware.&lt;br /&gt;
|-&lt;br /&gt;
| '''emission_modulate_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || A colour with which to modulate the '''emission_map'''. If the emission map is in full colour, it is best to apply the colouring in advance using a graphics program. However, if the emission map is a single colour, using a greyscale emission map and a modulate colour will reduce memory usage by a factor of four when shaders are in use. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''emission_and_illumination_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture whose RGB channels act like '''emission_map''', and whose alpha channel acts like '''illumination_map''' (and can be coloured with '''illumination_modulate_color'''). This uses less memory (on systems with shaders) than using separate shaders, although blending the emission and illumination maps into a single emission map, as described above, is still preferable.&lt;br /&gt;
|-&lt;br /&gt;
| '''illumination_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture specifying local illumination colour, which is added to incoming light. It differs from an emission map in that it is modulated with the diffuse colour before being added to the final colour. See example below.&lt;br /&gt;
|-&lt;br /&gt;
| '''illumination_modulate_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || A colour with which to modulate the '''illumination_map'''. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''normal_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture modifying [[#Important concepts|normals]]. The red, green and blue channels are the x, y and z coordinates of normals relative to the underlying normal (“[http://en.wikipedia.org/wiki/Normal_mapping tangent-space normal mapping]”), and the alpha channel is ingored. This is only used when shaders are active and no custom shader is used.&lt;br /&gt;
|-&lt;br /&gt;
| '''normal_and_parallax_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || Like '''normal_map''', except that the alpha channel is includes a depth value used to add [http://en.wikipedia.org/wiki/Parallax_mapping simulated perspective]. If specified, '''normal_map''' is ignored.&lt;br /&gt;
|-&lt;br /&gt;
| '''parallax_bias''' || number || A value added to the parallax component of '''normal_and_parallax_map''', after multiplying by '''parallax_scale''' (default: 0).&lt;br /&gt;
|-&lt;br /&gt;
| '''parallax_scale''' || number || A scale factor for the parallax component of '''normal_and_parallax_map''' (default: 0.01). This value is the depth of the parallax map relative to the size of the texture. For instance, a value of 0.01 on a texture 100 metres wide will produce a maximum indentation of 1 metre. High parallax_scale values tend to lead to unacceptable texture distortion and “creeping” artefacts.&lt;br /&gt;
|-&lt;br /&gt;
| '''specular_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || The colour to use for specular reflection over the entire model when '''specular_map''' is not used. The specular term is added to the diffuse term; for less intense specular highlights, use a darker colour. Default: black (0.0, 0.0, 0.0, 1.0) if '''shininess''' is zero, (0.2, 0.2, 0.2, 1.0) otherwise. &lt;br /&gt;
|-&lt;br /&gt;
| '''specular_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture specifying the specular highlight colour in its red, green and blue channels, and '''shininess''' in its alpha channel. 1 (fully opaque) means the value of '''shininess''' is used. 0 means a very low shininess is used. This is only used when shaders are active and no custom shader is used.&lt;br /&gt;
|-&lt;br /&gt;
| '''specular_modulate_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || A colour with which to modulate the '''specular_map'''. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''shininess'''  || integer || The “tightness” of specular reflection, ranging from 0 to 128. 0 means no specular highlight. 128 is maximally shiny. Default: 128 if '''specular_map''' is used, 10 otherwise. '''Limitation:''' to use different shininess values with '''specular_map''' or '''specular_color''', you must either use the default or use different “shaders” and “materials” dictionaries. This should be fixed for 1.75.&lt;br /&gt;
|-&lt;br /&gt;
| '''vertex_shader''' || file&amp;amp;nbsp;name || name of GLSL vertex program to use.&lt;br /&gt;
|-&lt;br /&gt;
| '''fragment_shader''' || file&amp;amp;nbsp;name || name of GLSL fragment program to use.&lt;br /&gt;
|-&lt;br /&gt;
| '''textures''' || array&amp;amp;nbsp;of&amp;amp;nbsp;[[#Texture specifiers|texture&amp;amp;nbsp;specifier]]s || Textures to use in shader program.&lt;br /&gt;
|-&lt;br /&gt;
| '''uniforms''' || dictionary of uniform&amp;amp;nbsp;variable&amp;amp;nbsp;specifiers || uniform variables to use in shader program.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Illumination mapping vs. emission mapping ====&lt;br /&gt;
This image demonstrates the distinction between illumination mapping (top row) and emission mapping (bottom row).&lt;br /&gt;
&lt;br /&gt;
[[Image:Emission-vs-illumination.png]]&lt;br /&gt;
&lt;br /&gt;
=== Colour specifiers ===&lt;br /&gt;
'''Colour specifiers''' are used to declare colours in material attribute dictionaries, and in other contexts such as lasers in ''[[shipdata.plist]]''. Colour specifiers take any of several forms:&lt;br /&gt;
&lt;br /&gt;
==== Named colours ====&lt;br /&gt;
The simplest form of colour specifier is a string containing a colour name. The following names are supported:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Colour names&lt;br /&gt;
! Name !! RGBA value&lt;br /&gt;
|-&lt;br /&gt;
|  blackColor || 0, 0, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| darkGrayColor || 1/3, 1/3, 1/3, 1&lt;br /&gt;
|-&lt;br /&gt;
| lightGrayColor || 2/3, 2/3, 2/3, 1&lt;br /&gt;
|-&lt;br /&gt;
| whiteColor || 1, 1, 1, 1&lt;br /&gt;
|-&lt;br /&gt;
| grayColor || 1/2, 1/2, 1/2, 1&lt;br /&gt;
|-&lt;br /&gt;
| redColor || 1, 0, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| greenColor || 0, 1, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| blueColor || 0, 0, 1, 1&lt;br /&gt;
|-&lt;br /&gt;
| cyanColor || 0, 1, 1, 1&lt;br /&gt;
|-&lt;br /&gt;
| yellowColor || 1, 1, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| magentaColor || 1, 0, 1, 1&lt;br /&gt;
|-&lt;br /&gt;
|  orangeColor || 1, 1/2, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| purpleColor || 1/2, 0, 1/2, 1&lt;br /&gt;
|-&lt;br /&gt;
| brownColor || 0.6, 0.4, 0.2, 1&lt;br /&gt;
|-&lt;br /&gt;
| clearColor || 0, 0, 0, 0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RGBA tuples ====&lt;br /&gt;
Colours may also be specified in RGB or RGBA (red, green, blue, alpha [transparency]). RGB or RGBA tuples may be specified as arrays or as strings separated by spaces. The values may range from 0 to 1 or 0 to 255. (If no value is greater than 1, 0–1 is assumed, otherwise 0–255.) Examples:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;1 1 0&amp;quot;&amp;lt;/code&amp;gt; — yellow&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;0 128 0 128&amp;quot;&amp;lt;/code&amp;gt; — medium green at 50% opacity&lt;br /&gt;
* &amp;lt;code&amp;gt;(1, 0, 0)&amp;lt;/code&amp;gt; – red&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== RGBA dictionaries ====&lt;br /&gt;
Just in case you’re unsure of the order the RGB[A] components come in, you can use a dictionary:&lt;br /&gt;
 {&lt;br /&gt;
    blue = 0.8;&lt;br /&gt;
    green = 0.8;&lt;br /&gt;
 }&lt;br /&gt;
Accepted keys are '''red''', '''green''', '''blue''' and '''alpha''' (or '''opacity'''), all optional (default: 0.0 for red, green and blue, 1.0 for alpha).&lt;br /&gt;
&lt;br /&gt;
==== HSBA dictionaries ====&lt;br /&gt;
But wait, there’s more! Colours may also be specified as dictionaries in the [http://en.wikipedia.org/wiki/HSB_colour_space HSB colour space]. Accepted keys are '''hue''' (hue angle in degrees, required), '''saturation''', '''brightness''' (or '''value''') and '''alpha''' (or '''opacity'''). The default for the optional keys is 1.0.&lt;br /&gt;
 {&lt;br /&gt;
    // Pale magenta&lt;br /&gt;
    hue = 300;&lt;br /&gt;
    saturation = 0.3;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Texture specifiers ===&lt;br /&gt;
'''Texture specifiers''' are used to, er, specify textures. The simplest form of texture specifier is a string: &amp;lt;code&amp;gt;&amp;quot;ahruman-example-texture.png&amp;quot;&amp;lt;/code&amp;gt;. The very simplest texture specifier is the empty string, &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt;, meaning no texture. More complex texture specifiers are dictionaries, which can be used to specify a number of texture options.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Texture specifier attributes&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''anisotropy''' || real || The degree of [http://en.wikipedia.org/wiki/Anisotropic_filtering anisotropic filtering] to use. Anisotropic filtering is used to reduce blurriness of MIP mapped textures shown at an angle (and thus only applies to textures whose '''min_filter''' is '''mipmap''' or '''default'''). The '''anisotropy''' setting is multiplied by the maximum anisotropy level specified by the system, and anisotropic filtering is used only if the result is greater than 1. (For example, on a GeForce FX 5200 card, the maximum level is 8, so an anisotropy value of 0.5 means an effective anisotropic filtering strength of 4. The precise meaning of this number is hardware-dependant. Fun, eh?) Anisotropic filtering is disabled in Reduced Detail mode and is not available on all hardware. Default: 0.5.&lt;br /&gt;
|-&lt;br /&gt;
| '''cube_map''' || boolean || If this is true, and the texture file is six times as high as it is wide, the texture will be treated as a cube map. If cube maps are not supported, it will be converted to a latitude/longitude map; if used as a diffuse map or emission/illumination map, you must ensure the model has appropriate texture coordinates. Note that cube maps are always available if shaders are supported, so custom shaders do not need to worry about this.&lt;br /&gt;
&lt;br /&gt;
'''cube_map''' is always true for planet textures. To convert textures to and from cube maps, see [[planettool]].&lt;br /&gt;
|-&lt;br /&gt;
| '''extract_channel''' || string || Indicates that one of the channels of the texture should be extracted into a new greyscale texture. Allowed values: '''r''', '''g''', '''b''' and '''a'''.&lt;br /&gt;
&lt;br /&gt;
This obviously involves extra work for Oolite, which is always a bad thing, but it makes it possible to combine multiple effect maps in a single texture for shaders and then extract channels for use as emission or illumination maps without shipping a redundant texture. If this means nothing to you, you probably don’t want to use '''extract_channel'''.&lt;br /&gt;
|-&lt;br /&gt;
| '''mag_filter''' || string || Specifies how to scale up the texture when it is near the camera. Either of:&lt;br /&gt;
* '''nearest''' (use nearest-neighbour sampling, which produces a pixellated effect)&lt;br /&gt;
* '''linear''' (use linear interpolation, which produces a blurry effect).&lt;br /&gt;
Default: '''linear'''.&lt;br /&gt;
|-&lt;br /&gt;
| '''min_filter''' || string || Specifies how to scale down the texture when it is far from the camera. One of:&lt;br /&gt;
* '''nearest''': nearest-neighbour sampling; generally very ugly, but sometimes useful for shaders using textures for special purposes.&lt;br /&gt;
* '''linear''': efficient, but rather ugly for textures with significant contrast or details.&lt;br /&gt;
* '''mipmap''': use trilinear MIP map filtering to improve scaling quality; generally also fast and least ugly, but uses 1/3 more memory, potentially slowing down systems with limited RAM or video memory.&lt;br /&gt;
* '''default''': '''linear''' in reduced detail mode, otherwise '''mipmap'''.&lt;br /&gt;
Default: '''default'''.&lt;br /&gt;
|-&lt;br /&gt;
| '''name''' || string || The file name of the texture to use. Must be a PNG image, in the Textures folder of Oolite or an OXP. In the specific case of '''diffuse_map''' textures, '''name''' is implicitly the same as the material key; to use no texture, you must specify &amp;lt;code&amp;gt;diffuse_map = &amp;quot;&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| '''no_shrink''' || boolean || Indicates that Oolite should not scale the texture down, except to meet hardware requirements. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''repeat_s''' || boolean || Whether Oolite should repeat the texture in the ''s'' (or ''u'') co-ordinate, rather than clamping it. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''repeat_t''' || boolean || Whether Oolite should repeat the texture in the ''t'' (or ''v'') co-ordinate, rather than clamping it. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''texture_LOD_bias''' || real || tweak factor for MIP mapping (which does not apply to other '''min_filter''' modes). MIP mapping involves a trade-off between scaling artefacts and blurriness; the LOD (level of detail) bias affects this. Positive values mean more blur, negative ones mean more artefacts. The default value is −0.25 (mostly so people won’t say “hey, why is everything blurrier in the new Oolite?”). Texture LOD bias is not available on all hardware.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Uniform specifiers ===&lt;br /&gt;
:''Main article: [[Shaders in Oolite: uniforms]]''&lt;br /&gt;
A ''uniform specifier'' is used to specify game information to pass to a [[Shaders in Oolite|shader program]]. As with [[#Texture specifiers|texture specifiers]], the simple case is a string, which is treated as &amp;lt;code&amp;gt;{ binding = &amp;quot;the string&amp;quot; }&amp;lt;/code&amp;gt;. For instance, uHullHeatLevel = hullHeatLevel&amp;lt;/code&amp;gt; will bind a shader’s &amp;lt;code&amp;gt;uHullHeatLevel&amp;lt;/code&amp;gt; uniform to a ship’s &amp;lt;code&amp;gt;hullHeatLevel&amp;lt;/code&amp;gt; property. Additional properties can be specified in a dictionary.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Texture specifier attributes&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''asMatrix''' || boolean || For a '''binding''' uniform whose bound property is of type ''quaternion'', setting '''asMatrix''' to true causes the value to be converted to a rotation matrix. If '''asMatrix''' is false, the quaternion will be converted to a vector, whose w, x, y and z values match those of the quaternion. For any other type of uniform, '''asMatrix''' is ignored. Default: true.&lt;br /&gt;
|-&lt;br /&gt;
| '''binding''' || string || The entity property to bind to, for a '''binding''' uniform. Ignored for other types of uniform.&lt;br /&gt;
|-&lt;br /&gt;
| '''clamped''' || boolean || For a '''binding''' uniform whose bound property is of type ''float'', setting '''clamped''' to true causes the value to be restricted to the range 0 to 1, inclusive. For a binding of type ''int'', causes the value to be set to either 0 or 1; 1 indicates that the underlying property has any value other than 0. For any other type of uniform, '''clamped''' is ignored. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''normalized''' || boolean || For a '''binding''' uniform whose bound property is of type ''vector'', setting '''normalized''' to true causes the value to be normalized, that is, scaled to a length of 1. For any other type of uniform, '''normalized''' is ignored. The spelling '''normalised''' is also accepted. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''type''' || string || One of:&lt;br /&gt;
* '''binding''': indicates that the '''binding''' property specifies an entity property to be set dynamically each time the shader is used.&lt;br /&gt;
* '''float''' or '''real''': indicates that the '''value''' property is an floating-point number.&lt;br /&gt;
* '''int''' or '''integer''': indicates that the '''value''' property is an integer, or whole number.&lt;br /&gt;
* '''texture''': indicates that the '''value''' property is an integer specifying a texture unit, that is, an index in the '''textures''' array.&lt;br /&gt;
Default: '''float'''.&lt;br /&gt;
|-&lt;br /&gt;
| '''value''' || number || The value to use for a '''float''', '''int''' or '''texture''' uniform. Ignored for '''binding''' uniforms.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Material dictionary example ===&lt;br /&gt;
Here is an example from the [[Material Test Suite OXP]]:&lt;br /&gt;
 materials =&lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;cube-face&amp;quot; =&lt;br /&gt;
     {&lt;br /&gt;
         diffuse_map = &amp;quot;oolite_shader_test_suite_7_diffuse.png&amp;quot;;&lt;br /&gt;
         emission_and_illumination_map = &amp;quot;oolite_shader_test_suite_emission_and_illumination.png&amp;quot;;&lt;br /&gt;
         emission_modulate_color = (160, 255, 160);&lt;br /&gt;
         illumination_modulate_color = (180, 180, 200);&lt;br /&gt;
     };&lt;br /&gt;
 };&lt;br /&gt;
Here, the “cube-face” material is assigned the diffuse texture “oolite_shader_test_suite_7_diffuse.png” and a combined emission and illumination map (which is a greyscale+alpha texture). The emission and illumination components are then given coloured tints (slightly green and slightly blue, respectively), producing this:&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 7.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Material Test Suite OXP]] — demonstrates most material properties.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Oolite]] [[Category:Oolite_scripting]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_EquipmentInfo&amp;diff=36562</id>
		<title>Oolite JavaScript Reference: EquipmentInfo</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_EquipmentInfo&amp;diff=36562"/>
		<updated>2013-03-30T21:13:59Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: There's no such word as “its'”.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt;''' objects provide information about a type of equipment. To acquire an &amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt; object, use the &amp;lt;code&amp;gt;[[#infoForKey|infoForKey]]()&amp;lt;/code&amp;gt; method, as in:&lt;br /&gt;
 var missileInfo = EquipmentInfo.infoForKey(&amp;quot;EQ_MISSILE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== Equipment Expressions ===&lt;br /&gt;
Many methods can take either an &amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt; or an equipment key. For instance, &amp;lt;code&amp;gt;ship.hasEquipment(&amp;quot;EQ_ECM&amp;quot;)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;ship.hasEquipment(EquipmentInfo.infoForKey(&amp;quot;EQ_ECM&amp;quot;))&amp;lt;/code&amp;gt;. In specifications, this is represented by arguments typed &amp;lt;code&amp;gt;equipmentInfoExpression&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;canBeDamaged&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''canBeDamaged''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type can be damaged (either in combat or using &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#setEquipmentStatus|Ship.setEquipmentStatus()]]&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently, this is hard-coded: trumbles, passenger berths, cargo bays and external stores are invulnerable.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;canCarryMultiple&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''canCarryMultiple''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if multiple instances of the equipment type can be used at once, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently, this is hard-coded to trumbles, passenger berths and external stores.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;damageProbability&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''damageProbability''' : Number (read-only nonnegative)&lt;br /&gt;
The relative probability of this item of equipment being damaged, as specified by the &amp;lt;code&amp;gt;damage_probability&amp;lt;/code&amp;gt; key in [[equipment.plist]]. This is always zero for mines and missiles, and defaults to one for other equipment. The chance of a particular piece of equipment being damaged is its damageProbability divided by the total damageProbability of all remaining undamaged equipment.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''description''' : String (read-only)&lt;br /&gt;
A short description of the equipment, as seen on the Ship Outfitting screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;effectiveTechLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''effectiveTechLevel''' : Number (read/write nonnegative integer)&lt;br /&gt;
The effective tech level required to purchase this item. Unlike &amp;lt;code&amp;gt;[[#techLevel|techLevel]]&amp;lt;/code&amp;gt;, this takes the special meaning of 99 and &amp;lt;code&amp;gt;TL_FOR_EQ_WHATEVER&amp;lt;/code&amp;gt; mission variables into account. If the raw tech level is 99, changing the value of &amp;lt;code&amp;gt;[[#effectiveTechLevel|effectiveTechLevel]]&amp;lt;/code&amp;gt; is equivalent to setting the appropriate &amp;lt;code&amp;gt;TL_FOR_EQ_WHATEVER&amp;lt;/code&amp;gt; mission variable. If the raw tech level is not 99, changes to &amp;lt;code&amp;gt;[[#effectiveTechLevel|effectiveTechLevel]]&amp;lt;/code&amp;gt; are ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
Setting &amp;lt;code&amp;gt;effectiveTechLevel&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;, will remove the corresponding &amp;lt;code&amp;gt;TL_FOR_EQ_WHATEVER&amp;lt;/code&amp;gt; mission variable.&lt;br /&gt;
&lt;br /&gt;
'''See also: &amp;lt;code&amp;gt;[[#techLevel|techLevel]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;equipmentKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''equipmentKey''' : String (read-only)&lt;br /&gt;
The equipment key for the equipment described by this &amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt; object. For EQ_MISSILE, this is &amp;quot;EQ_MISSILE&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;incompatibleEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''incompatibleEquipment''' : Array (read-only)&lt;br /&gt;
An array of equipment keys (in arbitrary order). In order to be installed, no item in this array may already be installed.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresAnyEquipment|requiresAnyEquipment]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requiresEquipment|requiresEquipment]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isAvailableToAll&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isAvailableToAll''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type can be used with any ship, regardless of its shipyard settings. It only has effect on player ships. npc ships always can have it, unless they are explicit excluded with the &amp;lt;code&amp;gt;isAvailableToNPCs&amp;lt;/code&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isAvailableToNPCs&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isAvailableToNPCs''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type can be used by non-player ships (&amp;lt;code&amp;gt;available_to_NPCs&amp;lt;/code&amp;gt; in [[equipment.plist]], default &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isAvailableToPlayer&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isAvailableToPlayer''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type can be used by player ships (&amp;lt;code&amp;gt;available_to_player&amp;lt;/code&amp;gt; in [[equipment.plist]], default &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isExternalStore&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isExternalStore''' : Boolean (read-only)&lt;br /&gt;
The value of the &amp;lt;code&amp;gt;is_external_store&amp;lt;/code&amp;gt; equipment.plist key, if specified; otherwise, &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for _MISSILE and _MINE equipment types, and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for others.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPortableBetweenShips&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPortableBetweenShips''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if equipment of this type is kept when buying a new ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isVisible&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isVisible''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type is visible on the ship info screen (&amp;lt;code&amp;gt;visible&amp;lt;/code&amp;gt; in [[equipment.plist]], default: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read-only)&lt;br /&gt;
The display name for the equipment described by this &amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt; object. This string is localized. For EQ_MISSILE in English, this is &amp;quot;Missile&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''price''' : Number (read-only nonnegative integer)&lt;br /&gt;
This is the value as used in the equipment.plist. Divide this by ten for the real value in credits.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiredCargoSpace&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiredCargoSpace''' : Number (read-only nonnegative integer)&lt;br /&gt;
Until Oolite 1.76 this was only used to decide '''if''' an item could be displayed on the equipment screen. Starting with Oolite 1.77, this key will actually make that the equipment uses cargo space when installed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresAnyEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresAnyEquipment''' : Array (read-only)&lt;br /&gt;
An array of equipment keys (in arbitrary order). In order to be installed, ''at least one'' item in this array must already be installed.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#incompatibleEquipment|incompatibleEquipment]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requiresEquipment|requiresEquipment]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresCleanLegalRecord&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresCleanLegalRecord''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresNonCleanLegalRecord|requiresNonCleanLegalRecord]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresEmptyPylon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresEmptyPylon''' : Boolean (read-only)&lt;br /&gt;
True for equipment that requires at least one pylon to have nothing on it.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresMountedPylon|requiresMountedPylon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresEquipment''' : Array (read-only)&lt;br /&gt;
An array of equipment keys (in arbitrary order). In order to be installed, ''all'' items in this array must already be installed.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#incompatibleEquipment|incompatibleEquipment]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requiresAnyEquipment|requiresAnyEquipment]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresFreePassengerBerth&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresFreePassengerBerth''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresFullFuel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresFullFuel''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresNonFullFuel|requiresNonFullFuel]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresMountedPylon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresMountedPylon''' : Boolean (read-only)&lt;br /&gt;
True for equipment that requires at least one pylon to have a store (missile, mine or equipment) on it.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresEmptyPylon|requiresEmptyPylon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresNonCleanLegalRecord&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresNonCleanLegalRecord''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresCleanLegalRecord|requiresCleanLegalRecord]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresNonFullFuel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresNonFullFuel''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresFullFuel|requiresFullFuel]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scriptInfo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scriptInfo''' : Object (read-only)&lt;br /&gt;
The contents of the &amp;lt;code&amp;gt;script_info&amp;lt;/code&amp;gt; key in the equipments’s ''[[equipment.plist]]'' entry, if any. This may be any [[property list]] object, but the reccomended approach is to use a dictionary whose keys have a unique prefix (such as you should be using for file names, ship names etc.). A property list dictionary is converted to a JavaScript object with properties corresponding to the dictionary’s keys. All other property list types used with Oolite have directly corresponding JavaScript types.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scriptName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scriptName''' : String (read-only)&lt;br /&gt;
The name of an attached script. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;techLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''techLevel''' : Number (read-only nonnegative integer)&lt;br /&gt;
The raw tech level required to purchase this item. Unlike &amp;lt;code&amp;gt;[[#effectiveTechLevel|effectiveTechLevel]]&amp;lt;/code&amp;gt;, this does not take the special meaning of 99 and &amp;lt;code&amp;gt;TL_FOR_EQ_WHATEVER&amp;lt;/code&amp;gt; mission variables into account.&lt;br /&gt;
&lt;br /&gt;
'''See also: &amp;lt;code&amp;gt;[[#effectiveTechLevel|effectiveTechLevel]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Static properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;allEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 allEquipment : Array (EquipmentInfos, read-only)&lt;br /&gt;
Returns a list of all known equipment types.&lt;br /&gt;
&lt;br /&gt;
== Static methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;infoForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''infoForKey'''(equipmentKey : String) : EquipmentInfo&lt;br /&gt;
Returns the equipment info object for a given type of equipment, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for an unrecognised key. Example: &amp;lt;code&amp;gt;var missileInfo = EquipmentInfo.infoForKey(&amp;quot;EQ_MISSILE&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Equipment.plist]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Quaternion&amp;diff=35253</id>
		<title>Oolite JavaScript Reference: Quaternion</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Quaternion&amp;diff=35253"/>
		<updated>2012-12-26T22:00:46Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Quaternion Expressions */ Removed obsolete musings.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Quaternion&amp;lt;/code&amp;gt;''' class represents a [[quaternion]], a four-dimensional number, which is used to express rotations. Explaining quaternion mathematics is ''way'' beyond the scope of this document, but a quick overview is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Quaternions for Rotations ===&lt;br /&gt;
This is a very quick, pragmatic discussion of quaternions as they apply to rotating things in Oolite. If you’re interested in the theory, see:&lt;br /&gt;
* Wikipedia: [http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Quaternions and spatial rotation]&lt;br /&gt;
* Wikipedia: [http://en.wikipedia.org/wiki/Quaternion Quaternion]&lt;br /&gt;
* MathWorld: [http://mathworld.wolfram.com/Quaternion.html Quaternion]&lt;br /&gt;
&lt;br /&gt;
Consider a ship at point ''h'' oriented to face a station at point ''t''. This can be expressed as the vector from the ship to the station, ''v'' = ''t'' − ''h''. However, if the ship rolls, it is still heading along the same vector ''v'', so additional information is required: a twist angle, ''α''. A rotation quaternion is a tuple ''Q'' = (''w'', ''x'', ''y'', ''z''), such that&lt;br /&gt;
:''Q&amp;lt;sub&amp;gt;w&amp;lt;/sub&amp;gt;'' = cos ''α''/2&lt;br /&gt;
:''Q&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;'' = ''v&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;'' sin ''α''/2&lt;br /&gt;
:''Q&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;'' = ''v&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;'' sin ''α''/2&lt;br /&gt;
:''Q&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;'' = ''v&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;'' sin ''α''/2&lt;br /&gt;
Additionally, a rotation quaternion must be normalized; that is, it must fulfill the '''normal invariant''' ''Q&amp;lt;sub&amp;gt;w&amp;lt;/sub&amp;gt;''² + ''Q&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;''² + ''Q&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;''² + ''Q&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;''² = 1. Unlike with [[property list]] scripting and specifications, quaternions will not be automatically normalized for you except where specified, but a &amp;lt;code&amp;gt;[[#normalize|normalize]]()&amp;lt;/code&amp;gt; method is provided.&lt;br /&gt;
&lt;br /&gt;
An '''identity rotation''' – that is, one which, when applied, has no effect – is represented by the '''identity quaternion''' (1, 0, 0, 0).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Quaternion&amp;lt;/code&amp;gt; class provides several methods to make construction of rotations easier: &amp;lt;code&amp;gt;[[#rotate|rotate]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#rotateX|rotateX]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#rotateY|rotateY]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#rotateZ|rotateZ]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Rotations can be combined by quaternion multiplication (see the &amp;lt;code&amp;gt;[[#multiply|multiply]]()&amp;lt;/code&amp;gt; method). Note that quaternion multiplication is not commutative; that is, ''PQ'' is not the same as ''QP''. If this seems strange, take a box or book and assign it ''x'', ''y'' and ''z'' axes. Rotate it about the ''x'' axis and then the ''y'' axis. Then, rotate it about the ''y'' axis followed by the ''x'' axis. If the results of the two rotations are the same, you’re doing it wrong.&lt;br /&gt;
&lt;br /&gt;
=== Quaternion Expressions ===&lt;br /&gt;
All Oolite-provided functions which take a quaternion as an argument may instead be passed an array of four numbers, or an [[Oolite JavaScript Reference: Entity|Entity]] (in which case the entity’s &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#orientation|orientation]]&amp;lt;/code&amp;gt; is used). In specifications, this is represented by arguments typed &amp;lt;code&amp;gt;quaternionExpression&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''w''' : Number (read/write)&lt;br /&gt;
&lt;br /&gt;
The ''w'' component of the quaternion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''x''' : Number (read/write)&lt;br /&gt;
The ''x'' component of the quaternion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''y''' : Number (read/write)&lt;br /&gt;
The ''y'' component of the quaternion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''z''' : Number (read/write)&lt;br /&gt;
The ''z'' component of the quaternion.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== Constructor ===&lt;br /&gt;
 '''new Quaternion'''([value : [[#Quaternion Expressions|quaternionExpression]]])&lt;br /&gt;
Create a new quaternion with the specified value. If no value is provided, the vector is initialized to the identity quaternion (1, 0, 0, 0).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;conjugate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''conjugate'''() : Quaternion&lt;br /&gt;
Return the conjugate of the quaternion (i.e. the quaternion which when multiplied by the original quaternion returns the identity quaternion). The input quaternion must be normalized.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dot&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''dot'''(q : [[#Quaternion Expressions|quaternionExpression]]) : Number&lt;br /&gt;
Returns the quaternion dot product (inner product) of the target and &amp;lt;code&amp;gt;q&amp;lt;/code&amp;gt;. (For two normalized quaternions, this will be 1 if they’re equal, -1 if they’re opposite and 0 if they’re perpendicular.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;multiply&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''multiply'''(q : [[#Quaternion Expressions|quaternionExpression]]) : Quaternion&lt;br /&gt;
Returns the standard quaternion product (Grassmann product) of the target and &amp;lt;code&amp;gt;q&amp;lt;/code&amp;gt;. This is used to concatenate rotations together.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;normalize&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''normalize'''() : Quaternion&lt;br /&gt;
Returns the quaternion adjusted to fulfill the [[#Quaternions for Rotations|normal invariant]]. Specifically, this divides each component by the square root of (''w''² + ''x''² + ''y''² + ''z''²).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotate'''(a : [[Oolite JavaScript Reference: Vector#Vector Expressions|vectorExpression]], angle : Number) : Quaternion&lt;br /&gt;
Returns a quaternion rotated &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt; radians about the axis of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;. The vector &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; must be a normalized vector. (FIXME: clockwise or anticlockwise?)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotateX&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotateX'''(angle : Number) : Quaternion&lt;br /&gt;
Returns a quaternion rotated &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt; radians about the ''x'' axis. (FIXME: clockwise or anticlockwise?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;q.rotateX(angle)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;q.[[#rotate|rotate]]([1, 0, 0], angle)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotateY&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotateY'''(angle : Number) : Quaternion&lt;br /&gt;
Returns a quaternion rotated &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt; radians about the ''y'' axis. (FIXME: clockwise or anticlockwise?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;q.rotateY(angle)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;q.[[#rotate|rotate]]([0, 1, 0], angle)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotateZ'''(angle : Number) : Quaternion&lt;br /&gt;
Returns a quaternion rotated &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt; radians about the ''z'' axis. (FIXME: clockwise or anticlockwise?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;q.rotateZ(angle)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;q.[[#rotate|rotate]]([0, 0, 1], angle)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;toArray&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''toArray'''() : Array&lt;br /&gt;
Returns an array of the quaternion’s components, in the order &amp;lt;code&amp;gt;[w, x, y, z]&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;q.toArray()&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;[q.w, q.x, q.y, q.z]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorForward&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''vectorForward'''() : [[Oolite JavaScript Reference: Vector|Vector]]&lt;br /&gt;
Returns the forward vector from the quaternion.&lt;br /&gt;
&lt;br /&gt;
To understand this, consider an entity which is aligned with the world co-ordinate system – that is, its &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#orientation|orientation]]&amp;lt;/code&amp;gt; is the identity quaternion (1, 0, 0, 0), and thus its ''x'' axis is aligned with the world ''x'' axis, its ''y'' axis is aligned with the world ''y'' axis and its ''z'' axis is aligned with the world ''z'' axis. If it is rotated by a quaternion ''Q'', &amp;lt;code&amp;gt;Q.vectorForward()&amp;lt;/code&amp;gt; is the forward (''z'') axis after rotation. Similarly, &amp;lt;code&amp;gt;Q.[[#vectorUp|vectorUp]]()&amp;lt;/code&amp;gt; is the up (''y'') axis after rotation, and &amp;lt;code&amp;gt;Q.[[#vectorRight|vectorRight]]()&amp;lt;/code&amp;gt; is the right (''x'') axis after rotation.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorRight&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''vectorRight'''() : [[Oolite JavaScript Reference: Vector|Vector]]&lt;br /&gt;
Returns the right vector from the quaternion. See &amp;lt;code&amp;gt;[[#vectorForward|vectorForward]]()&amp;lt;/code&amp;gt; for a definition.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorUp&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''vectorUp'''() : [[Oolite JavaScript Reference: Vector|Vector]]&lt;br /&gt;
Returns the up vector from the quaternion. See &amp;lt;code&amp;gt;[[#vectorForward|vectorForward]]()&amp;lt;/code&amp;gt; for a definition.&lt;br /&gt;
&lt;br /&gt;
== Static Methods ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;random&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''random'''() : Quaternion&lt;br /&gt;
Returns a random normalized quaternion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Quaternion&amp;diff=35241</id>
		<title>Oolite JavaScript Reference: Quaternion</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Quaternion&amp;diff=35241"/>
		<updated>2012-12-24T10:51:53Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* conjugate */ Incorrect synopsis.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Quaternion&amp;lt;/code&amp;gt;''' class represents a [[quaternion]], a four-dimensional number, which is used to express rotations. Explaining quaternion mathematics is ''way'' beyond the scope of this document, but a quick overview is provided below.&lt;br /&gt;
&lt;br /&gt;
=== Quaternions for Rotations ===&lt;br /&gt;
This is a very quick, pragmatic discussion of quaternions as they apply to rotating things in Oolite. If you’re interested in the theory, see:&lt;br /&gt;
* Wikipedia: [http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Quaternions and spatial rotation]&lt;br /&gt;
* Wikipedia: [http://en.wikipedia.org/wiki/Quaternion Quaternion]&lt;br /&gt;
* MathWorld: [http://mathworld.wolfram.com/Quaternion.html Quaternion]&lt;br /&gt;
&lt;br /&gt;
Consider a ship at point ''h'' oriented to face a station at point ''t''. This can be expressed as the vector from the ship to the station, ''v'' = ''t'' − ''h''. However, if the ship rolls, it is still heading along the same vector ''v'', so additional information is required: a twist angle, ''α''. A rotation quaternion is a tuple ''Q'' = (''w'', ''x'', ''y'', ''z''), such that&lt;br /&gt;
:''Q&amp;lt;sub&amp;gt;w&amp;lt;/sub&amp;gt;'' = cos ''α''/2&lt;br /&gt;
:''Q&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;'' = ''v&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;'' sin ''α''/2&lt;br /&gt;
:''Q&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;'' = ''v&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;'' sin ''α''/2&lt;br /&gt;
:''Q&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;'' = ''v&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;'' sin ''α''/2&lt;br /&gt;
Additionally, a rotation quaternion must be normalized; that is, it must fulfill the '''normal invariant''' ''Q&amp;lt;sub&amp;gt;w&amp;lt;/sub&amp;gt;''² + ''Q&amp;lt;sub&amp;gt;x&amp;lt;/sub&amp;gt;''² + ''Q&amp;lt;sub&amp;gt;y&amp;lt;/sub&amp;gt;''² + ''Q&amp;lt;sub&amp;gt;z&amp;lt;/sub&amp;gt;''² = 1. Unlike with [[property list]] scripting and specifications, quaternions will not be automatically normalized for you except where specified, but a &amp;lt;code&amp;gt;[[#normalize|normalize]]()&amp;lt;/code&amp;gt; method is provided.&lt;br /&gt;
&lt;br /&gt;
An '''identity rotation''' – that is, one which, when applied, has no effect – is represented by the '''identity quaternion''' (1, 0, 0, 0).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Quaternion&amp;lt;/code&amp;gt; class provides several methods to make construction of rotations easier: &amp;lt;code&amp;gt;[[#rotate|rotate]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#rotateX|rotateX]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#rotateY|rotateY]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#rotateZ|rotateZ]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Rotations can be combined by quaternion multiplication (see the &amp;lt;code&amp;gt;[[#multiply|multiply]]()&amp;lt;/code&amp;gt; method). Note that quaternion multiplication is not commutative; that is, ''PQ'' is not the same as ''QP''. If this seems strange, take a box or book and assign it ''x'', ''y'' and ''z'' axes. Rotate it about the ''x'' axis and then the ''y'' axis. Then, rotate it about the ''y'' axis followed by the ''x'' axis. If the results of the two rotations are the same, you’re doing it wrong.&lt;br /&gt;
&lt;br /&gt;
=== Quaternion Expressions ===&lt;br /&gt;
All Oolite-provided functions which take a quaternion as an argument may instead be passed an [[Oolite JavaScript Reference: Entity|Entity]] instead, in which case the entity’s &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#orientation|orientation]]&amp;lt;/code&amp;gt; is used. In specifications, this is represented by arguments named &amp;lt;code&amp;gt;quaternionOrEntity&amp;lt;/code&amp;gt;. (Is this actually useful? It seems less compellingly so than the [[Oolite JavaScript Reference: Vector#Vector Expressions|vector equivalent]]. -- [[User:Ahruman]])&lt;br /&gt;
&lt;br /&gt;
Additionally, most &amp;lt;code&amp;gt;Quaternion&amp;lt;/code&amp;gt; methods may be passed four numbers, or an array of four numbers, instead of a quaternion. In specifications, this is represented by arguments named &amp;lt;code&amp;gt;quaternionExpression&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''w''' : Number (read/write)&lt;br /&gt;
&lt;br /&gt;
The ''w'' component of the quaternion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''x''' : Number (read/write)&lt;br /&gt;
The ''x'' component of the quaternion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''y''' : Number (read/write)&lt;br /&gt;
The ''y'' component of the quaternion.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''z''' : Number (read/write)&lt;br /&gt;
The ''z'' component of the quaternion.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== Constructor ===&lt;br /&gt;
 '''new Quaternion'''([value : [[#Quaternion Expressions|quaternionExpression]]])&lt;br /&gt;
Create a new quaternion with the specified value. If no value is provided, the vector is initialized to the identity quaternion (1, 0, 0, 0).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;conjugate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''conjugate'''() : Quaternion&lt;br /&gt;
Return the conjugate of the quaternion (i.e. the quaternion which when multiplied by the original quaternion returns the identity quaternion). The input quaternion must be normalized.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dot&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''dot'''(q : [[#Quaternion Expressions|quaternionExpression]]) : Number&lt;br /&gt;
Returns the quaternion dot product (inner product) of the target and &amp;lt;code&amp;gt;q&amp;lt;/code&amp;gt;. (For two normalized quaternions, this will be 1 if they’re equal, -1 if they’re opposite and 0 if they’re perpendicular.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;multiply&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''multiply'''(q : [[#Quaternion Expressions|quaternionExpression]]) : Quaternion&lt;br /&gt;
Returns the standard quaternion product (Grassmann product) of the target and &amp;lt;code&amp;gt;q&amp;lt;/code&amp;gt;. This is used to concatenate rotations together.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;normalize&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''normalize'''() : Quaternion&lt;br /&gt;
Returns the quaternion adjusted to fulfill the [[#Quaternions for Rotations|normal invariant]]. Specifically, this divides each component by the square root of (''w''² + ''x''² + ''y''² + ''z''²).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotate'''(a : [[Oolite JavaScript Reference: Vector#Vector Expressions|vectorExpression]], angle : Number) : Quaternion&lt;br /&gt;
Returns a quaternion rotated &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt; radians about the axis of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;. The vector &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; must be a normalized vector. (FIXME: clockwise or anticlockwise?)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotateX&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotateX'''(angle : Number) : Quaternion&lt;br /&gt;
Returns a quaternion rotated &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt; radians about the ''x'' axis. (FIXME: clockwise or anticlockwise?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;q.rotateX(angle)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;q.[[#rotate|rotate]]([1, 0, 0], angle)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotateY&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotateY'''(angle : Number) : Quaternion&lt;br /&gt;
Returns a quaternion rotated &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt; radians about the ''y'' axis. (FIXME: clockwise or anticlockwise?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;q.rotateY(angle)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;q.[[#rotate|rotate]]([0, 1, 0], angle)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotateZ'''(angle : Number) : Quaternion&lt;br /&gt;
Returns a quaternion rotated &amp;lt;code&amp;gt;angle&amp;lt;/code&amp;gt; radians about the ''z'' axis. (FIXME: clockwise or anticlockwise?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;q.rotateZ(angle)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;q.[[#rotate|rotate]]([0, 0, 1], angle)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;toArray&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''toArray'''() : Array&lt;br /&gt;
Returns an array of the quaternion’s components, in the order &amp;lt;code&amp;gt;[w, x, y, z]&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;q.toArray()&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;[q.w, q.x, q.y, q.z]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorForward&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''vectorForward'''() : [[Oolite JavaScript Reference: Vector|Vector]]&lt;br /&gt;
Returns the forward vector from the quaternion.&lt;br /&gt;
&lt;br /&gt;
To understand this, consider an entity which is aligned with the world co-ordinate system – that is, its &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#orientation|orientation]]&amp;lt;/code&amp;gt; is the identity quaternion (1, 0, 0, 0), and thus its ''x'' axis is aligned with the world ''x'' axis, its ''y'' axis is aligned with the world ''y'' axis and its ''z'' axis is aligned with the world ''z'' axis. If it is rotated by a quaternion ''Q'', &amp;lt;code&amp;gt;Q.vectorForward()&amp;lt;/code&amp;gt; is the forward (''z'') axis after rotation. Similarly, &amp;lt;code&amp;gt;Q.[[#vectorUp|vectorUp]]()&amp;lt;/code&amp;gt; is the up (''y'') axis after rotation, and &amp;lt;code&amp;gt;Q.[[#vectorRight|vectorRight]]()&amp;lt;/code&amp;gt; is the right (''x'') axis after rotation.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorRight&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''vectorRight'''() : [[Oolite JavaScript Reference: Vector|Vector]]&lt;br /&gt;
Returns the right vector from the quaternion. See &amp;lt;code&amp;gt;[[#vectorForward|vectorForward]]()&amp;lt;/code&amp;gt; for a definition.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorUp&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''vectorUp'''() : [[Oolite JavaScript Reference: Vector|Vector]]&lt;br /&gt;
Returns the up vector from the quaternion. See &amp;lt;code&amp;gt;[[#vectorForward|vectorForward]]()&amp;lt;/code&amp;gt; for a definition.&lt;br /&gt;
&lt;br /&gt;
== Static Methods ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;random&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''random'''() : Quaternion&lt;br /&gt;
Returns a random normalized quaternion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=User:Ahruman&amp;diff=34496</id>
		<title>User:Ahruman</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=User:Ahruman&amp;diff=34496"/>
		<updated>2012-11-03T20:42:37Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Jens Ayton is the current project lead for [[Oolite]], although he has officially retired from “feature development”.&lt;br /&gt;
&lt;br /&gt;
He also has a [http://jens.ayton.se/blag/ programming blog thing] which updates some years.&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=34322</id>
		<title>Oolite JavaScript Reference: System</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=34322"/>
		<updated>2012-10-08T17:41:44Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* legacy_addShips etc. */ Derp.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;System&amp;lt;/code&amp;gt;''' class represents the current system. There is always one &amp;lt;code&amp;gt;System&amp;lt;/code&amp;gt; object, available through the global property &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Attempts to change system properties are ignored in interstellar space (i.e., the place you end up in after a witchspace malfunction).&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;allShips&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''allShips''' : Array (read-only)&lt;br /&gt;
A list of the ships in the system.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;allVisualEffects&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''allVisualEffects''' : Array (read-only)&lt;br /&gt;
A list of the [[Oolite_JavaScript_Reference:_VisualEffect|visual effects]] in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;breakPattern&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''breakPattern''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (the default state set on entry to a new system), the break pattern will be shown to the player as they exit witchspace. While this property may be set from places other than the &amp;lt;code&amp;gt;shipWillExitWitchspace&amp;lt;/code&amp;gt; world script event, it is pointless to do so.&lt;br /&gt;
&lt;br /&gt;
Unlike all other system properties, this one may be changed on entry to interstellar space.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''description''' : String (read/write)&lt;br /&gt;
The description of the current system, as seen on the planet info screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;economy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''economy''' : Number (integer, read/write)&lt;br /&gt;
The type of economy in the current system, ranging from 0 (Rich Industrial) to 7 (Poor Agricultural).&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#economyDescription|economyDescription]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;economyDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''economyDescription''' : String (read-only)&lt;br /&gt;
A localized description of the economy type, for example, “Mostly Industrial”. Since this string is localized, it should only be used for display purposes.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#economy|economy]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;government&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''government''' : Number (read/write, integer)&lt;br /&gt;
The type of government in the current system, ranging from 0 (Anarchy) to 7 (Corporate State).&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#governmentDescription|governmentDescription]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;governmentDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''governmentDescription''' : String (read-only)&lt;br /&gt;
A localized description of the government type, for example, “Democracy”. Since this string is localized, it should only be used for display purposes.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#government|government]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 ID : Number (integer, read-only)&lt;br /&gt;
A number identifying the system. 0 to 255, or -1 for interstellar space.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''info''' : [[Oolite JavaScript Reference: SystemInfo|SystemInfo]] (read/write)&lt;br /&gt;
Allows access to system properties, using the same keys as [[planetinfo.plist]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 system.info.description = &amp;quot;This is a dull planet.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;inhabitantsDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''inhabitantsDescription''' : String (read/write)&lt;br /&gt;
The description of the inhabitants of the current system, such as “Slimy Blue Frogs”.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isInterstellarSpace&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isInterstellarSpace''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the current system is in interstellar space, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mainPlanet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mainPlanet''' : {{oojsclass|Planet}} (read-only)&lt;br /&gt;
The system’s main planet, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mainStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mainStation''' : [[Oolite JavaScript Reference: Station|Station]] (read-only)&lt;br /&gt;
The system’s main station, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read/write)&lt;br /&gt;
The name of the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;planets&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''planets''' : Array (read-only)&lt;br /&gt;
A list of the planets in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;population&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''population''' : Number (integer, read/write)&lt;br /&gt;
The population of the current system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;productivity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''productivity''' : Number (integer, read/write)&lt;br /&gt;
The productivity of the current system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandom100&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandom100''' : Number (integer, read-only)&lt;br /&gt;
A random number between 0 and 99 that is always the same for a given system. '''Important:''' this method has the undesirable side effect of resetting the system random number generator. It should only be used for backwards-compatibility. For new development, use &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[[#pseudoRandomNumber|pseudoRandomNumber]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandom256&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandom256''' : Number (integer, read-only)&lt;br /&gt;
A random number between 0 and 255 that is always the same for a given system. '''Important:''' this method has the undesirable side effect of resetting the system random number generator. It should only be used for backwards-compatibility. For new development, use &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[[#pseudoRandomNumber|pseudoRandomNumber]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandomNumber&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandomNumber''' : Number (read-only)&lt;br /&gt;
A random number between 0 and 1 that is always the same for a given system. In general, you should avoid using this number directly and call &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sun&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''sun''' : [[Oolite JavaScript Reference: Sun|Sun]] (read-only)&lt;br /&gt;
The system’s sun, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;techLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''techLevel''' : Number (integer, read/write)&lt;br /&gt;
The technology level of the current system, ranging from 0 to 15.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addGroup&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addGroup'''(role : String, count : Number [, position: {{oojsvecexpr}}] [, radius: Number]) : {{oojsclass|ShipGroup}}&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;, but puts the ships in a group and returns the group.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroupToRoute|addGroupToRoute()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addGroupToRoute&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addGroupToRoute'''(role : String, count : Number [, fraction: Number] [, route: String]) : {{oojsclass|ShipGroup}}&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;, but puts the ships in a group and returns the group.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroup|addGroup()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMoon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMoon'''(planetInfoKey : String) : {{oojsclass|Planet}}&lt;br /&gt;
Adds a moon to the system, using the specified entry in ''[[planetinfo.plist]]''. A moon is the same as a planet, except that it has no atmosphere.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addPlanet|addPlanet()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addPlanet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addPlanet'''(planetInfoKey : String) : {{oojsclass|Planet}}&lt;br /&gt;
Adds a planet to the system, using the specified entry in ''[[planetinfo.plist]]''.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addMoon|addMoon()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addShips&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addShips'''(role : String, count : Number [, position: {{oojsvecexpr}}] [, radius: Number]) : Array&lt;br /&gt;
Adds ships to the system and returns the added ships in an array. Position is in absolute coordinates. When no position is given, the witchpoint is assumed. When no radius is given, the maximum scanner range is used. Ships added in range of the witchpoint automatically create a witchpoint entry cloud.&lt;br /&gt;
&lt;br /&gt;
When you want to use coordinates from the legacy &amp;quot;pwp&amp;quot; system you can use the function [[Oolite_JavaScript_Reference:_Vector3D#fromCoordinateSystem|fromCoordinateSystem]] to convert legacy type coordinates to absolute coordinates.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroup|addGroup()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addShipsToRoute&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addShipsToRoute'''(role : String, count : Number [, fraction: Number] [, route: String]) : Array&lt;br /&gt;
Adds ships to the system on certain common routes and returns the added ships as an array. The routes are the two character codes &amp;lt;code&amp;gt;wp&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pw&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ws&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sw&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sp&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;ps&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt; stands for the witchpoint, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; for the planet and &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for the sun.&lt;br /&gt;
&lt;br /&gt;
When no route is defined, the route witchpoint → main station is assumed.&lt;br /&gt;
&lt;br /&gt;
The position is a fraction of the route and must be between 0 and 1. Unlike the legacy commands the fraction takes planetary radii in account, so it does not start counting in the centre of sun/planet but from its surface. When no fraction is defined, a random fraction is chosen. Ships are added within scanner range of this position. Ships added in range of the witchpoint automatically create a witchpoint entry cloud.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 var ships = system.addShipsToRoute(&amp;quot;myShips&amp;quot;, 2, 0.7, &amp;quot;sw&amp;quot;)&lt;br /&gt;
 var pirates = system.addShipsToRoute(&amp;quot;pirate&amp;quot;, 3, Math.random(), &amp;quot;sp&amp;quot;)&lt;br /&gt;
The first line adds 2 ships near each-other on the route from sun to witchpoint and puts the added ship in the array &amp;lt;code&amp;gt;ships&amp;lt;/code&amp;gt;, and the second line adds a group of 3 pirates at a random position along the sun to planet route and returns the array &amp;lt;code&amp;gt;pirates&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' this method will fail and return &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if either of the route end points doesn’t exist. No valid routes exist in interstellar space.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroupToRoute|addGroupToRoute()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addVisualEffect&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''addVisualEffect'''(effectKey : String, position: {{oojsvecexpr}}) : VisualEffect&lt;br /&gt;
Adds a new visual effect with the effectKey in effectdata to the system, at the specified position, and returns the added effect. If the effectKey does not exist, or creation was otherwise impossible, this method will fail and return &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that unlike the functions for adding ships, &amp;lt;code&amp;gt;addVisualEffect&amp;lt;/code&amp;gt; returns a single entity, not an array.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countEntitiesWithScanClass&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countEntitiesWithScanClass'''(scanClass : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified ScanClass in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countShipsWithPrimaryRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countShipsWithPrimaryRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified primary role in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countShipsWithRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countShipsWithRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified role in the system. Counts not only the primary role the ship is added with but all roles a ship can have.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;entitiesWithScanClass&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''entitiesWithScanClass'''(scanClass : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose scan class is &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;filteredEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''filteredEntities'''(this : Object, predicate : Function [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities for which &amp;lt;code&amp;gt;predicate&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 this.findIdlePoliceInScannerRange = function()&lt;br /&gt;
 {&lt;br /&gt;
     function $isIdlePolice(entity)&lt;br /&gt;
     {&lt;br /&gt;
         return entity.isShip &amp;amp;&amp;amp; entity.isPolice &amp;amp;&amp;amp; !entity.target&lt;br /&gt;
     }&lt;br /&gt;
   &lt;br /&gt;
     return system.filteredEntities(this, $isIdlePolice, player.ship, 25600);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;legacy_addShips etc.&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''legacy_addShips'''(role : String, count : Number)&lt;br /&gt;
 function '''legacy_addSystemShips'''(role : String, count : Number, position : Number)&lt;br /&gt;
 function '''legacy_addShipsAt'''(role : String, count : Number, coordscheme : String, where : {{oojsvecexpr}})&lt;br /&gt;
 function '''legacy_addShipsAtPrecisely'''(role : String, count : Number, coordscheme : String, where : {{oojsclass|Planet}})&lt;br /&gt;
 function '''legacy_addShipsWithinRadius'''(role : String, count : Number, coordScheme : String, where : {{oojsclass|Planet}}, radius : Number)&lt;br /&gt;
 function '''legacy_spawnShip'''(shipDataKey : String)&lt;br /&gt;
Various ways of causing ships to appear. Each of these corresponds to a legacy scripting method. For more info about the &amp;lt;code&amp;gt;coordScheme&amp;lt;/code&amp;gt;, look at [[Oolite coordinate systems]]. These methods are kept for backwards-compatibility; for new development, &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt; is preferred.&lt;br /&gt;
&lt;br /&gt;
'''Important:''' &amp;lt;code&amp;gt;legacy_spawn&amp;lt;/code&amp;gt;, previously listed here, never worked as intended and has been replaced with &amp;lt;code&amp;gt;Ship.[[Oolite JavaScript Reference: Ship#spawn|spawn]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scrambledPseudoRandomNumber&amp;lt;/code&amp;gt;===&lt;br /&gt;
 function '''scrambledPseudoRandomNumber'''(salt : Number (integer)) : Number&lt;br /&gt;
Returns a number that’s greater than or equal to zero and less than one. It will always return the same value for a given &amp;lt;code&amp;gt;salt&amp;lt;/code&amp;gt; value and system. Crucially, the relationship between systems and numbers is effectively completely different for each salt value, so scripts making similar decisions based on &amp;lt;code&amp;gt;scrambledPseudoRandomNumber()&amp;lt;/code&amp;gt; but using different salts will get uncorrelated results. For example, if two different OXPs add a certain type of station to 25% of systems using &amp;lt;code&amp;gt;if (system.pseudoRandomNumber &amp;lt; 0.25)&amp;lt;/code&amp;gt;, the two station types will always be found in the same system; using &amp;lt;code&amp;gt;scrambledPseudoRandomNumber()&amp;lt;/code&amp;gt; with different salts avoids this.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sendAllShipsAway&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''sendAllShipsAway'''()&lt;br /&gt;
Makes all ships hyperspace out of the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipsWithPrimaryRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''shipsWithPrimaryRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose [[Oolite JavaScript Reference: Ship#primaryRole|primary role]] is &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipsWithRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''shipsWithRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose [[Oolite JavaScript Reference: Ship#roles|role set]] contains &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Static Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;infoForSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''infoForSystem'''(galaxyNumber: Integer, systemID : Integer) (write-only)&lt;br /&gt;
Overwrites existing info of the given system. As properties it uses the [[planetinfo.plist]] keys. e.g.&lt;br /&gt;
 System.infoForSystem(0, 55).description = &amp;quot;This is a dull planet.&amp;quot;&lt;br /&gt;
sets the description of planet nr 55 in galaxy 0 to &amp;quot;This is a dull planet.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Starting from Oolite 1.73, all system Info for the present galaxy is also readable. Even though any galaxy system info property is fully settable, due to engine limitations other galaxies' data is not accessible. In other words&lt;br /&gt;
 System.infoForSystem(0, 55).description&lt;br /&gt;
would return &amp;quot;This is a dull planet.&amp;quot; if called from galaxy 0, and throw an exception if called from the other galaxies.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;systemIDForName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''systemIDForName'''(systemName : String) : Integer&lt;br /&gt;
Returns the ID number of a system in the current galaxy based on the system name.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' in galaxy 8, there are two systems named “Inzaan”. &amp;lt;code&amp;gt;systemIDForName()&amp;lt;/code&amp;gt; will return the lower ID, which is 22.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;systemNameForID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''systemNameForID'''(systemID : Integer) : String&lt;br /&gt;
Returns the name of a system in the current galaxy based on the given ID number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=34321</id>
		<title>Oolite JavaScript Reference: System</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=34321"/>
		<updated>2012-10-08T17:41:23Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* legacy_addShips etc. */ Formatting error.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;System&amp;lt;/code&amp;gt;''' class represents the current system. There is always one &amp;lt;code&amp;gt;System&amp;lt;/code&amp;gt; object, available through the global property &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Attempts to change system properties are ignored in interstellar space (i.e., the place you end up in after a witchspace malfunction).&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;allShips&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''allShips''' : Array (read-only)&lt;br /&gt;
A list of the ships in the system.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;allVisualEffects&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''allVisualEffects''' : Array (read-only)&lt;br /&gt;
A list of the [[Oolite_JavaScript_Reference:_VisualEffect|visual effects]] in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;breakPattern&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''breakPattern''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (the default state set on entry to a new system), the break pattern will be shown to the player as they exit witchspace. While this property may be set from places other than the &amp;lt;code&amp;gt;shipWillExitWitchspace&amp;lt;/code&amp;gt; world script event, it is pointless to do so.&lt;br /&gt;
&lt;br /&gt;
Unlike all other system properties, this one may be changed on entry to interstellar space.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''description''' : String (read/write)&lt;br /&gt;
The description of the current system, as seen on the planet info screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;economy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''economy''' : Number (integer, read/write)&lt;br /&gt;
The type of economy in the current system, ranging from 0 (Rich Industrial) to 7 (Poor Agricultural).&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#economyDescription|economyDescription]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;economyDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''economyDescription''' : String (read-only)&lt;br /&gt;
A localized description of the economy type, for example, “Mostly Industrial”. Since this string is localized, it should only be used for display purposes.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#economy|economy]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;government&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''government''' : Number (read/write, integer)&lt;br /&gt;
The type of government in the current system, ranging from 0 (Anarchy) to 7 (Corporate State).&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#governmentDescription|governmentDescription]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;governmentDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''governmentDescription''' : String (read-only)&lt;br /&gt;
A localized description of the government type, for example, “Democracy”. Since this string is localized, it should only be used for display purposes.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#government|government]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 ID : Number (integer, read-only)&lt;br /&gt;
A number identifying the system. 0 to 255, or -1 for interstellar space.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''info''' : [[Oolite JavaScript Reference: SystemInfo|SystemInfo]] (read/write)&lt;br /&gt;
Allows access to system properties, using the same keys as [[planetinfo.plist]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 system.info.description = &amp;quot;This is a dull planet.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;inhabitantsDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''inhabitantsDescription''' : String (read/write)&lt;br /&gt;
The description of the inhabitants of the current system, such as “Slimy Blue Frogs”.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isInterstellarSpace&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isInterstellarSpace''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the current system is in interstellar space, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mainPlanet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mainPlanet''' : {{oojsclass|Planet}} (read-only)&lt;br /&gt;
The system’s main planet, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mainStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mainStation''' : [[Oolite JavaScript Reference: Station|Station]] (read-only)&lt;br /&gt;
The system’s main station, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read/write)&lt;br /&gt;
The name of the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;planets&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''planets''' : Array (read-only)&lt;br /&gt;
A list of the planets in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;population&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''population''' : Number (integer, read/write)&lt;br /&gt;
The population of the current system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;productivity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''productivity''' : Number (integer, read/write)&lt;br /&gt;
The productivity of the current system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandom100&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandom100''' : Number (integer, read-only)&lt;br /&gt;
A random number between 0 and 99 that is always the same for a given system. '''Important:''' this method has the undesirable side effect of resetting the system random number generator. It should only be used for backwards-compatibility. For new development, use &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[[#pseudoRandomNumber|pseudoRandomNumber]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandom256&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandom256''' : Number (integer, read-only)&lt;br /&gt;
A random number between 0 and 255 that is always the same for a given system. '''Important:''' this method has the undesirable side effect of resetting the system random number generator. It should only be used for backwards-compatibility. For new development, use &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[[#pseudoRandomNumber|pseudoRandomNumber]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandomNumber&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandomNumber''' : Number (read-only)&lt;br /&gt;
A random number between 0 and 1 that is always the same for a given system. In general, you should avoid using this number directly and call &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sun&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''sun''' : [[Oolite JavaScript Reference: Sun|Sun]] (read-only)&lt;br /&gt;
The system’s sun, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;techLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''techLevel''' : Number (integer, read/write)&lt;br /&gt;
The technology level of the current system, ranging from 0 to 15.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addGroup&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addGroup'''(role : String, count : Number [, position: {{oojsvecexpr}}] [, radius: Number]) : {{oojsclass|ShipGroup}}&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;, but puts the ships in a group and returns the group.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroupToRoute|addGroupToRoute()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addGroupToRoute&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addGroupToRoute'''(role : String, count : Number [, fraction: Number] [, route: String]) : {{oojsclass|ShipGroup}}&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;, but puts the ships in a group and returns the group.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroup|addGroup()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMoon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMoon'''(planetInfoKey : String) : {{oojsclass|Planet}}&lt;br /&gt;
Adds a moon to the system, using the specified entry in ''[[planetinfo.plist]]''. A moon is the same as a planet, except that it has no atmosphere.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addPlanet|addPlanet()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addPlanet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addPlanet'''(planetInfoKey : String) : {{oojsclass|Planet}}&lt;br /&gt;
Adds a planet to the system, using the specified entry in ''[[planetinfo.plist]]''.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addMoon|addMoon()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addShips&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addShips'''(role : String, count : Number [, position: {{oojsvecexpr}}] [, radius: Number]) : Array&lt;br /&gt;
Adds ships to the system and returns the added ships in an array. Position is in absolute coordinates. When no position is given, the witchpoint is assumed. When no radius is given, the maximum scanner range is used. Ships added in range of the witchpoint automatically create a witchpoint entry cloud.&lt;br /&gt;
&lt;br /&gt;
When you want to use coordinates from the legacy &amp;quot;pwp&amp;quot; system you can use the function [[Oolite_JavaScript_Reference:_Vector3D#fromCoordinateSystem|fromCoordinateSystem]] to convert legacy type coordinates to absolute coordinates.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroup|addGroup()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addShipsToRoute&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addShipsToRoute'''(role : String, count : Number [, fraction: Number] [, route: String]) : Array&lt;br /&gt;
Adds ships to the system on certain common routes and returns the added ships as an array. The routes are the two character codes &amp;lt;code&amp;gt;wp&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pw&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ws&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sw&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sp&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;ps&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt; stands for the witchpoint, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; for the planet and &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for the sun.&lt;br /&gt;
&lt;br /&gt;
When no route is defined, the route witchpoint → main station is assumed.&lt;br /&gt;
&lt;br /&gt;
The position is a fraction of the route and must be between 0 and 1. Unlike the legacy commands the fraction takes planetary radii in account, so it does not start counting in the centre of sun/planet but from its surface. When no fraction is defined, a random fraction is chosen. Ships are added within scanner range of this position. Ships added in range of the witchpoint automatically create a witchpoint entry cloud.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 var ships = system.addShipsToRoute(&amp;quot;myShips&amp;quot;, 2, 0.7, &amp;quot;sw&amp;quot;)&lt;br /&gt;
 var pirates = system.addShipsToRoute(&amp;quot;pirate&amp;quot;, 3, Math.random(), &amp;quot;sp&amp;quot;)&lt;br /&gt;
The first line adds 2 ships near each-other on the route from sun to witchpoint and puts the added ship in the array &amp;lt;code&amp;gt;ships&amp;lt;/code&amp;gt;, and the second line adds a group of 3 pirates at a random position along the sun to planet route and returns the array &amp;lt;code&amp;gt;pirates&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' this method will fail and return &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if either of the route end points doesn’t exist. No valid routes exist in interstellar space.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroupToRoute|addGroupToRoute()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addVisualEffect&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''addVisualEffect'''(effectKey : String, position: {{oojsvecexpr}}) : VisualEffect&lt;br /&gt;
Adds a new visual effect with the effectKey in effectdata to the system, at the specified position, and returns the added effect. If the effectKey does not exist, or creation was otherwise impossible, this method will fail and return &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that unlike the functions for adding ships, &amp;lt;code&amp;gt;addVisualEffect&amp;lt;/code&amp;gt; returns a single entity, not an array.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countEntitiesWithScanClass&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countEntitiesWithScanClass'''(scanClass : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified ScanClass in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countShipsWithPrimaryRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countShipsWithPrimaryRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified primary role in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countShipsWithRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countShipsWithRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified role in the system. Counts not only the primary role the ship is added with but all roles a ship can have.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;entitiesWithScanClass&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''entitiesWithScanClass'''(scanClass : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose scan class is &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;filteredEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''filteredEntities'''(this : Object, predicate : Function [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities for which &amp;lt;code&amp;gt;predicate&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 this.findIdlePoliceInScannerRange = function()&lt;br /&gt;
 {&lt;br /&gt;
     function $isIdlePolice(entity)&lt;br /&gt;
     {&lt;br /&gt;
         return entity.isShip &amp;amp;&amp;amp; entity.isPolice &amp;amp;&amp;amp; !entity.target&lt;br /&gt;
     }&lt;br /&gt;
   &lt;br /&gt;
     return system.filteredEntities(this, $isIdlePolice, player.ship, 25600);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;legacy_addShips etc.&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''legacy_addShips'''(role : String, count : Number)&lt;br /&gt;
 function '''legacy_addSystemShips'''(role : String, count : Number, position : Number)&lt;br /&gt;
 function '''legacy_addShipsAt'''(role : String, count : Number, coordscheme : String, where : {{oojsvecexpr}})&lt;br /&gt;
 function '''legacy_addShipsAtPrecisely'''(role : String, count : Number, coordscheme : String, where : {{oojsclass|Planet}})&lt;br /&gt;
 function '''legacy_addShipsWithinRadius'''(role : String, count : Number, coordScheme : String, where : {{oojsclass|Planet}}, radius : Number)&lt;br /&gt;
 function '''legacy_spawnShip'''(shipDataKey : String)&lt;br /&gt;
Various ways of causing ships to appear. Each of these corresponds to a legacy scripting method. For more info about the &amp;lt;code&amp;gt;coordScheme&amp;lt;/code&amp;gt;, look at [[Oolite coordinate systems]]. These methods are kept for backwards-compatibility; for new development, &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code is preferred.&lt;br /&gt;
&lt;br /&gt;
'''Important:''' &amp;lt;code&amp;gt;legacy_spawn&amp;lt;/code&amp;gt;, previously listed here, never worked as intended and has been replaced with &amp;lt;code&amp;gt;Ship.[[Oolite JavaScript Reference: Ship#spawn|spawn]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scrambledPseudoRandomNumber&amp;lt;/code&amp;gt;===&lt;br /&gt;
 function '''scrambledPseudoRandomNumber'''(salt : Number (integer)) : Number&lt;br /&gt;
Returns a number that’s greater than or equal to zero and less than one. It will always return the same value for a given &amp;lt;code&amp;gt;salt&amp;lt;/code&amp;gt; value and system. Crucially, the relationship between systems and numbers is effectively completely different for each salt value, so scripts making similar decisions based on &amp;lt;code&amp;gt;scrambledPseudoRandomNumber()&amp;lt;/code&amp;gt; but using different salts will get uncorrelated results. For example, if two different OXPs add a certain type of station to 25% of systems using &amp;lt;code&amp;gt;if (system.pseudoRandomNumber &amp;lt; 0.25)&amp;lt;/code&amp;gt;, the two station types will always be found in the same system; using &amp;lt;code&amp;gt;scrambledPseudoRandomNumber()&amp;lt;/code&amp;gt; with different salts avoids this.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sendAllShipsAway&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''sendAllShipsAway'''()&lt;br /&gt;
Makes all ships hyperspace out of the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipsWithPrimaryRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''shipsWithPrimaryRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose [[Oolite JavaScript Reference: Ship#primaryRole|primary role]] is &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipsWithRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''shipsWithRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose [[Oolite JavaScript Reference: Ship#roles|role set]] contains &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Static Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;infoForSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''infoForSystem'''(galaxyNumber: Integer, systemID : Integer) (write-only)&lt;br /&gt;
Overwrites existing info of the given system. As properties it uses the [[planetinfo.plist]] keys. e.g.&lt;br /&gt;
 System.infoForSystem(0, 55).description = &amp;quot;This is a dull planet.&amp;quot;&lt;br /&gt;
sets the description of planet nr 55 in galaxy 0 to &amp;quot;This is a dull planet.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Starting from Oolite 1.73, all system Info for the present galaxy is also readable. Even though any galaxy system info property is fully settable, due to engine limitations other galaxies' data is not accessible. In other words&lt;br /&gt;
 System.infoForSystem(0, 55).description&lt;br /&gt;
would return &amp;quot;This is a dull planet.&amp;quot; if called from galaxy 0, and throw an exception if called from the other galaxies.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;systemIDForName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''systemIDForName'''(systemName : String) : Integer&lt;br /&gt;
Returns the ID number of a system in the current galaxy based on the system name.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' in galaxy 8, there are two systems named “Inzaan”. &amp;lt;code&amp;gt;systemIDForName()&amp;lt;/code&amp;gt; will return the lower ID, which is 22.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;systemNameForID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''systemNameForID'''(systemID : Integer) : String&lt;br /&gt;
Returns the name of a system in the current galaxy based on the given ID number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_World_script_event_handlers&amp;diff=34320</id>
		<title>Oolite JavaScript Reference: World script event handlers</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_World_script_event_handlers&amp;diff=34320"/>
		<updated>2012-10-08T16:50:22Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Defunct */ Removed reference to reset() (which disappeared in test release 1.74) and marked tickle() as removed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides an exhaustive list of event handlers which can be implemented inside world scripts [[Scripting Oolite with JavaScript|JavaScript scripts for Oolite]].&lt;br /&gt;
&lt;br /&gt;
Most event handlers can be used both in world scripts and in ship scripts. Generally speaking, handlers starting with &amp;quot;ship&amp;quot; can be used for both scripts and those starting with &amp;quot;player&amp;quot; are meant only for the player (= can only be used in a world script). Exceptions on this rule are mentioned with the individual handlers below. &lt;br /&gt;
&lt;br /&gt;
World scripts can be either found inside Config\script.js, or be distinctly named .js files inside the Scripts directory - in the latter case, the worldScript.plist will list the active world scripts.&lt;br /&gt;
&lt;br /&gt;
World scripts are always active.&lt;br /&gt;
&lt;br /&gt;
The list of event handlers will change from version to version (usually additions of extra handlers). For this reason, any variables or functions you create as &amp;lt;code&amp;gt;this.variable&amp;lt;/code&amp;gt; should have a name beginning with '_' or '$' - e.g. &amp;lt;code&amp;gt;this._variable&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;this.$variable&amp;lt;/code&amp;gt; - to avoid potential conflicts with future event handlers.&lt;br /&gt;
&lt;br /&gt;
=== Game State ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;startUp&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;startUp&amp;lt;/code&amp;gt; handler is called after all OXPs have been loaded. It can be used to do one-off initialisation such as registering to listen for certain keystrokes etc. note that keystroke listening is not implemented. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.startUp = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerWillSaveGame&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerWillSaveGame&amp;lt;/code&amp;gt; handler is called whenever the player saves a game. The transferred message is one of the following strings: 'standardSave', 'autoSave' or 'quickSave'&lt;br /&gt;
&lt;br /&gt;
 this.playerWillSaveGame = function(message : String)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Using this event is useful for storing temporary variables in missionVariables, just before the game gets saved. missionVariables are slow in use compared to normal JS variables, therefor their use should be minimised for efficient code. The main benefit of using missionVariables is that they are saved in a saved game.&lt;br /&gt;
&lt;br /&gt;
=== Docking ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillDockWithStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillDockWithStation&amp;lt;/code&amp;gt; handler is called at the beginning of the docking tunnel effect.&lt;br /&gt;
&lt;br /&gt;
 this.shipWillDockWithStation = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
At this moment &amp;quot;ship.dockedStation == null&amp;quot;, &amp;quot;ship.docked == true&amp;quot;, &amp;quot;ship.status == STATUS_DOCKING&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipDockedWithStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipDockedWithStation&amp;lt;/code&amp;gt; handler is called at the end of the docking tunnel effect.&lt;br /&gt;
&lt;br /&gt;
 this.shipDockedWithStation = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
At this moment &amp;quot;ship.dockedStation == the station&amp;quot;, &amp;quot;ship.docked == true&amp;quot;, &amp;quot;ship.status == STATUS_DOCKED&amp;quot; and &amp;quot;gui_screen&amp;quot; is either GUI_SCREEN_STATUS or GUI_SCREEN_REPORT. However, any identical handler from an other oxp could have changed those values. Never count on it but double check when important.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillLaunchFromStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillLaunchFromStation&amp;lt;/code&amp;gt; handler is called at the beginning of the launch tunnel effect.&lt;br /&gt;
&lt;br /&gt;
 this.shipWillLaunchFromStation = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
At this moment &amp;quot;ship.dockedStation == the station&amp;quot;, &amp;quot;ship.docked == false&amp;quot;, &amp;quot;ship.status == STATUS_LAUNCHING&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipLaunchedFromStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipLaunchedFromStation&amp;lt;/code&amp;gt; handler is called at the end of the launch tunnel effect.&lt;br /&gt;
&lt;br /&gt;
 this.shipLaunchedFromStation = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
At this moment &amp;quot;ship.dockedStation == null&amp;quot;, &amp;quot;ship.docked == false&amp;quot;, &amp;quot;ship.status == STATUS_IN_FLIGHT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerStartedAutoPilot&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerStartedAutoPilot&amp;lt;/code&amp;gt; handler is called when the player starts autopilot docking. It is not called for the instantaneous dock command.&lt;br /&gt;
&lt;br /&gt;
 this.playerStartedAutoPilot = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerCancelledAutoPilot&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerCancelledAutoPilot&amp;lt;/code&amp;gt; handler is called when the player cancels autopilot docking.&lt;br /&gt;
&lt;br /&gt;
 this.playerCancelledAutoPilot = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerDockingRefused&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerDockingRefused&amp;lt;/code&amp;gt; handler is called when a station refuses to provide autopilot docking instructions.&lt;br /&gt;
&lt;br /&gt;
 this.playerDockingRefused = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerRequestedDockingClearance&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerRequestedDockingClearance&amp;lt;/code&amp;gt; handler is called when a station answers on a docking request of the player by targeting the station and pressing L (shift-l).&lt;br /&gt;
&lt;br /&gt;
 this.playerRequestedDockingClearance = function(message)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Message is a string and can take the values: &amp;quot;DOCKING_CLEARANCE_GRANTED&amp;quot;, &amp;quot;DOCKING_CLEARANCE_DENIED_TRAFFIC_OUTBOUND&amp;quot;, &amp;quot;DOCKING_CLEARANCE_DENIED_TRAFFIC_INBOUND&amp;quot;,  &amp;quot;DOCKING_CLEARANCE_DENIED_SHIP_FUGITIVE&amp;quot;, &amp;quot;DOCKING_CLEARANCE_NOT_REQUIRED&amp;quot;, &amp;quot;DOCKING_CLEARANCE_EXTENDED&amp;quot; or &amp;quot;DOCKING_CLEARANCE_CANCELLED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Witchspace Jumps ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerStartedJumpCountdown&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerStartedJumpCountdown&amp;lt;/code&amp;gt; handler is called when the user starts a witchspace or galactic witchspace jump countdown. The &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; parameter is a string specifying which type of jump is occuring; currently, the possible values are “standard” and “galactic”. Other values may be added in future. The &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; parameter is a number specifying the number of seconds the countdown is running for.&lt;br /&gt;
&lt;br /&gt;
 this.playerStartedJumpCountdown = function(type, seconds)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerCancelledJumpCountdown&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerCancelledJumpCountdown&amp;lt;/code&amp;gt; handler is called when the user cancels a witchspace or galactic witchspace jump countdown.&lt;br /&gt;
&lt;br /&gt;
 this.playerCancelledJumpCountdown = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerJumpFailed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerJumpFailed&amp;lt;/code&amp;gt; handler is called at the end of a witchspace or galactic witchspace countdown, if the jump is not possible. The &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt; parameter is a string specifying why the jump failed. The current values are:&lt;br /&gt;
* '''&amp;quot;insufficient fuel&amp;quot;''' - the ship no longer has enough fuel to make the jump (e.g. injector use or fuel leak).&lt;br /&gt;
* '''&amp;quot;blocked&amp;quot;''' - a heavy ship is near the player (specifically &amp;lt;code&amp;gt;object mass&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;object distance&amp;lt;/code&amp;gt;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; &amp;gt;= 10.0, and &amp;lt;code&amp;gt;object distance&amp;lt;/code&amp;gt; &amp;lt;= scanner range).&lt;br /&gt;
* '''&amp;quot;malfunction&amp;quot;''' - the jump malfunctioned in a way that leaves the player ship in the current system.&lt;br /&gt;
* '''&amp;quot;malfunction&amp;quot;''' - the Galactic Hyperdrive is damaged or removed during a galactic jump countdown.&lt;br /&gt;
&lt;br /&gt;
Also theoretically possible but unlikely in current Oolite:&lt;br /&gt;
* '''&amp;quot;too far&amp;quot;''' - the jump destination is outside the 7LY range (but wasn't when the countdown started).&lt;br /&gt;
* '''&amp;quot;no target&amp;quot;''' - the jump destination is the current location (but wasn't when the countdown started).&lt;br /&gt;
&lt;br /&gt;
 this.playerJumpFailed = function(reason)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillEnterWitchspace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillEnterWitchspace&amp;lt;/code&amp;gt; handler is called immediately before a witchspace jump, while the player is still in the starting system. The &amp;lt;code&amp;gt;cause&amp;lt;/code&amp;gt; parameter is a string specifying what sort of jump is occuring; currently, the possible values are “standard jump”, “galactic jump” and “wormhole”. Other values may be added in future.&lt;br /&gt;
&lt;br /&gt;
 this.shipWillEnterWitchspace = function(cause)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillExitWitchspace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillExitWitchspace&amp;lt;/code&amp;gt; handler is called as a witchspace jump concludes. When it is called, the player is (from a program perspective) in the destination system, but the tunnel effect has not yet been shown. Use this event to set up elements which need to be present in-system after the player exits witchspace.&lt;br /&gt;
&lt;br /&gt;
 this.shipWillExitWitchspace = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipExitedWitchspace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipExitedWitchspace&amp;lt;/code&amp;gt; handler is called after a witchspace jump has concluded and the tunnel effect has been shown.&lt;br /&gt;
&lt;br /&gt;
 this.shipExitedWitchspace = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerEnteredNewGalaxy&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerEnteredNewGalaxy&amp;lt;/code&amp;gt; handler is called just before shipWillExitWitchspace.&lt;br /&gt;
&lt;br /&gt;
the sequence of events for a player jumping to a different galaxy is as follows:&lt;br /&gt;
&lt;br /&gt;
shipWillEnterWitchspace (world event)&amp;lt;br&amp;gt;&lt;br /&gt;
playerWillEnterWitchspace (NPC ship event)&amp;lt;br&amp;gt;&lt;br /&gt;
playerEnteredNewGalaxy (world event)&amp;lt;br&amp;gt;&lt;br /&gt;
shipWillExitWitchspace (world event)&amp;lt;br&amp;gt;&lt;br /&gt;
shipExitedWitchspace (world event)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 this.playerEnteredNewGalaxy = function(galaxyNumber)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Enter/Exit Aegis ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipEnteredStationAegis&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipEnteredStationAegis&amp;lt;/code&amp;gt; handler is called when the player enters the aegis of the main-station (2x scanner range from main-station). Other stations than the main-station don't give aegis messages.&lt;br /&gt;
&lt;br /&gt;
 this.shipEnteredStationAegis = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipExitedStationAegis&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipExitedStationAegis&amp;lt;/code&amp;gt; handler is called when the player leaves the aegis of the main-station (2x scanner range from main-station).&lt;br /&gt;
&lt;br /&gt;
 this.shipExitedStationAegis = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipEnteredPlanetaryVicinity&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipEnteredPlanetaryVicinity&amp;lt;/code&amp;gt; handler is called when the player enters the planet aegis (3x planet radius).&lt;br /&gt;
&lt;br /&gt;
 this.shipEnteredPlanetaryVicinity = function(planet)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipExitedPlanetaryVicinity&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipExitedPlanetaryVicinity&amp;lt;/code&amp;gt; handler is called when the player leaves the planet aegis (3x planet radius).&lt;br /&gt;
&lt;br /&gt;
 this.shipExitedPlanetaryVicinity = function(planet)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipApproachingPlanetSurface&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipApproachingPlanetSurface&amp;lt;/code&amp;gt; handler is called when the player is very close to the planet (crosses a border ± 500 meter above the surface).&lt;br /&gt;
&lt;br /&gt;
 this.shipApproachingPlanetSurface = function(planet)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipLeavingPlanetSurface&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipLeavingPlanetSurface&amp;lt;/code&amp;gt; handler is called when the player leaves the planet (crosses a border ± 500 meter above the surface).&lt;br /&gt;
&lt;br /&gt;
 this.shipLeavingPlanetSurface = function(planet)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Combat ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;alertConditionChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;alertConditionChanged&amp;lt;/code&amp;gt; handler is called when the player’s alert status (&amp;lt;code&amp;gt;[[Oolite_JavaScript_Reference:_Player#alertCondition|player.alertCondition]]&amp;lt;/code&amp;gt;) changes. Only the player and stations have an alert condition. (world script and station scripts)&lt;br /&gt;
&lt;br /&gt;
 this.alertConditionChanged = function(newCondition, oldCondition)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerTargetedMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerTargetedMissile&amp;lt;/code&amp;gt; handler is called when the player targets the nearest missile by pressing T (shift-t) on the keybord.&lt;br /&gt;
&lt;br /&gt;
 this.playerTargetedMissile = function(missile)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipAttackedOther&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipAttackedOther&amp;lt;/code&amp;gt; handler is called when the player hits another with a laser shot. &amp;lt;code&amp;gt;other&amp;lt;/code&amp;gt; is the identity of the ship being hit.&lt;br /&gt;
&lt;br /&gt;
 this.shipAttackedOther = function(other)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipAttackedWithMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipAttackedWithMissile&amp;lt;/code&amp;gt; handler is called when a missile is fired. &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt; contains the missile entity and &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt; the identity of the ship that launched the missile.&lt;br /&gt;
&lt;br /&gt;
 this.shipAttackedWithMissile = function(missile, whom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipBeingAttacked&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipBeingAttacked&amp;lt;/code&amp;gt; handler is called when a laser shot  hits. &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt; the identity of the ship that attacked.&lt;br /&gt;
&lt;br /&gt;
 this.shipBeingAttacked = function(whom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipBeingAttackedByCloaked&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipBeingAttackedByCloaked&amp;lt;/code&amp;gt; handler is called when a laser shot from a cloaked ship hits. Guess what, there is no parameter because he is cloaked!&lt;br /&gt;
&lt;br /&gt;
 this.shipBeingAttackedByCloaked = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipKilledOther&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipKilledOther&amp;lt;/code&amp;gt; handler is called when a ship kills an other ship. &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt; the identity of the ship that was killed. &amp;lt;code&amp;gt;damageType&amp;lt;/code&amp;gt; is the type of damage. (Handler added in test version 1.75) &lt;br /&gt;
&lt;br /&gt;
 this.shipKilledOther = function(whom,damageType)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipTargetDestroyed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipTargetDestroyed&amp;lt;/code&amp;gt; handler is called when the target gets destroyed. &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; contains the destroyed target entity. This command is always preceded by the &amp;lt;code&amp;gt;shipTargetLost&amp;lt;/code&amp;gt; handler.&lt;br /&gt;
&lt;br /&gt;
 this.shipTargetDestroyed = function(target)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipDied&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipDied&amp;lt;/code&amp;gt; handler is called when the ship or player dies. Expect a &amp;lt;code&amp;gt;reset()&amp;lt;/code&amp;gt; shortly when it is the player ship.&lt;br /&gt;
&lt;br /&gt;
 this.shipDied = function(whom, why)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
'''whom''' contains the entity that caused the kill. '''why''' is the cause written as string and is one of: &amp;quot;removed&amp;quot;, &amp;quot;hit a planet&amp;quot;, &amp;quot;energy damage&amp;quot;, &amp;quot;scrape damage&amp;quot;, &amp;quot;heat damage&amp;quot;, &amp;quot;cascade weapon&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
(&amp;quot;cascade weapon&amp;quot; is new in 1.74 and  &amp;quot;removed&amp;quot; / &amp;quot;energy damage&amp;quot; were accidentally switched in 1.73)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipFiredMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipFiredMissile&amp;lt;/code&amp;gt; handler is called when a missile is fired. &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt; contains the missile entity and &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; the identity of the target. The handler is send to the ship that launched the missile.&lt;br /&gt;
&lt;br /&gt;
 this.shipFiredMissile = function(missile, target)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipTargetLost&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipTargetLost&amp;lt;/code&amp;gt; handler is called when the target gets lost. &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; contains the lost target entity.&lt;br /&gt;
&lt;br /&gt;
 this.shipTargetLost = function(target)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipTargetCloaked&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipTargetCloaked&amp;lt;/code&amp;gt; handler is called when the target cloakes.&lt;br /&gt;
&lt;br /&gt;
 this.shipTargetCloaked = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Equipment and Cargo ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentDestroyed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentDestroyed&amp;lt;/code&amp;gt; handler is called when equipment gets destroyed completely beyond repair. (in strict mode)  (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.equipmentDestroyed = function(equipment)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentDamaged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentDamaged&amp;lt;/code&amp;gt; handler is called when equipment gets damaged. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.equipmentDamaged = function(equipment)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentRepaired&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentRepaired&amp;lt;/code&amp;gt; handler is called when equipment gets repaired. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.equipmentRepaired = function(equipment)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerBoughtCargo&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerBoughtCargo&amp;lt;/code&amp;gt; handler is called when cargo is bought at the market screen. &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; contains the non-localised name for the cargo. You can get the localised name using &amp;lt;code&amp;gt;expandDescription(&amp;quot;[commodity-name &amp;quot;+commodity+&amp;quot;]&amp;quot;);&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; is price per unit in tenths of a credit.&lt;br /&gt;
&lt;br /&gt;
 this.playerBoughtCargo = function(commodity, units, price)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerBoughtEquipment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerBoughtEquipment&amp;lt;/code&amp;gt; handler is called when equipment is bought at the outfit screen.&lt;br /&gt;
&lt;br /&gt;
 this.playerBoughtEquipment = function(equipment)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerBoughtNewShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerBoughtNewShip&amp;lt;/code&amp;gt; handler is called when a new ship is bought. May be needed to re-evaluate the old equipment as buying a new ship does not trigger equipment removal.&lt;br /&gt;
&lt;br /&gt;
 this.playerBoughtNewShip = function(ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerSoldCargo&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerSoldCargo&amp;lt;/code&amp;gt; handler is called when cargo is sold at the market screen. &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; contains the non-localised name for the cargo. You can get the localised name using &amp;lt;code&amp;gt;expandDescription(&amp;quot;[commodity-name &amp;quot;+commodity+&amp;quot;]&amp;quot;);&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; is price per unit in tenths of a credit.&lt;br /&gt;
&lt;br /&gt;
 this.playerSoldCargo = function(commodity, units, price)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipScoopedFuel&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipScoopedFuel&amp;lt;/code&amp;gt; handler is called whenever the player's ship transfers 0.1LY of fuel from the scoops to the tank.&lt;br /&gt;
&lt;br /&gt;
 this.shipScoopedFuel = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipScoopedOther&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipScoopedOther&amp;lt;/code&amp;gt; handler is called when a ship scoops cargo. The scooped item is transferred as argument.&amp;lt;br&amp;gt;If the cargo is scripted cargo, but not otherwise, then the scooped cargo itself gets the handler &amp;lt;code&amp;gt;shipWasScooped&amp;lt;/code&amp;gt; with the scooper as argument.&lt;br /&gt;
&lt;br /&gt;
 this.shipScoopedOther = function(whom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;compassTargetChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;compassTargetChanged&amp;lt;/code&amp;gt; handler is called when a new target is selected. Mode can be any of the following:&lt;br /&gt;
&lt;br /&gt;
 COMPASS_MODE_BASIC&lt;br /&gt;
 COMPASS_MODE_PLANET&lt;br /&gt;
 COMPASS_MODE_STATION&lt;br /&gt;
 COMPASS_MODE_SUN&lt;br /&gt;
 COMPASS_MODE_TARGET&lt;br /&gt;
 COMPASS_MODE_BEACONS&lt;br /&gt;
&lt;br /&gt;
script example &lt;br /&gt;
&lt;br /&gt;
 this.compassTargetChanged = function(whom, mode)&lt;br /&gt;
 {&lt;br /&gt;
      log(' Now targeting ' + whom);&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;dayChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;dayChanged&amp;lt;/code&amp;gt; handler is called each time a new day starts. At very low frame rates while the clock is updating, it is possible for this handler to be called twice in the same frame. Therefore, clock.days will not be correct for one of the calls. Use the day number passed to the function instead.&lt;br /&gt;
&lt;br /&gt;
 this.dayChanged = function(newday)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;guiScreenChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;guiScreenChanged&amp;lt;/code&amp;gt; handler is called when the guiScreen changes. &amp;quot;from&amp;quot; is the screen it is changing from and &amp;quot;to&amp;quot; is the screen were it initially switched to. Note that the screen can have changed again in the meantime by the action of other oxps. Therefor, it will generally better to test for the global &amp;lt;code&amp;gt;guiScreen&amp;lt;/code&amp;gt; to see which page is really on display instead of using the &amp;quot;to&amp;quot; parameter. (world script only)&amp;lt;br&amp;gt;&lt;br /&gt;
This handler will not fire for every screen the player can switch to, but only when switching to any of the following screens: &amp;lt;code&amp;gt;GUI_SCREEN_MAIN, GUI_SCREEN_STATUS, GUI_SCREEN_MANIFEST, GUI_SCREEN_SYSTEM_DATA, GUI_SCREEN_OPTIONS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_SHIPYARD, GUI_SCREEN_SHORT_RANGE_CHART, GUI_SCREEN_LONG_RANGE_CHART, GUI_SCREEN_MARKET, GUI_SCREEN_CONTRACTS, GUI_SCREEN_REPORT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 this.guiScreenChanged = function(to, from)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;guiScreenWillChange&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;guiScreenWillChange&amp;lt;/code&amp;gt; handler is called when the guiScreen is about to change.  It only fires for the screens: &amp;lt;code&amp;gt;GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_MANIFEST, GUI_SCREEN_MARKET, GUI_SCREEN_SHIPYARD&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;GUI_SCREEN_SYSTEM_DATA&amp;lt;/code&amp;gt;. On these screens a script could change the content of the page to be displayed. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.guiScreenWillChange = function(to, from)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;missionChoiceWasReset&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;missionChoiceWasReset&amp;lt;/code&amp;gt; handler is called when the mission choice is set to null via script (either using the legacy script method resetMissionChice, or using mission.choice = null; in javascript)&lt;br /&gt;
&lt;br /&gt;
 this.missionChoiceWasReset= function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;missionScreenEnded&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;missionScreenEnded&amp;lt;/code&amp;gt; handler is called when the missionscreen ends. Note that an other script may have put up a new missionscreen in the meantime. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.missionScreenEnded = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler is called if there are no mission / report screens active, and the player is docked to a station. It gets fired at game startup, upon docking, and after a docking report or previous mission screen has ended.  (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.missionScreenOpportunity= function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This handler works a bit different as other handlers. It fires for every installed oxp, until an oxp creates a mission screen during this handler. Than it stops. When the mission screen ends and there is no callback function that created a new mission screen, than the missionScreenOpportunity is send again to all installed oxps, starting with the oxp that used the mission screen as last one. All this means that when this handler fires, it is safe to show a mission screen and no further test are needed.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;reportScreenEnded&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;reportScreenEnded&amp;lt;/code&amp;gt; handler is called when the last arrival-report  screen ends. This is a screen that should not be written by a missionscreen. The code should wait until this eventhandler fires. Note that an other script may have put up a new missionscreen in the meantime. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.reportScreenEnded = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipCollided&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipCollided&amp;lt;/code&amp;gt; handler is send after a collision with otherShip.&lt;br /&gt;
&lt;br /&gt;
 this.shipCollided = function(otherShip)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipSpawned&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipSpawned&amp;lt;/code&amp;gt; handler is called after an NPC ship has been added to the system. After a witchspace jump it means that first all ships are added to the system, then all the relevant shipSpawned events are triggered.&amp;lt;br&amp;gt;&lt;br /&gt;
This handler for the woldScript is new since Oolite 1.74. After the event is sent to the shipScript, it is now also send to the worldScript with the added entity as argument.&lt;br /&gt;
&lt;br /&gt;
 this.shipSpawned = function(ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipLaunchedEscapePod&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipLaunchedEscapePod&amp;lt;/code&amp;gt; handler is called when the player bails out. This will be followed by a &amp;lt;code&amp;gt;shipWillDockWithStation()&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;shipDockedWithStation()&amp;lt;/code&amp;gt; pair after a few seconds.&lt;br /&gt;
&lt;br /&gt;
 this.shipLaunchedEscapePod = function(escapepod)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;viewDirectionChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;viewDirectionChanged&amp;lt;/code&amp;gt; handler is called when the player view changes, with a string to indicate which view the player is facing. Amongst its possible values are &amp;quot;VIEW_FORWARD&amp;quot;, &amp;quot;VIEW_AFT&amp;quot;, &amp;quot;VIEW_PORT&amp;quot;, &amp;quot;VIEW_STARBOARD&amp;quot;,&lt;br /&gt;
&amp;quot;VIEW_CUSTOM&amp;quot;,&lt;br /&gt;
&amp;quot;VIEW_GUI_DISPLAY&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 this.viewDirectionChanged = function(viewString)&lt;br /&gt;
 {&lt;br /&gt;
   if (viewString == &amp;quot;VIEW_PORT&amp;quot;)&lt;br /&gt;
   {&lt;br /&gt;
      // Your code here&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Defunct ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;tickle&amp;lt;/code&amp;gt; (removed in 1.77) ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;tickle&amp;lt;/code&amp;gt; handler is called periodically-ish, whenever the old [[property list|plist]] scripts are updated. &amp;lt;code&amp;gt;tickle()&amp;lt;/code&amp;gt; is deprecated. In new code, use appropriate event handlers or [[Oolite JavaScript Reference: Timer|timers]] instead.&lt;br /&gt;
&lt;br /&gt;
=== Missing Events ===&lt;br /&gt;
&lt;br /&gt;
All the initially planned events have been implemented in 1.74.&lt;br /&gt;
&lt;br /&gt;
If there are other events you would like to be able to respond to, please write a request [http://www.aegidian.org/bb/viewtopic.php?t=3296 on the forum].&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[Oolite JavaScript Reference: ship_script_event_handlers|ship_script_event_handlers]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Scripting_Oolite_with_JavaScript&amp;diff=34319</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=34319"/>
		<updated>2012-10-08T16:48:36Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Using JavaScript */ Removed reference to tickle().&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Oolite]] 1.68 and later supports scripts written in [http://en.wikipedia.org/wiki/ECMAScript ECMAScript] (more commonly known as [http://en.wikipedia.org/wiki/JavaScript JavaScript]) in addition to its traditional model based on [[property lists]]. This page provides an overview of how JavaScript is used in Oolite. The page [[Oolite JavaScript Reference: object model]] provides reference for Oolite-specific objects and methods. The page [[Oolite JavaScript Reference: world script event handlers]] provides reference for the event handlers Oolite supports. The language standards and some tutorials can be found through the Wiki links provided above.&lt;br /&gt;
&lt;br /&gt;
== Using JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Currently, JavaScript is supported for “worldScripts”, that is, as a replacement for scripts in ''script.plist'' and shipScripts, that acts as expansion for the ships AI. While a ''script.plist'' file may contain any number of separate scripts, a single JavaScript file may contain only one script.&lt;br /&gt;
&lt;br /&gt;
If your OXP only uses one script, place a JavaScript file named ''script.js'' (or ''script.es'') in the OXP’s ''Config'' directory. If you wish to use multiple scripts, you may instead create file named ''world-scripts.plist'' in the ''Config'' directory. This [[property list]] file should consist of an array of worldScript names; the named scripts should exist in a directory named ''Scripts'' inside your OXP. As with most “atomic” files (files which cannot be merged), such script files must have a unique name to avoid conflicts with other OXPs. Using the ''world-scripts.plist'' method, you can combine JavaScript, plist and OOS scripts however you wish.&lt;br /&gt;
&lt;br /&gt;
Whereas plist scripts are based on polling – all scripts are run at semi-regular intervals, whether they need to be or not – scripts written in JavaScript are “event driven” – different functions, or ''event handlers'', in the script are called in response to state changes in the game, or when other events of interest happen. For instance, &amp;lt;code&amp;gt;willExitWitchSpace&amp;lt;/code&amp;gt; is called just before player exits witchspace, and &amp;lt;code&amp;gt;alertConditionChanged&amp;lt;/code&amp;gt; is called whenever the alert condition changes. See the [[Oolite JavaScript event handler reference|event handler reference]] for a full list of handlers and when Oolite will call them.&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. '''Every script must have a unique name.''' If multiple scripts with the same name are encountered, Oolite will arbitrarily select one and discard the others.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;this.name           = &amp;quot;My OXP Script&amp;quot;&lt;br /&gt;
this.author         = &amp;quot;Your Name Here&amp;quot;&lt;br /&gt;
this.copyright      = &amp;quot;(C) 2009 Me.&amp;quot;&lt;br /&gt;
this.licence        = &amp;quot;CC-NC-by-SA 2.0&amp;quot;&lt;br /&gt;
this.description    = &amp;quot;This OXP doesn't do very much yet.&amp;quot;;&lt;br /&gt;
this.version        = &amp;quot;1.0 alpha 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;use strict&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
/*  You can copy and paste this function and just change the &amp;quot;startUp&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.startUp = function()&lt;br /&gt;
{&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;
== See Also ==&lt;br /&gt;
* [https://developer.mozilla.org/en/JavaScript/Reference Mozilla JavaScript reference pages]&lt;br /&gt;
* [[Oolite JavaScript event handler reference]]&lt;br /&gt;
* [[Oolite JavaScript object model]]&lt;br /&gt;
&amp;lt;!-- * [[JavaScript test OXP]] --&amp;gt;&lt;br /&gt;
* [[Variables in Oolite JavaScripts]]&lt;br /&gt;
* [[Javascript Operators]]&lt;br /&gt;
* [[Handling OXP Dependencies with JavaScript]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite scripting]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=34245</id>
		<title>Running Oolite-Mac</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=34245"/>
		<updated>2012-09-19T22:18:52Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Building Oolite from source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
Oolite was originally developed for OS X, and as such, OS X is Oolite's home operating system. The OS X version can be considered the reference version for all other ports. It has some specific Mac OS X only support such as speech synthesis, iTunes integration and Growl integration. Joysticks are not directly supported - however, there are programs that convert joystick inputs into mouse and keyboard inputs, and these programs are reported to work well with Oolite.&lt;br /&gt;
&lt;br /&gt;
==Getting and installing the game==&lt;br /&gt;
You can get the most recent release of the game from [http://developer.berlios.de/project/showfiles.php?group_id=3577 BerliOS].&lt;br /&gt;
&lt;br /&gt;
Installation is the standard method of dragging the Oolite folder to your Applications or Games folder.&lt;br /&gt;
&lt;br /&gt;
===Installing [[OXP]]s (add ons)===&lt;br /&gt;
In the Oolite folder that you dragged from the disk image, you will find an Oolite application and an AddOns folder. Place OXPs in the AddOns folder, and they will be loaded the next time you start the game.&lt;br /&gt;
&lt;br /&gt;
==Building Oolite from source==&lt;br /&gt;
&lt;br /&gt;
=== Development Environment (Xcode) ===&lt;br /&gt;
The supported development environment for Oolite trunk is Xcode&amp;amp;nbsp;4.5 or later under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.7.4 or 10.8. At the time of writing, Xcode 4.2–4.4 are likely to work, while earlier versions such as 3.2.6 running under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.6 or later will only work after some additional changes, and are no longer supported. Xcode&amp;amp;nbsp;4 is available for free from the [http://itunes.apple.com/us/app/xcode/id497799835?mt=12 Mac App Store].&lt;br /&gt;
&lt;br /&gt;
Earlier versions of Oolite, including the 1.76-maintenace branch, require Xcode&amp;amp;nbsp;3.2.6, even under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.7 or 10.8. For more information, see [http://wiki.alioth.net/index.php?title=Running_Oolite-Mac&amp;amp;oldid=28534#Building_Oolite_from_source this earlier version of this page].&lt;br /&gt;
&lt;br /&gt;
You will also require the Subversion version control tool; an up-to-date binary is available [http://downloads.open.collab.net/binaries.html here], or in the optional Xcode command line tools package. To download the command line tools package, select Open Developer Tool→More Developer Tools… from the '''Xcode''' menu within Xcode.&lt;br /&gt;
&lt;br /&gt;
=== Getting the source ===&lt;br /&gt;
&lt;br /&gt;
The source code and data files are available from [http://developer.berlios.de/projects/oolite-linux/ the oolite-linux BerliOS project]. Don't be confused by the name 'oolite-linux'; at one point there were three separate repositories for Oolite, but the Linux one was where they ended up being merged together. The SVN url for the current development line is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
Version 1.76 is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/tags/1.76&lt;br /&gt;
&lt;br /&gt;
The 1.76.x maintenance branch is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/branches/1.76-maintenance&lt;br /&gt;
&lt;br /&gt;
Note that the 1.76 versions require Xcode&amp;amp;nbsp;3.2.6 as mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To download the source with Subversion, the quickest way to do it is to open a Terminal window, and run the following command:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
If you have a BerliOS account and are a project member, you can get it with:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
Developers should also checkout the relevant maintenance branch:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/branches/1.76-maintenance/&lt;br /&gt;
&lt;br /&gt;
=== Building Oolite ===&lt;br /&gt;
For a trunk build, open Oolite.xcodeproj, select the ''Oolite – Debug'' or ''Oolite – Test Release'' scheme from the Scheme pop-up menu, and hit Build. Dependencies will be downloaded automatically (in the deps folder inside the Oolite repository).&lt;br /&gt;
&lt;br /&gt;
When you open the project for the first time, Xcode will generate build schemes for all the subprojects used to build Oolite. It is unlikely that you will ever need this, so it’s a good idea to hide them. Select Manage Schemes from the Product menu and uncheck the checkboxes in the Show column, except for the schemes marked Shared.&lt;br /&gt;
&lt;br /&gt;
==== Building earlier versions ====&lt;br /&gt;
For instructions on building earlier versions of Oolite, see  [http://wiki.alioth.net/index.php?title=Running_Oolite-Mac&amp;amp;oldid=28534#Building_Oolite_from_source this earlier version of this page].&lt;br /&gt;
&lt;br /&gt;
==== Build products ====&lt;br /&gt;
Building any of the shared build schemes in trunk will result in the following being created in the build results folder: ''AddOns'', ''Debug.oxp'', ''include'' (with subfolders ''js'', ''ogg'', ''png'' and ''vorbis''), ''jskwgen'', ''jsoplengen'', ''libjs_for_oolite.a'', ''libnspr4_for_oolite.a'', ''libogg_for_oolite.a'', ''libpng_for_oolite.a'', ''libvorbis_for_oolite.a'', ''Oolite.app'',  ''Oolite.docktileplugin'' and ''Oolite.mdimporter''. ''AddOns'' contains a copy of ''Debug.oxp''. Oolite.app contains a copy of ''Oolite.mdimporter'' and ''Oolite.docktileplugin'', and static libraries (.a files) are linked into the Oolite executable. Everything except ''Oolite.app'' and ''AddOns'' can be considered side effects of the build process.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]] [[Category:Factual]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_World_script_event_handlers&amp;diff=33534</id>
		<title>Oolite JavaScript Reference: World script event handlers</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_World_script_event_handlers&amp;diff=33534"/>
		<updated>2012-07-13T16:10:51Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* tickle */ Deprecated, timers now exist.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides an exhaustive list of event handlers which can be implemented inside world scripts [[Scripting Oolite with JavaScript|JavaScript scripts for Oolite]].&lt;br /&gt;
&lt;br /&gt;
Most event handlers can be used both in world scripts and in ship scripts. Generally speaking, handlers starting with &amp;quot;ship&amp;quot; can be used for both scripts and those starting with &amp;quot;player&amp;quot; are meant only for the player (= can only be used in a world script). Exceptions on this rule are mentioned with the individual handlers below. &lt;br /&gt;
&lt;br /&gt;
World scripts can be either found inside Config\script.js, or be distinctly named .js files inside the Scripts directory - in the latter case, the worldScript.plist will list the active world scripts.&lt;br /&gt;
&lt;br /&gt;
World scripts are always active.&lt;br /&gt;
&lt;br /&gt;
The list of event handlers will change from version to version (usually additions of extra handlers). For this reason, any variables or functions you create as &amp;lt;code&amp;gt;this.variable&amp;lt;/code&amp;gt; should have a name beginning with '_' or '$' - e.g. &amp;lt;code&amp;gt;this._variable&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;this.$variable&amp;lt;/code&amp;gt; - to avoid potential conflicts with future event handlers.&lt;br /&gt;
&lt;br /&gt;
=== Game State ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;startUp&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;startUp&amp;lt;/code&amp;gt; handler is called after all OXPs have been loaded. It can be used to do one-off initialisation such as registering to listen for certain keystrokes etc. note that keystroke listening is not implemented. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.startUp = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;reset (removed in 1.74)&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;reset&amp;lt;/code&amp;gt; handler is called whenever the player is respawned, such as after dying or when loading a saved game. It should be used to reset any local state in the script. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.reset = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
in 1.74 the startUp event is called in its place, eliminating the need for two separate events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerWillSaveGame&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerWillSaveGame&amp;lt;/code&amp;gt; handler is called whenever the player saves a game. The transferred message is one of the following strings: 'standardSave', 'autoSave' or 'quickSave'&lt;br /&gt;
&lt;br /&gt;
 this.playerWillSaveGame = function(message : String)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Using this event is useful for storing temporary variables in missionVariables, just before the game gets saved. missionVariables are slow in use compared to normal JS variables, therefor their use should be minimised for efficient code. The main benefit of using missionVariables is that they are saved in a saved game.&lt;br /&gt;
&lt;br /&gt;
=== Docking ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillDockWithStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillDockWithStation&amp;lt;/code&amp;gt; handler is called at the beginning of the docking tunnel effect.&lt;br /&gt;
&lt;br /&gt;
 this.shipWillDockWithStation = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
At this moment &amp;quot;ship.dockedStation == null&amp;quot;, &amp;quot;ship.docked == true&amp;quot;, &amp;quot;ship.status == STATUS_DOCKING&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipDockedWithStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipDockedWithStation&amp;lt;/code&amp;gt; handler is called at the end of the docking tunnel effect.&lt;br /&gt;
&lt;br /&gt;
 this.shipDockedWithStation = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
At this moment &amp;quot;ship.dockedStation == the station&amp;quot;, &amp;quot;ship.docked == true&amp;quot;, &amp;quot;ship.status == STATUS_DOCKED&amp;quot; and &amp;quot;gui_screen&amp;quot; is either GUI_SCREEN_STATUS or GUI_SCREEN_REPORT. However, any identical handler from an other oxp could have changed those values. Never count on it but double check when important.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillLaunchFromStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillLaunchFromStation&amp;lt;/code&amp;gt; handler is called at the beginning of the launch tunnel effect.&lt;br /&gt;
&lt;br /&gt;
 this.shipWillLaunchFromStation = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
At this moment &amp;quot;ship.dockedStation == the station&amp;quot;, &amp;quot;ship.docked == false&amp;quot;, &amp;quot;ship.status == STATUS_LAUNCHING&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipLaunchedFromStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipLaunchedFromStation&amp;lt;/code&amp;gt; handler is called at the end of the launch tunnel effect.&lt;br /&gt;
&lt;br /&gt;
 this.shipLaunchedFromStation = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
At this moment &amp;quot;ship.dockedStation == null&amp;quot;, &amp;quot;ship.docked == false&amp;quot;, &amp;quot;ship.status == STATUS_IN_FLIGHT&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerStartedAutoPilot&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerStartedAutoPilot&amp;lt;/code&amp;gt; handler is called when the player starts autopilot docking. It is not called for the instantaneous dock command.&lt;br /&gt;
&lt;br /&gt;
 this.playerStartedAutoPilot = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerCancelledAutoPilot&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerCancelledAutoPilot&amp;lt;/code&amp;gt; handler is called when the player cancels autopilot docking.&lt;br /&gt;
&lt;br /&gt;
 this.playerCancelledAutoPilot = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerDockingRefused&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerDockingRefused&amp;lt;/code&amp;gt; handler is called when a station refuses to provide autopilot docking instructions.&lt;br /&gt;
&lt;br /&gt;
 this.playerDockingRefused = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerRequestedDockingClearance&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerRequestedDockingClearance&amp;lt;/code&amp;gt; handler is called when a station answers on a docking request of the player by targeting the station and pressing L (shift-l).&lt;br /&gt;
&lt;br /&gt;
 this.playerRequestedDockingClearance = function(message)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Message is a string and can take the values: &amp;quot;DOCKING_CLEARANCE_GRANTED&amp;quot;, &amp;quot;DOCKING_CLEARANCE_DENIED_TRAFFIC_OUTBOUND&amp;quot;, &amp;quot;DOCKING_CLEARANCE_DENIED_TRAFFIC_INBOUND&amp;quot;,  &amp;quot;DOCKING_CLEARANCE_DENIED_SHIP_FUGITIVE&amp;quot;, &amp;quot;DOCKING_CLEARANCE_NOT_REQUIRED&amp;quot;, &amp;quot;DOCKING_CLEARANCE_EXTENDED&amp;quot; or &amp;quot;DOCKING_CLEARANCE_CANCELLED&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Witchspace Jumps ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerStartedJumpCountdown&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerStartedJumpCountdown&amp;lt;/code&amp;gt; handler is called when the user starts a witchspace or galactic witchspace jump countdown. The &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; parameter is a string specifying which type of jump is occuring; currently, the possible values are “standard” and “galactic”. Other values may be added in future. The &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; parameter is a number specifying the number of seconds the countdown is running for.&lt;br /&gt;
&lt;br /&gt;
 this.playerStartedJumpCountdown = function(type, seconds)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerCancelledJumpCountdown&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerCancelledJumpCountdown&amp;lt;/code&amp;gt; handler is called when the user cancels a witchspace or galactic witchspace jump countdown.&lt;br /&gt;
&lt;br /&gt;
 this.playerCancelledJumpCountdown = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerJumpFailed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerJumpFailed&amp;lt;/code&amp;gt; handler is called at the end of a witchspace or galactic witchspace countdown, if the jump is not possible. The &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt; parameter is a string specifying why the jump failed; currently, the possible values are “blocked”, “too far” and “insufficient fuel”. Other values may be added in future.&lt;br /&gt;
&lt;br /&gt;
 this.playerJumpFailed = function(reason)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillEnterWitchspace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillEnterWitchspace&amp;lt;/code&amp;gt; handler is called immediately before a witchspace jump, while the player is still in the starting system. The &amp;lt;code&amp;gt;cause&amp;lt;/code&amp;gt; parameter is a string specifying what sort of jump is occuring; currently, the possible values are “standard jump”, “galactic jump” and “wormhole”. Other values may be added in future.&lt;br /&gt;
&lt;br /&gt;
 this.shipWillEnterWitchspace = function(cause)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillExitWitchspace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillExitWitchspace&amp;lt;/code&amp;gt; handler is called as a witchspace jump concludes. When it is called, the player is (from a program perspective) in the destination system, but the tunnel effect has not yet been shown. Use this event to set up elements which need to be present in-system after the player exits witchspace.&lt;br /&gt;
&lt;br /&gt;
 this.shipWillExitWitchspace = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipExitedWitchspace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipExitedWitchspace&amp;lt;/code&amp;gt; handler is called after a witchspace jump has concluded and the tunnel effect has been shown.&lt;br /&gt;
&lt;br /&gt;
 this.shipExitedWitchspace = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerEnteredNewGalaxy&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerEnteredNewGalaxy&amp;lt;/code&amp;gt; handler is called just before shipWillExitWitchspace.&lt;br /&gt;
&lt;br /&gt;
the sequence of events for a player jumping to a different galaxy is as follows:&lt;br /&gt;
&lt;br /&gt;
shipWillEnterWitchspace (world event)&amp;lt;br&amp;gt;&lt;br /&gt;
playerWillEnterWitchspace (NPC ship event)&amp;lt;br&amp;gt;&lt;br /&gt;
playerEnteredNewGalaxy (world event)&amp;lt;br&amp;gt;&lt;br /&gt;
shipWillExitWitchspace (world event)&amp;lt;br&amp;gt;&lt;br /&gt;
shipExitedWitchspace (world event)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 this.playerEnteredNewGalaxy = function(galaxyNumber)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Enter/Exit Aegis ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipEnteredStationAegis&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipEnteredStationAegis&amp;lt;/code&amp;gt; handler is called when the player enters the aegis of the main-station (2x scanner range from main-station). Other stations than the main-station don't give aegis messages.&lt;br /&gt;
&lt;br /&gt;
 this.shipEnteredStationAegis = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipExitedStationAegis&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipExitedStationAegis&amp;lt;/code&amp;gt; handler is called when the player leaves the aegis of the main-station (2x scanner range from main-station).&lt;br /&gt;
&lt;br /&gt;
 this.shipExitedStationAegis = function(station)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipEnteredPlanetaryVicinity&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipEnteredPlanetaryVicinity&amp;lt;/code&amp;gt; handler is called when the player enters the planet aegis (3x planet radius).&lt;br /&gt;
&lt;br /&gt;
 this.shipEnteredPlanetaryVicinity = function(planet)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipExitedPlanetaryVicinity&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipExitedPlanetaryVicinity&amp;lt;/code&amp;gt; handler is called when the player leaves the planet aegis (3x planet radius).&lt;br /&gt;
&lt;br /&gt;
 this.shipExitedPlanetaryVicinity = function(planet)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipApproachingPlanetSurface&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipApproachingPlanetSurface&amp;lt;/code&amp;gt; handler is called when the player is very close to the planet (crosses a border ± 500 meter above the surface).&lt;br /&gt;
&lt;br /&gt;
 this.shipApproachingPlanetSurface = function(planet)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipLeavingPlanetSurface&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipLeavingPlanetSurface&amp;lt;/code&amp;gt; handler is called when the player leaves the planet (crosses a border ± 500 meter above the surface).&lt;br /&gt;
&lt;br /&gt;
 this.shipLeavingPlanetSurface = function(planet)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Combat ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;alertConditionChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;alertConditionChanged&amp;lt;/code&amp;gt; handler is called when the player’s alert status (&amp;lt;code&amp;gt;[[Oolite_JavaScript_Reference:_Player#alertCondition|player.alertCondition]]&amp;lt;/code&amp;gt;) changes. Only the player and stations have an alert condition. (world script and station scripts)&lt;br /&gt;
&lt;br /&gt;
 this.alertConditionChanged = function(newCondition, oldCondition)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerTargetedMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerTargetedMissile&amp;lt;/code&amp;gt; handler is called when the player targets the nearest missile by pressing T (shift-t) on the keybord.&lt;br /&gt;
&lt;br /&gt;
 this.playerTargetedMissile = function(missile)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipAttackedWithMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipAttackedWithMissile&amp;lt;/code&amp;gt; handler is called when a missile is fired. &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt; contains the missile entity and &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt; the identity of the ship that launched the missile.&lt;br /&gt;
&lt;br /&gt;
 this.shipAttackedWithMissile = function(missile, whom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipBeingAttacked&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipBeingAttacked&amp;lt;/code&amp;gt; handler is called when a laser shot  hits. &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt; the identity of the ship that attacked.&lt;br /&gt;
&lt;br /&gt;
 this.shipBeingAttacked = function(whom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipBeingAttackedByCloaked&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipBeingAttackedByCloaked&amp;lt;/code&amp;gt; handler is called when a laser shot from a cloaked ship hits. Guess what, there is no parameter because he is cloaked!&lt;br /&gt;
&lt;br /&gt;
 this.shipBeingAttackedByCloaked = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipKilledOther&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipKilledOther&amp;lt;/code&amp;gt; handler is called when a ship kills an other ship. &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt; the identity of the ship that was killed. &amp;lt;code&amp;gt;damageType&amp;lt;/code&amp;gt; is the type of damage. (Handler added in test version 1.75) &lt;br /&gt;
&lt;br /&gt;
 this.shipKilledOther = function(whom,damageType)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipTargetDestroyed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipTargetDestroyed&amp;lt;/code&amp;gt; handler is called when the target gets destroyed. &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; contains the destroyed target entity. This command is always preceded by the &amp;lt;code&amp;gt;shipTargetLost&amp;lt;/code&amp;gt; handler.&lt;br /&gt;
&lt;br /&gt;
 this.shipTargetDestroyed = function(target)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipDied&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipDied&amp;lt;/code&amp;gt; handler is called when the ship or player dies. Expect a &amp;lt;code&amp;gt;reset()&amp;lt;/code&amp;gt; shortly when it is the player ship.&lt;br /&gt;
&lt;br /&gt;
 this.shipDied = function(whom, why)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
'''whom''' contains the entity that caused the kill. '''why''' is the cause written as string and is one of: &amp;quot;removed&amp;quot;, &amp;quot;hit a planet&amp;quot;, &amp;quot;energy damage&amp;quot;, &amp;quot;scrape damage&amp;quot;, &amp;quot;heat damage&amp;quot;, &amp;quot;cascade weapon&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
(&amp;quot;cascade weapon&amp;quot; is new in 1.74 and  &amp;quot;removed&amp;quot; / &amp;quot;energy damage&amp;quot; were accidentally switched in 1.73)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipFiredMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipFiredMissile&amp;lt;/code&amp;gt; handler is called when a missile is fired. &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt; contains the missile entity and &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; the identity of the target. The handler is send to the ship that launched the missile.&lt;br /&gt;
&lt;br /&gt;
 this.shipFiredMissile = function(missile, target)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipTargetLost&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipTargetLost&amp;lt;/code&amp;gt; handler is called when the target gets lost. &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; contains the lost target entity.&lt;br /&gt;
&lt;br /&gt;
 this.shipTargetLost = function(target)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipTargetCloaked&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipTargetCloaked&amp;lt;/code&amp;gt; handler is called when the target cloakes.&lt;br /&gt;
&lt;br /&gt;
 this.shipTargetCloaked = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Equipment and Cargo ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentDestroyed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentDestroyed&amp;lt;/code&amp;gt; handler is called when equipment gets destroyed completely beyond repair. (in strict mode)  (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.equipmentDestroyed = function(equipment)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentDamaged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentDamaged&amp;lt;/code&amp;gt; handler is called when equipment gets damaged. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.equipmentDamaged = function(equipment)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentRepaired&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentRepaired&amp;lt;/code&amp;gt; handler is called when equipment gets repaired. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.equipmentRepaired = function(equipment)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerBoughtCargo&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerBoughtCargo&amp;lt;/code&amp;gt; handler is called when cargo is bought at the market screen. &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; contains the non-localised name for the cargo. You can get the localised name using &amp;lt;code&amp;gt;expandDescription(&amp;quot;[commodity-name &amp;quot;+commodity+&amp;quot;]&amp;quot;);&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; is price per unit in tenths of a credit.&lt;br /&gt;
&lt;br /&gt;
 this.playerBoughtCargo = function(commodity, units, price)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerBoughtEquipment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerBoughtEquipment&amp;lt;/code&amp;gt; handler is called when equipment is bought at the outfit screen.&lt;br /&gt;
&lt;br /&gt;
 this.playerBoughtEquipment = function(equipment)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerBoughtNewShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerBoughtNewShip&amp;lt;/code&amp;gt; handler is called when a new ship is bought. May be needed to re-evaluate the old equipment as buying a new ship does not trigger equipment removal.&lt;br /&gt;
&lt;br /&gt;
 this.playerBoughtNewShip = function(ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerSoldCargo&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerSoldCargo&amp;lt;/code&amp;gt; handler is called when cargo is sold at the market screen. &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; contains the non-localised name for the cargo. You can get the localised name using &amp;lt;code&amp;gt;expandDescription(&amp;quot;[commodity-name &amp;quot;+commodity+&amp;quot;]&amp;quot;);&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; is price per unit in tenths of a credit.&lt;br /&gt;
&lt;br /&gt;
 this.playerSoldCargo = function(commodity, units, price)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipScoopedFuel&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipScoopedFuel&amp;lt;/code&amp;gt; handler is called whenever the player's ship transfers 0.1LY of fuel from the scoops to the tank.&lt;br /&gt;
&lt;br /&gt;
 this.shipScoopedFuel = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipScoopedOther&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipScoopedOther&amp;lt;/code&amp;gt; handler is called when a ship scoops cargo. The scooped item is transferred as argument.&amp;lt;br&amp;gt;If the cargo is scripted cargo, but not otherwise, then the scooped cargo itself gets the handler &amp;lt;code&amp;gt;shipWasScooped&amp;lt;/code&amp;gt; with the scooper as argument.&lt;br /&gt;
&lt;br /&gt;
 this.shipScoopedOther = function(whom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;compassTargetChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;compassTargetChanged&amp;lt;/code&amp;gt; handler is called when a new target is selected. Mode can be any of the following:&lt;br /&gt;
&lt;br /&gt;
 COMPASS_MODE_BASIC&lt;br /&gt;
 COMPASS_MODE_PLANET&lt;br /&gt;
 COMPASS_MODE_STATION&lt;br /&gt;
 COMPASS_MODE_SUN&lt;br /&gt;
 COMPASS_MODE_TARGET&lt;br /&gt;
 COMPASS_MODE_BEACONS&lt;br /&gt;
&lt;br /&gt;
script example &lt;br /&gt;
&lt;br /&gt;
 this.compassTargetChanged = function(whom, mode)&lt;br /&gt;
 {&lt;br /&gt;
      log(' Now targeting ' + whom);&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;guiScreenChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;guiScreenChanged&amp;lt;/code&amp;gt; handler is called when the guiScreen changes. &amp;quot;from&amp;quot; is the screen it is changing from and &amp;quot;to&amp;quot; is the screen were it initially switched to. Note that the screen can have changed again in the meantime by the action of other oxps. Therefor, it will generally better to test for the global &amp;lt;code&amp;gt;guiScreen&amp;lt;/code&amp;gt; to see which page is really on display instead of using the &amp;quot;to&amp;quot; parameter. (world script only)&amp;lt;br&amp;gt;&lt;br /&gt;
This handler will not fire for every screen the player can switch to, but only when switching to any of the following screens: &amp;lt;code&amp;gt;GUI_SCREEN_MAIN, GUI_SCREEN_STATUS, GUI_SCREEN_MANIFEST, GUI_SCREEN_SYSTEM_DATA, GUI_SCREEN_OPTIONS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_SHIPYARD, GUI_SCREEN_SHORT_RANGE_CHART, GUI_SCREEN_LONG_RANGE_CHART, GUI_SCREEN_MARKET, GUI_SCREEN_CONTRACTS, GUI_SCREEN_REPORT&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 this.guiScreenChanged = function(to, from)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;guiScreenWillChange&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;guiScreenWillChange&amp;lt;/code&amp;gt; handler is called when the guiScreen is about to change.  It only fires for the screens: &amp;lt;code&amp;gt;GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_MANIFEST, GUI_SCREEN_MARKET&amp;lt;/code&amp;gt; and&amp;lt;code&amp;gt; GUI_SCREEN_SHIPYARD&amp;lt;/code&amp;gt;. On these screens a script could change the content of the page to be displayed.  In Oolite 1.75 will &amp;lt;code&amp;gt;GUI_SCREEN_SYSTEM_DATA&amp;lt;/code&amp;gt; be added to this list. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.guiScreenWillChange = function(to, from)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;missionChoiceWasReset&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;missionChoiceWasReset&amp;lt;/code&amp;gt; handler is called when the mission choice is set to null via script (either using the legacy script method resetMissionChice, or using mission.choice = null; in javascript)&lt;br /&gt;
&lt;br /&gt;
 this.missionChoiceWasReset= function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;missionScreenEnded&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;missionScreenEnded&amp;lt;/code&amp;gt; handler is called when the missionscreen ends. Note that an other script may have put up a new missionscreen in the meantime. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.missionScreenEnded = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler is called if there are no mission / report screens active, and the player is docked to a station. It gets fired at game startup, upon docking, and after a docking report or previous mission screen has ended.  (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.missionScreenOpportunity= function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This handler works a bit different as other handlers. It fires for every installed oxp, until an oxp creates a mission screen during this handler. Than it stops. When the mission screen ends and there is no callback function that created a new mission screen, than the missionScreenOpportunity is send again to all installed oxps, starting with the oxp that used the mission screen as last one. All this means that when this handler fires, it is safe to show a mission screen and no further test are needed.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;reportScreenEnded&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;reportScreenEnded&amp;lt;/code&amp;gt; handler is called when the last arrival-report  screen ends. This is a screen that should not be written by a missionscreen. The code should wait until this eventhandler fires. Note that an other script may have put up a new missionscreen in the meantime. (world script only)&lt;br /&gt;
&lt;br /&gt;
 this.reportScreenEnded = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipCollided&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipCollided&amp;lt;/code&amp;gt; handler is send after a collision with otherShip.&lt;br /&gt;
&lt;br /&gt;
 this.shipCollided = function(otherShip)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipSpawned&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipSpawned&amp;lt;/code&amp;gt; handler is called after an NPC ship has been added to the system. After a witchspace jump it means that first all ships are added to the system, then all the relevant shipSpawned events are triggered.&amp;lt;br&amp;gt;&lt;br /&gt;
This handler for the woldScript is new since Oolite 1.74. After the event is sent to the shipScript, it is now also send to the worldScript with the added entity as argument.&lt;br /&gt;
&lt;br /&gt;
 this.shipSpawned = function(ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipLaunchedEscapePod&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipLaunchedEscapePod&amp;lt;/code&amp;gt; handler is called when the player bails out. This will be followed by a &amp;lt;code&amp;gt;shipWillDockWithStation()&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;shipDockedWithStation()&amp;lt;/code&amp;gt; pair after a few seconds.&lt;br /&gt;
&lt;br /&gt;
 this.shipLaunchedEscapePod = function(escapepod)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;tickle&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;tickle&amp;lt;/code&amp;gt; handler is called periodically-ish, whenever the old [[property list|plist]] scripts are updated. &amp;lt;code&amp;gt;tickle()&amp;lt;/code&amp;gt; is deprecated. In new code, use appropriate event handlers or [[Oolite JavaScript Reference: Timer|timers]] instead.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;viewDirectionChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;viewDirectionChanged&amp;lt;/code&amp;gt; handler is called when the player view changes, with a string to indicate which view the player is facing. Amongst its possible values are &amp;quot;VIEW_FORWARD&amp;quot;, &amp;quot;VIEW_AFT&amp;quot;, &amp;quot;VIEW_PORT&amp;quot;, &amp;quot;VIEW_STARBOARD&amp;quot;,&lt;br /&gt;
&amp;quot;VIEW_CUSTOM&amp;quot;,&lt;br /&gt;
&amp;quot;VIEW_GUI_DISPLAY&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 this.viewDirectionChanged = function(viewString)&lt;br /&gt;
 {&lt;br /&gt;
   if (viewString == &amp;quot;VIEW_PORT&amp;quot;)&lt;br /&gt;
   {&lt;br /&gt;
      // Your code here&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Missing Events ===&lt;br /&gt;
&lt;br /&gt;
All the initially planned events have been implemented in 1.74.&lt;br /&gt;
&lt;br /&gt;
If there are other events you would like to be able to respond to, please write a request [http://www.aegidian.org/bb/viewtopic.php?t=3296 on the forum].&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[Oolite JavaScript Reference: ship_script_event_handlers|ship_script_event_handlers]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=32415</id>
		<title>Oolite JavaScript Reference: Global</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=32415"/>
		<updated>2012-06-10T20:05:24Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Documented worldScriptNames&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Global variables and functions are visible to all scripts. They are also properties of &amp;lt;code&amp;gt;[[#global|global]]&amp;lt;/code&amp;gt;, which is itself a global variable and hence a property of itself.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;clock&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''clock''' : {{oojsclass|Clock}} (read-only)&lt;br /&gt;
This property allows an OXP to access the game clock's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;defaultFont&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''defaultFont''' : Object (read-only)&lt;br /&gt;
An object with a single method, &amp;lt;code&amp;gt;measureString(string)&amp;lt;/code&amp;gt;, which returns the width of the specified string, as it would be shown on the screen, in '''ems'''. One em is the intrinsic unit size of a font; for example, if a font is rendered at 12 points, 1 em = 12 pt. The mission screen text area is 32 em wide.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galaxyNumber&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galaxyNumber''' : Number (read-only)&lt;br /&gt;
Returns the number of the galaxy the player is in.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;global&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''global''' : Global (read-only)&lt;br /&gt;
All global variables and functions are actually properties of the global object. The global object is a property of itself, and this is it.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;guiScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''guiScreen''' : String (read-only)&lt;br /&gt;
Returns the screen the player is looking at. If in flight, this is &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MAIN&amp;quot;&amp;lt;/code&amp;gt;. Currently, the other possible values are &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTRO1&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTRO2&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LONG_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHORT_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_CONTRACTS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_OPTIONS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_GAMEOPTIONS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LOAD&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SAVE&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SAVE_OVERWRITE&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STICKMAPPER&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MISSION&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_REPORT&amp;quot;&amp;lt;/code&amp;gt;. This list may change in future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;manifest&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''manifest''' : {{oojsclass|Manifest}} (read-only)&lt;br /&gt;
An alias to &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|player.ship.manifest]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mission&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mission''' : {{oojsclass|Mission}} (read-only)&lt;br /&gt;
See [[Oolite JavaScript Reference: Mission]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''missionVariables''' : Object (read-only)&lt;br /&gt;
The &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt; object stores values that are stored in saved games. This is the main way for scripts to store information permanently.&lt;br /&gt;
&lt;br /&gt;
Whenever a value is assigned to a property of &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt;, it is converted to a string object and tracked with the player. When the value is read, it will be converted to a number if possible, otherwise returned as a string. Example:&lt;br /&gt;
 missionVariables.exampleVar = 42;&lt;br /&gt;
 let x = missionVariables.exampleVar; // x is now the number 42&lt;br /&gt;
&lt;br /&gt;
Mission variables can also be used in legacy scripts and in [[Misc_plists|descriptions.plist]] string expansions, by prefixing the name with “mission_”. Example:&lt;br /&gt;
 expandDescription(&amp;quot;My variable is [mission_exampleVar].&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Setting and retrieving mission variables has a significant overhead'''*'''. If a function needs to use a mission variable value several times, it is strongly recommended that it be copied into a local variable and, if necessary, stored back once. Example:&lt;br /&gt;
 let x = missionVariables.exampleVar;&lt;br /&gt;
 if (x &amp;lt; 3)  x = processSmallValue(x);&lt;br /&gt;
 else  x = processBigValue(x);&lt;br /&gt;
 missionVariables.exampleVar = x;&lt;br /&gt;
&lt;br /&gt;
Mission variable names may not begin with an underscore (“_”). Unassigned mission variables are always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''*''' On a computer where the loop &amp;quot;&amp;lt;code&amp;gt;for ( var i= 0 ; i &amp;lt; 1000 ; i++){}&amp;lt;/code&amp;gt;&amp;quot; takes just 0.62 msec, will the same loop with missionVarriables &amp;lt;code&amp;gt;for (missionVariables.i= 0 ; missionVariables.i &amp;lt; 1000 ; missionVariables.i++){}&amp;lt;/code&amp;gt; consumes a full 38 msec. That is 60 times longer.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;oolite&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''oolite''' : {{oojsclass|Oolite}} (read-only)&lt;br /&gt;
An object describing properties of the Oolite application; see [[Oolite JavaScript Reference: Oolite]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''player''' : {{oojsclass|Player}} (read-only)&lt;br /&gt;
This property allows an OXP to access the player object's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''system''' : {{oojsclass|System}} (read-only)&lt;br /&gt;
This property allows an OXP to access the current system's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;timeAccelerationFactor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''timeAccelerationFactor''' : Number (read/write)&lt;br /&gt;
Also known as TAF. Will change the ratio between game real time and actual real time (default is 1). The accepted range is between 0.0625 (1/16) and 16. Attempting to set numbers outside this range will reset the TAF to 1. (In end-user stable builds, this will be a read-only property with the value 1.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;worldScriptNames&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''worldScriptNames''' : Array of strings (read-only)&lt;br /&gt;
A list of the names of world script objects, the keys of &amp;lt;code&amp;gt;[[#worldScripts|worldScripts]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;worldScripts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''worldScripts''' : Object (read-only)&lt;br /&gt;
All loaded world script objects. The keys are the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; properties of the scripts.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 log(worldScripts[&amp;quot;oolite-nova&amp;quot;].version);&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addFrameCallback'''(callback : Function) : ''TrackingID''&lt;br /&gt;
Registers a ''frame callback'' which will be invoked every frame, after entity updates but before rendering. This can be used to implement animations. The return value is a ''tracking ID'' which may be passed to &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;; the type and meaning of the tracking ID is unspecified and may change at any time. Frame callbacks are automatically removed when the game resets (for instance, when the player dies), but not at any other time.&lt;br /&gt;
&lt;br /&gt;
The callback is passed one parameter, &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt;, which is the time since the last frame (in [[Time_scales in Oolite|game clock time]]). Frame callbacks fire even when the game is paused, in which case &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt; is 0.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var sum = 0;&lt;br /&gt;
 this.fcb = addFrameCallback(function (delta)&lt;br /&gt;
 {&lt;br /&gt;
     sum += delta;&lt;br /&gt;
     log(&amp;quot;Time elapsed: &amp;quot; + sum + &amp;quot; (delta: &amp;quot; + delta + &amp;quot;)&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#isValidFrameCallback|isValidFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayNameForCommodity&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''displayNameForCommodity'''(commodityName : String) &lt;br /&gt;
Returns the display name corresponding to the specified commodity. Useful in conjunction with localisation OXPs, or expansions that rename commodities depending on which station / system the player is at.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;expandDescription&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''expandDescription'''(description : String [, locals : Object (Dictionary)]) : String&lt;br /&gt;
Expands a string, substituting special tokens and any key inside square brackets with the substitution rules for [[Methods#Communications|Communications]].&lt;br /&gt;
When local key/value pairs are provided, they take precedence over any other values.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 expandDescription(&amp;quot;My ball is [my_color].&amp;quot;, { my_color: &amp;quot;red&amp;quot; }); &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;expandMissionText&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''expandMissionText'''(textKey: String [, locals : Object (Dictionary)]) : String&lt;br /&gt;
Load a string specified by &amp;lt;code&amp;gt;textKey&amp;lt;/code&amp;gt; from [[missiontext.plist]], then perform &amp;lt;code&amp;gt;[[#expandDescription|expandDescription()]]&amp;lt;/code&amp;gt;-type substitutions on it, and also replace “\n” with line breaks. The &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; parameter works as with &amp;lt;code&amp;gt;[[#expandDescription|expandDescription()]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 expandMissionText(&amp;quot;oolite_trumble_title&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;formatCredits&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''formatCredits'''(value : number, [includeDeciCredits : boolean, [includeCurrencySymbol : boolean]]) : String&lt;br /&gt;
Converts the &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; parameter to a string formatted in a currency friendly manner. If &amp;lt;code&amp;gt;includeDeciCredits&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the string will be formatted to 1 decimal place. If &amp;lt;code&amp;gt;includeCurrencySymbol&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; an appropriate currency symbol following any localisation rules is included. The default currency symbol is a terminal ₢.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;formatInteger&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''formatInteger'''(value : number) : String&lt;br /&gt;
Converts the &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; parameter to a string formatted as an integer following any localisation rules in place.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isValidFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''isValidFrameCallback'''(trackingID: ''TrackingID'') : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;trackingID&amp;lt;/code&amp;gt; identifies a frame callback which has been registered with &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt; and not yet removed. (There should be no need to use this except for debugging and testing.)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''log'''([messageClass : String ,] message : String)&lt;br /&gt;
Writes a message to Oolite's log. The optional messageClass can be used to specify which type of message is written to the log.&amp;lt;br&amp;gt;&lt;br /&gt;
The default messageClass is &amp;lt;code&amp;gt;script.debug.message&amp;lt;/code&amp;gt;. When set to true, the messages will be written to the logfile. The classes to be logged are set in the file &amp;lt;code&amp;gt;logcontrol.plist&amp;lt;/code&amp;gt;. messageClasses not listed in &amp;lt;code&amp;gt;logcontrol.plist&amp;lt;/code&amp;gt; are always logged.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 log(&amp;quot;myOXP.init&amp;quot;,&amp;quot;MyOXP initialised and ready!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
You can temporary enable/disable logging above message by typing in the console:&lt;br /&gt;
 console.setDisplayMessagesInClass(&amp;quot;myOXP.init&amp;quot;, true/false)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;randomInhabitantsDescription&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''randomInhabitantsDescription'''([plural : boolean, default true])&lt;br /&gt;
Returns a random sentient species name, like “Large Red Fat Insects” or “Human Colonials”, following the same pattern (and probability distribution) as for planet inhabitants.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.consoleMessage(&amp;quot;You'll meet a &amp;quot; +  randomInhabitantsDescription(false) +&lt;br /&gt;
                       &amp;quot;. She'll be with a group of &amp;quot; + randomInhabitantsDescription(true) +&amp;quot;.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;randomName&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''randomName'''()&lt;br /&gt;
Returns a random capitalised word, suitable for use as name, or indeed surname.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.consoleMessage(randomName() + &amp;quot; &amp;quot; + randomName() +&amp;quot; rules this system with an iron fist.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''removeFrameCallback'''(trackingID : ''TrackingID'')&lt;br /&gt;
Removes a frame callback previously registered with &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#isValidFrameCallback|isValidFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenBackground&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''setScreenBackground'''(image : ''guiTextureSpecifier'') &lt;br /&gt;
Temporary override that sets the background of the current gui screen to the specified image. Override is lost after the player switches screens.&lt;br /&gt;
&lt;br /&gt;
''guiTextureSpecifier'' can be either a string or an object with the required key &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and optional keys &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;. If neither width nor height is specified, the dimensions of the image are used. If only one is specified, the other is calculated such that the image is not distorted. The scale unit is 1/480 of the height of the window; in other words, the window is always considered 480 units high, and the width depends on the aspect ratio of the window.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setScreenBackground({ name: &amp;quot;oolite-nova-system.png&amp;quot;, height: 512 });&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenOverlay&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''setScreenOverlay'''(image : ''guiTextureSpecifier'') &lt;br /&gt;
Temporary override that sets the overlay of the current gui screen to the specified image. Override is lost after the player switches screens.&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;[[#setScreenBackground|setScreenBackground()]]&amp;lt;/code&amp;gt; for a discussion of ''guiTextureSpecifier''.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setScreenOverlay('trumblebox.png');&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;takeSnapShot&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''takeSnapShot'''([filename : String]) : Bool&lt;br /&gt;
Saves a snapshot of the current screen to your hard disk. A filename is optional. When a name is used, only alphanumeric values and &amp;quot;-&amp;quot; and &amp;quot;_&amp;quot; are allowed for the filename. The appropriate extension for the used operating system (like .png) is added by Oolite and should not be part of the filename.&amp;lt;br&amp;gt;&lt;br /&gt;
When a filename already exists, it is not overwritten but the string &amp;quot;-xxx&amp;quot; is added, starting with &amp;quot;-001&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;takeSnapShot()&amp;lt;/code&amp;gt; will not be available in the stable release version of Oolite, but will be available in a special OXP developer release.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 takeSnapShot('mission_target_1');&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Material_Test_Suite_OXP&amp;diff=30724</id>
		<title>Material Test Suite OXP</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Material_Test_Suite_OXP&amp;diff=30724"/>
		<updated>2012-01-29T20:37:18Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Material Test Suite''' is an expansion pack which tests Oolite’s [[Materials in Oolite|material model]] and built-in shaders. It was created during the testing phase before version 1.76 to test material functionality across different platforms and hardware. It may be useful in diagnosing some rendering problems.&lt;br /&gt;
&lt;br /&gt;
To run the test suite:&lt;br /&gt;
* [http://jens.ayton.se/oolite/files/material-test-suite-1.2.oxp.zip Download the test suite] and install it. (Oolite test release 1.75 or later required. For information on installing expansion packs, see [[OXP#Installing an OXP&amp;quot;|the “OXP” article]].)&lt;br /&gt;
* Run Oolite, and decline when asked whether you want to load a game. (If you are using Strict Mode, disable it and restart Oolite.)&lt;br /&gt;
* You should now be presented with an information screen and the options “Run test suite” and “Cancel”. Select “Run test suite”.&lt;br /&gt;
* You will now be shown a series of spinning cubes. The precise number shown depends on your system’s capabilities. A successful test shows a grey box with a number on it (see [[#Sample Images|sample images]] below). A failed test will show something else, typically a solid black box.&lt;br /&gt;
* Please take a note of any failed tests, writing down the label shown on the left of the screen (such as “simple: 3”). If it is something other than a sold black or red box, please also take a screen shot (“'''*'''” key).&lt;br /&gt;
* While you’re at it, we’d appreciate if you tested dust rendering. When the test suite is complete, leave the station and fly away until you are no longer mass locked. Fly at normal speed and at hyperspeed (default: “'''J'''” key). Note whether you see dust particles flying past. Test this in every available shader mode (to change shader mode, pause, press “'''2'''” or “'''F2'''”, and select “Game Options…”).&lt;br /&gt;
&lt;br /&gt;
If all the tests work and dust is nicely dusty, we’re done. You can throw out the Material Test Suite expansion pack and get back to playing the game. Otherwise, please report the problem:&lt;br /&gt;
* Quit Oolite and open the log file. (To locate the log file, see [[Oolite FAQ#Diagnosing Problems|the FAQ entry on diagnosing problems]].)&lt;br /&gt;
* Copy the lines between “&amp;lt;code&amp;gt;========== [Marker 1] ==========&amp;lt;/code&amp;gt;” and “&amp;lt;code&amp;gt;========== [Marker 2] ==========&amp;lt;/code&amp;gt;”. Paste them into an e-mail to [mailto:bugs@oolite.org bugs@oolite.org] or [http://www.aegidian.org/bb/viewtopic.php?t=8038 this forum thread] (or send the whole log as an attachment). Don’t forget to specify which tests failed!&lt;br /&gt;
&lt;br /&gt;
If your tests passed, feel free to report anyway. Confirmation that we’re doing something right is good for our egos. But if they failed, we really need to know. We can’t fix problems we don’t know about.&lt;br /&gt;
&lt;br /&gt;
== Sample Images ==&lt;br /&gt;
Click the images for a bigger view. Note that tests 8–16 will not be shown on systems without GLSL shader support.&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 1.png|160px|left|thumb]] Test 1: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; only.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 2.png|160px|left|thumb]] Test 2: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''2''' glows green in the dark.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 3.png|160px|left|thumb]] Test 3: &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''3''' and the ring both glow green in the dark.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 4.png|160px|left|thumb]] Test 4: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that number '''4''' is illuminated as though by a spotlight (with a slightly blue tint).&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 5.png|160px|left|thumb]] Test 5: &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''5''' and the ring both glow with a dull blue tint.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 6.png|160px|left|thumb]] Test 6: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''6''' is illuminated as in test 4, and the ring glows with a slight green tint.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 7.png|160px|left|thumb]] Test 7: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;emission_and_illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When rendered correctly, the effects should be the same as in test 6.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 8.png|160px|left|thumb]] Test 8: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note the shadows and highlights around the inside of the ring, which conform to the main light source, producing the effect of an indentation containing the number '''8'''.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 9.png|160px|left|thumb]] Test 9: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This should look similar to test 8, but with slightly better perspective. If you noticed a “creeping” effect in test 8, it should be alleviated in test 9. This is more noticeable if you look at the tests again.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 10.png|160px|left|thumb]] Test 10: &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The number '''10''' and the ring glow as in test 3, and the interior of the ring is indented as in test 9.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 11.png|160px|left|thumb]] Test 11: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The ring is white and the number '''11''' glows green, as in test 2, and the interior of the ring is indented.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 12.png|160px|left|thumb]] Test 12: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The ring glows and the indented area around the number is illuminated as though by a spotlight, as in tests 6 and 7.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 13.png|160px|left|thumb]] Test 13: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''13''' is only visible as a variation in the glossiness of the surface, and completely invisible in shadow.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 14.png|160px|left|thumb]] Test 14: &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''14''' and the ring are only visible as a variation in the glossiness of the surface, and the cube is uniformly grey in shadow.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 15.png|160px|left|thumb]] Test 15: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A shiny surface as in tests 13 and 14, but width a glowing number '''15'''.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 16.png|160px|left|thumb]] Test 16: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Everything all at once: like test 12, but with the varying shininess from tests 13–15.&lt;br /&gt;
&lt;br /&gt;
'''Bug:''' For unknown reasons, the shininess of test 16 does not match that of tests 13–15.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite expansion packs]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Material_Test_Suite_OXP&amp;diff=30690</id>
		<title>Material Test Suite OXP</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Material_Test_Suite_OXP&amp;diff=30690"/>
		<updated>2012-01-24T13:15:22Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: No longer soliciting test results.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''Material Test Suite''' is an expansion pack which tests Oolite’s [[Materials in Oolite|material model]] and built-in shaders. It was created during the testing phase before version 1.76 to test material functionality across different platforms and hardware. It may be useful in diagnosing some rendering problems.&lt;br /&gt;
&lt;br /&gt;
To run the test suite:&lt;br /&gt;
* [http://jens.ayton.se/oolite/files/material-test-suite-1.2.oxp.zip Download the test suite] and install it. (Oolite test release 1.75 or later required. For information on installing expansion packs, see [[OXP#Installing an OXP&amp;quot;|the “OXP” article]].)&lt;br /&gt;
* Run Oolite, and decline when asked whether you want to start a new game. (If you are using Strict Mode, disable it and restart Oolite.)&lt;br /&gt;
* You should now be presented with an information screen and the options “Run test suite” and “Cancel”. Select “Run test suite”.&lt;br /&gt;
* You will now be shown a series of spinning cubes. The precise number shown depends on your system’s capabilities. A successful test shows a grey box with a number on it (see [[#Sample Images|sample images]] below). A failed test will show something else, typically a solid black box.&lt;br /&gt;
* Please take a note of any failed tests, writing down the label shown on the left of the screen (such as “simple: 3”). If it is something other than a sold black or red box, please also take a screen shot (“'''*'''” key).&lt;br /&gt;
* While you’re at it, we’d appreciate if you tested dust rendering. When the test suite is complete, leave the station and fly away until you are no longer mass locked. Fly at normal speed and at hyperspeed (default: “'''J'''” key). Note whether you see dust particles flying past. Test this in every available shader mode (to change shader mode, pause, press “'''2'''” or “'''F2'''”, and select “Game Options…”).&lt;br /&gt;
&lt;br /&gt;
If all the tests work and dust is nicely dusty, we’re done. You can throw out the Material Test Suite expansion pack and get back to playing the game. Otherwise, please report the problem:&lt;br /&gt;
* Quit Oolite and open the log file. (To locate the log file, see [[Oolite FAQ#Diagnosing Problems|the FAQ entry on diagnosing problems]].)&lt;br /&gt;
* Copy the lines between “&amp;lt;code&amp;gt;========== [Marker 1] ==========&amp;lt;/code&amp;gt;” and “&amp;lt;code&amp;gt;========== [Marker 2] ==========&amp;lt;/code&amp;gt;”. Paste them into an e-mail to [mailto:bugs@oolite.org bugs@oolite.org] or [http://www.aegidian.org/bb/viewtopic.php?t=8038 this forum thread] (or send the whole log as an attachment). Don’t forget to specify which tests failed!&lt;br /&gt;
&lt;br /&gt;
If your tests passed, feel free to report anyway. Confirmation that we’re doing something right is good for our egos. But if they failed, we really need to know. We can’t fix problems we don’t know about.&lt;br /&gt;
&lt;br /&gt;
== Sample Images ==&lt;br /&gt;
Click the images for a bigger view. Note that tests 8–16 will not be shown on systems without GLSL shader support.&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 1.png|160px|left|thumb]] Test 1: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; only.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 2.png|160px|left|thumb]] Test 2: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''2''' glows green in the dark.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 3.png|160px|left|thumb]] Test 3: &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''3''' and the ring both glow green in the dark.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 4.png|160px|left|thumb]] Test 4: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that number '''4''' is illuminated as though by a spotlight (with a slightly blue tint).&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 5.png|160px|left|thumb]] Test 5: &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''5''' and the ring both glow with a dull blue tint.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 6.png|160px|left|thumb]] Test 6: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''6''' is illuminated as in test 4, and the ring glows with a slight green tint.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 7.png|160px|left|thumb]] Test 7: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;emission_and_illumination_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When rendered correctly, the effects should be the same as in test 6.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 8.png|160px|left|thumb]] Test 8: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note the shadows and highlights around the inside of the ring, which conform to the main light source, producing the effect of an indentation containing the number '''8'''.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 9.png|160px|left|thumb]] Test 9: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This should look similar to test 8, but with slightly better perspective. If you noticed a “creeping” effect in test 8, it should be alleviated in test 9. This is more noticeable if you look at the tests again.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 10.png|160px|left|thumb]] Test 10: &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The number '''10''' and the ring glow as in test 3, and the interior of the ring is indented as in test 9.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 11.png|160px|left|thumb]] Test 11: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The ring is white and the number '''11''' glows green, as in test 2, and the interior of the ring is indented.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 12.png|160px|left|thumb]] Test 12: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The ring glows and the indented area around the number is illuminated as though by a spotlight, as in tests 6 and 7.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 13.png|160px|left|thumb]] Test 13: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''13''' is only visible as a variation in the glossiness of the surface, and completely invisible in shadow.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 14.png|160px|left|thumb]] Test 14: &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
Note that the number '''14''' and the ring are only visible as a variation in the glossiness of the surface, and the cube is uniformly grey in shadow.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 15.png|160px|left|thumb]] Test 15: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A shiny surface as in tests 13 and 14, but width a glowing number '''15'''.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 16.png|160px|left|thumb]] Test 16: &amp;lt;code&amp;gt;diffuse_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;emission_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;illumination_map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;normal_and_parallax_map&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;specular_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Everything all at once: like test 12, but with the varying shininess from tests 13–15.&lt;br /&gt;
&lt;br /&gt;
'''Bug:''' For unknown reasons, the shininess of test 16 does not match that of tests 13–15.&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite expansion packs]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_SystemInfo&amp;diff=30670</id>
		<title>Oolite JavaScript Reference: SystemInfo</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_SystemInfo&amp;diff=30670"/>
		<updated>2012-01-20T11:54:58Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed outdated beta stuff.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt;''' objects provide information about a specific system. &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt;s can be retrieved for any system in the current galaxy, but not systems in other galaxies. If you keep a reference to a &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt; object after the player goes to a different galaxy, attempts to read properties of the stored &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt; will cause an exception.&lt;br /&gt;
&lt;br /&gt;
In interstellar space, &amp;lt;code&amp;gt;system.info&amp;lt;/code&amp;gt; refers to a temporary &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt; object whose properties cannot be written to. Attempting to read properties of such a temporary &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt; after leaving interstellar space will raise an exception.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;coordinates&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''coordinates''' : {{oojsclass|Vector3D}} (read-only)&lt;br /&gt;
The coordinates of the system in light years. e.g. for Lave: &amp;lt;code&amp;gt;(8, 34.6, 0)&amp;lt;/code&amp;gt;. The z component is always zero.&lt;br /&gt;
&lt;br /&gt;
The upper left corner has the coordinate &amp;lt;code&amp;gt;(0, 0, 0)&amp;lt;/code&amp;gt;. Going right increases the x value while going down on the map increases the y value.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 System.infoForSystem(galaxyNumber, 7).coordinates&lt;br /&gt;
returns the coordinates of the system with an ID number of 7 in the current galaxy. In the first galaxy that would be the coordinates for Lave: &amp;lt;code&amp;gt;(8, 34.6, 0)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galaxyID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galaxyID''' : Number (read-only nonnegative integer)&lt;br /&gt;
The ID number of the galaxy.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;internalCoordinates&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''internalCoordinates''' : {{oojsclass|Vector3D}} (read-only)&lt;br /&gt;
'''Discouraged in favour of &amp;lt;code&amp;gt;[[#coordinates|coordinates]]&amp;lt;/code&amp;gt;.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The coordinate of the system in the internal coordinate system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;systemID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''systemID''' : Number (read-only nonnegative integer)&lt;br /&gt;
The ID number of the system.&lt;br /&gt;
&lt;br /&gt;
== More properties ==&lt;br /&gt;
In addition to the properties above, you can access many other system properties, using the same keys as [[planetinfo.plist]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 &amp;lt;code&amp;gt;system.info.description = &amp;quot;This is a dull planet.&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
sets the description of the current planet to “This is a dull planet.”&lt;br /&gt;
&lt;br /&gt;
Modified properties are permanent and are stored in saved game. Changes made by scripts override those in ''[[planetinfo.plist]]''. Set a property to &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; to restore the ''[[planetinfo.plist]]'' value, or the default.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;distanceToSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''distanceToSystem'''(system : SystemInfo) : Number&lt;br /&gt;
Returns the distance in light years to another &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 System.infoForSystem(galaxyNumber, 7).distanceToSystem(System.infoForSystem(galaxyNumber, 8))&lt;br /&gt;
If galaxyNumber is 0, this returns 92.8.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;routeToSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''routeToSystem'''(system : SystemInfo [, &amp;quot;OPTIMIZED_BY_JUMPS&amp;quot; | &amp;quot;OPTIMIZED_BY_TIME&amp;quot;] ) : Object&lt;br /&gt;
Returns a dictionary containing the route information to another &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt;. The dictionary contains the array of system IDs that belong to the &amp;lt;code&amp;gt;route&amp;lt;/code&amp;gt; found, the &amp;lt;code&amp;gt;distance&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt; corresponding to said route. Takes the optional parameter &amp;lt;code&amp;gt;&amp;quot;OPTIMIZED_BY_JUMPS&amp;quot;&amp;lt;/code&amp;gt; (default) or &amp;lt;code&amp;gt;&amp;quot;OPTIMIZED_BY_TIME&amp;quot;&amp;lt;/code&amp;gt; to calculate least number of jumps or fastest transit time routes respectively.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var myRoute = System.infoForSystem(galaxyNumber, 7).routeToSystem(System.infoForSystem(galaxyNumber, 8))&lt;br /&gt;
 myRoute.route&lt;br /&gt;
 myRoute.distance&lt;br /&gt;
 myRoute.time&lt;br /&gt;
returns:&lt;br /&gt;
 7,129,227,73,89,222,29,42,131,62,150,36,28,16,185,86,138,51,8  (the route)&lt;br /&gt;
 96.40  (distance of added jumps)&lt;br /&gt;
 530.40 (travelled time)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;systemsInRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''systemsInRange'''([range : Number]) : Array&lt;br /&gt;
Returns an array of &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt;s in range (default: 7) from the given system.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' will not produce correct results if used in interstellar space.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 system.info.systemsInRange(5);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;SystemInfo.[[#systemsInRange_2|systemsInRange()]]&amp;lt;/code&amp;gt; (which always provides results relative to the current system).&lt;br /&gt;
&lt;br /&gt;
== Static methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;filteredSystems&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''filteredSystems'''(this : Object, predicate : Function) : Array of SystemInfo&lt;br /&gt;
A list of the &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt;s for which &amp;lt;code&amp;gt;predicate&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 // This is the actual implementation of &amp;lt;code&amp;gt;[[#systemsInRange|systemsInRange()]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
 SystemInfo.prototype.systemsInRange = function systemsInRange(range) &lt;br /&gt;
 { &lt;br /&gt;
    if (range === undefined) &lt;br /&gt;
    { &lt;br /&gt;
        range = 7; &lt;br /&gt;
    } &lt;br /&gt;
    &lt;br /&gt;
    return SystemInfo.filteredSystems(this, function(other) &lt;br /&gt;
    { &lt;br /&gt;
        return (other.systemID !== this.systemID) &amp;amp;&amp;amp; (this.distanceToSystem(other) &amp;lt;= range); &lt;br /&gt;
    }); &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Shaders_in_Oolite:_uniforms&amp;diff=30627</id>
		<title>Shaders in Oolite: uniforms</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Shaders_in_Oolite:_uniforms&amp;diff=30627"/>
		<updated>2012-01-19T17:29:18Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Conversions */ Spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:&amp;lt;small&amp;gt;The information presented on this page applies to Oolite test release 1.69 and later.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A '''uniform''' in a [[Shaders in Oolite|shader]] is a variable whose value is specified by the host application – in this case, [[Oolite]]. Oolite allows arbitrary uniforms to be specified for shaders applied to ships, and these may either take constant values specified in ''shipdata.plist'', or be “bound” to an attribute of the ship. This allows shader authors to access numerous properties of a game entity without having to ask for them and wait for an updated version of Oolite. ('''Note:''' in the case of subentities, bound properties are fetched from the parent ship.)&lt;br /&gt;
&lt;br /&gt;
=== Basic syntax ===&lt;br /&gt;
Uniforms are specified in the ''materials'' or ''shaders'' dictionary of a ship’s ''shipdata.plist'' entry:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;&amp;quot;ahruman_shady_cobra_example&amp;quot; =&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;    like_ship = &amp;quot;cobra3-player&amp;quot;;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;    shaders =&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;    {&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;        &amp;quot;cobra3_redux.png&amp;quot; =&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;        {&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;            textures = ( &amp;quot;cobra3_redux.png&amp;quot; );&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;            fragment_shader = &amp;quot;ahruman_shady_cobra_example.fragment&amp;quot;;&amp;lt;/font&amp;gt;&lt;br /&gt;
             uniforms =&lt;br /&gt;
             {&lt;br /&gt;
                 shininess =&lt;br /&gt;
                 {&lt;br /&gt;
                     type = float;&lt;br /&gt;
                     value = 42.0;&lt;br /&gt;
                 };&lt;br /&gt;
                 withinAegis = &amp;quot;withinStationAegis&amp;quot;;&lt;br /&gt;
                 compassMode = &amp;quot;compassMode&amp;quot;;&lt;br /&gt;
             }&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;        }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;    }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&lt;br /&gt;
This contrived example declares three uniforms, ''shininess'', ''withinAegis'' and ''compassMode''. ''shininess'' is a constant &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;; it is always 42. ''withinAegis'' is bound to the ship’s ''withinStationAegis'' property. (See below for information on available properties.) This is a boolean, that is, a number whose value is either 0 (meaning no) or 1 (meaning yes). ''compassMode'' is a binding to the ''compassMode'' property. To use the uniforms within a shader (either a vertex shader or a fragment shader), they are declared as follows:&lt;br /&gt;
 uniform float shininess;&lt;br /&gt;
 uniform int withinAegis;&lt;br /&gt;
 uniform int compassMode;&lt;br /&gt;
 ...&lt;br /&gt;
 void main(void)&lt;br /&gt;
 {&lt;br /&gt;
     if (withinAegis)&lt;br /&gt;
     {&lt;br /&gt;
          // Do aegis-specific effect here&lt;br /&gt;
     }&lt;br /&gt;
     ...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Uniform property types ===&lt;br /&gt;
Every bindable property has a '''type'''. The simplest types, ''int'' and ''float'', correspond directly to the same types in GLSL. Both represent numbers, with the difference that a ''float'' can represent fractional values and very large values, but always has the same level of precision (about six digits), while ''int''s can represent any integer (non-fractional value) in a limited range. A ''bool'' is an integer whose value can be only 0 (meaning no or false) or 1 (meaning yes or true). ('''Note:''' the GLSL specification is deliberately vague on the ranges of the number types. It also points out that most hardware will actually use floating-point calculations for ''int'' variables, which implies that integer calculations will incur rounding overhead.)&lt;br /&gt;
&lt;br /&gt;
The ''vector'' type is translated to a GLSL ''vec4'', whose ''x'', ''y'' and ''z'' components correspond to those of the Oolite vector, and whose ''w'' component is always 1.0.&lt;br /&gt;
&lt;br /&gt;
The ''quaternion'' type can be translated to a ''mat4x4'' representing a rotation matrix, or to a ''vec4'' whose ''x'', ''y'', ''z'' and ''w'' components correspond to those of the Oolite quaternion.&lt;br /&gt;
&lt;br /&gt;
The ''matrix'' type is translated into a GLSL ''mat4x4''.&lt;br /&gt;
&lt;br /&gt;
The ''colour'' type is translated into a GLSL ''vec4'' type, whose ''r'', ''g'', ''b'' and ''a'' components correspond to those of the Oolite colour object.&lt;br /&gt;
&lt;br /&gt;
==== Conversions ====&lt;br /&gt;
Several types of binding can be modified by conversion options, specified in the '''uniforms''' dictionary, for example:&lt;br /&gt;
 haveFuel =&lt;br /&gt;
 {&lt;br /&gt;
     binding = &amp;quot;fuel&amp;quot;;&lt;br /&gt;
     clamped = true;&lt;br /&gt;
 };&lt;br /&gt;
The '''clamped''' conversion option, when applied to a property of type ''float'', causes the value to be clamped to the range [0, 1]. When applied to an ''int'' property, any value other than 0 (including negative values) is converted to 1. The default value is ''false''.&lt;br /&gt;
&lt;br /&gt;
The '''normalized''' option causes vector properties to be normalized, that is, scaled so they have the same direction but length 1. The default value is ''false''.&lt;br /&gt;
&lt;br /&gt;
The '''asMatrix''' option causes quaternion properties to be converted to rotation matrix, rather than having their components packed into a ''vec4''. The default value is ''true''.&lt;br /&gt;
&lt;br /&gt;
=== Bindable property reference ===&lt;br /&gt;
The following sections list entity properties which can be used in a uniform binding, regardless of apparent usefullness. Note, however, that '''some of these names may change before the next stable release'''.&lt;br /&gt;
&lt;br /&gt;
==== Entity ====&lt;br /&gt;
The following properties are available for all entities:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Bindable entity properties&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ''position'' || vector || The location of the entity in system co-ordinates.&lt;br /&gt;
|-&lt;br /&gt;
| ''orientation'' || quaternion || The orientation of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''relativePosition'' || vector || The location of the entity, relative to the player.&lt;br /&gt;
|-&lt;br /&gt;
| ''viewpointOffset'' || vector || The location of the current camera, in entity co-ordinates. Although this is defined for all entities, it is only meaningful for the player ship.&lt;br /&gt;
|-&lt;br /&gt;
| ''collisionRadius'' || float || Together with the ''position'', specifies a sphere completely containing the collidable volume of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''mass'' || float || The mass of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''energy'' || float || The current energy level of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''maxEnergy'' || float || The current maximum energy level of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''universalTime'' || float || The [[Time scales in Oolite#game real time|game real time]] clock. The value is the same for all entities and updates once per frame.&lt;br /&gt;
|-&lt;br /&gt;
| ''spawnTime'' || float || The [[Time scales in Oolite#game real time|game real time]] at which the entity came into existance.&lt;br /&gt;
|-&lt;br /&gt;
| ''timeElapsedSinceSpawn'' || float || The number of seconds (in the [[Time scales in Oolite#game real time|game real time]] scale) since the entity came into existance – the difference between ''universalTime'' and ''spawnTime''.&lt;br /&gt;
|-&lt;br /&gt;
| ''throwingSparks'' || bool || Whether the entity is generating sparks (for instance, a ship about to explode).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ship ====&lt;br /&gt;
Ships (i.e., anything set up in ''shipdata.plist'', regardless of function) have all the properties of [[#Entity|entities]], and several others:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Bindable ship properties&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ''isBeacon'' || bool || True if the entity is a beacon.&lt;br /&gt;
|-&lt;br /&gt;
| ''isFrangible'' || bool || True if the entity is frangible, i.e. subentities can be shot off.&lt;br /&gt;
|-&lt;br /&gt;
| ''isCloaked'' || bool || True if the entity is cloaked. [b]Note:[/b] a cloaked ship will only be drawn approximately once per ten frames, regardless of shaders.&lt;br /&gt;
|-&lt;br /&gt;
| ''isJammingScanning'' || bool || True if the ship has an active military jammer.&lt;br /&gt;
|-&lt;br /&gt;
| ''hasMilitaryScannerFilter'' || bool || True if the ship has a military scanner filter.&lt;br /&gt;
|-&lt;br /&gt;
| ''messageTime'' || float || Time before a radio message may be sent, in seconds. (This is set to 6.0 seconds when an NPC ship sends a message, and decreases over time.)&lt;br /&gt;
|-&lt;br /&gt;
| ''groupID'' || int || Unique identifier for the escort group the ship belongs to.&lt;br /&gt;
|-&lt;br /&gt;
| ''escortCount'' || int || The number of active escorts the ship has.&lt;br /&gt;
|-&lt;br /&gt;
| ''hasHostileTarget'' || bool || True if the ship has a target and the ship’s current AI behaviour is one of hostile intent.&lt;br /&gt;
|-&lt;br /&gt;
| ''weaponRange'' || float || Maximum range (in metres) of the ship’s main weapon. [b]Note:[/b] since subentities’ shaders get the parent ship’s properties, this may not work as expected.&lt;br /&gt;
|-&lt;br /&gt;
| ''scannerRange'' || float || The distance (in metres) in which the ship will scan for enemies.&lt;br /&gt;
|-&lt;br /&gt;
| ''withinStationAegis'' || float || True if the ship is within the aegis of the system’s main station.&lt;br /&gt;
|-&lt;br /&gt;
| ''fuel'' || int || Ship’s fuel level, in tenths of a light year.&lt;br /&gt;
|-&lt;br /&gt;
| ''flightPitch'' || float || Current pitch rate.&lt;br /&gt;
|-&lt;br /&gt;
| ''flightRoll'' || float || Current roll rate.&lt;br /&gt;
|-&lt;br /&gt;
| ''flightYaw'' || float || Current yaw rate. Currently always 0 for NPC ships.&lt;br /&gt;
|-&lt;br /&gt;
| ''flightSpeed'' || float || Ship’s current speed.&lt;br /&gt;
|-&lt;br /&gt;
| ''maxFlightSpeed'' || float || Ship’s speed at full throttle. Something of a misnomer – actual speed may be higher using afterburners or hyperspeed.&lt;br /&gt;
|-&lt;br /&gt;
| ''speedFactor'' || float || ''flightSpeed'' divided by ''maxFlightSpeed''. May be greater than 1.0 (unless [[#Conversions|clamped]] is used).&lt;br /&gt;
|-&lt;br /&gt;
| ''damage'' || int || ''energy'' expressed as a percentage of ''maxEnergy''.&lt;br /&gt;
|-&lt;br /&gt;
| ''laserHeatLevel'' || float || The temperature level of the current weapon.&lt;br /&gt;
|-&lt;br /&gt;
| ''hullHeatLevel'' || float || The temperature level of the hull, due to proximity to stars, atmospheric drag or combat hits. When it reaches 1.0, the ship starts taking damage rapidly.&lt;br /&gt;
|-&lt;br /&gt;
| ''entityPersonality'' || float || A randomly-generated value in the range 0.0 to 1.0 that stays with the entity for its lifetime. Useful for adding random variations.&lt;br /&gt;
|-&lt;br /&gt;
| ''entityPersonalityInt'' || float || Same as ''entity_personality'', scaled to the range 0 to 32767.&lt;br /&gt;
|-&lt;br /&gt;
| ''numberOfScannedShips'' || int || The number of ships within scanner range (but no more than 16).&lt;br /&gt;
|-&lt;br /&gt;
| ''destination'' || vector || The location, in system co-ordinates, that the AI is trying to fly to. This may not always be meaningful depending on AI state.&lt;br /&gt;
|-&lt;br /&gt;
| ''rangeToDestination'' || float || The distance in metres between ''position'' and ''destination''.&lt;br /&gt;
|-&lt;br /&gt;
| ''rangeToPrimaryTarget'' || float || The distance in metres to the AI’s target (i.e., the ship it is trying to shoot). 0 if no target.&lt;br /&gt;
|-&lt;br /&gt;
| ''laserColor'' || colour || The colour of the ship’s laser.&lt;br /&gt;
|-&lt;br /&gt;
| ''isHulk'' || bool || True if the ship has been abandoned.&lt;br /&gt;
|-&lt;br /&gt;
| ''lightsActive'' || bool || True if flashers are turned on, false otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Player ship ====&lt;br /&gt;
The player ship has all the properties of [[#Entity|entities]] and [[#Ship|ships]], and several others:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Bindable player ship properties&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ''massLocked'' || bool || True if the ship is too close to a large object to be able to make a witchspace jump.&lt;br /&gt;
|-&lt;br /&gt;
| ''atHyperspeed'' || bool || True if the ship is at hyperspeed.&lt;br /&gt;
|-&lt;br /&gt;
| ''velocityVector'' || vector || The ship’s velocity.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialForwardShield'' || float || The forward shield level, ranging from 0.0 to 1.0.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialAftShield'' || float || The aft shield level, ranging from 0.0 to 1.0.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialMissileStatus'' || int || State of selected missile – 0 for safe/no missile, 1 for active, 2 for locked.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialFuelScoopStatus'' || int || State of cargo scoop – 0 for no scoop installed, 1 for full hold, 2 for idle with space in hold, 3 for actively scooping.&lt;br /&gt;
|-&lt;br /&gt;
| ''compassMode'' || int || State of advanced space compass – 0 for no advanced space compass installed, 1 for planet mode, 2 for station mode, 3 for sun mode, 4 for target mode, 5 for any beacon. More may be added in future.&lt;br /&gt;
|-&lt;br /&gt;
| ''activeMissile'' || int || Which missile slot is currently selected, from 0 to ''dialMaxMissiles'' - 1.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialMaxMissiles'' || int || The number of missile slots on the ship.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialIdentEngaged'' || bool || True if ident (targeting) mode is active.&lt;br /&gt;
|-&lt;br /&gt;
| ''alertCondition'' || int || Current alert condition – 0 for docked, 1 for green, 2 for yellow, 3 for red.&lt;br /&gt;
|-&lt;br /&gt;
| ''trumbleCount'' || int || Number of trumbles with which the player’s ship is infected.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
Additionally, all [[Methods#Querying states|state query scripting methods]] ending with ''_number'' may be used for the player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;br /&gt;
[[Category:Oolite scripting]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Shaders_in_Oolite:_uniforms&amp;diff=30626</id>
		<title>Shaders in Oolite: uniforms</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Shaders_in_Oolite:_uniforms&amp;diff=30626"/>
		<updated>2012-01-19T17:28:24Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Basic syntax */ Formatting fixes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:&amp;lt;small&amp;gt;The information presented on this page applies to Oolite test release 1.69 and later.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A '''uniform''' in a [[Shaders in Oolite|shader]] is a variable whose value is specified by the host application – in this case, [[Oolite]]. Oolite allows arbitrary uniforms to be specified for shaders applied to ships, and these may either take constant values specified in ''shipdata.plist'', or be “bound” to an attribute of the ship. This allows shader authors to access numerous properties of a game entity without having to ask for them and wait for an updated version of Oolite. ('''Note:''' in the case of subentities, bound properties are fetched from the parent ship.)&lt;br /&gt;
&lt;br /&gt;
=== Basic syntax ===&lt;br /&gt;
Uniforms are specified in the ''materials'' or ''shaders'' dictionary of a ship’s ''shipdata.plist'' entry:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;&amp;quot;ahruman_shady_cobra_example&amp;quot; =&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;{&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;    like_ship = &amp;quot;cobra3-player&amp;quot;;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;    shaders =&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;    {&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;        &amp;quot;cobra3_redux.png&amp;quot; =&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;        {&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;            textures = ( &amp;quot;cobra3_redux.png&amp;quot; );&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;            fragment_shader = &amp;quot;ahruman_shady_cobra_example.fragment&amp;quot;;&amp;lt;/font&amp;gt;&lt;br /&gt;
             uniforms =&lt;br /&gt;
             {&lt;br /&gt;
                 shininess =&lt;br /&gt;
                 {&lt;br /&gt;
                     type = float;&lt;br /&gt;
                     value = 42.0;&lt;br /&gt;
                 };&lt;br /&gt;
                 withinAegis = &amp;quot;withinStationAegis&amp;quot;;&lt;br /&gt;
                 compassMode = &amp;quot;compassMode&amp;quot;;&lt;br /&gt;
             }&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;        }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;    }&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;#AAAAAA&amp;quot;&amp;gt;}&amp;lt;/font&amp;gt;&lt;br /&gt;
This contrived example declares three uniforms, ''shininess'', ''withinAegis'' and ''compassMode''. ''shininess'' is a constant &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;; it is always 42. ''withinAegis'' is bound to the ship’s ''withinStationAegis'' property. (See below for information on available properties.) This is a boolean, that is, a number whose value is either 0 (meaning no) or 1 (meaning yes). ''compassMode'' is a binding to the ''compassMode'' property. To use the uniforms within a shader (either a vertex shader or a fragment shader), they are declared as follows:&lt;br /&gt;
 uniform float shininess;&lt;br /&gt;
 uniform int withinAegis;&lt;br /&gt;
 uniform int compassMode;&lt;br /&gt;
 ...&lt;br /&gt;
 void main(void)&lt;br /&gt;
 {&lt;br /&gt;
     if (withinAegis)&lt;br /&gt;
     {&lt;br /&gt;
          // Do aegis-specific effect here&lt;br /&gt;
     }&lt;br /&gt;
     ...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Uniform property types ===&lt;br /&gt;
Every bindable property has a '''type'''. The simplest types, ''int'' and ''float'', correspond directly to the same types in GLSL. Both represent numbers, with the difference that a ''float'' can represent fractional values and very large values, but always has the same level of precision (about six digits), while ''int''s can represent any integer (non-fractional value) in a limited range. A ''bool'' is an integer whose value can be only 0 (meaning no or false) or 1 (meaning yes or true). ('''Note:''' the GLSL specification is deliberately vague on the ranges of the number types. It also points out that most hardware will actually use floating-point calculations for ''int'' variables, which implies that integer calculations will incur rounding overhead.)&lt;br /&gt;
&lt;br /&gt;
The ''vector'' type is translated to a GLSL ''vec4'', whose ''x'', ''y'' and ''z'' components correspond to those of the Oolite vector, and whose ''w'' component is always 1.0.&lt;br /&gt;
&lt;br /&gt;
The ''quaternion'' type can be translated to a ''mat4x4'' representing a rotation matrix, or to a ''vec4'' whose ''x'', ''y'', ''z'' and ''w'' components correspond to those of the Oolite quaternion.&lt;br /&gt;
&lt;br /&gt;
The ''matrix'' type is translated into a GLSL ''mat4x4''.&lt;br /&gt;
&lt;br /&gt;
The ''colour'' type is translated into a GLSL ''vec4'' type, whose ''r'', ''g'', ''b'' and ''a'' components correspond to those of the Oolite colour object.&lt;br /&gt;
&lt;br /&gt;
==== Conversions ====&lt;br /&gt;
Several types of binding can be modified by conversion options, specified in the '''uniforms''' dictionary, for example:&lt;br /&gt;
 haveFuel =&lt;br /&gt;
 {&lt;br /&gt;
     binding = &amp;quot;fuel&amp;quot;;&lt;br /&gt;
     clamped = true;&lt;br /&gt;
 };&lt;br /&gt;
The '''clamped''' conversion option, when applied to a property of type ''float'', causes the value to be clamped to the range [0, 1]. When applied to an ''int'' propertie, any value other than 0 (including negative values) is converted to 1. The default value is ''false''.&lt;br /&gt;
&lt;br /&gt;
The '''normalized''' option causes vector properties to be normalized, that is, scaled so they have the same direction but length 1. The default value is ''false''.&lt;br /&gt;
&lt;br /&gt;
The '''asMatrix''' option causes quaternion properties to be converted to rotation matrix, rather than having their components packed into a ''vec4''. The default value is ''true''.&lt;br /&gt;
&lt;br /&gt;
=== Bindable property reference ===&lt;br /&gt;
The following sections list entity properties which can be used in a uniform binding, regardless of apparent usefullness. Note, however, that '''some of these names may change before the next stable release'''.&lt;br /&gt;
&lt;br /&gt;
==== Entity ====&lt;br /&gt;
The following properties are available for all entities:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Bindable entity properties&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ''position'' || vector || The location of the entity in system co-ordinates.&lt;br /&gt;
|-&lt;br /&gt;
| ''orientation'' || quaternion || The orientation of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''relativePosition'' || vector || The location of the entity, relative to the player.&lt;br /&gt;
|-&lt;br /&gt;
| ''viewpointOffset'' || vector || The location of the current camera, in entity co-ordinates. Although this is defined for all entities, it is only meaningful for the player ship.&lt;br /&gt;
|-&lt;br /&gt;
| ''collisionRadius'' || float || Together with the ''position'', specifies a sphere completely containing the collidable volume of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''mass'' || float || The mass of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''energy'' || float || The current energy level of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''maxEnergy'' || float || The current maximum energy level of the entity.&lt;br /&gt;
|-&lt;br /&gt;
| ''universalTime'' || float || The [[Time scales in Oolite#game real time|game real time]] clock. The value is the same for all entities and updates once per frame.&lt;br /&gt;
|-&lt;br /&gt;
| ''spawnTime'' || float || The [[Time scales in Oolite#game real time|game real time]] at which the entity came into existance.&lt;br /&gt;
|-&lt;br /&gt;
| ''timeElapsedSinceSpawn'' || float || The number of seconds (in the [[Time scales in Oolite#game real time|game real time]] scale) since the entity came into existance – the difference between ''universalTime'' and ''spawnTime''.&lt;br /&gt;
|-&lt;br /&gt;
| ''throwingSparks'' || bool || Whether the entity is generating sparks (for instance, a ship about to explode).&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ship ====&lt;br /&gt;
Ships (i.e., anything set up in ''shipdata.plist'', regardless of function) have all the properties of [[#Entity|entities]], and several others:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Bindable ship properties&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ''isBeacon'' || bool || True if the entity is a beacon.&lt;br /&gt;
|-&lt;br /&gt;
| ''isFrangible'' || bool || True if the entity is frangible, i.e. subentities can be shot off.&lt;br /&gt;
|-&lt;br /&gt;
| ''isCloaked'' || bool || True if the entity is cloaked. [b]Note:[/b] a cloaked ship will only be drawn approximately once per ten frames, regardless of shaders.&lt;br /&gt;
|-&lt;br /&gt;
| ''isJammingScanning'' || bool || True if the ship has an active military jammer.&lt;br /&gt;
|-&lt;br /&gt;
| ''hasMilitaryScannerFilter'' || bool || True if the ship has a military scanner filter.&lt;br /&gt;
|-&lt;br /&gt;
| ''messageTime'' || float || Time before a radio message may be sent, in seconds. (This is set to 6.0 seconds when an NPC ship sends a message, and decreases over time.)&lt;br /&gt;
|-&lt;br /&gt;
| ''groupID'' || int || Unique identifier for the escort group the ship belongs to.&lt;br /&gt;
|-&lt;br /&gt;
| ''escortCount'' || int || The number of active escorts the ship has.&lt;br /&gt;
|-&lt;br /&gt;
| ''hasHostileTarget'' || bool || True if the ship has a target and the ship’s current AI behaviour is one of hostile intent.&lt;br /&gt;
|-&lt;br /&gt;
| ''weaponRange'' || float || Maximum range (in metres) of the ship’s main weapon. [b]Note:[/b] since subentities’ shaders get the parent ship’s properties, this may not work as expected.&lt;br /&gt;
|-&lt;br /&gt;
| ''scannerRange'' || float || The distance (in metres) in which the ship will scan for enemies.&lt;br /&gt;
|-&lt;br /&gt;
| ''withinStationAegis'' || float || True if the ship is within the aegis of the system’s main station.&lt;br /&gt;
|-&lt;br /&gt;
| ''fuel'' || int || Ship’s fuel level, in tenths of a light year.&lt;br /&gt;
|-&lt;br /&gt;
| ''flightPitch'' || float || Current pitch rate.&lt;br /&gt;
|-&lt;br /&gt;
| ''flightRoll'' || float || Current roll rate.&lt;br /&gt;
|-&lt;br /&gt;
| ''flightYaw'' || float || Current yaw rate. Currently always 0 for NPC ships.&lt;br /&gt;
|-&lt;br /&gt;
| ''flightSpeed'' || float || Ship’s current speed.&lt;br /&gt;
|-&lt;br /&gt;
| ''maxFlightSpeed'' || float || Ship’s speed at full throttle. Something of a misnomer – actual speed may be higher using afterburners or hyperspeed.&lt;br /&gt;
|-&lt;br /&gt;
| ''speedFactor'' || float || ''flightSpeed'' divided by ''maxFlightSpeed''. May be greater than 1.0 (unless [[#Conversions|clamped]] is used).&lt;br /&gt;
|-&lt;br /&gt;
| ''damage'' || int || ''energy'' expressed as a percentage of ''maxEnergy''.&lt;br /&gt;
|-&lt;br /&gt;
| ''laserHeatLevel'' || float || The temperature level of the current weapon.&lt;br /&gt;
|-&lt;br /&gt;
| ''hullHeatLevel'' || float || The temperature level of the hull, due to proximity to stars, atmospheric drag or combat hits. When it reaches 1.0, the ship starts taking damage rapidly.&lt;br /&gt;
|-&lt;br /&gt;
| ''entityPersonality'' || float || A randomly-generated value in the range 0.0 to 1.0 that stays with the entity for its lifetime. Useful for adding random variations.&lt;br /&gt;
|-&lt;br /&gt;
| ''entityPersonalityInt'' || float || Same as ''entity_personality'', scaled to the range 0 to 32767.&lt;br /&gt;
|-&lt;br /&gt;
| ''numberOfScannedShips'' || int || The number of ships within scanner range (but no more than 16).&lt;br /&gt;
|-&lt;br /&gt;
| ''destination'' || vector || The location, in system co-ordinates, that the AI is trying to fly to. This may not always be meaningful depending on AI state.&lt;br /&gt;
|-&lt;br /&gt;
| ''rangeToDestination'' || float || The distance in metres between ''position'' and ''destination''.&lt;br /&gt;
|-&lt;br /&gt;
| ''rangeToPrimaryTarget'' || float || The distance in metres to the AI’s target (i.e., the ship it is trying to shoot). 0 if no target.&lt;br /&gt;
|-&lt;br /&gt;
| ''laserColor'' || colour || The colour of the ship’s laser.&lt;br /&gt;
|-&lt;br /&gt;
| ''isHulk'' || bool || True if the ship has been abandoned.&lt;br /&gt;
|-&lt;br /&gt;
| ''lightsActive'' || bool || True if flashers are turned on, false otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Player ship ====&lt;br /&gt;
The player ship has all the properties of [[#Entity|entities]] and [[#Ship|ships]], and several others:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Bindable player ship properties&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ''massLocked'' || bool || True if the ship is too close to a large object to be able to make a witchspace jump.&lt;br /&gt;
|-&lt;br /&gt;
| ''atHyperspeed'' || bool || True if the ship is at hyperspeed.&lt;br /&gt;
|-&lt;br /&gt;
| ''velocityVector'' || vector || The ship’s velocity.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialForwardShield'' || float || The forward shield level, ranging from 0.0 to 1.0.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialAftShield'' || float || The aft shield level, ranging from 0.0 to 1.0.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialMissileStatus'' || int || State of selected missile – 0 for safe/no missile, 1 for active, 2 for locked.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialFuelScoopStatus'' || int || State of cargo scoop – 0 for no scoop installed, 1 for full hold, 2 for idle with space in hold, 3 for actively scooping.&lt;br /&gt;
|-&lt;br /&gt;
| ''compassMode'' || int || State of advanced space compass – 0 for no advanced space compass installed, 1 for planet mode, 2 for station mode, 3 for sun mode, 4 for target mode, 5 for any beacon. More may be added in future.&lt;br /&gt;
|-&lt;br /&gt;
| ''activeMissile'' || int || Which missile slot is currently selected, from 0 to ''dialMaxMissiles'' - 1.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialMaxMissiles'' || int || The number of missile slots on the ship.&lt;br /&gt;
|-&lt;br /&gt;
| ''dialIdentEngaged'' || bool || True if ident (targeting) mode is active.&lt;br /&gt;
|-&lt;br /&gt;
| ''alertCondition'' || int || Current alert condition – 0 for docked, 1 for green, 2 for yellow, 3 for red.&lt;br /&gt;
|-&lt;br /&gt;
| ''trumbleCount'' || int || Number of trumbles with which the player’s ship is infected.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
Additionally, all [[Methods#Querying states|state query scripting methods]] ending with ''_number'' may be used for the player.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]]&lt;br /&gt;
[[Category:Oolite scripting]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=30608</id>
		<title>Oolite JavaScript Reference: Global</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=30608"/>
		<updated>2012-01-17T08:22:38Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* isValidFrameCallback */ Style fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Global variables and functions are visible to all scripts. They are also properties of &amp;lt;code&amp;gt;[[#global|global]]&amp;lt;/code&amp;gt;, which is itself a global variable and hence a property of itself.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;clock&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''clock''' : {{oojsclass|Clock}} (read-only)&lt;br /&gt;
This property allows an OXP to access the game clock's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;defaultFont&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''defaultFont''' : Object (read-only)&lt;br /&gt;
An object with a single method, &amp;lt;code&amp;gt;measureString(string)&amp;lt;/code&amp;gt;, which returns the width of the specified string, as it would be shown on the screen, in '''ems'''. One em is the intrinsic unit size of a font; for example, if a font is rendered at 12 points, 1 em = 12 pt. The mission screen text area is 32 em wide.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galaxyNumber&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galaxyNumber''' : Number (read-only)&lt;br /&gt;
Returns the number ot the galaxy the player is in.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;global&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''global''' : Global (read-only)&lt;br /&gt;
All global variables and functions are actually properties of the global object. The global object is a property of itself, and this is it.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;guiScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''guiScreen''' : String (read-only)&lt;br /&gt;
Returns the screen the player is looking at. If in flight, this is &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MAIN&amp;quot;&amp;lt;/code&amp;gt;. Currently, the other possible values are &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTRO1&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTRO2&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LONG_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHORT_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_CONTRACTS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_OPTIONS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_GAMEOPTIONS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LOAD&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SAVE&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SAVE_OVERWRITE&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STICKMAPPER&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MISSION&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_REPORT&amp;quot;&amp;lt;/code&amp;gt;. This list may change in future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;manifest&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''manifest''' : {{oojsclass|Manifest}} (read-only)&lt;br /&gt;
An alias to &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|player.ship.manifest]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mission&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mission''' : {{oojsclass|Mission}} (read-only)&lt;br /&gt;
See [[Oolite JavaScript Reference: Mission]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''missionVariables''' : Object (read-only)&lt;br /&gt;
The &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt; object stores values that are stored in saved games. This is the main way for scripts to store information permanently.&lt;br /&gt;
&lt;br /&gt;
Whenever a value is assigned to a property of &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt;, it is converted to a string object and tracked with the player. When the value is read, it will be converted to a number if possible, otherwise returned as a string. Example:&lt;br /&gt;
 missionVariables.exampleVar = 42;&lt;br /&gt;
 let x = missionVariables.exampleVar; // x is now the number 42&lt;br /&gt;
&lt;br /&gt;
Mission variables can also be used in legacy scripts and in [[Misc_plists|descriptions.plist]] string expansions, by prefixing the name with “mission_”. Example:&lt;br /&gt;
 expandDescription(&amp;quot;My variable is [mission_exampleVar].&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Setting and retrieving mission variables has a significant overhead #. If a function needs to use a mission variable value several times, it is strongly recommended that it be copied into a local variable and, if necessary, stored back once. Example:&lt;br /&gt;
 let x = missionVariables.exampleVar;&lt;br /&gt;
 if (x &amp;lt; 3)  x = processSmallValue(x);&lt;br /&gt;
 else  x = processBigValue(x);&lt;br /&gt;
 missionVariables.exampleVar = x;&lt;br /&gt;
&lt;br /&gt;
Mission variable names may not begin with an underscore (“_”). Unassigned mission variables are always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
.#: On a computer were the loop &amp;quot;&amp;lt;code&amp;gt;for ( var i= 0 ; i &amp;lt; 1000 ; i++){}&amp;lt;/code&amp;gt;&amp;quot; takes just 0.62 msec, will the same loop with missionVarriables &amp;lt;code&amp;gt;for (missionVariables.i= 0 ; missionVariables.i &amp;lt; 1000 ; missionVariables.i++){}&amp;lt;/code&amp;gt; consume a full 38 msec. That is 60 times longer.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;oolite&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''oolite''' : {{oojsclass|Oolite}} (read-only)&lt;br /&gt;
An object describing properties of the Oolite application; see [[Oolite JavaScript Reference: Oolite]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''player''' : {{oojsclass|Player}} (read-only)&lt;br /&gt;
This property allows an OXP to access the player object's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''system''' : {{oojsclass|System}} (read-only)&lt;br /&gt;
This property allows an OXP to access the current system's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;timeAccelerationFactor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''timeAccelerationFactor''' : Number (read/write)&lt;br /&gt;
Also known as TAF. Will change the ratio between game real time and actual real time (default is 1). The accepted range is between 0.0625 (1/16) and 16. Attempting to set numbers outside this range will reset the TAF to 1. (In end-user stable builds, this will be a read-only property with the value 1.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;worldScripts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''worldScripts''' : Object (read-only)&lt;br /&gt;
A list of world script objects.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 log(worldScripts[&amp;quot;oolite-nova&amp;quot;].version);&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addFrameCallback'''(callback : Function) : ''TrackingID''&lt;br /&gt;
Registers a ''frame callback'' which will be invoked every frame, after entity updates but before rendering. This can be used to implement animations. The return value is a ''tracking ID'' which may be passed to &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;; the type and meaning of the tracking ID is unspecified and may change at any time. Frame callbacks are automatically removed when the game resets (for instance, when the player dies), but not at any other time.&lt;br /&gt;
&lt;br /&gt;
The callback is passed one parameter, &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt;, which is the time since the last frame (in [[Time_scales in Oolite|game clock time]]). Frame callbacks fire even when the game is paused, in which case &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt; is 0.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var sum = 0;&lt;br /&gt;
 this.fcb = addFrameCallback(function (delta)&lt;br /&gt;
 {&lt;br /&gt;
     sum += delta;&lt;br /&gt;
     log(&amp;quot;Time elapsed: &amp;quot; + sum + &amp;quot; (delta: &amp;quot; + delta + &amp;quot;)&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#isValidFrameCallback|isValidFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayNameForCommodity&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''displayNameForCommodity'''(commodityName : String) &lt;br /&gt;
Returns the display name corresponding to the specified commodity. Useful in conjunction with localisation OXPs, or expansions that rename commodities depending on which station / system the player is at.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;expandDescription&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''expandDescription'''(description : String [, locals : Object (Dictionary)]) : String&lt;br /&gt;
Expands a string, substituting special tokens and any key inside square brackets with the substitution rules for [[Methods#Communications|Communications]].&lt;br /&gt;
When local key/value pairs are provided, they take precedence over any other values.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 expandDescription(&amp;quot;My ball is [my_color].&amp;quot;, { my_color: &amp;quot;red&amp;quot; }); &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;expandMissionText&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''expandMissionText'''(textKey: String [, locals : Object (Dictionary)]) : String&lt;br /&gt;
Load a string specified by &amp;lt;code&amp;gt;textKey&amp;lt;/code&amp;gt; from [[missiontext.plist]], then perform &amp;lt;code&amp;gt;[[#expandDescription|expandDescription()]]&amp;lt;/code&amp;gt;-type substitutions on it, and also replace “\n” with line breaks. The &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; parameter works as with &amp;lt;code&amp;gt;[[#expandDescription|expandDescription()]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 expandMissionText(&amp;quot;oolite_trumble_title&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isValidFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''isValidFrameCallback'''(trackingID: ''TrackingID'') : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;trackingID&amp;lt;/code&amp;gt; identifies a frame callback which has been registered with &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt; and not yet removed. (There should be no need to use this except for debugging and testing.)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''log'''([messageClass : String ,] message : String)&lt;br /&gt;
Writes a message to Oolite's log. The optional messageClass can be used to specify which type of message is written to the log.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 log(&amp;quot;myOXP.init&amp;quot;,&amp;quot;MyOXP initialised and ready!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;randomInhabitantsDescription&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''randomInhabitantsDescription'''([plural : boolean, default true])&lt;br /&gt;
Returns a random sentient species name, like “Large Red Fat Insects” or “Human Colonials”, following the same pattern (and probability distribution) as for planet inhabitants.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.consoleMessage(&amp;quot;You'll meet a &amp;quot; +  randomInhabitantsDescription(false) +&lt;br /&gt;
                       &amp;quot;. She'll be with a group of &amp;quot; + randomInhabitantsDescription(true) +&amp;quot;.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;randomName&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''randomName'''()&lt;br /&gt;
Returns a random capitalised word, suitable for use as name, or indeed surname.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.consoleMessage(randomName() + &amp;quot; &amp;quot; + randomName() +&amp;quot; rules this system with an iron fist.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''removeFrameCallback'''(trackingID : ''TrackingID'')&lt;br /&gt;
Removes a frame callback previously registered with &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#isValidFrameCallback|isValidFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenBackground&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''setScreenBackground'''(image : ''guiTextureSpecifier'') &lt;br /&gt;
Temporary override that sets the background of the current gui screen to the specified image. Override is lost after the player switches screens.&lt;br /&gt;
&lt;br /&gt;
''guiTextureSpecifier'' can be either a string or an object with the required key &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and optional keys &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;. If neither width nor height is specified, the dimensions of the image are used. If only one is specified, the other is calculated such that the image is not distorted. The scale unit is 1/480 of the height of the window; in other words, the window is always considered 480 units high, and the width depends on the aspect ratio of the window.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setScreenBackground({ name: &amp;quot;oolite-nova-system.png&amp;quot;, height: 512 });&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenOverlay&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''setScreenOverlay'''(image : ''guiTextureSpecifier'') &lt;br /&gt;
Temporary override that sets the overlay of the current gui screen to the specified image. Override is lost after the player switches screens.&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;[[#setScreenBackground|setScreenBackground()]]&amp;lt;/code&amp;gt; for a discussion of ''guiTextureSpecifier''.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setScreenOverlay('trumblebox.png');&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;takeSnapShot&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''takeSnapShot'''([filename : String]) : Bool&lt;br /&gt;
Saves a snapshot of the current screen to your hard disk. A filename is optional. When a name is used, only alphanumeric values and &amp;quot;-&amp;quot; and &amp;quot;_&amp;quot; are allowed for the filename. The appropriate extension for the used operating system (like .png) is added by Oolite and should not be part of the filename.&amp;lt;br&amp;gt;&lt;br /&gt;
When a filename already exists, it is not overwritten but the string &amp;quot;-xxx&amp;quot; is added, starting with &amp;quot;-001&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;takeSnapShot()&amp;lt;/code&amp;gt; will not be available in the stable release version of Oolite, but will be available in a special OXP developer release.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 takeSnapShot('mission_target_1');&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=30485</id>
		<title>Running Oolite-Mac</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=30485"/>
		<updated>2012-01-08T19:29:16Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Development Environment (Xcode) */ Linkified app store.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
Oolite was originally developed for OS X, and as such, OS X is Oolite's home operating system. The OS X version can be considered the reference version for all other ports. It has some specific Mac OS X only support such as speech synthesis, iTunes integration and Growl integration. Joysticks are not directly supported - however, there are programs that convert joystick inputs into mouse and keyboard inputs, and these programs are reported to work well with Oolite.&lt;br /&gt;
&lt;br /&gt;
==Getting and installing the game==&lt;br /&gt;
You can get the most recent release of the game from [http://developer.berlios.de/project/showfiles.php?group_id=3577 BerliOS].&lt;br /&gt;
&lt;br /&gt;
Installation is the standard method of dragging the Oolite folder to your Applications or Games folder.&lt;br /&gt;
&lt;br /&gt;
===Installing OXPs (add ons)===&lt;br /&gt;
In the Oolite folder that you dragged from the disk image, you will find an Oolite application and an AddOns folder. Place OXPs in the AddOns folder, and they will be loaded the next time you start the game.&lt;br /&gt;
&lt;br /&gt;
==Building Oolite from source==&lt;br /&gt;
&lt;br /&gt;
=== Development Environment (Xcode) ===&lt;br /&gt;
The supported development environment for Oolite trunk is Xcode&amp;amp;nbsp;4.2 or later under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.7. At the time of writing, earlier versions of Xcode running under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.6 or later will work, but are not supported. Xcode&amp;amp;nbsp;4 is available for free from the [http://itunes.apple.com/se/app/xcode/id448457090?mt=12 Mac App Store].&lt;br /&gt;
&lt;br /&gt;
Earlier versions of Oolite, including the 1.76-maintenace branch, require Xcode&amp;amp;nbsp;3.2.6, even under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.7. For more information, see [http://wiki.alioth.net/index.php?title=Running_Oolite-Mac&amp;amp;oldid=28534#Building_Oolite_from_source this earlier version of this page].&lt;br /&gt;
&lt;br /&gt;
You will also require the Subversion version control tool; an up-to-date binary is available [http://downloads.open.collab.net/binaries.html here].&lt;br /&gt;
&lt;br /&gt;
=== Getting the source ===&lt;br /&gt;
&lt;br /&gt;
The source code and data files are available from [http://developer.berlios.de/projects/oolite-linux/ the oolite-linux BerliOS project]. Don't be confused by the name 'oolite-linux'; at one point there were three separate repositories for Oolite, but the Linux one was where they ended up being merged together. The SVN url for the current development line is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
Version 1.76 is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/tags/1.76&lt;br /&gt;
&lt;br /&gt;
The 1.76.x maintenance branch is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/branches/1.76-maintenance&lt;br /&gt;
&lt;br /&gt;
Note that the 1.76 versions require Xcode&amp;amp;nbsp;3.2.6 as mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To download the source with Subversion, the quickest way to do it is to open a Terminal window, and run the following command:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
If you have a BerliOS account and are a project member, you can get it with:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
Developers should also checkout the relevant maintenance branch:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/branches/1.76-maintenance/&lt;br /&gt;
&lt;br /&gt;
=== Building Oolite ===&lt;br /&gt;
For a trunk build, open Oolite.xcodeproj, select the ''Oolite – Debug'' or ''Oolite – Test Release'' scheme from the Scheme pop-up menu, and hit Build. Dependencies will be downloaded automatically (in the deps folder inside the Oolite repository).&lt;br /&gt;
&lt;br /&gt;
When you open the project for the first time, Xcode will generate build schemes for all the subprojects used to build Oolite. It is unlikely that you will ever need this, so it’s a good idea to hide them. Select Manage Schemes from the Product menu and uncheck the checkboxes in the Show column, except for the schemes marked Shared.&lt;br /&gt;
&lt;br /&gt;
==== Building earlier versions ====&lt;br /&gt;
For instructions on building earlier versions of Oolite, see  [http://wiki.alioth.net/index.php?title=Running_Oolite-Mac&amp;amp;oldid=28534#Building_Oolite_from_source this earlier version of this page].&lt;br /&gt;
&lt;br /&gt;
==== Build products ====&lt;br /&gt;
Building any of the shared build schemes in trunk will result in the following being created in the build results folder: ''AddOns'', ''Debug.oxp'', ''include'' (with subfolders ''js'', ''ogg'', ''png'' and ''vorbis''), ''jskwgen'', ''jsoplengen'', ''libjs_for_oolite.a'', ''libnspr4_for_oolite.a'', ''libogg_for_oolite.a'', ''libpng_for_oolite.a'', ''libvorbis_for_oolite.a'', ''Oolite.app'',  ''Oolite.docktileplugin'' and ''Oolite.mdimporter''. ''AddOns'' contains a copy of ''Debug.oxp''. Oolite.app contains a copy of ''Oolite.mdimporter'' and ''Oolite.docktileplugin'', and static libraries (.a files) are linked into the Oolite executable. Everything except ''Oolite.app'' and ''AddOns'' can be considered side effects of the build process.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]] [[Category:Factual]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=30484</id>
		<title>Running Oolite-Mac</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=30484"/>
		<updated>2012-01-08T19:25:30Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Building Oolite from source */ Updated for Xcode 4 regime.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
Oolite was originally developed for OS X, and as such, OS X is Oolite's home operating system. The OS X version can be considered the reference version for all other ports. It has some specific Mac OS X only support such as speech synthesis, iTunes integration and Growl integration. Joysticks are not directly supported - however, there are programs that convert joystick inputs into mouse and keyboard inputs, and these programs are reported to work well with Oolite.&lt;br /&gt;
&lt;br /&gt;
==Getting and installing the game==&lt;br /&gt;
You can get the most recent release of the game from [http://developer.berlios.de/project/showfiles.php?group_id=3577 BerliOS].&lt;br /&gt;
&lt;br /&gt;
Installation is the standard method of dragging the Oolite folder to your Applications or Games folder.&lt;br /&gt;
&lt;br /&gt;
===Installing OXPs (add ons)===&lt;br /&gt;
In the Oolite folder that you dragged from the disk image, you will find an Oolite application and an AddOns folder. Place OXPs in the AddOns folder, and they will be loaded the next time you start the game.&lt;br /&gt;
&lt;br /&gt;
==Building Oolite from source==&lt;br /&gt;
&lt;br /&gt;
=== Development Environment (Xcode) ===&lt;br /&gt;
The supported development environment for Oolite trunk is Xcode&amp;amp;nbsp;4.2 or later under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.7. At the time of writing, earlier versions of Xcode running under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.6 or later will work, but are not supported. Xcode&amp;amp;nbsp;4 is available for free from the Mac App Store.&lt;br /&gt;
&lt;br /&gt;
Earlier versions of Oolite, including the 1.76-maintenace branch, require Xcode&amp;amp;nbsp;3.2.6, even under Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X&amp;amp;nbsp;10.7. For more information, see [http://wiki.alioth.net/index.php?title=Running_Oolite-Mac&amp;amp;oldid=28534#Building_Oolite_from_source this earlier version of this page].&lt;br /&gt;
&lt;br /&gt;
You will also require the Subversion version control tool; an up-to-date binary is available [http://downloads.open.collab.net/binaries.html here].&lt;br /&gt;
&lt;br /&gt;
=== Getting the source ===&lt;br /&gt;
&lt;br /&gt;
The source code and data files are available from [http://developer.berlios.de/projects/oolite-linux/ the oolite-linux BerliOS project]. Don't be confused by the name 'oolite-linux'; at one point there were three separate repositories for Oolite, but the Linux one was where they ended up being merged together. The SVN url for the current development line is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
Version 1.76 is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/tags/1.76&lt;br /&gt;
&lt;br /&gt;
The 1.76.x maintenance branch is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/branches/1.76-maintenance&lt;br /&gt;
&lt;br /&gt;
Note that the 1.76 versions require Xcode&amp;amp;nbsp;3.2.6 as mentioned above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To download the source with Subversion, the quickest way to do it is to open a Terminal window, and run the following command:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
If you have a BerliOS account and are a project member, you can get it with:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
Developers should also checkout the relevant maintenance branch:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/branches/1.76-maintenance/&lt;br /&gt;
&lt;br /&gt;
=== Building Oolite ===&lt;br /&gt;
For a trunk build, open Oolite.xcodeproj, select the ''Oolite – Debug'' or ''Oolite – Test Release'' scheme from the Scheme pop-up menu, and hit Build. Dependencies will be downloaded automatically (in the deps folder inside the Oolite repository).&lt;br /&gt;
&lt;br /&gt;
When you open the project for the first time, Xcode will generate build schemes for all the subprojects used to build Oolite. It is unlikely that you will ever need this, so it’s a good idea to hide them. Select Manage Schemes from the Product menu and uncheck the checkboxes in the Show column, except for the schemes marked Shared.&lt;br /&gt;
&lt;br /&gt;
==== Building earlier versions ====&lt;br /&gt;
For instructions on building earlier versions of Oolite, see  [http://wiki.alioth.net/index.php?title=Running_Oolite-Mac&amp;amp;oldid=28534#Building_Oolite_from_source this earlier version of this page].&lt;br /&gt;
&lt;br /&gt;
==== Build products ====&lt;br /&gt;
Building any of the shared build schemes in trunk will result in the following being created in the build results folder: ''AddOns'', ''Debug.oxp'', ''include'' (with subfolders ''js'', ''ogg'', ''png'' and ''vorbis''), ''jskwgen'', ''jsoplengen'', ''libjs_for_oolite.a'', ''libnspr4_for_oolite.a'', ''libogg_for_oolite.a'', ''libpng_for_oolite.a'', ''libvorbis_for_oolite.a'', ''Oolite.app'',  ''Oolite.docktileplugin'' and ''Oolite.mdimporter''. ''AddOns'' contains a copy of ''Debug.oxp''. Oolite.app contains a copy of ''Oolite.mdimporter'' and ''Oolite.docktileplugin'', and static libraries (.a files) are linked into the Oolite executable. Everything except ''Oolite.app'' and ''AddOns'' can be considered side effects of the build process.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]] [[Category:Factual]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Vector3D&amp;diff=30451</id>
		<title>Oolite JavaScript Reference: Vector3D</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Vector3D&amp;diff=30451"/>
		<updated>2012-01-06T16:41:28Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* rotationTo */ Noted that both vectors must be normal, and cleaned up.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Vector3D&amp;lt;/code&amp;gt;''' class represents a [http://en.wikipedia.org/wiki/Vector_%28spatial%29 geometrical vector] in three-dimensional space, in cartesian representation. It is used to represent positions, headings and velocities. Explaining vector geometry is beyond the scope of this document, but there are numerous tutorials on the web.&lt;br /&gt;
&lt;br /&gt;
=== Vector Expressions ===&lt;br /&gt;
All Oolite-provided functions which take a vector as an argument may instead be passed an array of three numbers, or an [[Oolite JavaScript Reference: Entity|Entity]] (in which case the entity’s &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#position|position]]&amp;lt;/code&amp;gt; is used). In specifications, this is represented by arguments typed &amp;lt;code&amp;gt;vectorExpression&amp;lt;/code&amp;gt;. For example, if &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; are vectors whose values are (0, 1, 0) and (1, 0, 0) respectively, the following are equivalent:&lt;br /&gt;
&lt;br /&gt;
 var c = a.add(b);&lt;br /&gt;
 var d = a.add(Vector3D(1, 0, 0));&lt;br /&gt;
 var e = a.add([1, 0, 0]);&lt;br /&gt;
 // c, d and e are now all (1, 1, 0).&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''x''' : Number (read/write)&lt;br /&gt;
The ''x'' co-ordinate of the vector.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''y''' : Number (read/write)&lt;br /&gt;
The ''y'' co-ordinate of the vector.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''z''' : Number (read/write)&lt;br /&gt;
The ''z'' co-ordinate of the vector.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== Constructor ===&lt;br /&gt;
 '''new Vector3D'''([value : [[#Vector Expressions|vectorExpression]]]) : Vector3D&lt;br /&gt;
Create a new vector with the specified value. If no value is provided, the vector is initialized to (0, 0, 0).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''add'''(v : [[#Vector Expressions|vectorExpression]]) : Vector3D&lt;br /&gt;
Returns the vector sum of the target and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#subtract|subtract]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;angleTo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''angleTo'''(v : [[#Vector Expressions|vectorExpression]]) : Number&lt;br /&gt;
Returns the angle (in radians) between the target and &amp;lt;code&amp;gt;[[#Vector Expressions|vectorExpression]]&amp;lt;/code&amp;gt;. This is always a positive value between 0 and π.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;v.angleTo(u)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;Math.[https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/acos acos](v.[[#direction|direction]]().[[#dot|dot]](u.[[#direction|direction]]()))&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cross&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''cross'''(v : [[#Vector Expressions|vectorExpression]]) : Vector3D&lt;br /&gt;
Returns the [http://en.wikipedia.org/wiki/Vector_%28spatial%29#Cross_product cross product] of the target and &amp;lt;code&amp;gt;[[#Vector Expressions|vectorExpression]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#dot|dot]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''direction'''() : Vector3D&lt;br /&gt;
Returns the [http://en.wikipedia.org/wiki/Unit_vector unit vector] with the same direction as the target.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;v.direction()&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;v.[[#multiply|multiply]](1 / v.[[#magnitude|magnitude]]())&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#magnitude|magnitude]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;distanceTo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''distanceTo'''(v : [[#Vector Expressions|vectorExpression]]) : Number&lt;br /&gt;
Returns the distance between the target and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;u.distanceTo(v)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;u.[[#subtract|subtract]](v).[[#magnitude|magnitude]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#squaredDistanceTo|squaredDistanceTo]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dot&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''dot'''(v : [[#Vector Expressions|vectorExpression]]) : Number&lt;br /&gt;
Returns the [http://en.wikipedia.org/wiki/Vector_%28spatial%29#Dot_product dot product] of the target and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The dot product of two vectors says something how well they are aligned to each other. The dot product of two identical vectors is 1 while two vectors pointing in opposite direction result in a -1 result. Also you can't reliably compare two vectors with each other to see if they are identical. To to check if &amp;lt;code&amp;gt;vector1 == vector2&amp;lt;/code&amp;gt; you need the dot product :&lt;br /&gt;
 vector1.dot(vector2) &amp;gt; 0.999&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#cross|cross]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fromCoordinateSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''fromCoordinateSystem'''(system : String) : Vector3D&lt;br /&gt;
Convert a vector from an [[Oolite coordinate systems|abstract coordinate system]] to absolute coordinates. &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; must be a three-letter string specifying an abstract coordinate system.&lt;br /&gt;
&lt;br /&gt;
'''Important:'''&lt;br /&gt;
Vectors do not “know” which coordinate system they’re in. The script must keep track of that. If you add together vectors in different coordinate systems the result will be nonsense, just as if you added measurements in different units without appropriate conversions.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 this.halfway = Vector3D(0, 0, 0.5).fromCoordinateSystem(&amp;quot;wpu&amp;quot;);&lt;br /&gt;
 // Equivalent: Vector3D.interpolate([0, 0, 0], S.mainPlanet, 0.5)&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#toCoordinateSystem|toCoordinateSystem]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;magnitude&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''magnitude'''() : Number&lt;br /&gt;
Returns the magnitude (or length) of the vector.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#squaredMagnitude|squaredMagnitude]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#direction|direction]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;multiply&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''multiply'''(f : Number) : Vector3D&lt;br /&gt;
Returns the product of the target and &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;. This has the effect of scaling the vector by the factor &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotateBy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotateBy'''(q : [[Oolite JavaScript Reference: Quaternion#Quaternion Expressions|quaternionExpression]]) : Vector3D&lt;br /&gt;
Apply the rotation specified by &amp;lt;code&amp;gt;q&amp;lt;/code&amp;gt; to the target vector.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotationTo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''rotationTo'''(v : [[#Vector Expressions|vectorExpression]] [, maxArc : Number]) : [[Oolite JavaScript Reference: Quaternion|Quaternion]]&lt;br /&gt;
Returns a [[Oolite JavaScript Reference: Quaternion|quaternion]] corresponding to a rotation from the target vector to &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;. The optional parameter &amp;lt;code&amp;gt;maxArc&amp;lt;/code&amp;gt; specifies a maximum rotation angle; if the angle between the target and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; is greater than &amp;lt;code&amp;gt;maxArc&amp;lt;/code&amp;gt; radians, a rotation of &amp;lt;code&amp;gt;maxArc&amp;lt;/code&amp;gt; radians towards &amp;lt;code&amp;gt;vectorExpression&amp;lt;/code&amp;gt; is generated instead.&lt;br /&gt;
&lt;br /&gt;
Both the target and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; must be normalized. The vectors must not be antiparallel (180° apart), since the axis of rotation is undefined in this case.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var orientation = myVector.rotationTo([0, 0, 1])&lt;br /&gt;
This will generate a quaternion were the &amp;lt;code&amp;gt;forwardVector&amp;lt;/code&amp;gt; is pointing in the same direction as &amp;lt;code&amp;gt;myVector&amp;lt;/code&amp;gt;. (&amp;lt;code&amp;gt;[0, 0, 1]&amp;lt;/code&amp;gt; is equal to the &amp;lt;code&amp;gt;forwardVector&amp;lt;/code&amp;gt; of the identity quaternion.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;squaredDistanceTo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''squaredDistanceTo'''(v: [[#Vector Expressions|vectorExpression]]) : Number&lt;br /&gt;
Returns the square of the distance between the target and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;u.squaredDistanceTo(v)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;u.[[#distanceTo|distanceTo]](v) * u.[[#distanceTo|distanceTo]](v)&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;u.[[#subtract|subtract]](v).[[#squaredMagnitude|squaredMagnitude]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;squaredMagnitude&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''squaredMagnitude'''() : Number&lt;br /&gt;
Returns the square of the magnitude of the vector.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;v.squaredMagnitude()&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;v.[[#magnitude|magnitude]]() * v.[[#magnitude|magnitude]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;subtract&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''subtract'''(v : [[#Vector Expressions|vectorExpression]]) : Vector3D&lt;br /&gt;
Returns the vector difference between the target and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#add|add]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;toArray&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''toArray'''() : Array&lt;br /&gt;
Returns an array of the vector’s components, in the order &amp;lt;code&amp;gt;[x, y, z]&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;v.toArray()&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;[v.x, v.y, v.z]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;toCoordinateSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''toCoordinateSystem'''(system : String) : Vector3D&lt;br /&gt;
Convert a vector from absolute coordinates to an [[Oolite coordinate systems|abstract coordinate system]]. &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; must be a three-letter string specifying an abstract coordinate system. The target of the method must be a vector in absolute coordinates. (To convert a vector from one abstract coordinate system to another, you must first call code&amp;gt;[[#fromCoordinateSystem|fromCoordinateSystem]]()&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;toCoordinateSystem()&amp;lt;/code&amp;gt;.)&lt;br /&gt;
&lt;br /&gt;
'''Important:'''&lt;br /&gt;
Vectors do not “know” which coordinate system they’re in. The script must keep track of that. If you add together vectors in different coordinate systems the result will be nonsense, just as if you added measurements in different units without appropriate conversions.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 Vector3D(0, 0, 226380).toCoordinateSystem(&amp;quot;wpu&amp;quot;)&lt;br /&gt;
 // In Lave system, this returns (0, 0, 0.5).&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#fromCoordinateSystem|fromCoordinateSystem]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;tripleProduct&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''tripleProduct'''(v : [[#Vector Expressions|vectorExpression]], w : [[#Vector Expressions|vectorExpression]]) : Number&lt;br /&gt;
Returns the [http://en.wikipedia.org/wiki/Vector_%28spatial%29#Triple_product triple product] of the target, &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;u.tripleProduct(v, w)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;u.[[#dot|dot]](v.[[#cross|cross]](w))&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Static methods ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;interpolate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''interpolate'''(u : [[#Vector Expressions|vectorExpression]], v : [[#Vector Expressions|vectorExpression]], where : Number) : Vector3D&lt;br /&gt;
Returns a point on the line between &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt; is 0, the result is &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt;.  If &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt; is 1, the result is &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt; is 0.5, the result is half way between &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;. Values of &amp;lt;code&amp;gt;where&amp;lt;/code&amp;gt; outside the range [0, 1] are valid; for instance, &amp;lt;code&amp;gt;Vector3D.interpolate(u, v, -1)&amp;lt;/code&amp;gt; returns a point as far from &amp;lt;code&amp;gt;u&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; is, but in the opposite direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Vector3D.interpolate(u, v, where)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;u.[[#add|add]](v.[[#subtract|subtract]](u).[[#multiply|multiply]](where))&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;u.[[#multiply|multiply]](1 - where).[[#add|add]](v. [[#multiply|multiply]](where))&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;random&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''random'''([maxLength : Number]) : Vector3D&lt;br /&gt;
Returns a vector of random length up to &amp;lt;code&amp;gt;maxLength&amp;lt;/code&amp;gt;, in a random direction. If &amp;lt;code&amp;gt;maxLength&amp;lt;/code&amp;gt; is not specified (or not a number), 1.0 is used. These vectors are uniformly distributed within the unit sphere, which has the effect that longer vectors are more common than shorter ones. Use &amp;lt;code&amp;gt;Vector3D.[[#randomDirectionAndLength|randomDirectionAndLength]]()&amp;lt;/code&amp;gt; if an even length distribution is desired.&lt;br /&gt;
&lt;br /&gt;
In the following image, the cloud on the left was made with the 2D equivalent of &amp;lt;code&amp;gt;random()&amp;lt;/code&amp;gt;, and the image on the right was made with the 2D equivalent of &amp;lt;code&amp;gt;randomDirectionAndLength()&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;[[Image:Randomvectordistribution.png]]&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#randomDirection|randomDirection]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#randomDirectionAndLength|randomDirectionAndLength]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;randomDirection&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''randomDirection'''([scale : Number]) : Vector3D&lt;br /&gt;
Returns a vector of length &amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt;, in a random direction. If &amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; is not specified (or not a number), 1.0 is used.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#random|random]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#randomDirectionAndLength|randomDirectionAndLength]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;randomDirectionAndLength&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''randomDirectionAndLength'''([maxLength : Number]) : Vector3D&lt;br /&gt;
Returns a vector of random length up to &amp;lt;code&amp;gt;maxLength&amp;lt;/code&amp;gt;, in a random direction. If &amp;lt;code&amp;gt;maxLength&amp;lt;/code&amp;gt; is not specified (or not a number), 1.0 is used. These vectors have a uniform distribution of magnitude (all lengths are equally likely), but cluster towards the origin. Use &amp;lt;code&amp;gt;Vector3D.[[#random|random]]()&amp;lt;/code&amp;gt; if an even spacial distribution is desired.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#random|random]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#randomDirection|randomDirection]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=29906</id>
		<title>Oolite JavaScript Reference: System</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=29906"/>
		<updated>2011-12-16T21:41:02Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;System&amp;lt;/code&amp;gt;''' class represents the current system. There is always one &amp;lt;code&amp;gt;System&amp;lt;/code&amp;gt; object, available through the global property &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Attempts to change system properties are ignored in interstellar space (i.e., the place you end up in after a witchspace malfunction).&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;allShips&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''allShips''' : Array (read-only)&lt;br /&gt;
A list of the ships in the system.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''description''' : String (read/write)&lt;br /&gt;
The description of the current system, as seen on the planet info screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;economy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''economy''' : Number (integer, read/write)&lt;br /&gt;
The type of economy in the current system, ranging from 0 (Rich Industrial) to 7 (Poor Agricultural).&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#economyDescription|economyDescription]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;economyDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''economyDescription''' : String (read-only)&lt;br /&gt;
A localized description of the economy type, for example, “Mostly Industrial”. Since this string is localized, it should only be used for display purposes.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#economy|economy]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;government&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''government''' : Number (read/write, integer)&lt;br /&gt;
The type of government in the current system, ranging from 0 (Anarchy) to 7 (Corporate State).&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#governmentDescription|governmentDescription]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;governmentDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''governmentDescription''' : String (read-only)&lt;br /&gt;
A localized description of the government type, for example, “Democracy”. Since this string is localized, it should only be used for display purposes.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#government|government]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 ID : Number (integer, read-only)&lt;br /&gt;
A number identifying the system. 0 to 255, or -1 for interstellar space.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;info&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''info''' : [[Oolite JavaScript Reference: SystemInfo|SystemInfo]] (read/write)&lt;br /&gt;
Allows access to system properties, using the same keys as [[planetinfo.plist]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 system.info.description = &amp;quot;This is a dull planet.&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;inhabitantsDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''inhabitantsDescription''' : String (read/write)&lt;br /&gt;
The description of the inhabitants of the current system, such as “Slimy Blue Frogs”.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isInterstellarSpace&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isInterstellarSpace''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the current system is in interstellar space, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mainPlanet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mainPlanet''' : {{oojsclass|Planet}} (read-only)&lt;br /&gt;
The system’s main planet, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mainStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mainStation''' : [[Oolite JavaScript Reference: Station|Station]] (read-only)&lt;br /&gt;
The system’s main station, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read/write)&lt;br /&gt;
The name of the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;planets&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''planets''' : Array (read-only)&lt;br /&gt;
A list of the planets in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;population&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''population''' : Number (integer, read/write)&lt;br /&gt;
The population of the current system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;productivity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''productivity''' : Number (integer, read/write)&lt;br /&gt;
The productivity of the current system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandom100&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandom100''' : Number (integer, read-only)&lt;br /&gt;
A random number between 0 and 99 that is always the same for a given system. '''Important:''' this method has the undesirable side effect of resetting the system random number generator. It should only be used for backwards-compatibility. For new development, use &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[[#pseudoRandomNumber|pseudoRandomNumber]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandom256&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandom256''' : Number (integer, read-only)&lt;br /&gt;
A random number between 0 and 255 that is always the same for a given system. '''Important:''' this method has the undesirable side effect of resetting the system random number generator. It should only be used for backwards-compatibility. For new development, use &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[[#pseudoRandomNumber|pseudoRandomNumber]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pseudoRandomNumber&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''pseudoRandomNumber''' : Number (read-only)&lt;br /&gt;
A random number between 0 and 1 that is always the same for a given system. In general, you should avoid using this number directly and call &amp;lt;code&amp;gt;[[#scrambledPseudoRandomNumber|scrambledPseudoRandomNumber]]()&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sun&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''sun''' : [[Oolite JavaScript Reference: Sun|Sun]] (read-only)&lt;br /&gt;
The system’s sun, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if there is none.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;techLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''techLevel''' : Number (integer, read/write)&lt;br /&gt;
The technology level of the current system, ranging from 0 to 15.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addGroup&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addGroup'''(role : String, count : Number [, position: {{oojsvecexpr}}] [, radius: Number]) : {{oojsclass|ShipGroup}}&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;, but puts the ships in a group and returns the group.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroupToRoute|addGroupToRoute()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addGroupToRoute&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addGroupToRoute'''(role : String, count : Number [, fraction: Number] [, route: String]) : {{oojsclass|ShipGroup}}&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;, but puts the ships in a group and returns the group.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroup|addGroup()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMoon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMoon'''(planetInfoKey : String) : {{oojsclass|Planet}}&lt;br /&gt;
Adds a moon to the system, using the specified entry in ''[[planetinfo.plist]]''. A moon is the same as a planet, except that it has no atmosphere.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addPlanet|addPlanet()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addPlanet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addPlanet'''(planetInfoKey : String) : {{oojsclass|Planet}}&lt;br /&gt;
Adds a planet to the system, using the specified entry in ''[[planetinfo.plist]]''.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addMoon|addMoon()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addShips&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addShips'''(role : String, count : Number [, position: {{oojsvecexpr}}] [, radius: Number]) : Array&lt;br /&gt;
Adds ships to the system and returns the added ships in an array. Position is in absolute coordinates. When no position is given, the witchpoint is assumed. When no radius is given, the maximum scanner range is used. Ships added in range of the witchpoint automatically create a witchpoint entry cloud.&lt;br /&gt;
&lt;br /&gt;
When you want to use coordinates from the legacy &amp;quot;pwp&amp;quot; system you can use the function [[Oolite_JavaScript_Reference:_Vector3D#fromCoordinateSystem|fromCoordinateSystem]] to convert legacy type coordinates to absolute coordinates.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroup|addGroup()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShipsToRoute|addShipsToRoute()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addShipsToRoute&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addShipsToRoute'''(role : String, count : Number [, fraction: Number] [, route: String]) : Array&lt;br /&gt;
Adds ships to the system on certain common routes and returns the added ships as an array. The routes are the two character codes &amp;lt;code&amp;gt;wp&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pw&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ws&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sw&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sp&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;ps&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt; stands for the witchpoint, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; for the planet and &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for the sun.&lt;br /&gt;
&lt;br /&gt;
When no route is defined, the route witchpoint → main station is assumed.&lt;br /&gt;
&lt;br /&gt;
The position is a fraction of the route and must be between 0 and 1. Unlike the legacy commands the fraction takes planetary radii in account, so it does not start counting in the centre of sun/planet but from its surface. When no fraction is defined, a random fraction is chosen. Ships are added within scanner range of this position. Ships added in range of the witchpoint automatically create a witchpoint entry cloud.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 var ships = system.addShipsToRoute(&amp;quot;myShips&amp;quot;, 2, 0.7, &amp;quot;sw&amp;quot;)&lt;br /&gt;
 var pirates = system.addShipsToRoute(&amp;quot;pirate&amp;quot;, 3, Math.random(), &amp;quot;sp&amp;quot;)&lt;br /&gt;
The first line adds 2 ships near each-other on the route from sun to witchpoint and puts the added ship in the array &amp;lt;code&amp;gt;ships&amp;lt;/code&amp;gt;, and the second line adds a group of 3 pirates at a random position along the sun to planet route and returns the array &amp;lt;code&amp;gt;pirates&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' this method will fail and return &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if either of the route end points doesn’t exist. No valid routes exist in interstellar space.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#addGroupToRoute|addGroupToRoute()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addShips|addShips()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countEntitiesWithScanClass&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countEntitiesWithScanClass'''(scanClass : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified ScanClass in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countShipsWithPrimaryRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countShipsWithPrimaryRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified primary role in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;countShipsWithRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''countShipsWithRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Number (integer)&lt;br /&gt;
Returns the number of ships with the specified role in the system. Counts not only the primary role the ship is added with but all roles a ship can have.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;entitiesWithScanClass&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''entitiesWithScanClass'''(scanClass : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose scan class is &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;filteredEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''filteredEntities'''(this : Object, predicate : Function [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities for which &amp;lt;code&amp;gt;predicate&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 this.findIdlePoliceInScannerRange = function()&lt;br /&gt;
 {&lt;br /&gt;
     function isIdlePolice(entity)&lt;br /&gt;
     {&lt;br /&gt;
         return entity.isShip &amp;amp;&amp;amp; entity.isPolice &amp;amp;&amp;amp; !entity.target&lt;br /&gt;
     }&lt;br /&gt;
   &lt;br /&gt;
     return system.filteredEntities(this, isIdlePolice, player, 25600);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithPrimaryRole|shipsWithPrimaryRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;legacy_addShips etc.&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''legacy_addShips'''(role : String, count : Number)&lt;br /&gt;
 function '''legacy_addSystemShips'''(role : String, count : Number, position : Number)&lt;br /&gt;
 function '''legacy_addShipsAt'''(role : String, count : Number, coordscheme : String, where : {{oojsvecexpr}})&lt;br /&gt;
 function '''legacy_addShipsAtPrecisely'''(role : String, count : Number, coordscheme : String, where : {{oojsclass|Planet}})&lt;br /&gt;
 function '''legacy_addShipsWithinRadius'''(role : String, count : Number, coordScheme : String, where : {{oojsclass|Planet}}, radius : Number)&lt;br /&gt;
 function '''legacy_spawnShip'''(shipDataKey : String)&lt;br /&gt;
Various ways of causing ships to appear. Each of these corresponds to a legacy scripting method. For more info about the &amp;lt;code&amp;gt;coordScheme&amp;lt;/code&amp;gt;, look at [[Oolite coordinate systems]]. These methods are kept for backwards-compatibility; for new development, &amp;lt;code&amp;gt;[[#addShips|addShips()]] is preferred.&lt;br /&gt;
&lt;br /&gt;
'''Important:''' &amp;lt;code&amp;gt;legacy_spawn&amp;lt;/code&amp;gt;, previously listed here, never worked as intended and has been replaced with &amp;lt;code&amp;gt;Ship.[[Oolite JavaScript Reference: Ship#spawn|spawn]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scrambledPseudoRandomNumber&amp;lt;/code&amp;gt;===&lt;br /&gt;
 function '''scrambledPseudoRandomNumber'''(salt : Number (integer)) : Number&lt;br /&gt;
Returns a number that’s greater than or equal to zero and less than one. It will always return the same value for a given &amp;lt;code&amp;gt;salt&amp;lt;/code&amp;gt; value and system. Crucially, the relationship between systems and numbers is effectively completely different for each salt value, so scripts making similar decisions based on &amp;lt;code&amp;gt;scrambledPseudoRandomNumber()&amp;lt;/code&amp;gt; but using different salts will get uncorrelated results. For example, if two different OXPs add a certain type of station to 25 % of systems using &amp;lt;code&amp;gt;if (system.pseudoRandomNumber &amp;lt; 0.25)&amp;lt;/code&amp;gt;, the two station types will always be found in the same system; using &amp;lt;code&amp;gt;scrambledPseudoRandomNumber()&amp;lt;/code&amp;gt; with different salts avoids this.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sendAllShipsAway&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''sendAllShipsAway'''()&lt;br /&gt;
Makes all ships hyperspace out of the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipsWithPrimaryRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''shipsWithPrimaryRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose [[Oolite JavaScript Reference: Ship#primaryRole|primary role]] is &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipsWithRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''shipsWithRole'''(role : String [, relativeTo : {{oojsclass|Entity}} [, range : Number]]) : Array&lt;br /&gt;
A list of the entities in the system whose [[Oolite JavaScript Reference: Ship#roles|role set]] contains &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; is specified, the list will be sorted in order of proximity to &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; (i.e., the first element of the list is closest). If &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; is also specified, entities further than &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; metres from &amp;lt;code&amp;gt;relativeTo&amp;lt;/code&amp;gt; will be excluded. If no matching entities are found, an empty array is returned.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#shipsWithRole|shipsWithRole]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#entitiesWithScanClass|entitiesWithScanClass]]()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#filteredEntities|filteredEntities]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Static Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;infoForSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''infoForSystem'''(galaxyNumber: Integer, systemID : Integer) (write-only)&lt;br /&gt;
Overwrites existing info of the given system. As properties it uses the [[planetinfo.plist]] keys. e.g.&lt;br /&gt;
 System.infoForSystem(0, 55).description = &amp;quot;This is a dull planet.&amp;quot;&lt;br /&gt;
sets the description of planet nr 55 in galaxy 0 to his is a dull planet.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Starting from Oolite 1.73, all system Info for the present galaxy is also readable. Even though any galaxy system info property is fully settable, due to engine limitations other galaxies' data is not accessible. In other words&lt;br /&gt;
 System.infoForSystem(0, 55).description&lt;br /&gt;
would return &amp;quot;This is a dull planet.&amp;quot; if called from galaxy 0, null from the other galaxies.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;systemIDForName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''systemIDForName'''(systemName : String) : Integer&lt;br /&gt;
Returns the ID number of a system in the current galaxy based on the system name)&lt;br /&gt;
&lt;br /&gt;
'''Note:''' in galaxy 8, there are two systems named “Inzaan”. &amp;lt;code&amp;gt;systemIDForName()&amp;lt;/code&amp;gt; will return the lower ID, which is 22.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;systemNameForID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''systemNameForID'''(systemID : Integer) : String&lt;br /&gt;
Returns the name of a system in the current galaxy based on the given ID number)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Station&amp;diff=29905</id>
		<title>Oolite JavaScript Reference: Station</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Station&amp;diff=29905"/>
		<updated>2011-12-16T21:40:49Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship|Ship]]&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Station&amp;lt;/code&amp;gt;''' class is an &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity|Entity]]&amp;lt;/code&amp;gt; representing a station or carrier (i.e., a ship with a docking port). A &amp;lt;code&amp;gt;Station&amp;lt;/code&amp;gt; has all the properties and methods of a &amp;lt;code&amp;gt; [[Oolite JavaScript Reference: Ship|Ship]]&amp;lt;/code&amp;gt;, and some others.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertCondition&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertCondition''' : Number (read/write, integer)&lt;br /&gt;
Returns the current alert condition. 1 = Green, 2 = Yellow, 3 = Red.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;allowsAutoDocking&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''allowsAutoDocking''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the player may dock with this station using autopilot (assuming it isn’t hostile). The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;allows_auto_docking&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;allowsFastDocking&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''allowsFastDocking''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the player may dock with this station instantaneously (assuming it isn’t hostile). The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;allows_fast_docking&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, but set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; when setting up the main station).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockedContractors&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''dockedContractors''' : Number (read-only, integer)&lt;br /&gt;
Returns the number of docked contractors ships that can launch as miner or scavenger.&amp;lt;br&amp;gt;&lt;br /&gt;
There is only one counter for miners and scavengers. The maximum that can launch as miner/scavenger is determined by the shipdata-key max_scavengers. However, miners can only launch when there is no other miner in the stations scanner range, even when contractor ships are docked.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockedDefenders&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''dockedDefenders''' : Number (read-only, integer)&lt;br /&gt;
Returns the number of docked defence ships that can launch as defence ships.&amp;lt;br&amp;gt;&lt;br /&gt;
There is only one counter for defence and police ships. However, the maximum that can launch as defenders is determined by the shipdata-key max_defense_ships.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockedPolice&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''dockedPolice''' : Number (read-only, integer)&lt;br /&gt;
Returns the number of docked defence ships that can launch as police or patrol ships.&amp;lt;br&amp;gt;&lt;br /&gt;
There is only one counter for defence and police ships. However, the maximum that can launch as police/patrol is determined by the shipdata-key max_police.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;equipmentPriceFactor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''equipmentPriceFactor''' : Number (read-only, float)&lt;br /&gt;
Returns the equipment_price_factor for the station as defined in shipdata.plist.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;equivalentTechLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''equivalentTechLevel''' : Number (read-only, Integer)&lt;br /&gt;
Returns the equivalent_tech_level for the station as defined in shipdata.plist.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasNPCTraffic&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hasNPCTraffic''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the station has associated non-player traffic, such as shuttles, patrol ships and scavengers. Corresponds to the &amp;lt;code&amp;gt;has_npc_traffic&amp;lt;/code&amp;gt; ''[[shipdata.plist#has_npc_traffic|shipdata.plist]]'' key.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isMainStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isMainStation''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the station is the main station of the system, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresDockingClearance&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresDockingClearance''' : Boolean (read/write)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the station requires docking clearance, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;suppressArrivalReports&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''suppressArrivalReports''' : Boolean (read/write)&lt;br /&gt;
If set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, arrival reports are not shown when the player docks with the station.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockPlayer&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''dockPlayer()''' : Boolean &lt;br /&gt;
This method docks the player at the specified station. Returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if docking fails, otherwise &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launchDefenseShip&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''launchDefenseShip()''' : Ship &lt;br /&gt;
This method adds a ship with a role defined in the ship key &amp;quot;defense_ship_role&amp;quot; or a specific ship defined with a ship key &amp;quot;defense_ship&amp;quot;,  to the launching queue at the specified station. When no defense ships are defined it selects one from the police or interceptors. All ships launch with a primary role of &amp;quot;defense_ship&amp;quot;. Returns the entity of the chosen ship. This method aborts all dockings for an immediate launch.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launchMiner&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''launchMiner()''' : Ship &lt;br /&gt;
This method adds a ship with a miner role to the launching queue at the specified station. Returns the entity of the chosen ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launchPatrol&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''launchPatrol()''' : Ship &lt;br /&gt;
This method adds a ship with a police role and planetPatrolAI.plist to the launching queue at the specified station. Returns the entity of the chosen ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launchPirateShip&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''launchPirateShip()''' : Ship &lt;br /&gt;
This method adds a ship with a pirate role  to the launching queue at the specified station. All ships launch with a primary role of &amp;quot;defense_ship&amp;quot; and pirateAI.plist. These pirate ships are counted as defense_ship. Returns the entity of the chosen ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launchPolice&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''launchPolice()''' : Array &lt;br /&gt;
This method adds up to 4 police ships to the launching queue at the specified station. Returns an array of chosen police ships. Depending on the system it selects ships with role police or interceptor, but on launch all primary roles will be police&amp;lt;br&amp;gt;&lt;br /&gt;
It will only launch a ship if the station has a target and there are police ships left. This method aborts all dockings for an immediate launch.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launchScavenger&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''launchScavenger()''' : Ship &lt;br /&gt;
This method adds a ship with a scavenger role to the launching queue at the specified station. Launches only a scavenger when there is a contractor ship at the station and when the number of scavengers around the station is less than the maximum number of scavengers. Returns the entity of the chosen ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launchShipWithRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''launchShipWithRole(role : String, [abortAllDockings : Boolean])''' : Ship &lt;br /&gt;
This method adds a ship with given role to the launching queue at the specified station. Launches only a miner when there is a contractor ship at the station and when the number of miners around the station is zero. (there can only be one!) Returns the entity of the chosen ship.&amp;lt;br&amp;gt;&lt;br /&gt;
When &amp;lt;code&amp;gt;abortAllDockings&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;), all ships in the docking process get an ''abort'' message and launching of ships starts immediately. Don't use this parameter when not strictly necessary for your launching ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launchShuttle&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''launchShuttle()''' : Ship &lt;br /&gt;
This method adds a ship with a shuttle role to the launching queue at the specified station. Returns the entity of the chosen ship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=29904</id>
		<title>Oolite JavaScript Reference: Ship</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=29904"/>
		<updated>2011-12-16T21:40:35Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity|Entity]]&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station|Station]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip|PlayerShip]]&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Ship&amp;lt;/code&amp;gt;''' class is an &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity|Entity]]&amp;lt;/code&amp;gt; representing a ship, station, missile, cargo pod or other flying item – anything that can be specified in [[shipdata.plist]]. A &amp;lt;code&amp;gt;Ship&amp;lt;/code&amp;gt; has all the properties and methods of a &amp;lt;code&amp;gt;Entity&amp;lt;/code&amp;gt;, and several others.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station|Station]]&amp;lt;/code&amp;gt;s and the &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip|PlayerShip]]&amp;lt;/code&amp;gt; are types of ship. Note that these more specific types have additional properties and methods.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;aftWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''aftWeapon''' : EquipmentType (read-only)&lt;br /&gt;
The currently equipped aft weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#forwardWeapon|forwardWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#portWeapon|portWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''AI''' : String (read-only)&lt;br /&gt;
The name of the ship’s current AI.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AIState|AIState]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setAI|setAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#switchAI|switchAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#exitAI|exitAI()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIState&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''AIState''' : String (read/write, read-only for player)&lt;br /&gt;
The ship’s AI’s current state.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#reactToAIMessage|reactToAIMessage()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#hasSuspendedAI|hasSuspendedAI]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;beaconCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''beaconCode''' : String (read-only)&lt;br /&gt;
If the ship is a beacon, an identifying string. The first character is used for identification on the [[Advanced Space Compass]]. For non-beacons, this property is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#isBeacon|isBeacon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;bounty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''bounty''' : Number (read/write integer)&lt;br /&gt;
The bounty on the ship. In the case of the player, it is halved at each witchspace jump.&amp;lt;br&amp;gt;&lt;br /&gt;
It is actually the legal status of the ship that is shown here and not the bounty. For all ships both are the same but for anything with scan class Thargoid the legal status is only based on the ships mass and has no relation to its defined bounty.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceCapacity''' : Number (read-only integer)&lt;br /&gt;
The ship’s cargo capacity, in tons.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;contracts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''contracts''' : Array (read-only NSDictionary)&lt;br /&gt;
The ship’s contracts. (For now only available for the player). Each contract contains the entries: &amp;lt;code&amp;gt;commodity: string, quantity: integer, description: string, start: integer, destination: integer, startName: string, destinationName: string, eta: integer, etaDescription: string, fee: Integer, premium: Integer&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, the information of the first contract can be obtained by:&lt;br /&gt;
 player.ship.contracts[0].commodity&lt;br /&gt;
 player.ship.contracts[0].quantity&lt;br /&gt;
 player.ship.contracts[0].description&lt;br /&gt;
 player.ship.contracts[0].start&lt;br /&gt;
 player.ship.contracts[0].destination&lt;br /&gt;
 player.ship.contracts[0].startName&lt;br /&gt;
 player.ship.contracts[0].destinationName&lt;br /&gt;
 player.ship.contracts[0].eta  // Estimated Time of Arrival.&lt;br /&gt;
 player.ship.contracts[0].etaDescription&lt;br /&gt;
 player.ship.contracts[0].fee      // The profit of the contract, paid out on successful delivery.&lt;br /&gt;
 player.ship.contracts[0].premium  // The sum paid to obtain the goods and paid back on successful delivery.&lt;br /&gt;
&lt;br /&gt;
start and destination contain system ID numbers for planets in the current galaxy chart, eta is in clock seconds, fee is the amount that the player will receive when delivering this contract, and premium was the amount the player had to pay to secure this contract.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cloakAutomatic&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cloakAutomatic''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (the default), the ship will automatically engage its cloak while attacking. Otherwise, it must be managed by a script. The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;cloak_automatic&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cruiseSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cruiseSpeed''' : Number (read-only nonnegative)&lt;br /&gt;
The ship’s “normal” &amp;lt;code&amp;gt;[[#desiredSpeed|desiredSpeed]]&amp;lt;/code&amp;gt;, used in normal flight. Normally this is 80 % of &amp;lt;code&amp;gt;[[#maxSpeed|maxSpeed]]&amp;lt;/code&amp;gt;, but it may be lowered when accepting a slow escort.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;desiredSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''desiredSpeed''' : Number (read/write nonnegative, read-only for player)&lt;br /&gt;
The speed the AI will attempt to maintain. The AI core and AI script may change this from time to time. The corresponding AI method is &amp;lt;code&amp;gt;setSpeedFactorTo:&amp;lt;/code&amp;gt;; a speed factor of 1.0 corresponds to a &amp;lt;code&amp;gt;desiredSpeed&amp;lt;/code&amp;gt; equal to &amp;lt;code&amp;gt;[[#maxSpeed|maxSpeed]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#cruiseSpeed|cruiseSpeed]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''displayName''' : String (read/write, read-only for player)&lt;br /&gt;
The name of the ship as seen by the player. By default it is the same as &amp;lt;code&amp;gt;[[#name|name]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;entityPersonality&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''entityPersonality''' : Number (read-only integer)&lt;br /&gt;
A random number in the range 0..32767 which is generated when the ship is created. Equivalent to the &amp;lt;code&amp;gt;entityPersonalityInt&amp;lt;/code&amp;gt; [[Shaders in Oolite: uniforms#Ship|uniform binding]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;equipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''equipment''' : Array of [[Oolite_JavaScript_Reference:_EquipmentInfo|EquipmentInfo ]] (read-only)&lt;br /&gt;
The equipment a ship is carrying.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;escortGroup&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''escortGroup''' : [[Oolite JavaScript Reference: ShipGroup|ShipGroup]]&lt;br /&gt;
The ship’s deployed escorts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;escorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''escorts''' : Array (read-only array of [[Oolite JavaScript Reference: Entity|Entity]]s)&lt;br /&gt;
The ship’s deployed escorts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;forwardWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''forwardWeapon''' : EquipmentType (read-only)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#aftWeapon|aftWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#portWeapon|portWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fuel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''fuel''' : Number (read/write)&lt;br /&gt;
The ship’s current fuel capacity, in LY. The game will limit this to the range 0..7, and round it off to the nearest tenth.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#fuelLeakRate|PlayerShip.fuelLeakRate]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== &amp;lt;code&amp;gt;fuelChargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Added in 1.74 but not documented, because it’s currently always 1.0.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''group''' : [[Oolite JavaScript Reference: ShipGroup|ShipGroup]]&lt;br /&gt;
Contains ship’s belonging to each other. Added pirate groups are an example or a station with its launched defenders.&amp;lt;br&amp;gt;&lt;br /&gt;
A group is an individual object that can be linked to several ships belonging to the same group. When a ship dies and the group object has still owners, the group stays active as object. The group is only removed from memory after the last ship that had this group as property is removed.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding a group to a ship does not automatic puts that ship in the group. For that to happen you need also use the addShip() command. &lt;br /&gt;
e.g. &lt;br /&gt;
 this.ship.group = new ShipGroup();&lt;br /&gt;
 this.ship.group.addShip(this.ship);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasHostileTarget&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hasHostileTarget''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship’s AI is trying to kill something, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Always &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for the player.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasHyperspaceMotor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hasHyperspaceMotor''' : Boolean (read-only)&lt;br /&gt;
True if the ship can make witchspace jumps. The corresponding ''[[shipdata.plist]]'' entry is &amp;lt;code&amp;gt;hyperspace_motor&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasSuspendedAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hasSuspendedAI''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has suspended AIs, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;heatInsulation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''heatInsulation''' : Number (read/write)&lt;br /&gt;
The ship’s heat insulation factor. 1.0 is normal, higher values mean more resistance to heat.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isBeacon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isBeacon''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a beacon (i.e., can show up on the [[Advanced Space Compass]] with a character indicating its identity), &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#beaconCode|beaconCode]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isBoulder&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isBoulder''' : Boolean (read/write)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a boulder (i.e., has the role &amp;quot;boulder in its roleset)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isCargo''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is cargo (i.e., has scan_class CLASS_CARGO and contains at least one unit)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isCloaked&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isCloaked''' : Boolean (read/write)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has a cloaking device which is currently active &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. If the ship has a cloaking device and sufficient energy to use it (&amp;lt;code&amp;gt;energy &amp;gt; 0.75 * maxEnergy&amp;lt;/code&amp;gt;), you can activate it by setting &amp;lt;code&amp;gt;isCloaked&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isDerelict&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isDerelict''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a derelict (i.e., the pilot has ejected from the ship, or the ship was created with the ship-key: &amp;quot;is_hulk&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isFrangible&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isFrangible''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is frangible (i.e., its subentities can be destroyed separately from the main ship), &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#subEntities|subEntities]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isJamming&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isJamming''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has a military scanner jammer which is currently active &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isMine&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isMine''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a mine, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isMissile&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isMissile''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a missile, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPiloted&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPiloted''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has a pilot on board, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Generally have ships, station and escape pods pilots and have cargo, rocks, missiles or buoys no pilots.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPirate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPirate''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a pirate vessel, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]] == &amp;quot;pirate&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPirateVictim&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPirateVictim''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship’s [[#primaryRole|primary role]] is listed in ''pirate-victim-roles.plist'', &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. This is the same test used by the pirate AI to select victims.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPolice&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPolice''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a police vessel, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#scanClass|scanClass]] == &amp;quot;CLASS_POLICE&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isRock&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isRock''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a rock (i.e., has scan_class: CLASS_ROCK)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isThargoid&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isThargoid''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a Thargoid vessel, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#scanClass|scanClass]] == &amp;quot;CLASS_THARGOID&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isTrader&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isTrader''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a merchant vessel, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]] == &amp;quot;trader&amp;quot; || isPlayer&amp;lt;/code&amp;gt;. '''Note:''' &amp;lt;code&amp;gt;[[#isPirateVictim|isPirateVictim]]&amp;lt;/code&amp;gt; may be a better choice in many cases.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isWeapon''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a weapon, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[#isMissile|isMissile]] || [[#isMine|isMine]] &amp;lt;/code&amp;gt;, but new categories of weapon could be added in future.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;lightsActive&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''lightsActive''' : Boolean (read-write)&lt;br /&gt;
Setting this property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; turns on all the entity’s flashers, and setting it to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; turns them off. Setting it sets the &amp;lt;code&amp;gt;lightsActive&amp;lt;/code&amp;gt; property for all subentities, but subentities’ setting can also be manipulated separately. In addition to affecting flashers, the value can be used by shaders.&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;lightsActive&amp;lt;/code&amp;gt; is always &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; when a ship is spawned, although individual flashers may be off because they have &amp;lt;code&amp;gt;initially_on&amp;lt;/code&amp;gt; set to false in their ''shipdata.plist'' declarations.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxSpeed''' : Number (read-only)&lt;br /&gt;
The ship’s maximum speed under normal power. Note that &amp;lt;code&amp;gt;[[#speed|speed]]&amp;lt;/code&amp;gt; may exceed this when [[witch fuel injectors]] or [[hyperspeed]] are in use.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#speed|speed]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxThrust&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxThrust''' : Number (read-only)&lt;br /&gt;
The ship’s maximum &amp;lt;code&amp;gt;[[#thrust|thrust]]&amp;lt;/code&amp;gt;. This value is the one defined as &amp;lt;code&amp;gt;thrust&amp;lt;/code&amp;gt; in ''[[Shipdata.plist#thrust|shipdata.plist]]''.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missileCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''missileCapacity''' : Number (read-only integer)&lt;br /&gt;
The maximum number of missiles the ship can carry.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missileLoadTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''missileLoadTime''' : Number (read-write nonnegative)&lt;br /&gt;
The minimum amount of time between two missiles. The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;missile_load_time&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missiles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''missiles''' : Array (read-only array of [[Oolite JavaScript Reference: EquipmentInfo|EquipmentInfo]])&lt;br /&gt;
The ship’s loaded missiles.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read/write, read-only for player)&lt;br /&gt;
The name of the ship type (&amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; key in [[shipdata.plist]]).&lt;br /&gt;
&lt;br /&gt;
''Note'': while &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; can be changed, this is discouraged (and will probably not be supported in Oolite 2.0). Use &amp;lt;code&amp;gt;[[#displayName|displayName]]&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;passengerCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerCapacity''' : Number (read-only integer)&lt;br /&gt;
The ship’s maximum passenger capacity.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;passengerCount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerCount''' : Number (read-only integer)&lt;br /&gt;
The ship’s current number of passengers.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;passengers&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengers''' : Array (read-only NSDictionary)&lt;br /&gt;
The ship’s passengers. (For now only available for the player). Each passengers list contains the entries: &amp;lt;code&amp;gt;name: String, start: integer, destination: integer, startName: string, destinationName: string, eta: integer, etaDescription: string, fee: Integer, premium: Integer&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the information of the first contract can be obtained by:&lt;br /&gt;
 player.ship.passengers[0].name&lt;br /&gt;
 player.ship.passengers[0].start&lt;br /&gt;
 player.ship.passengers[0].destination&lt;br /&gt;
 player.ship.passengers[0].startName&lt;br /&gt;
 player.ship.passengers[0].destinationName&lt;br /&gt;
 player.ship.passengers[0].eta&lt;br /&gt;
 player.ship.passengers[0].etaDescription&lt;br /&gt;
 player.ship.passengers[0].fee  // The final fee, paid out on successful delivery.&lt;br /&gt;
 player.ship.passengers[0].premium  // The advance fee, already paid on acceptance of the contract.&lt;br /&gt;
&lt;br /&gt;
start and destination contain system ID numbers for planets in the current galaxy chart, eta is in clock seconds, fee is the amount that the player will receive when delivering this passenger, and premium shows the amount the player received when the passenger boarded the ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''portWeapon''' : EquipmentType (read-only)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. Currently, this is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#aftWeapon|aftWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardWeapon|forwardWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;potentialCollider&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''potentialCollider''' : [[Oolite JavaScript Reference: Entity|Entity]] (read-only)&lt;br /&gt;
The entity the ship is currently trying not to crash into, if any.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;primaryRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''primaryRole''' : String (read/write, read-only for player)&lt;br /&gt;
The main role of the ship; the role for which it was created. For instance, if a ship’s ''shipdata.plist'' entry specifies the roles “pirate trader(0.5) escort”, and a ship of that type is spawned to be a trader, its &amp;lt;code&amp;gt;primaryRole&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;&amp;quot;trader&amp;quot;&amp;lt;/code&amp;gt;, its &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;[&amp;quot;escort&amp;quot;, &amp;quot;pirate&amp;quot;, &amp;quot;trader&amp;quot;]&amp;lt;/code&amp;gt; and its &amp;lt;code&amp;gt;roleWeights&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt; { &amp;quot;escort&amp;quot;:1, &amp;quot;pirate&amp;quot;:1, &amp;quot;trader&amp;quot;:0.5}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roles|roles]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#roleWeights|roleWeights]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;reportAIMessages&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''reportAIMessages''' : Boolean (read/write)&lt;br /&gt;
Debugging facility: set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to dump information about AI activity to the log. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roleWeights&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''roles''' : Object (read-only)&lt;br /&gt;
The probabilities for each role in &amp;lt;code&amp;gt;[[#roles|roles]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 this.pirateProb = ship.roleWeights[&amp;quot;pirate&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#roles|roles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''roles''' : Array (read-only array of Strings)&lt;br /&gt;
The roles of the ship. This consists of the roles specified in the ship’s ''shipdata.plist'' entry, as well as the &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]]&amp;lt;/code&amp;gt; if it is not among those.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#roleWeights|roleWeights]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#hasRole|hasRole()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;savedCoordinates&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''savedCoordinates''' : [[Oolite JavaScript Reference: Vector|Vector]] (read-write)&lt;br /&gt;
The savedCoordinates of the ship in system co-ordinates. The savedCoordinates vector is only used by AI scripting to store a coordinate that can be used by other AI commands like &amp;lt;code&amp;gt;setDestinationFromCoordinates&amp;lt;/code&amp;gt;. It are the same coordinates that are set by the AI command: &amp;lt;code&amp;gt;&amp;quot;setCoordinates: X Y Z&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerDisplayColor1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scannerDisplayColor1''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The first of two colours used by the ship’s scanner “lollipop”. When read, this will always be an array of four numbers in the range 0..1 (representing red, green, blue and alpha components). Any colour specifier format may be assigned to it. Assigning &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; will restore the value from [[shipdata.plist]], or the default value for the ship’s scan class.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#scannerDisplayColor2|scannerDisplayColor2]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerDisplayColor2&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scannerDisplayColor2''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The second scanner colour. If both &amp;lt;code&amp;gt;scannerDisplayColor1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;scannerDisplayColor2&amp;lt;/code&amp;gt; are specified, the scanner lollipop will alternate between the two colours.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#scannerDisplayColor1|scannerDisplayColor1]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scannerRange''' : Number (read-only)&lt;br /&gt;
The range of the ship’s scanner.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''script''' : [[Oolite JavaScript Reference: Script|Script]] (read-only)&lt;br /&gt;
The ship’s script.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scriptedMisjump&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scriptedMisjump''' : Boolean (read/write)&lt;br /&gt;
When &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the next hyperspace jump will be a misjump. The &amp;lt;code&amp;gt;scriptedMisjump&amp;lt;/code&amp;gt; flag will remain &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; during the &amp;lt;code&amp;gt;shipWillExitWitchspace()&amp;lt;/code&amp;gt; event handler, and will be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; after the &amp;lt;code&amp;gt;shipExitedWitchspace()&amp;lt;/code&amp;gt; event.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scriptInfo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scriptInfo''' : Object (read-only)&lt;br /&gt;
The contents of the &amp;lt;code&amp;gt;script_info&amp;lt;/code&amp;gt; key in the ship’s ''[[shipdata.plist]]'' entry, if any. This may be any [[property list]] object, but the reccomended approach is to use a dictionary whose keys have a unique prefix (such as you should be using for file names, ship names etc.). A property list dictionary is converted to a JavaScript object with properties corresponding to the dictionary’s keys. All other property list types used with Oolite have directly corresponding JavaScript types.&amp;lt;br&amp;gt;&lt;br /&gt;
When using numeric values in the scriptInfo, the JS engine is not able to detect the type reliably on all systems, so you always must expclicit convert its content to a number by using parseInt(scriptInfo.myKey) or parseFloat(scriptInfo.myKey).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;speed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''speed''' : Number (read-only)&lt;br /&gt;
The ship’s current speed.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxSpeed|maxSpeed]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;starboardWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''starboardWeapon''' : EquipmentType (read-only)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. Currently, this is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#aftWeapon|aftWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardWeapon|forwardWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#portWeapon|portWeapon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;subEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''subEntities''' : Array (read-only array of Ships)&lt;br /&gt;
The ships subentities, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if it has none. Special subentities such as flashers and exhaust plumes are not included.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#isFrangible|isFrangible]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;subEntityCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''subEntityCapacity''' : Number (read-only integer)&lt;br /&gt;
The original number of subentities on the ship. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#subEntities|subEntities]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#restoreSubEntities|restoreSubEntities()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''target''' : Ship (read-write)&lt;br /&gt;
The ship’s primary target, i.e. the entity it will attempt to shoot at. This value is automatically co-ordinated between a ship and its subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''temperature''' : Number (read/write)&lt;br /&gt;
The ship’s temperature, normalized such that a temperature of 1.0 is the level at which a ship starts taking heat damage.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;thrust&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''thrust''' : Number (read/write for NPCs, read-only for player)&lt;br /&gt;
The ship’s thrust, ranging from 0 to &amp;lt;code&amp;gt;maxThrust&amp;lt;/code&amp;gt;. This value determines how fast the ship accelerates or decelerates, specified in m/s².&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#thrustVector|thrustVector]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;thrustVector&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''thrustVector''' : Vector3D (read-only)&lt;br /&gt;
The inertialess velocity generated by the engines.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#thrust|thrust]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#velocity|velocity]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;trackCloseContacts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''trackCloseContacts''' : Boolean (read/write)&lt;br /&gt;
If true, AI events are generated for near collisions.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorForward&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''vectorForward''' : Vector3D (read-only)&lt;br /&gt;
The vector pointing forwards from the ship (in world space for ships, relative to the parent for subentities). Equivalent to &amp;lt;code&amp;gt;ship.[[Oolite JavaScript Reference: Entity#orientation|orientation]].[[Oolite JavaScript Reference: Quaternion#vectorForward|vectorForward]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorRight&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''vectorRight''' : Vector3D (read-only)&lt;br /&gt;
The vector pointing right from the ship (in world space for ships, relative to the parent for subentities). Equivalent to &amp;lt;code&amp;gt;ship.[[Oolite JavaScript Reference: Entity#orientation|orientation]].[[Oolite JavaScript Reference: Quaternion#vectorRight|vectorRight]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorUp&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''vectorUp''' : Vector3D (read-only)&lt;br /&gt;
The vector pointing up from the ship (in world space for ships, relative to the parent for subentities). Equivalent to &amp;lt;code&amp;gt;ship.[[Oolite JavaScript Reference: Entity#orientation|orientation]].[[Oolite JavaScript Reference: Quaternion#vectorUp|vectorUp]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;velocity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''velocity''' : Vector3D (read/write)&lt;br /&gt;
The ship’s velocity.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' A ship’s velocity consists of two components, inertial velocity and inertialess thrust. Generally, inertial velocity is zero (so &amp;lt;code&amp;gt;velocity&amp;lt;/code&amp;gt; is equal to &amp;lt;code&amp;gt;[[#thrustVector|thrustVector]]&amp;lt;/code&amp;gt;), but inertial impulses may be applied if a ship collides or is caught in an explosion. If inertial velocity is non-zero, the ship’s engines will work to counteract it. Changing the ship’s velocity will always apply inertial velocity, so for ships with non-zero &amp;lt;code&amp;gt;[[#maxThrust|maxThrust]]&amp;lt;/code&amp;gt; the effect will be temporary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#thrustVector|thrustVector]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;weaponRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''weaponRange''' : Number (read-only)&lt;br /&gt;
The maximum range of the ship’s primary weapon. For the player it is the range of the weapon that fired as last, even when the view direction changed.&amp;lt;br&amp;gt;&lt;br /&gt;
Range values are: WEAPON_PLASMA_CANNON: 5000, WEAPON_PULSE_LASER: 12500, WEAPON_BEAM_LASER: 15000, WEAPON_MINING_LASER: 12500, WEAPON_THARGOID_LASER: 17500, WEAPON_MILITARY_LASER: 30000, WEAPON_NONE: 32000.&amp;lt;br&amp;gt;&lt;br /&gt;
(Turrets are secondary weapons with a maximum range of 6000)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;withinStationAegis&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''withinStationAegis''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is within the aegis of the system’s main station (i.e., no more than 51 200 game metres from the station, or twice scanner range).&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;abandonShip&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''abandonShip'''() : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; when the ship has an escapepod. It will launch all escapeposd on board leaving the ship behind as a empty hulk. (scanClass = CLASS_CARGO). This command does nothing when no escape-pod is present.&amp;lt;br&amp;gt;&lt;br /&gt;
Pressence of an escapepod can be tested with: &amp;lt;code&amp;gt;equipmentStatus(&amp;quot;EQ_ESCAPE_POD&amp;quot;) == &amp;quot;EQUIPMENT_OK&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;awardEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''awardEquipment'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]]) : Boolean&lt;br /&gt;
Adds the given piece of equipment to the ship, if possible, returning &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if successful and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 ship.awardEquipment(&amp;quot;EQ_ECM&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#canAwardEquipment|canAwardEquipment()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeEquipment|removeEquipment()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;canAwardEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''canAwardEquipment'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]]) : Boolean&lt;br /&gt;
Tests whether it is possible to add a given equipment type. This command takes the conditions for offering inside equipment.plist into account. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;[[#awardEquipment|awardEquipment()]]&amp;lt;/code&amp;gt; is expected to succeed, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#awardEquipment|awardEquipment()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commsMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''commsMessage'''(message : String [,target : Ship])&lt;br /&gt;
Make the ship broadcast the specified message. Works on buoys and subentities as well as normal ships and stations. Messages are send to a maximum of 16 ships in range and always to the player when in range. When the optional target is used, the message goes only to that ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;deployEscorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''deployEscorts'''()&lt;br /&gt;
Launch the ship’s escorts, if any.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockEscorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''dockEscorts'''()&lt;br /&gt;
Dock the ship’s deployed escorts, if any.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dumpCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''dumpCargo'''() : Ship&lt;br /&gt;
Ejects one item of cargo from the ship, and returns the cargo item. Returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if the ship has no cargo, anything has been ejected in the last 0.5 seconds, or if sent to the player while docked.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#ejectSpecificItem|ejectSpecificItem]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ejectItem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''ejectItem'''(role : String) : Ship&lt;br /&gt;
Spawns a ship of role &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; immediately behind the ship, with a slight backwards velocity. (Note: an equal and opposite reaction is applied to the parent ship, so doing this with large ships is rarely useful. &amp;lt;code&amp;gt;player.ejectItem(&amp;quot;station&amp;quot;)&amp;lt;/code&amp;gt; may seem funny, but don’t come running to me if you have someone’s eye out.) Returns the generated ship, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if no ship is generated. The scanClass of the ejected item will always be CLASS_CARGO.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#ejectSpecificItem|ejectSpecificItem]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ejectSpecificItem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''ejectSpecificItem'''(itemKey : String) : Ship&lt;br /&gt;
Spawns a ship with the ''shipdata.plist'' key &amp;lt;code&amp;gt;itemKey&amp;lt;/code&amp;gt; immediately behind the ship, with a slight backwards velocity. The scanClass of the ejected item will always be CLASS_CARGO.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#ejectItem|ejectItem]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;equipmentStatus&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''equipmentStatus'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]]) : String&lt;br /&gt;
Tests whether the specified type of equipment is installed, and whether it is functioning. Returns one of the following strings: &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_OK&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_DAMAGED&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_UNAVAILABLE&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_UNKNOWN&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setEquipmentStatus|setEquipmentStatus()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''exitAI'''()&lt;br /&gt;
Exit the current AI, restoring the previous one. Equivalent to the &amp;lt;code&amp;gt;[[AI_methods|exitAI]]:&amp;lt;/code&amp;gt; AI method. May not be used on player. Will generate a warning if there are no suspended AI states.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setAI|setAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#hasSuspendedAI|hasSuspendedAI]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''exitSystem'''([targetSystem : Number]) : Boolean&lt;br /&gt;
Cause the ship to jump out of the system, if possible. If &amp;lt;code&amp;gt;targetSystem&amp;lt;/code&amp;gt; is specified, it will attempt to jump to the specified system, otherwise a random system within range is chosen.&lt;br /&gt;
&lt;br /&gt;
This method can fail for various reasons, in which case it returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;. It always fails for the player ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;explode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''explode'''()&lt;br /&gt;
Causes the ship to explode. Works on all ships, including the main station and the player except when docked.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#remove|remove()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fireECM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''fireECM'''()&lt;br /&gt;
activates an ecm burst, identical as the AI command.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fireMissile&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''fireMissile'''([missile]) : Ship&lt;br /&gt;
fireMissile() will try to fire the first available missile and will return the missile fired, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if no missiles can be fired at this time. It can take the optional missile identifier parameter, to allow for a specific missile to be fired. Missiles cannot be fired if the ship hasn’t got a valid target, or if the previous missile was launched less than &amp;lt;code&amp;gt;missile_load_time&amp;lt;/code&amp;gt; seconds before. If a missile type was specified, and not found on the ship, no missile will be fired.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''hasRole'''(role : String)&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; among its roles, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roles|roles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;reactToAIMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''reactToAIMessage'''(message : String)&lt;br /&gt;
Immediately perform the specified handler in the ship’s current AI state.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#sendAIMessage|sendAIMessage()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;remove&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''remove'''([suppressDeathEvent : Boolean])&lt;br /&gt;
Immediately removes the ship from the universe. Works on all ships except the player, including the main station.&amp;lt;br&amp;gt;It generates a this.shipRemoved(suppressDeathEvent) event. By default it will also trigger a this.shipDied() event, unless &amp;lt;code&amp;gt;suppressDeathEvent&amp;lt;/code&amp;gt; is true.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#explode|explode()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''removeEquipment'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]])&lt;br /&gt;
Removes the given piece of equipment from the ship.&lt;br /&gt;
This function can also be used to remove missiles (and mines). If more than one missile of the same type is found on board, only one of them will be removed.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 ship.removeEquipment(&amp;quot;EQ_ECM&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;restoreSubEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''restoreSubEntities'''() : Boolean&lt;br /&gt;
Recreate all destroyed subentities of the ship. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if any subentities were added.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;selectNewMissile&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''selectNewMissile'''() : equipmentKey&lt;br /&gt;
selectNewMissile() will automatically select a missile for a specific ship. It uses the missile_role shipdata.plist key to find out which missiles to select. As with the system populator, there's a small chance that missiles other than the missile_role specified in shipdata will be selected.&lt;br /&gt;
e.g.&lt;br /&gt;
 this.ship.awardEquipment(this.ship.selectNewMissile())&lt;br /&gt;
will automatically add the 'right type' of missile to a ship, i.e. one that its captain would normally choose.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sendAIMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''sendAIMessage'''(message : String)&lt;br /&gt;
Add a message to the ship’s AI deferred message queue. Messages in the queue are handled immediately after the next periodic &amp;lt;code&amp;gt;UPDATE&amp;lt;/code&amp;gt; message. Identical messages are coalesced.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#reactToAIMessage|reactToAIMessage()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setAI'''(AIName : String)&lt;br /&gt;
Set the current AI, leaving the old one suspended. Equivalent to the &amp;lt;code&amp;gt;[[AI_methods|setAITo]]:&amp;lt;/code&amp;gt; AI method. May not be used on player.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#switchAI|switchAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#exitAI|exitAI()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setCargo'''(commodity : String [, count : Number]) : Boolean&lt;br /&gt;
Attempts to create &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; weight units of the commodity &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; for a cargo barrel. (Can not be used to set cargo for ships) When more units are defined than 1 ton, the count is reduced to one ton.  It returns false when the selected commodity is unknown. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is not specified, one will be assumed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setEquipmentStatus&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setEquipmentStatus'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]], statusKey : String)&lt;br /&gt;
Changes the status of the given piece of equipment from the ship. The two only valid status keys are &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_OK&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_DAMAGED&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' by design, this method will throw an exception if called with an equipment type that does not exist. To test whether an equipment type exists, use &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: EquipmentInfo#infoForKey|EquipmentInfo.infoForKey()]]&amp;lt;/code&amp;gt;, which will return &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for undefined equipment.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#equipmentStatus|equipmentStatus()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setMaterials&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setMaterials'''(materialDictionary : Object [, shaderDictionary : Object]) : Boolean&lt;br /&gt;
Set the materials of the ship’s model. This works exactly like the &amp;lt;code&amp;gt;materials&amp;lt;/code&amp;gt; dictionary in [[shipdata.plist]]. The optional &amp;lt;code&amp;gt;shaderDictionary&amp;lt;/code&amp;gt; argument overrides &amp;lt;code&amp;gt;materialDictionary&amp;lt;/code&amp;gt; if shaders are active.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 this.ship.setMaterials({&amp;quot;my_ship_diffuse.png&amp;quot;: { diffuse_map: &amp;quot;my_ship_damaged_diffuse.png&amp;quot; }});&lt;br /&gt;
 &lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setShaders|setShaders()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScript&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setScript'''(scriptName : String)&lt;br /&gt;
Set, or completely replace, the javascript code associated to a ship entity.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setShaders&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setShaders'''(shaderDictionary : Object) : Boolean&lt;br /&gt;
Set the shader materials of the ship’s model. Equivalent to &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;materialDictionary&amp;lt;/code&amp;gt; value set to the ship’s current material dictionary.&lt;br /&gt;
 &lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;spawn&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''spawn'''(role : String [, count : Number]) : Array&lt;br /&gt;
Attempts to create &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; (maximum: 64) ships of role &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; close to the ship – specifically, inside the ship’s collision radius. (Since creating ships may fail, the number created may be less than &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt;). The created ships are returned in an array. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is not specified, one will be assumed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spawn()&amp;lt;/code&amp;gt; is intended for cases when a ship splits into multiple parts or drops parts. In particular, it has the following special behaviour:&lt;br /&gt;
* The spawned ships inherit most of the temperature of the parent.&lt;br /&gt;
* If the parent is a missile and a child has the &amp;lt;code&amp;gt;[[shipdata.plist#is_submunition|is_submunition]]&amp;lt;/code&amp;gt; property, the child will be considered a missile, its target will be set to that of the parent and the child’s owner will be set to the parent.&lt;br /&gt;
* &amp;lt;code&amp;gt;spawn()&amp;lt;/code&amp;gt; does not set up escorts for the new ships, or generate witchspace effects, or do any special AI handling.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;spawnOne&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''spawnOne'''(role : String) : Ship&lt;br /&gt;
Convenience method which calls &amp;lt;code&amp;gt;[[#spawn|spawn]](role)&amp;lt;/code&amp;gt; and returns the first element of the resulting array, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;spawn()&amp;lt;/code&amp;gt; fails.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;switchAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''switchAI'''(AIName : String)&lt;br /&gt;
Set the current AI, exiting the old one. Equivalent to the &amp;lt;code&amp;gt;[[AI_methods|switchAITo]]:&amp;lt;/code&amp;gt; AI method. May not be used on player.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setAI|setAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#exitAI|exitAI()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;updateEscortFormation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''updateEscortFormation'''()&lt;br /&gt;
Request that the game updates the target positions for the ship’s escorts by calling the ship’s script’s &amp;lt;code&amp;gt;coordinatesForEscortPosition()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_PlayerShip&amp;diff=29903</id>
		<title>Oolite JavaScript Reference: PlayerShip</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_PlayerShip&amp;diff=29903"/>
		<updated>2011-12-16T21:40:15Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship|Ship]]&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;PlayerShip&amp;lt;/code&amp;gt;''' class is an &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity|Entity]]&amp;lt;/code&amp;gt; representing the player’s ship. The &amp;lt;code&amp;gt;PlayerShip&amp;lt;/code&amp;gt; has all the properties and methods of a &amp;lt;code&amp;gt; [[Oolite JavaScript Reference: Ship|Ship]]&amp;lt;/code&amp;gt;, and several others. There is always exactly one Player object in existence, which can be accessed through &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#player|player]].ship&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Like any entity, the player ship can become [[Oolite JavaScript Reference: Entity#Stale References|invalid]] – specifically, when the player dies or ejects. Unlike other entities, the player ship can become valid again (after ejecting and being rescued). This is a technicality and it’s not guaranteed to work this way in future.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;aftShield&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''aftShield''' : Number (read/write, nonnegative)&lt;br /&gt;
The current aft shield level, ranging from 0 to &amp;lt;code&amp;gt;[[#maxAftShield|maxAftShield]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#aftShieldRechargeRate|aftShieldRechargeRate]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardShield|forwardShield]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#maxAftShield|maxAftShield]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;aftShieldRechargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''aftShieldRechargeRate''' : Number (read-only, nonnegative)&lt;br /&gt;
The rate at which the aft shield recharges (assuming enough energy is available). This is affected by equipment – currently, the Military Shield Enhancement. Currently always the same as &amp;lt;code&amp;gt;[[#forwardShieldRechargeRate|forwardShieldRechargeRate]]&amp;lt;/code&amp;gt;, but this may change in future.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#aftShield|aftShield]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardShieldRechargeRate|forwardShieldRechargeRate]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#maxAftShield|maxAftShield]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;compassMode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''compassMode''' : String (read-only)&lt;br /&gt;
Returns the current compass mode, which can be any one of the following:&lt;br /&gt;
* COMPASS_MODE_BASIC&lt;br /&gt;
* COMPASS_MODE_PLANET&lt;br /&gt;
* COMPASS_MODE_STATION&lt;br /&gt;
*COMPASS_MODE_SUN&lt;br /&gt;
* COMPASS_MODE_TARGET&lt;br /&gt;
* COMPASS_MODE_BEACONS&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;compassTarget&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''compassTarget''' : Entity(read-only)&lt;br /&gt;
Points at the entity currently targeted by the compass.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cursorCoordinates&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cursorCoordinates''' : Vector3D (read-only)&lt;br /&gt;
'''Discouraged in favour of &amp;lt;code&amp;gt;[[#cursorCoordinatesInLY|cursorCoordinatesInLY]]&amp;lt;/code&amp;gt;.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The current x and y cursor coordinates on the long range screen in the internal coordinate system. The &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; coordinate is always 0.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cursorCoordinatesInLY&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cursorCoordinatesInLY''' : Vector3D (read-only)&lt;br /&gt;
The current x and y cursor coordinates on the long range screen, in light years. The &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; coordinate is always 0.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;docked&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''docked''' : Boolean (read-only)&lt;br /&gt;
True if the player is docked with a station or carrier.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockedStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''dockedStation''' : [[Oolite JavaScript Reference: Station|Station]] (read-only)&lt;br /&gt;
The station with which the player is currently docked.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;forwardShield&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''forwardShield''' : Number (read/write, nonnegative)&lt;br /&gt;
The current forward shield level, ranging from 0 to &amp;lt;code&amp;gt;[[#maxForwardShield|maxForwardShield]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#aftShield|aftShield]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardShieldRechargeRate|forwardShieldRechargeRate]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#maxForwardShield|maxForwardShield]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;forwardShieldRechargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''forwardShieldRechargeRate''' : Number (read-only, nonnegative)&lt;br /&gt;
The rate at which the forward shield recharges (assuming enough energy is available). This is affected by equipment – currently, the Military Shield Enhancement. Currently always the same as &amp;lt;code&amp;gt;[[#aftShieldRechargeRate|aftShieldRechargeRate]]&amp;lt;/code&amp;gt;, but this may change in future.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#aftShieldRechargeRate|aftShieldRechargeRate]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardShield|forwardShield]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#maxForwardShield|maxForwardShield]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fuelLeakRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''fuelLeakRate''' : Number (read/write)&lt;br /&gt;
The rate at which the player is losing fuel, in tenths of a LY per second. May not be negative. Reset to 0 when fuel is empty.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galacticHyperspaceBehaviour&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galacticHyperspaceBehaviour''' : String (read/write)&lt;br /&gt;
A string indicating what the effect of a galactic hyperspace jump will be. The available options are:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;BEHAVIOUR_STANDARD&amp;quot;&amp;lt;/code&amp;gt;: the player arrives in the closest system to the starting point that is part of the main group of stars. Small groups (as seen in [[Oolite planet list/Galaxy 6|galaxy 6]], among others) can’t be reached.&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;BEHAVIOUR_ALL_SYSTEMS_REACHABLE&amp;quot;&amp;lt;/code&amp;gt;: The player arrives at the closest system to the starting point, even if it is in a small group. '''Important:''' this can leave the player stranded, unless there are missions providing the possibility of escape!&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;BEHAVIOUR_FIXED_COORDINATES&amp;quot;&amp;lt;/code&amp;gt;: The player arrives at the system closest to &amp;lt;code&amp;gt;[[#galacticHyperspaceFixedCoordsInLY|galacticHyperspaceFixedCoordsInLY]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#galacticHyperspaceFixedCoordsInLY|galacticHyperspaceFixedCoordsInLY]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galacticHyperspaceFixedCoords&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galacticHyperspaceFixedCoords''' : [[Oolite JavaScript Reference: Vector3D|Vector3D]] (read/write)&lt;br /&gt;
'''Discouraged in favour of &amp;lt;code&amp;gt;[[#galacticHyperspaceFixedCoordsInLY|galacticHyperspaceFixedCoordsInLY]]&amp;lt;/code&amp;gt;.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#galacticHyperspaceFixedCoordsInLY|galacticHyperspaceFixedCoordsInLY]]&amp;lt;/code&amp;gt;, but in the internal coordinate system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galacticHyperspaceFixedCoordsInLY&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galacticHyperspaceFixedCoordsInLY''' : [[Oolite JavaScript Reference: Vector3D|Vector3D]] (read/write)&lt;br /&gt;
The destination coordinates when &amp;lt;code&amp;gt;[[#galacticHyperspaceBehaviour|galacticHyperspaceBehaviour]]&amp;lt;/code&amp;gt; mode is &amp;lt;code&amp;gt;&amp;quot;GALACTIC_HYPERSPACE_BEHAVIOUR_FIXED_COORDINATES&amp;quot;&amp;lt;/code&amp;gt;. The coordinate system corresponds to &amp;lt;code&amp;gt;[[#galaxyCoordinatesInLY|galaxyCoordinatesInLY]]&amp;lt;/code&amp;gt;. Currently, when assigning a value its &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; coordinates will be rounded to integer internal coordinates, and the &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; coordinate will be rejected.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#galacticHyperspaceBehaviour|galacticHyperspaceBehaviour]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galaxyCoordinates&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galaxyCoordinates''' : Vector3D (read-only)&lt;br /&gt;
'''Discouraged in favour of &amp;lt;code&amp;gt;[[#galaxyCoordinatesInLY|galaxyCoordinatesInLY]]&amp;lt;/code&amp;gt;.'''&amp;lt;br /&amp;gt;&lt;br /&gt;
The player’s location in galactic space, in the internal coordinate system. The &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; coordinate is always 0.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galaxyCoordinatesInLY&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galaxyCoordinatesInLY''' : Vector3D (read-only)&lt;br /&gt;
The player’s location in galactic space, in light years (measured from the top left of the map). The &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; coordinate is always 0.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hud&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hud''' : String (read/write)&lt;br /&gt;
The name of the [[hud.plist|HUD plists]] defining the ship’s head up display.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hudHidden&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hudHidden''' : Boolean (read/write)&lt;br /&gt;
Whether the HUD should be visible.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;manifest&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''manifest''' : [[Oolite JavaScript Reference: Manifest|Manifest]] (read/write)&lt;br /&gt;
The manifest contains all the cargo the player carries. It can be addressed as a property of playerShip as well as a class [[Oolite JavaScript Reference: Manifest|Manifest]] of its own.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxAftShield&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxAftShield''' : Number (read-only, nonnegative)&lt;br /&gt;
The highest possible value of &amp;lt;code&amp;gt;[[#aftShield|aftShield]]&amp;lt;/code&amp;gt;. This is affected by equipment – currently the Shield Boosters and Military Shield Enhancement. Currently always the same as &amp;lt;code&amp;gt;[[#maxForwardShield|maxForwardShield]]&amp;lt;/code&amp;gt;, but this may change in future.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#aftShield|aftShield]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#aftShieldRechargeRate|aftShieldRechargeRate]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#maxForwardShield|maxForwardShield]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxForwardShield&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxAftShield''' : Number (read-only, nonnegative)&lt;br /&gt;
The highest possible value of &amp;lt;code&amp;gt;[[#forwardShield|forwardShield]]&amp;lt;/code&amp;gt;. This is affected by equipment – currently the Shield Boosters and Military Shield Enhancement. Currently always the same as &amp;lt;code&amp;gt;[[#maxAftShield|maxAftShield]]&amp;lt;/code&amp;gt;, but this may change in future.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#forwardShield|forwardShield]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardShieldRechargeRate|forwardShieldRechargeRate]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#maxAftShield|maxAftShield]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;reticleTargetSensitive&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''reticleTargetSensitive''' : Boolean (read/write)&lt;br /&gt;
If true, and Scanner Targeting Enhancement is installed, the selected target reticle will light up in red when the target is in the player’s sights. This is equivalent to the &amp;lt;code&amp;gt;reticle_target_sensitive&amp;lt;/code&amp;gt; key in [[hud.plist|HUD plists]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scoopOverride&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scoopOverride''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, and the player has a fuel scoop, the fuel scoop effect will run even if not close to a sun or scooping cargo.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;specialCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''specialCargo''' : String (read-only)&lt;br /&gt;
The special cargo the player is carrying, if any; otherwise &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#useSpecialCargo|useSpecialCargo]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;targetSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''targetSystem''' : Integer (read-only)&lt;br /&gt;
The ID of the selected hyperspace target system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;viewDirection&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''viewDirection''' : String (read-only)&lt;br /&gt;
Returns the view direction as string: &amp;lt;code&amp;gt;&amp;quot;VIEW_FORWARD&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;VIEW_AFT&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;VIEW_PORT&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;VIEW_STARBOARD&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;VIEW_CUSTOM&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;VIEW_GUI_DISPLAY&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;weaponsOnline&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''weaponsOnline''' : Boolean (read-only)&lt;br /&gt;
Returns the weapon safety status. Player can toggle the status with the underscore-key.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addPassenger&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addPassenger'''(name : String, start : Number, destination : Number, arrivalTime : Number, fee : Number) : Boolean&lt;br /&gt;
Add a passenger contract to the ship. &amp;lt;code&amp;gt;arrivalTime&amp;lt;/code&amp;gt; is the arrival time in seconds and must be greater than the current time. &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; are the ID numbers of the start and end systems.&lt;br /&gt;
&lt;br /&gt;
Returns	&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when there is no room for the passenger or the arrival time is invalid.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
  player.ship.addPassenger(&amp;quot;cmdr Jameson&amp;quot;, 34, 67, clock.seconds+3*24*3600, 1500);&lt;br /&gt;
&lt;br /&gt;
If successful - and in galaxy chart 1 - the player will have cmdr Jameson as a passenger, his documents will show that he boarded the ship at Inus, to go to Cemave, within exactly 3 days, and the player will be given 1500 credits if he gets there on time (early or late arrival will affect the amount paid).&lt;br /&gt;
&lt;br /&gt;
'''N.B.''' Normally a passenger will pay the captain a small advance upon boarding. Using this method, no inital payment is made.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;awardContract&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''awardContract'''(quantity : Number, commodity : String, start : Number, destination : Number, arrivalTime : Number, fee : Number) : Boolean&lt;br /&gt;
Add a cargo contract to the ship. &amp;lt;code&amp;gt;arrivalTime&amp;lt;/code&amp;gt; is the arrival time in seconds and must be greater than the current time. &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; are the ID numbers of the start and end systems.&lt;br /&gt;
&lt;br /&gt;
Returns	&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when there is no room for the cargo, the arrival time is invalid.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.ship.awardContract(12, &amp;quot;Food&amp;quot;, 34, 67, clock.seconds+7*24*3600, 5000)&lt;br /&gt;
&lt;br /&gt;
If successful - and in galaxy chart 1 - the player will have 12 more food containers on board, the manifest will show that the cargo was picked up at Inus, to be delivered at Cemave, within exactly 7 days, and the player will be given 5000 credits if the cargo is delivered on time (early or late delivery will affect the amount paid).&lt;br /&gt;
'''N.B.''' Normally to get a contract, the player will have to buy the cargo at the local market price. Using this method, no inital payment is made.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;awardEquipmentToCurrentPylon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''awardEquipmentToCurrentPylon'''(item : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]]) : Boolean&lt;br /&gt;
Replace the missile or mine currently being launched with the specified item (which must be an external store). This will only have an effect if called while a missile or mine is being launched. Effectively this means that this method must be used within the &amp;lt;code&amp;gt;shipFiredMissile()&amp;lt;/code&amp;gt; handler or in the ENTER message of the GLOBAL state of an missileAI.plist.&lt;br /&gt;
&lt;br /&gt;
'''Bug:''' In Oolite 1.74.0, if &amp;lt;code&amp;gt;awardEquipmentToCurrentPylon()&amp;lt;/code&amp;gt; fails the script will be halted without any error message. In future versions, it will simply return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#awardEquipment|Ship.awardEquipment()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;disengageAutopilot&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function disengageAutopilot()&lt;br /&gt;
Disenable autopilot.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#engageAutopilotToStation|engageAutopilotToStation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;engageAutopilotToStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function engageAutopilotToStation(station : [[Oolite JavaScript Reference: Station|Station]]) : Boolean&lt;br /&gt;
Engage autopilot, set to dock with the specified station.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#disengageAutopilot|disengageAutopilot()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;launch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''launch'''()&lt;br /&gt;
Launches the player’s ship if it is currently docked.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeAllCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''removeAllCargo'''()&lt;br /&gt;
Removes all cargo from the ship’s cargo bay.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removePassenger&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''removePassenger'''(name : String)&lt;br /&gt;
Remove a named passenger.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;useSpecialCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''useSpecialCargo'''(description : String)&lt;br /&gt;
Fills the cargo bay with the cargo described, effectively disabling the use of the cargo bay until the cargo is removed.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#specialCargo|specialCargo]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=29902</id>
		<title>Oolite JavaScript Reference: Player</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=29902"/>
		<updated>2011-12-16T21:39:53Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Player&amp;lt;/code&amp;gt;''' class is represents the player. There is always exactly one &amp;lt;code&amp;gt;Player&amp;lt;/code&amp;gt; object in existence, which can be accessed through the &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt; global property.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertAltitude&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertAltitude''' : Boolean (read-only)&lt;br /&gt;
Whether the player is dangerously close to a planet. (closer than 4000 meter to the surface)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertCondition&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertCondition''' : Number (read-only, integer)&lt;br /&gt;
Returns the current alert condition. 0 = Docked, 1 = Green, 2 = Yellow, 3 = Red.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertEnergy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertEnergy''' : Boolean (read-only)&lt;br /&gt;
Whether the player’s energy level is depleted (i.e., &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#energy|energy]]&amp;lt;/code&amp;gt; is less than &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#maxEnergy|maxEnergy]]&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertHostiles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertHostiles''' : Boolean (read-only)&lt;br /&gt;
Whether there are hostile ships within scanner range.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertMassLocked&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertMassLocked''' : Boolean (read-only)&lt;br /&gt;
Whether the player is mass locked.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertTemperature&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertTemperature''' : Boolean (read-only)&lt;br /&gt;
Whether the cabin temperature is dangerously high.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;bounty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''bounty''' : Number (read/write integer)&lt;br /&gt;
The bounty on the player, which determines legal status. It is halved at each witchspace jump.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#legalStatus|legalStatus]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceAvailable&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceAvailable''' : Number (read-only integer)&lt;br /&gt;
The ship’s available cargo space, in tons.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceUsed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceUsed''' : Number (read-only integer)&lt;br /&gt;
The ship’s current cargo, in tons.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;contractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''contractReputation''' : Number (read-only integer)&lt;br /&gt;
The player’s cargo contract reputation, ranging from -7 to +7. Reputation is based on fulfilled and unfulfilled contracts. Both individually ranging from 0 till 7. Both good and bad value erode away in time towards 0. All individually values below 7 are seen as '''unknown''' reputation. This unknown part is randomised based on the market situation. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#decreaseContractReputation|decreaseContractReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseContractReputation|increaseContractReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;credits&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''credits''' : Number (read/write, integer)&lt;br /&gt;
The amount of money the player has.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockingClearanceStatus&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''dockingClearanceStatus''' : String (read-only)&lt;br /&gt;
A string indicating whether the player has docking clearance. (''Clarify: for which station? -[[User:Ahruman|Ahruman]] 20:34, 3 November 2008 (UTC)'') Possible values are:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_NONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_REQUESTED&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_NOT_REQUIRED&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_GRANTED&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_TIMING_OUT&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;legalStatus&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''legalStatus''' : String (read-only)&lt;br /&gt;
A string describing the player’s legal status for display purposes, based on &amp;lt;code&amp;gt;[[#bounty|bounty]]&amp;lt;/code&amp;gt;. In English, this is one of &amp;lt;code&amp;gt;&amp;quot;Clean&amp;quot;&amp;lt;/code&amp;gt; (bounty = 0), &amp;lt;code&amp;gt;&amp;quot;Offender&amp;quot;&amp;lt;/code&amp;gt; (0 &amp;lt; bounty ≤ 50) or &amp;lt;code&amp;gt;&amp;quot;Fugitive&amp;quot;&amp;lt;/code&amp;gt;, but note that it can be localized.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read-only)&lt;br /&gt;
The name of the player’s character (e.g., “Jameson”).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;passengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerReputation''' : Number (read-only integer)&lt;br /&gt;
The player’s passenger contract reputation, ranging from -7 to +7. Reputation is based on fulfilled and unfulfilled contracts. Both individually ranging from 0 till 7. Both good and bad value erode away in time towards 0. All individually values below 7 are seen as '''unknown''' reputation. This unknown part is randomised based on the market situation. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#contractReputation|contractReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreasePassengerReputation|decreasePassengerReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increasePassengerReputation|increasePassengerReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rank&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''rank''' : String (read-only)&lt;br /&gt;
A string describing the player’s rank for display purposes, based on &amp;lt;code&amp;gt;[[#score|score]]&amp;lt;/code&amp;gt;, such as &amp;lt;code&amp;gt;&amp;quot;Mostly Harmless&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;Dangerous&amp;quot;&amp;lt;/code&amp;gt;. Note that it can be localized.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;score&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''score''' : Number (read/write, integer)&lt;br /&gt;
The player’s score; nominally the number of kills the player has made, although some missions award additional points.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;trumbleCount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''trumbleCount''' : Number (read-only nonnegative integer)&lt;br /&gt;
The number of trumbles the player is currently blessed with.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageToArrivalReport&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageToArrivalReport'''(message : String)&lt;br /&gt;
Adds a message to the arrival report. This is the report shown immediately after docking. Oolite is putting its own stuff on the list immediately after shipWillDockAtStation() so it will be a good moment to add the messages at that moment when you know what station will be docked. At shipDockedWithStation() it will be to late as the report is already being shown at that moment. Messages added will be on the list above oolites own arrival messages. Messages added on the list other than during shipWillDockAtStation() will trigged the report screen when using the F5 screen during flight. This will be fixed in future versions but for now, only add them at shipWillDockAtStation().&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commsMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''commsMessage'''(message : String [, duration: Number])&lt;br /&gt;
Writes the specified message in the player’s communications log, as well as displaying it as a console message. The optional &amp;lt;code&amp;gt;duration&amp;lt;/code&amp;gt; parameter determines how long the message should be displayed on the console before fading out. It is clamped to the range [1, 10]. If no duration is specified, 4.5 seconds will be used. Example: &amp;lt;code&amp;gt;player.commsMessage(&amp;quot;Hello, cruel universe.&amp;quot;, 6)&amp;lt;/code&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
NB. This commsMessage() is a property of &amp;quot;player&amp;quot;. &amp;quot;player.ship&amp;quot; has also a commsMessage() property, but that belongs to ship and has a different second parameter. (see [[Oolite_JavaScript_Reference:_Ship|Oolite JavaScript Reference: Ship]])&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;consoleMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''consoleMessage'''(message : String [, duration: Number])&lt;br /&gt;
Displays the specified message as a console message, that is, as a message on the HUD. The optional &amp;lt;code&amp;gt;duration&amp;lt;/code&amp;gt; parameter determines how long the message should be displayed before fading out. It is clamped to the range [1, 10]. If no duration is specified, 3 seconds will be used.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;decreaseContractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''decreaseContractReputation'''()&lt;br /&gt;
Give the player a negative reputation point for cargo contracts. Decreases the underlying value for contractReputation by 1 until a minimum of -7. Depending on the randomised part of the value can the visible value stay the same in one system.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseContractReputation|increaseContractReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;decreasePassengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''decreasePassengerReputation'''()&lt;br /&gt;
Give the player a negative reputation point for passenger contracts. Decreases the underlying value for passengerReputation by 1 until a minimum of -7. Depending on the randomised part of the value can the visible value stay the same in one system.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increasePassengerReputation|increasePassengerReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;increaseContractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''increaseContractReputation'''()&lt;br /&gt;
Give the player a positive reputation point for cargo contracts. Increases the underlying value for contractReputation by 1 until a maximum of 7&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreaseContractReputation|decreaseContractReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;increasePassengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''increasePassengerReputation'''()&lt;br /&gt;
Give the player a positive reputation point for passenger contracts. Increases the underlying value for passengerReputation by 1 until a maximum of 7&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreasePassengerReputation|decreasePassengerReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setEscapePodDestination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setEscapePodDestination'''(destination)&lt;br /&gt;
This method can only be called after the player has launched an escape pod – for example, from the &amp;lt;code&amp;gt;escapePodSequenceOver()&amp;lt;/code&amp;gt; event handler. It determines where the player will end up. &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; may be any carrier/station entity, or the string &amp;lt;code&amp;gt;&amp;quot;NEARBY_SYSTEM&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. If it is &amp;lt;code&amp;gt;&amp;quot;NEARBY_SYSTEM&amp;quot;&amp;lt;/code&amp;gt;, the player will end up at the main station in a random nearby system. If it is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;, the player will die of life support failure. (&amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; is the default in interstellar space.)&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Planet&amp;diff=29901</id>
		<title>Oolite JavaScript Reference: Planet</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Planet&amp;diff=29901"/>
		<updated>2011-12-16T21:39:43Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;[[Oolite/Development/Scripting/Class/Entity|Entity]]&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Planet&amp;lt;/code&amp;gt;''' class is an &amp;lt;code&amp;gt;[[Oolite/Development/Scripting/Class/Entity|Entity]]&amp;lt;/code&amp;gt; representing a planet or moon. A &amp;lt;code&amp;gt;Planet&amp;lt;/code&amp;gt; has all the properties and methods of a &amp;lt;code&amp;gt;Entity&amp;lt;/code&amp;gt;, and several others.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasAtmosphere&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hasAtmosphere''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity has an atmosphere, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Planets created with the &amp;lt;code&amp;gt;System.[[Oolite/Development/Scripting/Class/System#addMoon|addMoon]]()&amp;lt;/code&amp;gt; method (or corresponding legacy scripting method) have no atmosphere, other planets do.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isMainPlanet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isMainPlanet''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is the main planet of the current system, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;radius&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''radius''' : Number (read-only)&lt;br /&gt;
The equatorial radius of the planet, in metres.&lt;br /&gt;
&lt;br /&gt;
For reference: radii of main planets generated by Oolite vary between 28160 and 69110 meters. This value is shown on the planet information screen as: 2816 km to 6911 km. (Note the discrepancy of a factor 100.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rotationalVelocity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''rotationalVelocity''' : Number (read/write)&lt;br /&gt;
The rotation speed of a planet. A value of x means:  x/Math.PI rotations per second. The main planet default value is pseudorandom and varies between 0.0 until 0.01&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;texture&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''texture''' : String (read/write)&lt;br /&gt;
&lt;br /&gt;
The name of the texture file (diffuse map) used by the planet. This may only be assigned to during the &amp;lt;code&amp;gt;shipWillExitWitchspace&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;shipWillLaunchFromStation&amp;lt;/code&amp;gt; events.&lt;br /&gt;
&lt;br /&gt;
== Non-standard Properties ==&lt;br /&gt;
''These are not part of the official object model, but are used in various OXPs by the authors to allow manipulation of the OXP by other scripts and expansions. '''Important:''' the use of custom properties without a unique OXP-specific prefix is '''strongly discouraged''' and may cause conflicts with future versions of Oolite.''&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;solarGasGiant&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''solarGasGiant''' : Boolean (read/write)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is a gas giant and should therefore prevent attempts to land on the planet's surface, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.  Created for the Solar System OXP and used by the [[Planetfall OXP]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;PFNoLand&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PFNoLandQuiet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''PFNoLand''' : Boolean (read/write)&lt;br /&gt;
 '''PFNoLandQuiet''' : Boolean (read/write)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if landing will be prevented on the planet's surface (with and without a warning message), &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.  Created and used by the [[Planetfall OXP]] from version 1.40 onwards.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isGasGiant&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isGasGiant''' : Boolean (read/write)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is a gas giant, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.  Created and used by the [[System Redux 2 OXP]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=29900</id>
		<title>Oolite JavaScript Reference: Mission</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=29900"/>
		<updated>2011-12-16T21:39:33Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''mission''' global object is used to run mission screens, and perform other actions related to mission scripting.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayModel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''displayModel''' : {{oojsclass|Ship}}&lt;br /&gt;
If currently running a mission screen with a &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt;, the ship entity used to display the model. This can be animated by setting its position and orientation from a [[Oolite JavaScript Reference: Global#addFrameCallback|frame callback]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageText&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageText'''(message : String)&lt;br /&gt;
&lt;br /&gt;
Appends text to the currently running mission screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''markSystem'''(systemNumber : Number)&lt;br /&gt;
&lt;br /&gt;
Mark a system on the long range chart. Multiple systems may be marked at once, as in &amp;lt;code&amp;gt;mission.markSystem(4, 54, 222)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#unmarkSystem|unmarkSystem()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''runScreen(parameters : Object [, callback : Function [, this : Object]])''' &lt;br /&gt;
Present a mission screen.&lt;br /&gt;
&lt;br /&gt;
The appearance of the mission screen is defined by the properties of the &amp;lt;code&amp;gt;parameters&amp;lt;/code&amp;gt; object. The currently defined properties are:&lt;br /&gt;
* &amp;lt;code&amp;gt;title : String&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;titleKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;music : String&amp;lt;/code&amp;gt; (name of a music file)&lt;br /&gt;
* &amp;lt;code&amp;gt;overlay : ''guiTextureSpecifier''&amp;lt;/code&amp;gt; (name of an image used as overlay)&lt;br /&gt;
* &amp;lt;code&amp;gt;background : ''guiTextureSpecifier''&amp;lt;/code&amp;gt; (name of a picture used as background)&lt;br /&gt;
* &amp;lt;code&amp;gt;model : String&amp;lt;/code&amp;gt; (Role of a ship that will be shown as rotating ship)&lt;br /&gt;
* &amp;lt;code&amp;gt;message : String&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;messageKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;spinModel: Boolean&amp;lt;/code&amp;gt; (If &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the model is shown from the top with no automatic animation.)&lt;br /&gt;
* &amp;lt;code&amp;gt;choicesKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
&lt;br /&gt;
Some of these are mutually exclusive; for instance, “title” overrides “titleKey”. See [[Oolite JavaScript Reference: Global#setScreenBackground|setScreenBackground()]] for a discussion of ''guiTextureSpecifier''.&lt;br /&gt;
&lt;br /&gt;
The callback function is a function that is called when the player makes a choice. Every runScreen can have its own specific callback function, or you can design a single function to handle multiple mission screens instead.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
A simple mission screen:&lt;br /&gt;
 mission.runScreen({&lt;br /&gt;
     title: &amp;quot;My first mission screen&amp;quot;,&lt;br /&gt;
     message: &amp;quot;This am a mission screen wot is good&amp;quot;,&lt;br /&gt;
     choicesKey: &amp;quot;me_firstmission_choices&amp;quot;&lt;br /&gt;
 },&lt;br /&gt;
 function (choice)&lt;br /&gt;
 {&lt;br /&gt;
     if (choice === &amp;quot;1_YES&amp;quot;)  player.commsMessage(&amp;quot;Yay!&amp;quot;);&lt;br /&gt;
     else if (choice === &amp;quot;2_NO&amp;quot;)  player.commsMessage(&amp;quot;Boo.&amp;quot;);&lt;br /&gt;
     else  player.commsMessage(&amp;quot;Whut?&amp;quot;);&lt;br /&gt;
 });&lt;br /&gt;
In [[missiontext.plist]], you’ll need the following. The numbers are used because choices are sorted by key.&lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;me_firstmission_choices&amp;quot; =&lt;br /&gt;
     {&lt;br /&gt;
         &amp;quot;1_YES&amp;quot; = &amp;quot;Yes.&amp;quot;;&lt;br /&gt;
         &amp;quot;2_NO&amp;quot; = &amp;quot;No.&amp;quot;;&lt;br /&gt;
         &amp;quot;3_MAYBE&amp;quot; = &amp;quot;Maybe.&amp;quot;;&lt;br /&gt;
     };&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The call does not have to be laid out as above. The parameters object can be manipulated in any way you want beforehand, and the callback function can be written out of line. For example, the following is equivalent:&lt;br /&gt;
 var parameters = new Object();&lt;br /&gt;
 parameters.title = &amp;quot;My first mission screen&amp;quot;;&lt;br /&gt;
 parameters.message = &amp;quot;This am&amp;quot;;&lt;br /&gt;
 parameters.choicesKey = &amp;quot;me_firstmission_choices&amp;quot;;&lt;br /&gt;
 parameters.message += &amp;quot; a mission screen wot is good&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 function callback(choice)&lt;br /&gt;
 {&lt;br /&gt;
     if (choice === &amp;quot;1_YES&amp;quot;)  player.commsMessage(&amp;quot;Yay!&amp;quot;);&lt;br /&gt;
     else if (choice === &amp;quot;2_NO&amp;quot;)  player.commsMessage(&amp;quot;Boo.&amp;quot;);&lt;br /&gt;
     else  player.commsMessage(&amp;quot;Whut?&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 mission.runScreen(parameters, callback);&lt;br /&gt;
&lt;br /&gt;
This form is more complicated, and the ordering is less intuitive. However, it does allow you to make complex decisions about the parameters in code, and writing the callback out of line can be preferable if it’s long. It is recommended that you start out with the first approach, but keep in mind that there are other options if it becomes too limiting.&lt;br /&gt;
&lt;br /&gt;
One warning: &amp;lt;code&amp;gt;runScreen()&amp;lt;/code&amp;gt; will overwrite any existing missionscreen. The only safe place is using it inside a &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler, because that handler only fires when it is allowed to show such a screen. When using the command at other places, first make sure with &amp;lt;code&amp;gt;guiScreen != &amp;quot;GUI_SCREEN_MISSION&amp;quot;&amp;lt;/code&amp;gt; that there is currently no missionscreen on display by another oxp.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setInstructions(instructions : String, [worldScriptName : String])'''&lt;br /&gt;
&lt;br /&gt;
Specify a message to put on the Manifest screen (usually short instructions for current mission), under the title “Missions”.&lt;br /&gt;
&lt;br /&gt;
When not called from within a world script, the name of a world script must be specified so that Oolite knows which script the message belongs to. Clear the message by calling &amp;lt;code&amp;gt;setInstructions(null)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is recommended that &amp;lt;code&amp;gt;setInstructions()&amp;lt;/code&amp;gt; is used only when you need to customise the text for a specific scenario. For static text, use &amp;lt;code&amp;gt;[[#setInstructionsKey|setInstructionsKey()]]&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setInstructionsKey|setInstructionsKey()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setInstructionsKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setInstructionsKey(messageKey : String, [worldScript : String])'''&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#setInstructions|setInstructions()]]&amp;lt;/code&amp;gt;, but looks up the specified &amp;lt;code&amp;gt;messageKey&amp;lt;/code&amp;gt; in [[missiontext.plist]].&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setInstructions|setInstructions()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;unmarkSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''unmarkSystem'''(systemNumbers : Number)&lt;br /&gt;
&lt;br /&gt;
Remove a mark set with &amp;lt;code&amp;gt;[[#markSystem|markSystem()]]&amp;lt;/code&amp;gt;. Multiple systems may be unmarked at once, as in &amp;lt;code&amp;gt;mission.unmarkSystem(4, 54, 222)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#markSystem|markSystem()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=29899</id>
		<title>Oolite JavaScript Reference: Global</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=29899"/>
		<updated>2011-12-16T21:39:10Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Global variables and functions are visible to all scripts. They are also properties of &amp;lt;code&amp;gt;[[#global|global]]&amp;lt;/code&amp;gt;, which is itself a global variable and hence a property of itself.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;clock&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''clock''' : {{oojsclass|Clock}} (read-only)&lt;br /&gt;
This property allows an OXP to access the game clock's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;defaultFont&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''defaultFont''' : Object (read-only)&lt;br /&gt;
An object with a single method, &amp;lt;code&amp;gt;measureString(string)&amp;lt;/code&amp;gt;, which returns the width of the specified string, as it would be shown on the screen, in '''ems'''. One em is the intrinsic unit size of a font; for example, if a font is rendered at 12 points, 1 em = 12 pt. The mission screen text area is 32 em wide.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;galaxyNumber&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''galaxyNumber''' : Number (read-only)&lt;br /&gt;
Returns the number ot the galaxy the player is in.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;global&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''global''' : Global (read-only)&lt;br /&gt;
All global variables and functions are actually properties of the global object. The global object is a property of itself, and this is it.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;guiScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''guiScreen''' : String (read-only)&lt;br /&gt;
Returns the screen the player is looking at. If in flight, this is &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MAIN&amp;quot;&amp;lt;/code&amp;gt;. Currently, the other possible values are &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTRO1&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTRO2&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LONG_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHORT_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_CONTRACTS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_OPTIONS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_GAMEOPTIONS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LOAD&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SAVE&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SAVE_OVERWRITE&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STICKMAPPER&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MISSION&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_REPORT&amp;quot;&amp;lt;/code&amp;gt;. This list may change in future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;manifest&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''manifest''' : {{oojsclass|Manifest}} (read-only)&lt;br /&gt;
An alias to &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|player.ship.manifest]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mission&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mission''' : {{oojsclass|Mission}} (read-only)&lt;br /&gt;
See [[Oolite JavaScript Reference: Mission]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''missionVariables''' : Object (read-only)&lt;br /&gt;
The &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt; object stores values that are stored in saved games. This is the main way for scripts to store information permanently.&lt;br /&gt;
&lt;br /&gt;
Whenever a value is assigned to a property of &amp;lt;code&amp;gt;missionVariables&amp;lt;/code&amp;gt;, it is converted to a string object and tracked with the player. When the value is read, it will be converted to a number if possible, otherwise returned as a string. Example:&lt;br /&gt;
 missionVariables.exampleVar = 42;&lt;br /&gt;
 let x = missionVariables.exampleVar; // x is now the number 42&lt;br /&gt;
&lt;br /&gt;
Mission variables can also be used in legacy scripts and in [[Misc_plists|descriptions.plist]] string expansions, by prefixing the name with “mission_”. Example:&lt;br /&gt;
 expandDescription(&amp;quot;My variable is [mission_exampleVar].&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Setting and retrieving mission variables has a significant overhead #. If a function needs to use a mission variable value several times, it is strongly recommended that it be copied into a local variable and, if necessary, stored back once. Example:&lt;br /&gt;
 let x = missionVariables.exampleVar;&lt;br /&gt;
 if (x &amp;lt; 3)  x = processSmallValue(x);&lt;br /&gt;
 else  x = processBigValue(x);&lt;br /&gt;
 missionVariables.exampleVar = x;&lt;br /&gt;
&lt;br /&gt;
Mission variable names may not begin with an underscore (“_”). Unassigned mission variables are always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
.#: On a computer were the loop &amp;quot;&amp;lt;code&amp;gt;for ( var i= 0 ; i &amp;lt; 1000 ; i++){}&amp;lt;/code&amp;gt;&amp;quot; takes just 0.62 msec, will the same loop with missionVarriables &amp;lt;code&amp;gt;for (missionVariables.i= 0 ; missionVariables.i &amp;lt; 1000 ; missionVariables.i++){}&amp;lt;/code&amp;gt; consume a full 38 msec. That is 60 times longer.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;oolite&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''oolite''' : {{oojsclass|Oolite}} (read-only)&lt;br /&gt;
An object describing properties of the Oolite application; see [[Oolite JavaScript Reference: Oolite]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''player''' : {{oojsclass|Player}} (read-only)&lt;br /&gt;
This property allows an OXP to access the player object's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''system''' : {{oojsclass|System}} (read-only)&lt;br /&gt;
This property allows an OXP to access the current system's properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;timeAccelerationFactor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''timeAccelerationFactor''' : Number (read/write)&lt;br /&gt;
Also known as TAF. Will change the ratio between game real time and actual real time (default is 1). The accepted range is between 0.0625 (1/16) and 16. Attempting to set numbers outside this range will reset the TAF to 1. (In end-user stable builds, this will be a read-only property with the value 1.)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;worldScripts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''worldScripts''' : Object (read-only)&lt;br /&gt;
A list of world script objects.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 log(worldScripts[&amp;quot;oolite-nova&amp;quot;].version);&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addFrameCallback'''(callback : Function) : ''TrackingID''&lt;br /&gt;
Registers a ''frame callback'' which will be invoked every frame, after entity updates but before rendering. This can be used to implement animations. The return value is a ''tracking ID'' which may be passed to &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;; the type and meaning of the tracking ID is unspecified and may change at any time. Frame callbacks are automatically removed when the game resets (for instance, when the player dies), but not at any other time.&lt;br /&gt;
&lt;br /&gt;
The callback is passed one parameter, &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt;, which is the time since the last frame (in [[Time_scales in Oolite|game clock time]]). Frame callbacks fire even when the game is paused, in which case &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt; is 0.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var sum = 0;&lt;br /&gt;
 this.fcb = addFrameCallback(function (delta)&lt;br /&gt;
 {&lt;br /&gt;
     sum += delta;&lt;br /&gt;
     log(&amp;quot;Time elapsed: &amp;quot; + sum + &amp;quot; (delta: &amp;quot; + delta + &amp;quot;)&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#isValidFrameCallback|isValidFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayNameForCommodity&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''displayNameForCommodity'''(commodityName : String) &lt;br /&gt;
Returns the display name corresponding to the specified commodity. Useful in conjunction with localisation OXPs, or expansions that rename commodities depending on which station / system the player is at.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;expandDescription&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''expandDescription'''(description : String [, locals : Object (Dictionary)]) : String&lt;br /&gt;
Expands a string, substituting special tokens and any key inside square brackets with the substitution rules for [[Methods#Communications|Communications]].&lt;br /&gt;
When local key/value pairs are provided, they take precedence over any other values.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 expandDescription(&amp;quot;My ball is [my_color].&amp;quot;, { my_color: &amp;quot;red&amp;quot; }); &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;expandMissionText&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''expandMissionText'''(textKey: String [, locals : Object (Dictionary)]) : String&lt;br /&gt;
Load a string specified by &amp;lt;code&amp;gt;textKey&amp;lt;/code&amp;gt; from [[missiontext.plist]], then perform &amp;lt;code&amp;gt;[[#expandDescription|expandDescription()]]&amp;lt;/code&amp;gt;-type substitutions on it, and also replace “\n” with line breaks. The &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; parameter works as with &amp;lt;code&amp;gt;[[#expandDescription|expandDescription()]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 expandMissionText(&amp;quot;oolite_trumble_title&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isValidFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function isValidFrameCallback(trackingID: ''TrackingID'') : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;trackingID&amp;lt;/code&amp;gt; identifies a frame callback which has been registered with &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt; and not yet removed. (There should be no need to use this except for debugging and testing.)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeFrameCallback|removeFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''log'''([messageClass : String ,] message : String)&lt;br /&gt;
Writes a message to Oolite's log. The optional messageClass can be used to specify which type of message is written to the log.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 log(&amp;quot;myOXP.init&amp;quot;,&amp;quot;MyOXP initialised and ready!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;randomInhabitantsDescription&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''randomInhabitantsDescription'''([plural : boolean, default true])&lt;br /&gt;
Returns a random sentient species name, like “Large Red Fat Insects” or “Human Colonials”, following the same pattern (and probability distribution) as for planet inhabitants.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.consoleMessage(&amp;quot;You'll meet a &amp;quot; +  randomInhabitantsDescription(false) +&lt;br /&gt;
                       &amp;quot;. She'll be with a group of &amp;quot; + randomInhabitantsDescription(true) +&amp;quot;.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;randomName&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''randomName'''()&lt;br /&gt;
Returns a random capitalised word, suitable for use as name, or indeed surname.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.consoleMessage(randomName() + &amp;quot; &amp;quot; + randomName() +&amp;quot; rules this system with an iron fist.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeFrameCallback&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''removeFrameCallback'''(trackingID : ''TrackingID'')&lt;br /&gt;
Removes a frame callback previously registered with &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addFrameCallback|addFrameCallback()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#isValidFrameCallback|isValidFrameCallback()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenBackground&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''setScreenBackground'''(image : ''guiTextureSpecifier'') &lt;br /&gt;
Temporary override that sets the background of the current gui screen to the specified image. Override is lost after the player switches screens.&lt;br /&gt;
&lt;br /&gt;
''guiTextureSpecifier'' can be either a string or an object with the required key &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and optional keys &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;. If neither width nor height is specified, the dimensions of the image are used. If only one is specified, the other is calculated such that the image is not distorted. The scale unit is 1/480 of the height of the window; in other words, the window is always considered 480 units high, and the width depends on the aspect ratio of the window.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setScreenBackground({ name: &amp;quot;oolite-nova-system.png&amp;quot;, height: 512 });&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenOverlay&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''setScreenOverlay'''(image : ''guiTextureSpecifier'') &lt;br /&gt;
Temporary override that sets the overlay of the current gui screen to the specified image. Override is lost after the player switches screens.&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;[[#setScreenBackground|setScreenBackground()]]&amp;lt;/code&amp;gt; for a discussion of ''guiTextureSpecifier''.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setScreenOverlay('trumblebox.png');&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;takeSnapShot&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''takeSnapShot'''([filename : String]) : Bool&lt;br /&gt;
Saves a snapshot of the current screen to your hard disk. A filename is optional. When a name is used, only alphanumeric values and &amp;quot;-&amp;quot; and &amp;quot;_&amp;quot; are allowed for the filename. The appropriate extension for the used operating system (like .png) is added by Oolite and should not be part of the filename.&amp;lt;br&amp;gt;&lt;br /&gt;
When a filename already exists, it is not overwritten but the string &amp;quot;-xxx&amp;quot; is added, starting with &amp;quot;-001&amp;quot;.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;takeSnapShot()&amp;lt;/code&amp;gt; will not be available in the stable release version of Oolite, but will be available in a special OXP developer release.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 takeSnapShot('mission_target_1');&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_EquipmentInfo&amp;diff=29898</id>
		<title>Oolite JavaScript Reference: EquipmentInfo</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_EquipmentInfo&amp;diff=29898"/>
		<updated>2011-12-16T21:38:30Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt;''' objects provide information about a type of equipment. To acquire an &amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt; object, use the &amp;lt;code&amp;gt;[[#infoForKey|infoForKey]]()&amp;lt;/code&amp;gt; method, as in:&lt;br /&gt;
 var missileInfo = EquipmentInfo.infoForKey(&amp;quot;EQ_MISSILE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== Equipment Expressions ===&lt;br /&gt;
Many methods can take either an &amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt; or an equipment key. For instance, &amp;lt;code&amp;gt;ship.hasEquipment(&amp;quot;EQ_ECM&amp;quot;)&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;ship.hasEquipment(EquipmentInfo.infoForKey(&amp;quot;EQ_ECM&amp;quot;))&amp;lt;/code&amp;gt;. In specifications, this is represented by arguments typed &amp;lt;code&amp;gt;equipmentInfoExpression&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;canBeDamaged&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''canBeDamaged''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type can be damaged (either in combat or using &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#setEquipmentStatus|Ship.setEquipmentStatus()]]&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently, this is hard-coded: trumbles, passenger berths, cargo bays and external stores are invulnerable.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;canCarryMultiple&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''canCarryMultiple''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if multiple instances of the equipment type can be used at once, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently, this is hard-coded to trumbles, passenger berths and external stores.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''description''' : String (read-only)&lt;br /&gt;
A short description of the equipment, as seen on the Ship Outfitting screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;effectiveTechLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''effectiveTechLevel''' : Number (read/write nonnegative integer)&lt;br /&gt;
The effective tech level required to purchase this item. Unlike &amp;lt;code&amp;gt;[[#techLevel|techLevel]]&amp;lt;/code&amp;gt;, this takes the special meaning of 99 and &amp;lt;code&amp;gt;TL_FOR_EQ_WHATEVER&amp;lt;/code&amp;gt; mission variables into account. If the raw tech level is 99, changing the value of &amp;lt;code&amp;gt;[[#effectiveTechLevel|effectiveTechLevel]]&amp;lt;/code&amp;gt; is equivalent to setting the appropriate &amp;lt;code&amp;gt;TL_FOR_EQ_WHATEVER&amp;lt;/code&amp;gt; mission variable. If the raw tech level is not 99, changes to &amp;lt;code&amp;gt;[[#effectiveTechLevel|effectiveTechLevel]]&amp;lt;/code&amp;gt; are ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
Setting &amp;lt;code&amp;gt;effectiveTechLevel&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;, will remove the corresponding &amp;lt;code&amp;gt;TL_FOR_EQ_WHATEVER&amp;lt;/code&amp;gt; mission variable.&lt;br /&gt;
&lt;br /&gt;
'''See also: &amp;lt;code&amp;gt;[[#techLevel|techLevel]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;equipmentKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''equipmentKey''' : String (read-only)&lt;br /&gt;
The equipment key for the equipment described by this &amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt; object. For EQ_MISSILE, this is &amp;quot;EQ_MISSILE&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;incompatibleEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''incompatibleEquipment''' : Array (read-only)&lt;br /&gt;
An array of equipment keys (in arbitrary order). In order to be installed, no item in this array may already be installed.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresAnyEquipment|requiresAnyEquipment]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requiresEquipment|requiresEquipment]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isAvailableToAll&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isAvailableToAll''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type can be used with any ship, regardless of its shipyard settings.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isAvailableToNPCs&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isAvailableToNPCs''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type can be used by non-player ships (&amp;lt;code&amp;gt;available_to_player&amp;lt;/code&amp;gt; in [[equipment.plist]], default &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isAvailableToPlayer&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isAvailableToPlayer''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type can be used by player ships (&amp;lt;code&amp;gt;available_to_player&amp;lt;/code&amp;gt; in [[equipment.plist]], default &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isExternalStore&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isExternalStore''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for _MISSILE and _MINE equipment types.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPortableBetweenShips&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPortableBetweenShips''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if equipment of this type is kept when buying a new ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isVisible&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isVisible''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the equipment type is visible on the ship info screen (&amp;lt;code&amp;gt;visible&amp;lt;/code&amp;gt; in [[equipment.plist]], default: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read-only)&lt;br /&gt;
The display name for the equipment described by this &amp;lt;code&amp;gt;EquipmentInfo&amp;lt;/code&amp;gt; object. This string is localized. For EQ_MISSILE in English, this is &amp;quot;Missile&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''price''' : Number (read-only nonnegative integer)&lt;br /&gt;
This is the value as used in the equipment.plist. Divide this by ten for the real value in credits.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiredCargoSpace&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiredCargoSpace''' : Number (read-only nonnegative integer)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresAnyEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresAnyEquipment''' : Array (read-only)&lt;br /&gt;
An array of equipment keys (in arbitrary order). In order to be installed, ''at least one'' item in this array must already be installed.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#incompatibleEquipment|incompatibleEquipment]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requiresEquipment|requiresEquipment]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresCleanLegalRecord&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresCleanLegalRecord''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresNonCleanLegalRecord|requiresNonCleanLegalRecord]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresEmptyPylon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresEmptyPylon''' : Boolean (read-only)&lt;br /&gt;
True for equipment that requires at least one pylon to have nothing on it.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresMountedPylon|requiresMountedPylon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresEquipment''' : Array (read-only)&lt;br /&gt;
An array of equipment keys (in arbitrary order). In order to be installed, ''all'' items in this array must already be installed.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#incompatibleEquipment|incompatibleEquipment]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requiresAnyEquipment|requiresAnyEquipment]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresFreePassengerBerth&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresFreePassengerBerth''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresFullFuel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresFullFuel''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresNonFullFuel|requiresNonFullFuel]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresMountedPylon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresMountedPylon''' : Boolean (read-only)&lt;br /&gt;
True for equipment that requires at least one pylon to have a store (missile, mine or equipment) on it.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresEmptyPylon|requiresEmptyPylon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresNonCleanLegalRecord&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresNonCleanLegalRecord''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresCleanLegalRecord|requiresCleanLegalRecord]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requiresNonFullFuel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''requiresNonFullFuel''' : Boolean (read-only)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requiresFullFuel|requiresFullFuel]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scriptInfo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scriptInfo''' : Object (read-only)&lt;br /&gt;
The contents of the &amp;lt;code&amp;gt;script_info&amp;lt;/code&amp;gt; key in the equipments’s ''[[equipment.plist]]'' entry, if any. This may be any [[property list]] object, but the reccomended approach is to use a dictionary whose keys have a unique prefix (such as you should be using for file names, ship names etc.). A property list dictionary is converted to a JavaScript object with properties corresponding to the dictionary’s keys. All other property list types used with Oolite have directly corresponding JavaScript types.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scriptName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scriptName''' : String (read-only)&lt;br /&gt;
The name of an attached script. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;techLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''techLevel''' : Number (read-only nonnegative integer)&lt;br /&gt;
The raw tech level required to purchase this item. Unlike &amp;lt;code&amp;gt;[[#effectiveTechLevel|effectiveTechLevel]]&amp;lt;/code&amp;gt;, this does not take the special meaning of 99 and &amp;lt;code&amp;gt;TL_FOR_EQ_WHATEVER&amp;lt;/code&amp;gt; mission variables into account.&lt;br /&gt;
&lt;br /&gt;
'''See also: &amp;lt;code&amp;gt;[[#effectiveTechLevel|effectiveTechLevel]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Static properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;allEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 allEquipment : Array (EquipmentInfos, read-only)&lt;br /&gt;
Returns a list of all known equipment types.&lt;br /&gt;
&lt;br /&gt;
== Static methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;infoForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''infoForKey'''(equipmentKey : String) : EquipmentInfo&lt;br /&gt;
Returns the equipment info object for a given type of equipment, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for an unrecognised key. Example: &amp;lt;code&amp;gt;var missileInfo = EquipmentInfo.infoForKey(&amp;quot;EQ_MISSILE&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Entity&amp;diff=29897</id>
		<title>Oolite JavaScript Reference: Entity</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Entity&amp;diff=29897"/>
		<updated>2011-12-16T21:38:00Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Removed Oolite 1.75 change notes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Planet|Planet]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship|Ship]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Sun|Sun]]&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Entity&amp;lt;/code&amp;gt;''' class represents an object in the game universe. &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship|Ship]]&amp;lt;/code&amp;gt;s, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station|Station]]&amp;lt;/code&amp;gt;s, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Planet|Planet]]&amp;lt;/code&amp;gt;s and &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Sun|Sun]]&amp;lt;/code&amp;gt;s are types of entity. Note that these more specific types have additional properties and methods.&lt;br /&gt;
&lt;br /&gt;
=== Stale References ===&lt;br /&gt;
When an entity dies or is otherwise removed from the game universe (for instance, because player jumped from the system), existing &amp;lt;code&amp;gt;Entity&amp;lt;/code&amp;gt; variables referring to the entity become invalid; all their properties become &amp;lt;code&amp;gt;undefined&amp;lt;/code&amp;gt;, and their methods do nothing. In addition to the undefined properties, this can be detected with the &amp;lt;code&amp;gt;[[#isValid|isValid]]&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;collisionRadius&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''collisionRadius''' : Number (read-only)&lt;br /&gt;
The radius of the entity, in game meters. This is the radius of the spherical entity representation Oolite calculates with for non-colliding entities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;distanceTravelled&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''distanceTravelled''' : Number (read-only)&lt;br /&gt;
The distance the entity has travelled since being spawned, in game meters.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;energy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''energy''' : Number (read/write)&lt;br /&gt;
The entity’s total energy; ranges from 0 to &amp;lt;code&amp;gt;[[#maxEnergy|maxEnergy]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;heading&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''heading''' : [[Oolite JavaScript Reference: Vector|Vector]] (read-only)&lt;br /&gt;
The heading of the entity. This is equivalent to &amp;lt;code&amp;gt;[[#orientation|orientation]]&amp;lt;/code&amp;gt;, but ignoring the axial twist component (roll in the case of a ship).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;entity.heading()&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;entity.[[#orientation|orientation]].[[Oolite JavaScript Reference: Quaternion#forwardVector|forwardVector]]()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;mass&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''mass''' : Number (read-only)&lt;br /&gt;
The mass of the entity. Currently, this is directly proportional to the volume.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxEnergy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxEnergy''' : Number (read-only)&lt;br /&gt;
The highest permissible value of &amp;lt;code&amp;gt;[[#energy|energy]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;orientation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''orientation''' : [[Oolite JavaScript Reference: Quaternion|Quaternion]] (read/write)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;owner&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''owner''' : Entity (read-only)&lt;br /&gt;
The entity which owns this one. In the case of a subentity, the entity to which it is attached. In the case of a defense ship, the station it belongs to. In the case of a missile, the ship that launched it. There may be other uses.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''position''' : [[Oolite JavaScript Reference: Vector|Vector]] (read/write)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scanClass''' : String (read-only)&lt;br /&gt;
The current scan class of the entity (such as “CLASS_NEUTRAL” and “CLASS_CARGO”).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;spawnTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''spawnTime''' : Number (read-only)&lt;br /&gt;
The time at which the entity came into existence.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''status''' : String (read-only)&lt;br /&gt;
The current status of the entity (such as “STATUS_IN_FLIGHT” and “STATUS_BEING_SCOOPED”).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPlanet&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPlanet''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is a [[Oolite JavaScript Reference: Planet|Planet]], &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPlayer&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPlayer''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is the [[Oolite JavaScript Reference: PlayerShip|player ship]], &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isShip&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isShip''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is a [[Oolite JavaScript Reference: Ship|Ship]], &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isStation''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is a [[Oolite JavaScript Reference: Station|Station]], &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isSubEntity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isSubEntity''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is a subentity, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. A subentity’s owner can be acquired through the &amp;lt;code&amp;gt;[[#owner|owner]]&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isSun&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isSun''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is a [[Oolite JavaScript Reference: Sun|Sun]], &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isValid&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isValid''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the entity is a valid entity variable, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if it is [[#Stale References|stale]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=29896</id>
		<title>Debug OXP</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=29896"/>
		<updated>2011-12-16T21:23:14Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Updated download link for 1.76.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Debug.oxp''' is a special OXP that enables JavaScript console support in Oolite (1.70 and later). It also adds a menu with various debug facilities under Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
[http://jens.ayton.se/oolite/files/debug-oxp-1.76.zip Debug OXP for Oolite 1.76]&lt;br /&gt;
&lt;br /&gt;
== External JavaScript console support ==&lt;br /&gt;
On all platforms, installing Debug.oxp enables support for external console applications using the [[Oolite debug console TCP protocol]]. By default, it will attempt to connect to a console running on the same computer, but this can be changed by specifying a different &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; (and, optionally, &amp;lt;code&amp;gt;console-port&amp;lt;/code&amp;gt;) in ''debugConfig.plist''. For external console support on the same computer under Mac OS X, &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; must be explicitly set to “127.0.0.1”; if this is not done, the [[#Integrated JavaScript console|integrated JavaScript console]] will be used instead. For information on using a console (integrated or external), see [[#Using the JavaScript console|Using the JavaScript console]] below.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' A cross-platform, python based, external console application is available in the [http://developer.berlios.de/project/showfiles.php?group_id=3577 Berlios Oolite files] area.&lt;br /&gt;
&lt;br /&gt;
It contains a precompiled console for windows based computers, and the original python based console for Linux and Posix compliant computers.&lt;br /&gt;
&lt;br /&gt;
On Debian or Ubuntu Linux you will need python 2.6.x installed and (at least) the packages &amp;lt;code&amp;gt;blt python-tk tk8.5&amp;lt;/code&amp;gt; (or the equivalents in other distros.)&lt;br /&gt;
&lt;br /&gt;
== Mac OS X-specific features ==&lt;br /&gt;
Under Mac OS X, the Debug OXP provides a menu with various debugging options and an integrated JavaScript console, as well as enabling external console support as on all platforms.&lt;br /&gt;
&lt;br /&gt;
=== Debug menu ===&lt;br /&gt;
[[Image:Oolite-debug-menu.png|494px]]&lt;br /&gt;
&lt;br /&gt;
The Debug menu provides options to&lt;br /&gt;
* Show the Oolite run log in the standard Console application.&lt;br /&gt;
* Enable or disable various classes of log message at runtime (like editing ''logcontrol.plist'', without the need to restart Oolite).&lt;br /&gt;
* Enable various testing features, such as drawing of bounding boxes.&lt;br /&gt;
* Show the JavaScript console, and specify when it should be shown automatically. (This may not have any effect with external consoles, depending on the external console implementation.)&lt;br /&gt;
* Create a ship of any role near the main station (equivalent to the &amp;lt;code&amp;gt;:spawn&amp;lt;/code&amp;gt; [[#Macros|macro]]).&lt;br /&gt;
Note: some of these features are implemented by sending JavaScript messages to the [[#The console script|console script]]. If the script has been modified, some features may not work properly.&lt;br /&gt;
&lt;br /&gt;
The Log Message Classes submenu can be modified by editing ''debugLogMessageClassesMenu.plist'', found inside the OXP. This is merged from Config directories in the usual fashion.&lt;br /&gt;
&lt;br /&gt;
=== Integrated JavaScript console ===&lt;br /&gt;
[[Image:Oolite debug protocol example 1.png|594px]]&lt;br /&gt;
&lt;br /&gt;
The integrated JavaScript console provides a window within Oolite which acts as a [[#Using the JavaScript console|JavaScript console]]. It can be shown using the Show JavaScript Console command in the Debug menu, unless external console mode has been enabled by setting &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; in ''debugConfig.plist''.&lt;br /&gt;
&lt;br /&gt;
The integrated console has a 100-line memory. To see previous commands, press ⇞ (Page Up) or ⌥↑ (Option-Up Arrow). You can go the other way in the obvious manner.&lt;br /&gt;
&lt;br /&gt;
== Using the JavaScript console ==&lt;br /&gt;
The JavaScript console, whether integrated or external, provides a powerful mechanism for interactively manipulating the game world. It can be used to issue simple commands, like &amp;lt;code&amp;gt;player.awardEquipment(&amp;quot;EQ_FUEL_INJECTION&amp;quot;)&amp;lt;/code&amp;gt;. It can be used to inspect properties of entities in the game world. And it can be used to develop scripts, by rewriting and testing methods of live ship scripts and world scripts.&lt;br /&gt;
&lt;br /&gt;
=== Macros ===&lt;br /&gt;
Macros are a special type of command prefixed with a colon. Instead of being interpreted as a JavaScript command, a macro is looked up in a dictionary, and the result is used as the “real” command. For instance, if you enter the command &amp;lt;code&amp;gt;:listM&amp;lt;/code&amp;gt; (short for “list macros”), the macro dictionary is queried for the string “listM”, and (by default) the code &amp;lt;code&amp;gt;for (let prop in macros) { ConsoleMessage('macro-list', ':' + prop) }&amp;lt;/code&amp;gt; is found and executed. This code is called the ''expansion'' of the macro. The result is a list of macros being printed:&lt;br /&gt;
 :clr&lt;br /&gt;
 :clear&lt;br /&gt;
 :spawn&lt;br /&gt;
 :bgColor&lt;br /&gt;
 :showM&lt;br /&gt;
 :rmFgColor&lt;br /&gt;
 ::&lt;br /&gt;
 :d&lt;br /&gt;
 :ds&lt;br /&gt;
 :listM&lt;br /&gt;
 :setM&lt;br /&gt;
 :delM&lt;br /&gt;
 :fgColor&lt;br /&gt;
 :rmBgColor&lt;br /&gt;
 :resetM&lt;br /&gt;
&lt;br /&gt;
As you can see in the example, To see the expansion of a macro without executing it, use &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt;:&lt;br /&gt;
 &amp;gt; :showM :delM&lt;br /&gt;
 :delM = deleteMacro(PARAM)&lt;br /&gt;
&lt;br /&gt;
When a macro with the word &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is executed, &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is replaced with any text following the macro name, surrounded in quotation marks. This is how &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt; functions, for example; the string “:showM :delM” is expanded to “showMacro(&amp;quot;:delM&amp;quot;)”, causing the JavaScript function &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt;, which is part of the [[#The console script|console script]], to be called. You can see the implementation of &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt; by entering &amp;lt;code&amp;gt;showMacro&amp;lt;/code&amp;gt; – without any parentheses – into the console.&lt;br /&gt;
&lt;br /&gt;
An initial set of macros is loaded from ''debugConfig.plist''. If you edit any macros, using &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;:delM&amp;lt;/code&amp;gt;, all macros are saved in Oolite’s preferences from that point forwards. This means that you don’t have to re-enter any macros you write with &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; after restarting Oolite.&lt;br /&gt;
&lt;br /&gt;
The following example creates a simple :msg macro:&lt;br /&gt;
 &amp;gt; :setM msg ConsoleMessage(' ',PARAM)&lt;br /&gt;
If you then type:&lt;br /&gt;
 &amp;gt; :msg Hello World&lt;br /&gt;
The macro will be expanded, and you'll see “Hello World” on the console. However, macros are not functions, so you cannot use macros in the middle of javascript, or as part of another macro.&lt;br /&gt;
&lt;br /&gt;
=== The console script ===&lt;br /&gt;
While an external or integrated console is required to provide a means of user interaction, most of the actual behaviour of the console is implemented in JavaScript, in a script called ''oolite-debug-console.js''. Input typed into the console is passed to the console script, which then generates output. The console script is also informed of log messages and JavaScript errors, and provides a global function, &amp;lt;code&amp;gt;ConsoleMessage(colorCode: String, message: String)&amp;lt;/code&amp;gt;, to write messages to the console using its background colour support. Lastly, the console script implements the entire macro system.&lt;br /&gt;
&lt;br /&gt;
This means that the console’s behaviour can be extensively customized, for instance, by replacing the macro system with something more powerful. There are two basic approaches to doing this:&lt;br /&gt;
* Creating a custom script (or a copy) with the same name, in an OXP which loads later than Debug.oxp (e.g., one which has a name which comes later in alphabetical order).&lt;br /&gt;
* Using a normal world script, and changing the console script object at startup.&lt;br /&gt;
The latter approach has the advantage that it can continue to work with future versions of the console script, and multiple patches can coexist. For example, a modification to supplement the macro system with a better one might look as follows:&lt;br /&gt;
 this.name = &amp;quot;my-super-console-macros&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 this.startUp = function()&lt;br /&gt;
 {&lt;br /&gt;
     // Ensure debug console is installed&lt;br /&gt;
     if (!debugConsole)  return&lt;br /&gt;
     &lt;br /&gt;
     // Save original implementation of consolePerformJSCommand&lt;br /&gt;
     // Note the prefix, used to ensure uniqueness. If several scripts patch&lt;br /&gt;
     // the same method, it's important that they use different names.&lt;br /&gt;
     debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand = debugConsole.consolePerformJSCommand&lt;br /&gt;
     &lt;br /&gt;
     // Replace debugConsole.consolePerformJSCommand with custom function&lt;br /&gt;
     debugConsole.consolePerformJSCommand = function(command)&lt;br /&gt;
     {&lt;br /&gt;
         // Note that in this function &amp;quot;this&amp;quot; will refer to debugconsole, not&lt;br /&gt;
         // my-super-console-macros, since the function will be called as a&lt;br /&gt;
         // method of debugConsole.&lt;br /&gt;
         &lt;br /&gt;
         // Strip leading spaces, same code as original function.&lt;br /&gt;
         while (command.charAt(0) == &amp;quot; &amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             command = command.substring(1)&lt;br /&gt;
         }&lt;br /&gt;
         &lt;br /&gt;
         if (command.charAt(0) == &amp;quot;!&amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             // Super macro call detected.&lt;br /&gt;
             // Insert super macro system here.&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
             // Otherwise, call through to original method.&lt;br /&gt;
             debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand(command)&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
This same patching technique, incidentally, can be used to modify scripts at runtime, either from the console or from other scripts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{misc-OXP}}&lt;br /&gt;
[[Category:Oolite utilities]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=28534</id>
		<title>Running Oolite-Mac</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=28534"/>
		<updated>2011-07-21T12:54:59Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Building earlier versions */ Fixed horrible URL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
Oolite was originally developed for OS X, and as such, OS X is Oolite's home operating system. The OS X version can be considered the reference version for all other ports. It has some specific Mac OS X only support such as speech synthesis, iTunes integration and Growl integration. Joysticks are not directly supported - however, there are programs that convert joystick inputs into mouse and keyboard inputs, and these programs are reported to work well with Oolite.&lt;br /&gt;
&lt;br /&gt;
==Getting and installing the game==&lt;br /&gt;
You can get the most recent release of the game from [http://developer.berlios.de/project/showfiles.php?group_id=3577 BerliOS].&lt;br /&gt;
&lt;br /&gt;
Installation is the standard method of dragging the Oolite folder to your Applications or Games folder.&lt;br /&gt;
&lt;br /&gt;
===Installing OXPs (add ons)===&lt;br /&gt;
In the Oolite folder that you dragged from the disk image, you will find an Oolite application and an AddOns folder. Place OXPs in the AddOns folder, and they will be loaded the next time you start the game.&lt;br /&gt;
&lt;br /&gt;
==Building Oolite from source==&lt;br /&gt;
&lt;br /&gt;
=== Development Environment (Xcode) === &lt;br /&gt;
To start, you will need Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X 10.5 or later and Xcode tools 3.2 or later from the [http://connect.apple.com/ Apple Developer Connection] or your Mac&amp;amp;nbsp;OS&amp;amp;nbsp;install DVD. You will need an Apple Developer Connection membership to obtain download Xcode; however, the free online membership is sufficient. You can register [http://developer.apple.com/programs/register/ here]. You will also need to ensure you have installed the Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X 10.4 Universal SDK, which is available through the Xcode Tools installer. Lastly, you will require the Subversion version control tool; an up-to-date binary is available [http://downloads.open.collab.net/binaries.html here].&lt;br /&gt;
&lt;br /&gt;
The Oolite projects have not been updated for Xcode 4, and won’t be (in trunk) before the next stable release.&lt;br /&gt;
&lt;br /&gt;
=== Getting the Source ===&lt;br /&gt;
&lt;br /&gt;
The source code and data files are available from [http://developer.berlios.de/projects/oolite-linux/ the oolite-linux BerliOS project]. Don't be confused by the name 'oolite-linux'; at one point there were three separate repositories for Oolite, but the Linux one was where they ended up being merged together. The SVN url for 1.65 is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/tags/v165-final&lt;br /&gt;
&lt;br /&gt;
1.74.2 is:&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/tags/1.74.2&lt;br /&gt;
&lt;br /&gt;
You can also get the latest work-in-progress from:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
To download the source with Subversion, the quickest way to do it is to open a Terminal window, and run the following command:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
If you have a BerliOS account and are a project member, you can get it with:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
Developers should also checkout the relevant maintenance branch:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/branches/1.74-maintenance/&lt;br /&gt;
&lt;br /&gt;
=== Building Oolite ===&lt;br /&gt;
Oolite must be built using Xcode 3.2; Xcode 4 is not supported. Multiple versions of Xcode can be installed side-by-side, but installing Xcode 3.2.6 on OS X Lion is currently problematic. See [http://aegidian.org/bb/viewtopic.php?p=148396#p148396 this forum post] for more information.&lt;br /&gt;
&lt;br /&gt;
For a trunk build (as of revision 4026), just open Oolite.xcodeproj and hit Build. Dependencies will be downloaded automatically (in the deps folder inside the Oolite repository). The default target is Build All, which includes the Debug OXP, joystick support and a dock tile plug-in. The last can only be built under Snow Leopard or later; to build under Leopard you must switch to the Oolite project, or remove the dependency on Oolite-docktile.&lt;br /&gt;
&lt;br /&gt;
==== Building earlier versions ====&lt;br /&gt;
For 1.74.x and earlier versions, you must download the source release of [http://libpng.org/pub/png/libpng.html libpng]. This will decompress as a folder called “libpng-1.4.5” or similar. Rename it to “libpng” and move it to deps/Cross-platforms-deps in the Oolite repository. The trunk project now does this automatically. To build the “Build All” target, which includes the Debug OXP, you must install the [http://www.brockerhoff.net/src/rbs.html RBSplitView Interface Builder plug-in]. (To install it, simply put it somewhere tidy and open it; Interface Builder should load and register the plug-in.) '''Important:''' due to an unfortunate change between versions, you must use the 1.1.4 version of the RBSplitView IB plug-in, ''or'' use 1.2 but change its bundle identifier from &amp;lt;code&amp;gt;net.brockerhoff.RB'''S'''plitView.IBPlugin&amp;lt;/code&amp;gt; to  &amp;lt;code&amp;gt;net.brockerhoff.RB'''s'''plitView.IBPlugin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These steps do not need to be repeated after updating the repository using the &amp;lt;code&amp;gt;svn update&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Versions prior to r4584 (1.75.4) will not build under OS X Lion. To make them build, you will need to apply [http://svn.berlios.de/wsvn/oolite-linux?op=comp&amp;amp;compare%5B%5D=%2Ftrunk@4583&amp;amp;compare%5B%5D=%2Ftrunk%2F@4584 these changes] and set the “Header Search Paths” setting of the Oolite target to &amp;lt;code&amp;gt;$(SDKROOT)/usr/include/libkern/&amp;lt;/code&amp;gt; for all configurations.&lt;br /&gt;
&lt;br /&gt;
==== Build products ====&lt;br /&gt;
Building the Build All target (in trunk) will result in the following being created in the build results folder: AddOns, Debug.oxp, include (with subfolders js, ogg and vorbis), libjs_for_oolite.a, libnspr4_for_oolite.a, libogg_for_oolite.a, libpng_for_oolite.a, Oolite.app, Oolite Leopard Support.bundle, Oolite.mdimporter and Oolite.docktileplugin. AddOns contains a copy of Debug.oxp. Oolite.app contains a copy of Oolite Leopard Support.bundle, Oolite.mdimporter and Oolite.docktileplugin, and static libraries (.a files) are linked into the Oolite executable. Everything except Oolite.app and AddOns can be considered side effects of the build process.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]] [[Category:Factual]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=28533</id>
		<title>Running Oolite-Mac</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Running_Oolite-Mac&amp;diff=28533"/>
		<updated>2011-07-21T12:50:55Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Building Oolite */ Updated for Lion and added some subheadings.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
Oolite was originally developed for OS X, and as such, OS X is Oolite's home operating system. The OS X version can be considered the reference version for all other ports. It has some specific Mac OS X only support such as speech synthesis, iTunes integration and Growl integration. Joysticks are not directly supported - however, there are programs that convert joystick inputs into mouse and keyboard inputs, and these programs are reported to work well with Oolite.&lt;br /&gt;
&lt;br /&gt;
==Getting and installing the game==&lt;br /&gt;
You can get the most recent release of the game from [http://developer.berlios.de/project/showfiles.php?group_id=3577 BerliOS].&lt;br /&gt;
&lt;br /&gt;
Installation is the standard method of dragging the Oolite folder to your Applications or Games folder.&lt;br /&gt;
&lt;br /&gt;
===Installing OXPs (add ons)===&lt;br /&gt;
In the Oolite folder that you dragged from the disk image, you will find an Oolite application and an AddOns folder. Place OXPs in the AddOns folder, and they will be loaded the next time you start the game.&lt;br /&gt;
&lt;br /&gt;
==Building Oolite from source==&lt;br /&gt;
&lt;br /&gt;
=== Development Environment (Xcode) === &lt;br /&gt;
To start, you will need Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X 10.5 or later and Xcode tools 3.2 or later from the [http://connect.apple.com/ Apple Developer Connection] or your Mac&amp;amp;nbsp;OS&amp;amp;nbsp;install DVD. You will need an Apple Developer Connection membership to obtain download Xcode; however, the free online membership is sufficient. You can register [http://developer.apple.com/programs/register/ here]. You will also need to ensure you have installed the Mac&amp;amp;nbsp;OS&amp;amp;nbsp;X 10.4 Universal SDK, which is available through the Xcode Tools installer. Lastly, you will require the Subversion version control tool; an up-to-date binary is available [http://downloads.open.collab.net/binaries.html here].&lt;br /&gt;
&lt;br /&gt;
The Oolite projects have not been updated for Xcode 4, and won’t be (in trunk) before the next stable release.&lt;br /&gt;
&lt;br /&gt;
=== Getting the Source ===&lt;br /&gt;
&lt;br /&gt;
The source code and data files are available from [http://developer.berlios.de/projects/oolite-linux/ the oolite-linux BerliOS project]. Don't be confused by the name 'oolite-linux'; at one point there were three separate repositories for Oolite, but the Linux one was where they ended up being merged together. The SVN url for 1.65 is:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/tags/v165-final&lt;br /&gt;
&lt;br /&gt;
1.74.2 is:&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/tags/1.74.2&lt;br /&gt;
&lt;br /&gt;
You can also get the latest work-in-progress from:&lt;br /&gt;
&lt;br /&gt;
 svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
To download the source with Subversion, the quickest way to do it is to open a Terminal window, and run the following command:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn://svn.berlios.de/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
If you have a BerliOS account and are a project member, you can get it with:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/trunk&lt;br /&gt;
&lt;br /&gt;
Developers should also checkout the relevant maintenance branch:&lt;br /&gt;
&lt;br /&gt;
 svn checkout svn+ssh://''accountname''@svn.berlios.de/svnroot/repos/oolite-linux/branches/1.74-maintenance/&lt;br /&gt;
&lt;br /&gt;
=== Building Oolite ===&lt;br /&gt;
Oolite must be built using Xcode 3.2; Xcode 4 is not supported. Multiple versions of Xcode can be installed side-by-side, but installing Xcode 3.2.6 on OS X Lion is currently problematic. See [http://aegidian.org/bb/viewtopic.php?p=148396#p148396 this forum post] for more information.&lt;br /&gt;
&lt;br /&gt;
For a trunk build (as of revision 4026), just open Oolite.xcodeproj and hit Build. Dependencies will be downloaded automatically (in the deps folder inside the Oolite repository). The default target is Build All, which includes the Debug OXP, joystick support and a dock tile plug-in. The last can only be built under Snow Leopard or later; to build under Leopard you must switch to the Oolite project, or remove the dependency on Oolite-docktile.&lt;br /&gt;
&lt;br /&gt;
==== Building earlier versions ====&lt;br /&gt;
For 1.74.x and earlier versions, you must download the source release of [http://libpng.org/pub/png/libpng.html libpng]. This will decompress as a folder called “libpng-1.4.5” or similar. Rename it to “libpng” and move it to deps/Cross-platforms-deps in the Oolite repository. The trunk project now does this automatically. To build the “Build All” target, which includes the Debug OXP, you must install the [http://www.brockerhoff.net/src/rbs.html RBSplitView Interface Builder plug-in]. (To install it, simply put it somewhere tidy and open it; Interface Builder should load and register the plug-in.) '''Important:''' due to an unfortunate change between versions, you must use the 1.1.4 version of the RBSplitView IB plug-in, ''or'' use 1.2 but change its bundle identifier from &amp;lt;code&amp;gt;net.brockerhoff.RB'''S'''plitView.IBPlugin&amp;lt;/code&amp;gt; to  &amp;lt;code&amp;gt;net.brockerhoff.RB'''s'''plitView.IBPlugin&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These steps do not need to be repeated after updating the repository using the &amp;lt;code&amp;gt;svn update&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Versions prior to r4584 (1.75.4) will not build under OS X Lion. To make them build, you will need to apply [http://svn.berlios.de/wsvn/oolite-linux?op=comp&amp;amp;compare[]=%2Ftrunk@4583&amp;amp;compare[]=%2Ftrunk%2F@4584 these changes] and set the “Header Search Paths” setting of the Oolite target to &amp;lt;code&amp;gt;$(SDKROOT)/usr/include/libkern/&amp;lt;/code&amp;gt; for all configurations.&lt;br /&gt;
&lt;br /&gt;
==== Build products ====&lt;br /&gt;
Building the Build All target (in trunk) will result in the following being created in the build results folder: AddOns, Debug.oxp, include (with subfolders js, ogg and vorbis), libjs_for_oolite.a, libnspr4_for_oolite.a, libogg_for_oolite.a, libpng_for_oolite.a, Oolite.app, Oolite Leopard Support.bundle, Oolite.mdimporter and Oolite.docktileplugin. AddOns contains a copy of Debug.oxp. Oolite.app contains a copy of Oolite Leopard Support.bundle, Oolite.mdimporter and Oolite.docktileplugin, and static libraries (.a files) are linked into the Oolite executable. Everything except Oolite.app and AddOns can be considered side effects of the build process.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite]] [[Category:Factual]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=28456</id>
		<title>Oolite JavaScript Reference: Ship</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=28456"/>
		<updated>2011-07-16T12:28:56Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Properties */ Moving cargoSpaceAvailable and cargoSpaceUsed from Ship to PlayerShip. (Bug #18243)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity|Entity]]&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station|Station]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip|PlayerShip]]&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Ship&amp;lt;/code&amp;gt;''' class is an &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity|Entity]]&amp;lt;/code&amp;gt; representing a ship, station, missile, cargo pod or other flying item – anything that can be specified in [[shipdata.plist]]. A &amp;lt;code&amp;gt;Ship&amp;lt;/code&amp;gt; has all the properties and methods of a &amp;lt;code&amp;gt;Entity&amp;lt;/code&amp;gt;, and several others.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station|Station]]&amp;lt;/code&amp;gt;s and the &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip|PlayerShip]]&amp;lt;/code&amp;gt; are types of ship. Note that these more specific types have additional properties and methods.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;aftWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''aftWeapon''' : EquipmentType (read-only)&lt;br /&gt;
The currently equipped aft weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#forwardWeapon|forwardWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#portWeapon|portWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''AI''' : String (read-only)&lt;br /&gt;
The name of the ship’s current AI.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AIState|AIState]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setAI|setAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#switchAI|switchAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#exitAI|exitAI()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIState&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''AIState''' : String (read/write, read-only for player)&lt;br /&gt;
The ship’s AI’s current state.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#reactToAIMessage|reactToAIMessage()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#hasSuspendedAI|hasSuspendedAI]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;beaconCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''beaconCode''' : String (read-only)&lt;br /&gt;
If the ship is a beacon, an identifying string. The first character is used for identification on the [[Advanced Space Compass]]. For non-beacons, this property is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#isBeacon|isBeacon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;bounty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''bounty''' : Number (read/write integer)&lt;br /&gt;
The bounty on the ship. In the case of the player, it is halved at each witchspace jump.&amp;lt;br&amp;gt;&lt;br /&gt;
It is actually the legal status of the ship that is shown here and not the bounty. For all ships both are the same but for anything with scan class Thargoid the legal status is only based on the ships mass and has no relation to its defined bounty.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceCapacity''' : Number (read-only integer)&lt;br /&gt;
The ship’s cargo capacity, in tons.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;contracts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''contracts''' : Array (read-only NSDictionary)&lt;br /&gt;
The ship’s contracts. (For now only available for the player). Each contract contains the entries: &amp;lt;code&amp;gt;commodity: string, quantity: integer, description: string, start: integer, destination: integer, startName: string, destinationName: string, eta: integer, etaDescription: string, fee: Integer, premium: Integer&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, the information of the first contract can be obtained by:&lt;br /&gt;
 player.ship.contracts[0].commodity&lt;br /&gt;
 player.ship.contracts[0].quantity&lt;br /&gt;
 player.ship.contracts[0].description&lt;br /&gt;
 player.ship.contracts[0].start&lt;br /&gt;
 player.ship.contracts[0].destination&lt;br /&gt;
 player.ship.contracts[0].startName&lt;br /&gt;
 player.ship.contracts[0].destinationName&lt;br /&gt;
 player.ship.contracts[0].eta  // Estimated Time of Arrival.&lt;br /&gt;
 player.ship.contracts[0].etaDescription&lt;br /&gt;
 player.ship.contracts[0].fee      // The profit of the contract, paid out on successful delivery.&lt;br /&gt;
 player.ship.contracts[0].premium  // The sum paid to obtain the goods and paid back on successful delivery.&lt;br /&gt;
&lt;br /&gt;
start and destination contain system ID numbers for planets in the current galaxy chart, eta is in clock seconds, fee is the amount that the player will receive when delivering this contract, and premium was the amount the player had to pay to secure this contract.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cloakAutomatic&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.75|beta}}&lt;br /&gt;
 '''cloakAutomatic''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (the default), the ship will automatically engage its cloak while attacking. Otherwise, it must be managed by a script. The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;cloak_automatic&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cruiseSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.75|beta}}&lt;br /&gt;
 '''cruiseSpeed''' : Number (read-only nonnegative)&lt;br /&gt;
The ship’s “normal” &amp;lt;code&amp;gt;[[#desiredSpeed|desiredSpeed]]&amp;lt;/code&amp;gt;, used in normal flight. Normally this is 80 % of &amp;lt;code&amp;gt;[[#maxSpeed|maxSpeed]]&amp;lt;/code&amp;gt;, but it may be lowered when accepting a slow escort.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;desiredSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''desiredSpeed''' : Number (read/write nonnegative, read-only for player)&lt;br /&gt;
The speed the AI will attempt to maintain. The AI core and AI script may change this from time to time. The corresponding AI method is &amp;lt;code&amp;gt;setSpeedFactorTo:&amp;lt;/code&amp;gt;; a speed factor of 1.0 corresponds to a &amp;lt;code&amp;gt;desiredSpeed&amp;lt;/code&amp;gt; equal to &amp;lt;code&amp;gt;[[#maxSpeed|maxSpeed]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#cruiseSpeed|cruiseSpeed]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''displayName''' : String (read/write, read-only for player)&lt;br /&gt;
The name of the ship as seen by the player. By default it is the same as &amp;lt;code&amp;gt;[[#name|name]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;entityPersonality&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''entityPersonality''' : Number (read-only integer)&lt;br /&gt;
A random number in the range 0..32767 which is generated when the ship is created. Equivalent to the &amp;lt;code&amp;gt;entityPersonalityInt&amp;lt;/code&amp;gt; [[Shaders in Oolite: uniforms#Ship|uniform binding]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;equipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''equipment''' : Array of [[Oolite_JavaScript_Reference:_EquipmentInfo|EquipmentInfo ]] (read-only)&lt;br /&gt;
The equipment a ship is carrying.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;escortGroup&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''escortGroup''' : [[Oolite JavaScript Reference: ShipGroup|ShipGroup]]&lt;br /&gt;
The ship’s deployed escorts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;escorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''escorts''' : Array (read-only array of [[Oolite JavaScript Reference: Entity|Entity]]s)&lt;br /&gt;
The ship’s deployed escorts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;forwardWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''forwardWeapon''' : EquipmentType (read-only)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#aftWeapon|aftWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#portWeapon|portWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fuel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''fuel''' : Number (read/write)&lt;br /&gt;
The ship’s current fuel capacity, in LY. The game will limit this to the range 0..7, and round it off to the nearest tenth.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#fuelLeakRate|PlayerShip.fuelLeakRate]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== &amp;lt;code&amp;gt;fuelChargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Added in 1.74 but not documented, because it’s currently always 1.0.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''group''' : [[Oolite JavaScript Reference: ShipGroup|ShipGroup]]&lt;br /&gt;
Contains ship’s belonging to each other. Added pirate groups are an example or a station with its launched defenders.&amp;lt;br&amp;gt;&lt;br /&gt;
A group is an individual object that can be linked to several ships belonging to the same group. When a ship dies and the group object has still owners, the group stays active as object. The group is only removed from memory after the last ship that had this group as property is removed.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding a group to a ship does not automatic puts that ship in the group. For that to happen you need also use the addShip() command. &lt;br /&gt;
e.g. &lt;br /&gt;
 this.ship.group = new ShipGroup();&lt;br /&gt;
 this.ship.group.addShip(this.ship);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasHostileTarget&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hasHostileTarget''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship’s AI is trying to kill something, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Always &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for the player.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasHyperspaceMotor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.75|beta}}&lt;br /&gt;
 '''hasHyperspaceMotor''' : Boolean (read-only)&lt;br /&gt;
True if the ship can make witchspace jumps. The corresponding ''[[shipdata.plist]]'' entry is &amp;lt;code&amp;gt;hyperspace_motor&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasSuspendedAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hasSuspendedAI''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has suspended AIs, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;heatInsulation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''heatInsulation''' : Number (read/write)&lt;br /&gt;
The ship’s heat insulation factor. 1.0 is normal, higher values mean more resistance to heat.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isBeacon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isBeacon''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a beacon (i.e., can show up on the [[Advanced Space Compass]] with a character indicating its identity), &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#beaconCode|beaconCode]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isBoulder&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isBoulder''' : Boolean (read/write)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a boulder (i.e., has the role &amp;quot;boulder in its roleset)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isCargo''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is cargo (i.e., has scan_class CLASS_CARGO and contains at least one unit)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isCloaked&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isCloaked''' : Boolean (read/write)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has a cloaking device which is currently active &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. If the ship has a cloaking device and sufficient energy to use it (&amp;lt;code&amp;gt;energy &amp;gt; 0.75 * maxEnergy&amp;lt;/code&amp;gt;), you can activate it by setting &amp;lt;code&amp;gt;isCloaked&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isDerelict&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isDerelict''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a derelict (i.e., the pilot has ejected from the ship, or the ship was created with the ship-key: &amp;quot;is_hulk&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isFrangible&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isFrangible''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is frangible (i.e., its subentities can be destroyed separately from the main ship), &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#subEntities|subEntities]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isJamming&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isJamming''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has a military scanner jammer which is currently active &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isMine&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isMine''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a mine, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isMissile&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isMissile''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a missile, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPiloted&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.75}}&lt;br /&gt;
 '''isPiloted''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has a pilot on board, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Generally have ships, station and escape pods pilots and have cargo, rocks, missiles or buoys no pilots.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPirate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPirate''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a pirate vessel, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]] == &amp;quot;pirate&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPirateVictim&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPirateVictim''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship’s [[#primaryRole|primary role]] is listed in ''pirate-victim-roles.plist'', &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. This is the same test used by the pirate AI to select victims.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isPolice&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isPolice''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a police vessel, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#scanClass|scanClass]] == &amp;quot;CLASS_POLICE&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isRock&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isRock''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a rock (i.e., has scan_class: CLASS_ROCK)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isThargoid&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isThargoid''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a Thargoid vessel, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#scanClass|scanClass]] == &amp;quot;CLASS_THARGOID&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isTrader&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isTrader''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a merchant vessel, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]] == &amp;quot;trader&amp;quot; || isPlayer&amp;lt;/code&amp;gt;. '''Note:''' &amp;lt;code&amp;gt;[[#isPirateVictim|isPirateVictim]]&amp;lt;/code&amp;gt; may be a better choice in many cases.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isWeapon''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a weapon, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Currently equivalent to &amp;lt;code&amp;gt;[[#isMissile|isMissile]] || [[#isMine|isMine]] &amp;lt;/code&amp;gt;, but new categories of weapon could be added in future.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;lightsActive&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''lightsActive''' : Boolean (read-write)&lt;br /&gt;
Setting this property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; turns on all the entity’s flashers, and setting it to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; turns them off. Setting it sets the &amp;lt;code&amp;gt;lightsActive&amp;lt;/code&amp;gt; property for all subentities, but subentities’ setting can also be manipulated separately. In addition to affecting flashers, the value can be used by shaders.&lt;br /&gt;
&lt;br /&gt;
Note: &amp;lt;code&amp;gt;lightsActive&amp;lt;/code&amp;gt; is always &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; when a ship is spawned, although individual flashers may be off because they have &amp;lt;code&amp;gt;initially_on&amp;lt;/code&amp;gt; set to false in their ''shipdata.plist'' declarations.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxSpeed''' : Number (read-only)&lt;br /&gt;
The ship’s maximum speed under normal power. Note that &amp;lt;code&amp;gt;[[#speed|speed]]&amp;lt;/code&amp;gt; may exceed this when [[witch fuel injectors]] or [[hyperspeed]] are in use.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#speed|speed]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxThrust&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxThrust''' : Number (read-only)&lt;br /&gt;
The ship’s maximum &amp;lt;code&amp;gt;[[#thrust|thrust]]&amp;lt;/code&amp;gt;. This value is the one defined as &amp;lt;code&amp;gt;thrust&amp;lt;/code&amp;gt; in ''[[Shipdata.plist#thrust|shipdata.plist]]''.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missileCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''missileCapacity''' : Number (read-only integer)&lt;br /&gt;
The maximum number of missiles the ship can carry.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missileLoadTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.75|beta}}&lt;br /&gt;
 '''missileLoadTime''' : Number (read-write nonnegative)&lt;br /&gt;
The minimum amount of time between two missiles. The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;missile_load_time&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;missiles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''missiles''' : Array (read-only array of [[Oolite JavaScript Reference: EquipmentInfo|EquipmentInfo]])&lt;br /&gt;
The ship’s loaded missiles.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read/write, read-only for player)&lt;br /&gt;
The name of the ship type (&amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; key in [[shipdata.plist]]).&lt;br /&gt;
&lt;br /&gt;
''Note'': while &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; can be changed, this is discouraged (and will probably not be supported in Oolite 2.0). Use &amp;lt;code&amp;gt;[[#displayName|displayName]]&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;passengerCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerCapacity''' : Number (read-only integer)&lt;br /&gt;
The ship’s maximum passenger capacity.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;passengerCount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerCount''' : Number (read-only integer)&lt;br /&gt;
The ship’s current number of passengers.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;passengers&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengers''' : Array (read-only NSDictionary)&lt;br /&gt;
The ship’s passengers. (For now only available for the player). Each passengers list contains the entries: &amp;lt;code&amp;gt;name: String, start: integer, destination: integer, startName: string, destinationName: string, eta: integer, etaDescription: string, fee: Integer, premium: Integer&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the information of the first contract can be obtained by:&lt;br /&gt;
 player.ship.passengers[0].name&lt;br /&gt;
 player.ship.passengers[0].start&lt;br /&gt;
 player.ship.passengers[0].destination&lt;br /&gt;
 player.ship.passengers[0].startName&lt;br /&gt;
 player.ship.passengers[0].destinationName&lt;br /&gt;
 player.ship.passengers[0].eta&lt;br /&gt;
 player.ship.passengers[0].etaDescription&lt;br /&gt;
 player.ship.passengers[0].fee  // The final fee, paid out on successful delivery.&lt;br /&gt;
 player.ship.passengers[0].premium  // The advance fee, already paid on acceptance of the contract.&lt;br /&gt;
&lt;br /&gt;
start and destination contain system ID numbers for planets in the current galaxy chart, eta is in clock seconds, fee is the amount that the player will receive when delivering this passenger, and premium shows the amount the player received when the passenger boarded the ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''portWeapon''' : EquipmentType (read-only)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. Currently, this is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#aftWeapon|aftWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardWeapon|forwardWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;potentialCollider&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''potentialCollider''' : [[Oolite JavaScript Reference: Entity|Entity]] (read-only)&lt;br /&gt;
The entity the ship is currently trying not to crash into, if any.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;primaryRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''primaryRole''' : String (read/write, read-only for player)&lt;br /&gt;
The main role of the ship; the role for which it was created. For instance, if a ship’s ''shipdata.plist'' entry specifies the roles “pirate trader(0.5) escort”, and a ship of that type is spawned to be a trader, its &amp;lt;code&amp;gt;primaryRole&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;&amp;quot;trader&amp;quot;&amp;lt;/code&amp;gt;, its &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;[&amp;quot;escort&amp;quot;, &amp;quot;pirate&amp;quot;, &amp;quot;trader&amp;quot;]&amp;lt;/code&amp;gt; and its &amp;lt;code&amp;gt;roleWeights&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt; { &amp;quot;escort&amp;quot;:1, &amp;quot;pirate&amp;quot;:1, &amp;quot;trader&amp;quot;:0.5}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roles|roles]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#roleWeights|roleWeights]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;reportAIMessages&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''reportAIMessages''' : Boolean (read/write)&lt;br /&gt;
Debugging facility: set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to dump information about AI activity to the log. &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roleWeights&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''roles''' : Object (read-only)&lt;br /&gt;
The probabilities for each role in &amp;lt;code&amp;gt;[[#roles|roles]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 this.pirateProb = ship.roleWeights[&amp;quot;pirate&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#roles|roles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''roles''' : Array (read-only array of Strings)&lt;br /&gt;
The roles of the ship. This consists of the roles specified in the ship’s ''shipdata.plist'' entry, as well as the &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]]&amp;lt;/code&amp;gt; if it is not among those.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#primaryRole|primaryRole]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#roleWeights|roleWeights]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#hasRole|hasRole()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;savedCoordinates&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''savedCoordinates''' : [[Oolite JavaScript Reference: Vector|Vector]] (read-write)&lt;br /&gt;
The savedCoordinates of the ship in system co-ordinates. The savedCoordinates vector is only used by AI scripting to store a coordinate that can be used by other AI commands like &amp;lt;code&amp;gt;setDestinationFromCoordinates&amp;lt;/code&amp;gt;. It are the same coordinates that are set by the AI command: &amp;lt;code&amp;gt;&amp;quot;setCoordinates: X Y Z&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerDisplayColor1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scannerDisplayColor1''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The first of two colours used by the ship’s scanner “lollipop”. When read, this will always be an array of four numbers in the range 0..1 (representing red, green, blue and alpha components). Any colour specifier format may be assigned to it. Assigning &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; will restore the value from [[shipdata.plist]], or the default value for the ship’s scan class.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#scannerDisplayColor2|scannerDisplayColor2]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerDisplayColor2&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scannerDisplayColor2''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The second scanner colour. If both &amp;lt;code&amp;gt;scannerDisplayColor1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;scannerDisplayColor2&amp;lt;/code&amp;gt; are specified, the scanner lollipop will alternate between the two colours.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#scannerDisplayColor1|scannerDisplayColor1]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scannerRange''' : Number (read-only)&lt;br /&gt;
The range of the ship’s scanner.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;script&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''script''' : [[Oolite JavaScript Reference: Script|Script]] (read-only)&lt;br /&gt;
The ship’s script.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scriptedMisjump&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.75|beta}}&lt;br /&gt;
 '''scriptedMisjump''' : Boolean (read/write)&lt;br /&gt;
When &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the next hyperspace jump will be a misjump. The &amp;lt;code&amp;gt;scriptedMisjump&amp;lt;/code&amp;gt; flag will remain &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; during the &amp;lt;code&amp;gt;shipWillExitWitchspace()&amp;lt;/code&amp;gt; event handler, and will be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; after the &amp;lt;code&amp;gt;shipExitedWitchspace()&amp;lt;/code&amp;gt; event.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scriptInfo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scriptInfo''' : Object (read-only)&lt;br /&gt;
The contents of the &amp;lt;code&amp;gt;script_info&amp;lt;/code&amp;gt; key in the ship’s ''[[shipdata.plist]]'' entry, if any. This may be any [[property list]] object, but the reccomended approach is to use a dictionary whose keys have a unique prefix (such as you should be using for file names, ship names etc.). A property list dictionary is converted to a JavaScript object with properties corresponding to the dictionary’s keys. All other property list types used with Oolite have directly corresponding JavaScript types.&amp;lt;br&amp;gt;&lt;br /&gt;
When using numeric values in the scriptInfo, the JS engine is not able to detect the type reliably on all systems, so you always must expclicit convert its content to a number by using parseInt(scriptInfo.myKey) or parseFloat(scriptInfo.myKey).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;speed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''speed''' : Number (read-only)&lt;br /&gt;
The ship’s current speed.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxSpeed|maxSpeed]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;starboardWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''starboardWeapon''' : EquipmentType (read-only)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. Currently, this is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#aftWeapon|aftWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#forwardWeapon|forwardWeapon]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#portWeapon|portWeapon]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;subEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''subEntities''' : Array (read-only array of Ships)&lt;br /&gt;
The ships subentities, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if it has none. Special subentities such as flashers and exhaust plumes are not included.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#isFrangible|isFrangible]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;subEntityCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''subEntityCapacity''' : Number (read-only integer)&lt;br /&gt;
The original number of subentities on the ship. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#subEntities|subEntities]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#restoreSubEntities|restoreSubEntities()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''target''' : Ship (read-write)&lt;br /&gt;
The ship’s primary target, i.e. the entity it will attempt to shoot at. This value is automatically co-ordinated between a ship and its subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''temperature''' : Number (read/write)&lt;br /&gt;
The ship’s temperature, normalized such that a temperature of 1.0 is the level at which a ship starts taking heat damage.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;thrust&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''thrust''' : Number (read/write for NPCs, read-only for player)&lt;br /&gt;
The ship’s thrust, ranging from 0 to &amp;lt;code&amp;gt;maxThrust&amp;lt;/code&amp;gt;. This value determines how fast the ship accelerates or decelerates, specified in m/s².&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#thrustVector|thrustVector]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;thrustVector&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''thrustVector''' : Vector3D (read-only)&lt;br /&gt;
The inertialess velocity generated by the engines.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#thrust|thrust]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#velocity|velocity]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;trackCloseContacts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''trackCloseContacts''' : Boolean (read/write)&lt;br /&gt;
If true, AI events are generated for near collisions.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorForward&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''vectorForward''' : Vector3D (read-only)&lt;br /&gt;
The vector pointing forwards from the ship (in world space for ships, relative to the parent for subentities). Equivalent to &amp;lt;code&amp;gt;ship.[[Oolite JavaScript Reference: Entity#orientation|orientation]].[[Oolite JavaScript Reference: Quaternion#vectorForward|vectorForward]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorRight&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''vectorRight''' : Vector3D (read-only)&lt;br /&gt;
The vector pointing right from the ship (in world space for ships, relative to the parent for subentities). Equivalent to &amp;lt;code&amp;gt;ship.[[Oolite JavaScript Reference: Entity#orientation|orientation]].[[Oolite JavaScript Reference: Quaternion#vectorRight|vectorRight]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;vectorUp&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''vectorUp''' : Vector3D (read-only)&lt;br /&gt;
The vector pointing up from the ship (in world space for ships, relative to the parent for subentities). Equivalent to &amp;lt;code&amp;gt;ship.[[Oolite JavaScript Reference: Entity#orientation|orientation]].[[Oolite JavaScript Reference: Quaternion#vectorUp|vectorUp]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;velocity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''velocity''' : Vector3D (read/write)&lt;br /&gt;
The ship’s velocity.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' A ship’s velocity consists of two components, inertial velocity and inertialess thrust. Generally, inertial velocity is zero (so &amp;lt;code&amp;gt;velocity&amp;lt;/code&amp;gt; is equal to &amp;lt;code&amp;gt;[[#thrustVector|thrustVector]]&amp;lt;/code&amp;gt;), but inertial impulses may be applied if a ship collides or is caught in an explosion. If inertial velocity is non-zero, the ship’s engines will work to counteract it. Changing the ship’s velocity will always apply inertial velocity, so for ships with non-zero &amp;lt;code&amp;gt;[[#maxThrust|maxThrust]]&amp;lt;/code&amp;gt; the effect will be temporary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#thrustVector|thrustVector]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;weaponRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''weaponRange''' : Number (read-only)&lt;br /&gt;
The maximum range of the ship’s primary weapon. For the player it is the range of the weapon that fired as last, even when the view direction changed.&amp;lt;br&amp;gt;&lt;br /&gt;
Range values are: WEAPON_PLASMA_CANNON: 5000, WEAPON_PULSE_LASER: 12500, WEAPON_BEAM_LASER: 15000, WEAPON_MINING_LASER: 12500, WEAPON_THARGOID_LASER: 17500, WEAPON_MILITARY_LASER: 30000, WEAPON_NONE: 32000.&amp;lt;br&amp;gt;&lt;br /&gt;
(Turrets are secondary weapons with a maximum range of 6000)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;withinStationAegis&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''withinStationAegis''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is within the aegis of the system’s main station (i.e., no more than 51 200 game metres from the station, or twice scanner range).&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;abandonShip&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''abandonShip'''() : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; when the ship has an escapepod. It will launch all escapeposd on board leaving the ship behind as a empty hulk. (scanClass = CLASS_CARGO). This command does nothing when no escape-pod is present.&amp;lt;br&amp;gt;&lt;br /&gt;
Pressence of an escapepod can be tested with: &amp;lt;code&amp;gt;equipmentStatus(&amp;quot;EQ_ESCAPE_POD&amp;quot;) == &amp;quot;EQUIPMENT_OK&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;awardEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''awardEquipment'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]]) : Boolean&lt;br /&gt;
Adds the given piece of equipment to the ship, if possible, returning &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if successful and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 ship.awardEquipment(&amp;quot;EQ_ECM&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#canAwardEquipment|canAwardEquipment()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeEquipment|removeEquipment()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;canAwardEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''canAwardEquipment'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]]) : Boolean&lt;br /&gt;
Tests whether it is possible to add a given equipment type. This command takes the conditions for offering inside equipment.plist into account. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;[[#awardEquipment|awardEquipment()]]&amp;lt;/code&amp;gt; is expected to succeed, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#awardEquipment|awardEquipment()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commsMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''commsMessage'''(message : String [,target : Ship])&lt;br /&gt;
Make the ship broadcast the specified message. Works on buoys and subentities as well as normal ships and stations. Messages are send to a maximum of 16 ships in range and always to the player when in range. When the optional target is used, the message goes only to that ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;deployEscorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''deployEscorts'''()&lt;br /&gt;
Launch the ship’s escorts, if any.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockEscorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''dockEscorts'''()&lt;br /&gt;
Dock the ship’s deployed escorts, if any.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dumpCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''dumpCargo'''() : Ship&lt;br /&gt;
Ejects one item of cargo from the ship, and returns the cargo item. Returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if the ship has no cargo, anything has been ejected in the last 0.5 seconds, or if sent to the player while docked.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#ejectSpecificItem|ejectSpecificItem]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ejectItem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''ejectItem'''(role : String) : Ship&lt;br /&gt;
Spawns a ship of role &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; immediately behind the ship, with a slight backwards velocity. (Note: an equal and opposite reaction is applied to the parent ship, so doing this with large ships is rarely useful. &amp;lt;code&amp;gt;player.ejectItem(&amp;quot;station&amp;quot;)&amp;lt;/code&amp;gt; may seem funny, but don’t come running to me if you have someone’s eye out.) Returns the generated ship, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if no ship is generated. The scanClass of the ejected item will always be CLASS_CARGO.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#ejectSpecificItem|ejectSpecificItem]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;ejectSpecificItem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''ejectSpecificItem'''(itemKey : String) : Ship&lt;br /&gt;
Spawns a ship with the ''shipdata.plist'' key &amp;lt;code&amp;gt;itemKey&amp;lt;/code&amp;gt; immediately behind the ship, with a slight backwards velocity. The scanClass of the ejected item will always be CLASS_CARGO.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#ejectItem|ejectItem]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;equipmentStatus&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''equipmentStatus'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]]) : String&lt;br /&gt;
Tests whether the specified type of equipment is installed, and whether it is functioning. Returns one of the following strings: &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_OK&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_DAMAGED&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_UNAVAILABLE&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_UNKNOWN&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setEquipmentStatus|setEquipmentStatus()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''exitAI'''()&lt;br /&gt;
Exit the current AI, restoring the previous one. Equivalent to the &amp;lt;code&amp;gt;[[AI_methods|exitAI]]:&amp;lt;/code&amp;gt; AI method. May not be used on player. Will generate a warning if there are no suspended AI states.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setAI|setAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#hasSuspendedAI|hasSuspendedAI]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''exitSystem'''([targetSystem : Number]) : Boolean&lt;br /&gt;
Cause the ship to jump out of the system, if possible. If &amp;lt;code&amp;gt;targetSystem&amp;lt;/code&amp;gt; is specified, it will attempt to jump to the specified system, otherwise a random system within range is chosen.&lt;br /&gt;
&lt;br /&gt;
This method can fail for various reasons, in which case it returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;. It always fails for the player ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;explode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''explode'''()&lt;br /&gt;
Causes the ship to explode. Works on all ships, including the main station and the player except when docked.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#remove|remove()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fireECM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''fireECM'''()&lt;br /&gt;
activates an ecm burst, identical as the AI command.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fireMissile&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''fireMissile'''([missile]) : Ship&lt;br /&gt;
fireMissile() will try to fire the first available missile and will return the missile fired, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if no missiles can be fired at this time. It can take the optional missile identifier parameter, to allow for a specific missile to be fired. Missiles cannot be fired if the ship hasn’t got a valid target, or if the previous missile was launched less than &amp;lt;code&amp;gt;missile_load_time&amp;lt;/code&amp;gt; seconds before. If a missile type was specified, and not found on the ship, no missile will be fired.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''hasRole'''(role : String)&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; among its roles, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roles|roles]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;reactToAIMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''reactToAIMessage'''(message : String)&lt;br /&gt;
Immediately perform the specified handler in the ship’s current AI state.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#sendAIMessage|sendAIMessage()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;remove&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''remove'''([suppressDeathEvent : Boolean])&lt;br /&gt;
Immediately removes the ship from the universe. Works on all ships except the player, including the main station.&amp;lt;br&amp;gt;It generates a this.shipRemoved(suppressDeathEvent) event. By default it will also trigger a this.shipDied() event, unless &amp;lt;code&amp;gt;suppressDeathEvent&amp;lt;/code&amp;gt; is true.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#explode|explode()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''removeEquipment'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]])&lt;br /&gt;
Removes the given piece of equipment from the ship.&lt;br /&gt;
This function can also be used to remove missiles (and mines). If more than one missile of the same type is found on board, only one of them will be removed.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 ship.removeEquipment(&amp;quot;EQ_ECM&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;restoreSubEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.75|beta}}&lt;br /&gt;
 function '''restoreSubEntities'''() : Boolean&lt;br /&gt;
Recreate all destroyed subentities of the ship. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if any subentities were added.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;selectNewMissile&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''selectNewMissile'''() : equipmentKey&lt;br /&gt;
selectNewMissile() will automatically select a missile for a specific ship. It uses the missile_role shipdata.plist key to find out which missiles to select. As with the system populator, there's a small chance that missiles other than the missile_role specified in shipdata will be selected.&lt;br /&gt;
e.g.&lt;br /&gt;
 this.ship.awardEquipment(this.ship.selectNewMissile())&lt;br /&gt;
will automatically add the 'right type' of missile to a ship, i.e. one that its captain would normally choose.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sendAIMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.75}}&lt;br /&gt;
 function '''sendAIMessage'''(message : String)&lt;br /&gt;
Add a message to the ship’s AI deferred message queue. Messages in the queue are handled immediately after the next periodic &amp;lt;code&amp;gt;UPDATE&amp;lt;/code&amp;gt; message. Identical messages are coalesced.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#reactToAIMessage|reactToAIMessage()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setAI'''(AIName : String)&lt;br /&gt;
Set the current AI, leaving the old one suspended. Equivalent to the &amp;lt;code&amp;gt;[[AI_methods|setAITo]]:&amp;lt;/code&amp;gt; AI method. May not be used on player.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#switchAI|switchAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#exitAI|exitAI()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setCargo'''(commodity : String [, count : Number]) : Boolean&lt;br /&gt;
Attempts to create &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; weight units of the commodity &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; for a cargo barrel. (Can not be used to set cargo for ships) When more units are defined than 1 ton, the count is reduced to one ton.  It returns false when the selected commodity is unknown. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is not specified, one will be assumed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setEquipmentStatus&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setEquipmentStatus'''(equipmentType : [[Oolite JavaScript Reference: EquipmentInfo#Equipment Expressions|equipmentInfoExpression]], statusKey : String)&lt;br /&gt;
Changes the status of the given piece of equipment from the ship. The two only valid status keys are &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_OK&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;EQUIPMENT_DAMAGED&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' by design, this method will throw an exception if called with an equipment type that does not exist. To test whether an equipment type exists, use &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: EquipmentInfo#infoForKey|EquipmentInfo.infoForKey()]]&amp;lt;/code&amp;gt;, which will return &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for undefined equipment.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#equipmentStatus|equipmentStatus()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setMaterials&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setMaterials'''(materialDictionary : Object [, shaderDictionary : Object]) : Boolean&lt;br /&gt;
Set the materials of the ship’s model. This works exactly like the &amp;lt;code&amp;gt;materials&amp;lt;/code&amp;gt; dictionary in [[shipdata.plist]]. The optional &amp;lt;code&amp;gt;shaderDictionary&amp;lt;/code&amp;gt; argument overrides &amp;lt;code&amp;gt;materialDictionary&amp;lt;/code&amp;gt; if shaders are active.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 this.ship.setMaterials({&amp;quot;my_ship_diffuse.png&amp;quot;: { diffuse_map: &amp;quot;my_ship_damaged_diffuse.png&amp;quot; }});&lt;br /&gt;
 &lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setShaders|setShaders()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScript&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setScript'''(scriptName : String)&lt;br /&gt;
Set, or completely replace, the javascript code associated to a ship entity.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setShaders&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''setShaders'''(shaderDictionary : Object) : Boolean&lt;br /&gt;
Set the shader materials of the ship’s model. Equivalent to &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;materialDictionary&amp;lt;/code&amp;gt; value set to the ship’s current material dictionary.&lt;br /&gt;
 &lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;spawn&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''spawn'''(role : String [, count : Number]) : Array&lt;br /&gt;
Attempts to create &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; (maximum: 64) ships of role &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; close to the ship – specifically, inside the ship’s collision radius. (Since creating ships may fail, the number created may be less than &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt;). The created ships are returned in an array. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is not specified, one will be assumed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spawn()&amp;lt;/code&amp;gt; is intended for cases when a ship splits into multiple parts or drops parts. In particular, it has the following special behaviour:&lt;br /&gt;
* The spawned ships inherit most of the temperature of the parent.&lt;br /&gt;
* If the parent is a missile and a child has the &amp;lt;code&amp;gt;[[shipdata.plist#is_submunition|is_submunition]]&amp;lt;/code&amp;gt; property, the child will be considered a missile, its target will be set to that of the parent and the child’s owner will be set to the parent.&lt;br /&gt;
* &amp;lt;code&amp;gt;spawn()&amp;lt;/code&amp;gt; does not set up escorts for the new ships, or generate witchspace effects, or do any special AI handling.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;spawnOne&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''spawnOne'''(role : String) : Ship&lt;br /&gt;
Convenience method which calls &amp;lt;code&amp;gt;[[#spawn|spawn]](role)&amp;lt;/code&amp;gt; and returns the first element of the resulting array, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;spawn()&amp;lt;/code&amp;gt; fails.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;switchAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''switchAI'''(AIName : String)&lt;br /&gt;
Set the current AI, exiting the old one. Equivalent to the &amp;lt;code&amp;gt;[[AI_methods|switchAITo]]:&amp;lt;/code&amp;gt; AI method. May not be used on player.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setAI|setAI()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#exitAI|exitAI()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;updateEscortFormation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.75|beta}}&lt;br /&gt;
 function '''updateEscortFormation'''()&lt;br /&gt;
Request that the game updates the target positions for the ship’s escorts by calling the ship’s script’s &amp;lt;code&amp;gt;coordinatesForEscortPosition()&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=28455</id>
		<title>Oolite JavaScript Reference: Player</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=28455"/>
		<updated>2011-07-16T12:28:33Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Properties */ Moving cargoSpaceAvailable and cargoSpaceUsed from Ship to PlayerShip. (Bug #18243)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;small&amp;gt;'''Prototype:''' &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;'''Subtypes:''' none&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;Player&amp;lt;/code&amp;gt;''' class is represents the player. There is always exactly one &amp;lt;code&amp;gt;Player&amp;lt;/code&amp;gt; object in existence, which can be accessed through the &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt; global property.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertAltitude&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertAltitude''' : Boolean (read-only)&lt;br /&gt;
Whether the player is dangerously close to a planet. (closer than 4000 meter to the surface)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertCondition&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertCondition''' : Number (read-only, integer)&lt;br /&gt;
Returns the current alert condition. 0 = Docked, 1 = Green, 2 = Yellow, 3 = Red.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertEnergy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertEnergy''' : Boolean (read-only)&lt;br /&gt;
Whether the player’s energy level is depleted (i.e., &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#energy|energy]]&amp;lt;/code&amp;gt; is less than &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Entity#maxEnergy|maxEnergy]]&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertHostiles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertHostiles''' : Boolean (read-only)&lt;br /&gt;
Whether there are hostile ships within scanner range.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertMassLocked&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertMassLocked''' : Boolean (read-only)&lt;br /&gt;
Whether the player is mass locked.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;alertTemperature&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertTemperature''' : Boolean (read-only)&lt;br /&gt;
Whether the cabin temperature is dangerously high.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;bounty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''bounty''' : Number (read/write integer)&lt;br /&gt;
The bounty on the player, which determines legal status. It is halved at each witchspace jump.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#legalStatus|legalStatus]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceAvailable&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceAvailable''' : Number (read-only integer)&lt;br /&gt;
The ship’s available cargo space, in tons.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceUsed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceUsed''' : Number (read-only integer)&lt;br /&gt;
The ship’s current cargo, in tons.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;contractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''contractReputation''' : Number (read-only integer)&lt;br /&gt;
The player’s cargo contract reputation, ranging from -7 to +7. Reputation is based on fulfilled and unfulfilled contracts. Both individually ranging from 0 till 7. Both good and bad value erode away in time towards 0. All individually values below 7 are seen as '''unknown''' reputation. This unknown part is randomised based on the market situation. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#decreaseContractReputation|decreaseContractReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseContractReputation|increaseContractReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;credits&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''credits''' : Number (read/write, integer)&lt;br /&gt;
The amount of money the player has.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockingClearanceStatus&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''dockingClearanceStatus''' : String (read-only)&lt;br /&gt;
A string indicating whether the player has docking clearance. (''Clarify: for which station? -[[User:Ahruman|Ahruman]] 20:34, 3 November 2008 (UTC)'') Possible values are:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_NONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_REQUESTED&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_NOT_REQUIRED&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_GRANTED&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;DOCKING_CLEARANCE_STATUS_TIMING_OUT&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;legalStatus&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''legalStatus''' : String (read-only)&lt;br /&gt;
A string describing the player’s legal status for display purposes, based on &amp;lt;code&amp;gt;[[#bounty|bounty]]&amp;lt;/code&amp;gt;. In English, this is one of &amp;lt;code&amp;gt;&amp;quot;Clean&amp;quot;&amp;lt;/code&amp;gt; (bounty = 0), &amp;lt;code&amp;gt;&amp;quot;Offender&amp;quot;&amp;lt;/code&amp;gt; (0 &amp;lt; bounty ≤ 50) or &amp;lt;code&amp;gt;&amp;quot;Fugitive&amp;quot;&amp;lt;/code&amp;gt;, but note that it can be localized.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''name''' : String (read-only)&lt;br /&gt;
The name of the player’s character (e.g., “Jameson”).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;passengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerReputation''' : Number (read-only integer)&lt;br /&gt;
The player’s passenger contract reputation, ranging from -7 to +7. Reputation is based on fulfilled and unfulfilled contracts. Both individually ranging from 0 till 7. Both good and bad value erode away in time towards 0. All individually values below 7 are seen as '''unknown''' reputation. This unknown part is randomised based on the market situation. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#contractReputation|contractReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreasePassengerReputation|decreasePassengerReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increasePassengerReputation|increasePassengerReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;rank&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''rank''' : String (read-only)&lt;br /&gt;
A string describing the player’s rank for display purposes, based on &amp;lt;code&amp;gt;[[#score|score]]&amp;lt;/code&amp;gt;, such as &amp;lt;code&amp;gt;&amp;quot;Mostly Harmless&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;Dangerous&amp;quot;&amp;lt;/code&amp;gt;. Note that it can be localized.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;score&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''score''' : Number (read/write, integer)&lt;br /&gt;
The player’s score; nominally the number of kills the player has made, although some missions award additional points.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;trumbleCount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''trumbleCount''' : Number (read-only nonnegative integer)&lt;br /&gt;
The number of trumbles the player is currently blessed with.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageToArrivalReport&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageToArrivalReport'''(message : String)&lt;br /&gt;
Adds a message to the arrival report. This is the report shown immediately after docking. Oolite is putting its own stuff on the list immediately after shipWillDockAtStation() so it will be a good moment to add the messages at that moment when you know what station will be docked. At shipDockedWithStation() it will be to late as the report is already being shown at that moment. Messages added will be on the list above oolites own arrival messages. Messages added on the list other than during shipWillDockAtStation() will trigged the report screen when using the F5 screen during flight. This will be fixed in future versions but for now, only add them at shipWillDockAtStation().&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commsMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''commsMessage'''(message : String [, duration: Number])&lt;br /&gt;
Writes the specified message in the player’s communications log, as well as displaying it as a console message. The optional &amp;lt;code&amp;gt;duration&amp;lt;/code&amp;gt; parameter determines how long the message should be displayed on the console before fading out. It is clamped to the range [1, 10]. If no duration is specified, 4.5 seconds will be used. Example: &amp;lt;code&amp;gt;player.commsMessage(&amp;quot;Hello, cruel universe.&amp;quot;, 6)&amp;lt;/code&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
NB. This commsMessage() is a property of &amp;quot;player&amp;quot;. &amp;quot;player.ship&amp;quot; has also a commsMessage() property, but that belongs to ship and has a different second parameter. (see [[Oolite_JavaScript_Reference:_Ship|Oolite JavaScript Reference: Ship]])&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;consoleMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''consoleMessage'''(message : String [, duration: Number])&lt;br /&gt;
Displays the specified message as a console message, that is, as a message on the HUD. The optional &amp;lt;code&amp;gt;duration&amp;lt;/code&amp;gt; parameter determines how long the message should be displayed before fading out. It is clamped to the range [1, 10]. If no duration is specified, 3 seconds will be used.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;decreaseContractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''decreaseContractReputation'''()&lt;br /&gt;
Give the player a negative reputation point for cargo contracts. Decreases the underlying value for contractReputation by 1 until a minimum of -7. Depending on the randomised part of the value can the visible value stay the same in one system.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseContractReputation|increaseContractReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;decreasePassengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''decreasePassengerReputation'''()&lt;br /&gt;
Give the player a negative reputation point for passenger contracts. Decreases the underlying value for passengerReputation by 1 until a minimum of -7. Depending on the randomised part of the value can the visible value stay the same in one system.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increasePassengerReputation|increasePassengerReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;increaseContractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''increaseContractReputation'''()&lt;br /&gt;
Give the player a positive reputation point for cargo contracts. Increases the underlying value for contractReputation by 1 until a maximum of 7&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreaseContractReputation|decreaseContractReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;increasePassengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''increasePassengerReputation'''()&lt;br /&gt;
Give the player a positive reputation point for passenger contracts. Increases the underlying value for passengerReputation by 1 until a maximum of 7&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreasePassengerReputation|decreasePassengerReputation()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setEscapePodDestination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.75|beta}}&lt;br /&gt;
 function '''setEscapePodDestination'''(destination)&lt;br /&gt;
This method can only be called after the player has launched an escape pod – for example, from the &amp;lt;code&amp;gt;escapePodSequenceOver()&amp;lt;/code&amp;gt; event handler. It determines where the player will end up. &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; may be any carrier/station entity, or the string &amp;lt;code&amp;gt;&amp;quot;NEARBY_SYSTEM&amp;quot;&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. If it is &amp;lt;code&amp;gt;&amp;quot;NEARBY_SYSTEM&amp;quot;&amp;lt;/code&amp;gt;, the player will end up at the main station in a random nearby system. If it is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;, the player will die of life support failure. (&amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; is the default in interstellar space.)&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Materials_in_Oolite&amp;diff=28442</id>
		<title>Materials in Oolite</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Materials_in_Oolite&amp;diff=28442"/>
		<updated>2011-07-14T19:58:03Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: /* Important concepts */ Linked specular map demo video&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:&amp;lt;small&amp;gt;This page applies to Oolite test releases.&amp;lt;/small&amp;gt;&lt;br /&gt;
Traditionally, the surface appearance of ships in Oolite has been defined entirely by textures specified in the ship’s model file and the ''[[#smooth|smooth]]'' attribute. Test release 1.67 added support for [[Shaders in Oolite|shaders]], and test release 1.69 expanded this to a more flexible '''material model'''. Under the new model, the texture file names in model files have been repurposed as '''material keys'''. A material key specifies an entry in the ship’s '''material dictionary''', specified in the ship’s ''[[shipdata.plist]]'' entry. For backwards compatibility, if no material of a given name is found, a material is generated using the material key as a diffuse texture name – providing the same functionality as previous versions of Oolite.&lt;br /&gt;
&lt;br /&gt;
This page documents the material model as of Oolite test release 1.74.&lt;br /&gt;
&lt;br /&gt;
== Important concepts ==&lt;br /&gt;
The following concepts are important in understanding how materials work and how they interact with lights.&lt;br /&gt;
* '''Colour''': Oolite uses a basic low dynamic range lighting model. Colours are considered to be lists of three values, representing red, green and blue colours, each ranging from 0 to 1. These are often encoded as integers ranging from 0 to 255 for technical reasons, but 0 to 1 is the true range of values. There may also be an associated ''alpha channel'', which is traditionally used for blending effects. In shaders, any colour channel can be used for any purpose, and textures often encode values that are not treated as colours.&lt;br /&gt;
* '''Fragment''': roughty speaking, an on-screen pixel. When objects are rendered, their geometry is used to generate a fragments, which are then coloured based on lighting and materials.&lt;br /&gt;
* '''Modulation''': multiplying two colours together, by channel. For instance, if the calculated light colour for a given fragment is pale yellow – [1, 1, 0.8] – and the corresponding part of the diffuse map is turquoise – [0.2, 0.8, 0.8] – the ''diffuse contribution'' is [0.2, 0.8, 0.64] (a greenish tint). In graphics programs, this blending mode is usually called ''Multiply''.&lt;br /&gt;
* '''Additive blending''': adding two colours together, by channel. In Oolite’s low dynamic range lighting model, the result is always clipped to the range 0..1. In graphics programs, this blending mode is usually called ''Lighten''.&lt;br /&gt;
* '''Normals''': All lighting calculations require a concept of the orientation of a surface relative to a light and, for reflections, relative to the camera. A surface oriented towards the light will be lighter than a surface oriented away from it. The ''normal'' for any given point on a surface is a vector pointing straight out, which for our purposes ''defines'' the concept of “straight out”.&amp;lt;br /&amp;gt;By default, Oolite models have constant normals across each face. By setting the &amp;lt;code&amp;gt;smooth&amp;lt;/code&amp;gt; attribute in [[shipdata.plist]], normals are instead interpolated across each face, with each vertex having a normal that is a weighted average of surounding faces’ normals, and each point on a surface getting a weighted average of the normals at the corners of the face. Using ''smooth groups'', a model can be divided into regions which are smoothed but have sharp boundaries between them. As of Oolite 1.74, models can also include explicit per-vertex normals instead of having Oolite calculate them – most 3D modellers export this information.&amp;lt;br /&amp;gt;When using smoothing, it is important to understand that Oolite does not add any geometry,and will result in each vertex being lit as if it is locally flat. This is generally inappropriate for any sharp corner. If you set &amp;lt;code&amp;gt;smooth&amp;lt;/code&amp;gt; on a basic cube, the result will be badly lit.&lt;br /&gt;
* '''Diffuse reflection''': light that is reflected evenly in all directions. A “dull” surface primarily reflects diffusely. Because the light is reflected evenly in all directions, the diffuse term is independent of the camera position; it is a function of the light and the surface normal. The standard diffuse reflection term is the cosine of the angle between the direction to the light and the normal, or zero if this is negative – this is known as the [http://en.wikipedia.org/wiki/Lambertian_reflectance Lambertian reflectance model]. This value is then modulated with the material’s diffuse colour and diffuse map.&lt;br /&gt;
* '''Specular reflection''': light that is reflected in a particular direction, producing a shiny effect. In real life, this is simply a mirror reflection which is generally darkened and blurred, leaving an enlarged, blurry reflection of bright light sources, with other objects being washed out so they aren’t noticeable. In Oolite, a simpler mathematical model called the [http://en.wikipedia.org/wiki/Blinn–Phong_shading_model Blinn-Phong shading model] is used.&amp;lt;br /&amp;gt;[http://www.youtube.com/watch?v=76jvMmV1ih0 This video] demonstrates the effects of specular lighting and specular mapping on the built-in scarred alloy model.&lt;br /&gt;
&lt;br /&gt;
== The material dictionary ==&lt;br /&gt;
The '''material dictionary''' is actually specified as two separate dictionaries in the ''shipdata.plist'' entry. The first is called ''materials'', the second ''shaders''. If [[Shaders in Oolite|shader support]] is available and enabled, the entries in ''shaders'' are used in preference to those in ''materials''. Otherwise, ''shaders'' is ignored. The entries in the two dictionaries take exactly the same form, however; it is possible to specify a shader in the ''materials'' dictionary, and it will simply be ignored if shader support is not available. The ''materials'' and ''shaders'' dictionaries, merged together, are known as a ''material dictionary''.&lt;br /&gt;
&lt;br /&gt;
=== Material specifiers ===&lt;br /&gt;
The material dictionary is a [[property list]] dictionary whose keys are ''material keys'' as defined below, and whose values are '''material specifiers''', which are either dictionaries or strings. When a string is used as a material specifier, it is equivalent to a dictionary with that string as the value for '''diffuse_map''', and no other properties. Currently-supported material specifier keys are listed here; “texture specifier” and similar are defined below.&lt;br /&gt;
&lt;br /&gt;
Most of these keys have no effect when a custom shader is in effect.&lt;br /&gt;
&lt;br /&gt;
When shaders are disabled or not available, emission and illumination maps are supported only if reduced detail is disabled and the graphics hardware supports multi-texturing. If '''emission_modulate_color''', '''illumination_map''', or '''emission_and_illumination_map''' are used, Oolite must combine them into a single emission map. It is generally preferable to do this in advance (by modulating the illumination map with the diffuse map and blending it additively with the emission map, after applying any colouring). This is more efficient when using shaders, too.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ General material attribues&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''ambient_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || The ambient colour of the entity, that is, the colour reflected evenly in all directions by starlight. If there is a '''diffuse_map''', the '''ambient_color''' is modulated by the '''diffuse_map'''. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''diffuse_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || Overall diffuse colour of the entity; that is, the colour reflected in a “non-shiny” way on the sunlit side of the entity. If there is a '''diffuse_map''', the '''diffuse_color''' is modulated by the '''diffuse_map'''. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''diffuse_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture specifying the basic colour of the material. This is a “normal” texture, the same as you get without a material dictionary. If not specified, the material key will be used. To specify no texture, use an empty string for '''diffuse_map'''. Ignored when using shaders.&lt;br /&gt;
|-&lt;br /&gt;
| '''emission_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || The emitted (glow) colour of the material. This is ignored when '''emission_map''' is in use (but see also: '''emission_modulate_color'''). Default: black (0.0, 0.0, 0.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''emission_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture specifying emission (glow) colours. This is blended additively with all other colour terms. If '''emission_modulate_color''' is specified, the emission map is modulated by the modulate colour. Emission maps are used when shaders are active, and without shaders on supported hardware.&lt;br /&gt;
|-&lt;br /&gt;
| '''emission_modulate_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || A colour with which to modulate the '''emission_map'''. If the emission map is in full colour, it is best to apply the colouring in advance using a graphics program. However, if the emission map is a single colour, using a greyscale emission map and a modulate colour will reduce memory usage by a factor of four when shaders are in use. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''emission_and_illumination_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture whose RGB channels act like '''emission_map''', and whose alpha channel acts like '''illumination_map''' (and can be coloured with '''illumination_modulate_color'''). This uses less memory (on systems with shaders) than using separate shaders, although blending the emission and illumination maps into a single emission map, as described above, is still preferable.&lt;br /&gt;
|-&lt;br /&gt;
| '''illumination_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture specifying local illumination colour, which is added to incoming light. It differs from an emission map in that it is modulated with the diffuse colour before being added to the final colour. See example below.&lt;br /&gt;
|-&lt;br /&gt;
| '''illumination_modulate_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || A colour with which to modulate the '''illumination_map'''. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''normal_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture modifying [[#Important concepts|normals]]. The red, green and blue channels are the x, y and z coordinates of normals relative to the underlying normal (“[http://en.wikipedia.org/wiki/Normal_mapping tangent-space normal mapping]”), and the alpha channel is ingored. This is only used when shaders are active and no custom shader is used.&lt;br /&gt;
|-&lt;br /&gt;
| '''normal_and_parallax_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || Like '''normal_map''', except that the alpha channel is includes a depth value used to add [http://en.wikipedia.org/wiki/Parallax_mapping simulated perspective]. If specified, '''normal_map''' is ignored.&lt;br /&gt;
|-&lt;br /&gt;
| '''parallax_bias''' || number || A value added to the parallax component of '''normal_and_parallax_map''', after multiplying by '''parallax_scale''' (default: 0).&lt;br /&gt;
|-&lt;br /&gt;
| '''parallax_scale''' || number || A scale factor for the parallax component of '''normal_and_parallax_map''' (default: 0.01). This value is the depth of the parallax map relative to the size of the texture. For instance, a value of 0.01 on a texture 100 metres wide will produce a maximum indentation of 1 metre. High parallax_scale values tend to lead to unacceptable texture distortion and “creeping” artefacts.&lt;br /&gt;
|-&lt;br /&gt;
| '''specular_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || The colour to use for specular reflection over the entire model when '''specular_map''' is not used. The specular term is added to the diffuse term; for less intense specular highlights, use a darker colour. Default: black (0.0, 0.0, 0.0, 1.0) if '''shininess''' is zero, (0.2, 0.2, 0.2, 1.0) otherwise. &lt;br /&gt;
|-&lt;br /&gt;
| '''specular_map''' || [[#Texture specifiers|texture&amp;amp;nbsp;specifier]] || A texture specifying the specular highlight colour in its red, green and blue channels, and '''shininess''' in its alpha channel. 1 (fully opaque) means the value of '''shininess''' is used. 0 means a very low shininess is used. This is only used when shaders are active and no custom shader is used.&lt;br /&gt;
|-&lt;br /&gt;
| '''specular_modulate_color''' || [[#Colour specifiers|colour&amp;amp;nbsp;specifier]] || A colour with which to modulate the '''specular_map'''. Default: white (1.0, 1.0, 1.0, 1.0).&lt;br /&gt;
|-&lt;br /&gt;
| '''shininess'''  || integer || The “tightness” of specular reflection, ranging from 0 to 128. 0 means no specular highlight. 128 is maximally shiny. Default: 128 if '''specular_map''' is used, 10 otherwise. '''Limitation:''' to use different shininess values with '''specular_map''' or '''specular_color''', you must either use the default or use different “shaders” and “materials” dictionaries. This should be fixed for 1.75.&lt;br /&gt;
|-&lt;br /&gt;
| '''vertex_shader''' || file&amp;amp;nbsp;name || name of GLSL vertex program to use.&lt;br /&gt;
|-&lt;br /&gt;
| '''fragment_shader''' || file&amp;amp;nbsp;name || name of GLSL fragment program to use.&lt;br /&gt;
|-&lt;br /&gt;
| '''textures''' || array&amp;amp;nbsp;of&amp;amp;nbsp;[[#Texture specifiers|texture&amp;amp;nbsp;specifier]]s || Textures to use in shader program.&lt;br /&gt;
|-&lt;br /&gt;
| '''uniforms''' || dictionary of uniform&amp;amp;nbsp;variable&amp;amp;nbsp;specifiers || uniform variables to use in shader program.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Illumination mapping vs. emission mapping ====&lt;br /&gt;
This image demonstrates the distinction between illumination mapping (top row) and emission mapping (bottom row).&lt;br /&gt;
&lt;br /&gt;
[[Image:Emission-vs-illumination.png]]&lt;br /&gt;
&lt;br /&gt;
=== Colour specifiers ===&lt;br /&gt;
'''Colour specifiers''' are used to declare colours in material attribute dictionaries, and in other contexts such as lasers in ''[[shipdata.plist]]''. Colour specifiers take any of several forms:&lt;br /&gt;
&lt;br /&gt;
==== Named colours ====&lt;br /&gt;
The simplest form of colour specifier is a string containing a colour name. The following names are supported:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Colour names&lt;br /&gt;
! Name !! RGBA value&lt;br /&gt;
|-&lt;br /&gt;
|  blackColor || 0, 0, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| darkGrayColor || 1/3, 1/3, 1/3, 1&lt;br /&gt;
|-&lt;br /&gt;
| lightGrayColor || 2/3, 2/3, 2/3, 1&lt;br /&gt;
|-&lt;br /&gt;
| whiteColor || 1, 1, 1, 1&lt;br /&gt;
|-&lt;br /&gt;
| grayColor || 1/2, 1/2, 1/2, 1&lt;br /&gt;
|-&lt;br /&gt;
| redColor || 1, 0, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| greenColor || 0, 1, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| blueColor || 0, 0, 1, 1&lt;br /&gt;
|-&lt;br /&gt;
| cyanColor || 0, 1, 1, 1&lt;br /&gt;
|-&lt;br /&gt;
| yellowColor || 1, 1, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| magentaColor || 1, 0, 1, 1&lt;br /&gt;
|-&lt;br /&gt;
|  orangeColor || 1, 1/2, 0, 1&lt;br /&gt;
|-&lt;br /&gt;
| purpleColor || 1/2, 0, 1/2, 1&lt;br /&gt;
|-&lt;br /&gt;
| brownColor || 0.6, 0.4, 0.2, 1&lt;br /&gt;
|-&lt;br /&gt;
| clearColor || 0, 0, 0, 0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== RGBA tuples ====&lt;br /&gt;
Colours may also be specified in RGB or RGBA (red, green, blue, alpha [transparency]). RGB or RGBA tuples may be specified as arrays or as strings separated by spaces. The values may range from 0 to 1 or 0 to 255. (If no value is greater than 1, 0–1 is assumed, otherwise 0–255.) Examples:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;1 1 0&amp;quot;&amp;lt;/code&amp;gt; — yellow&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;0 128 0 128&amp;quot;&amp;lt;/code&amp;gt; — medium green at 50% opacity&lt;br /&gt;
* &amp;lt;code&amp;gt;(1, 0, 0)&amp;lt;/code&amp;gt; – red&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== RGBA dictionaries ====&lt;br /&gt;
Just in case you’re unsure of the order the RGB[A] components come in, you can use a dictionary:&lt;br /&gt;
 {&lt;br /&gt;
    blue = 0.8;&lt;br /&gt;
    green = 0.8;&lt;br /&gt;
 }&lt;br /&gt;
Accepted keys are '''red''', '''green''', '''blue''' and '''alpha''' (or '''opacity'''), all optional (default: 0.0 for red, green and blue, 1.0 for alpha).&lt;br /&gt;
&lt;br /&gt;
==== HSBA dictionaries ====&lt;br /&gt;
But wait, there’s more! Colours may also be specified as dictionaries in the [http://en.wikipedia.org/wiki/HSB_colour_space HSB colour space]. Accepted keys are '''hue''' (hue angle in degrees, required), '''saturation''', '''brightness''' (or '''value''') and '''alpha''' (or '''opacity'''). The default for the optional keys is 1.0.&lt;br /&gt;
 {&lt;br /&gt;
    // Pale magenta&lt;br /&gt;
    hue = 300;&lt;br /&gt;
    saturation = 0.3;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Texture specifiers ===&lt;br /&gt;
'''Texture specifiers''' are used to, er, specify textures. The simplest form of texture specifier is a string: &amp;lt;code&amp;gt;&amp;quot;ahruman-example-texture.png&amp;quot;&amp;lt;/code&amp;gt;. The very simplest texture specifier is the empty string, &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt;, meaning no texture. More complex texture specifiers are dictionaries, which can be used to specify a number of texture options.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Texture specifier attributes&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''anisotropy''' || real || The degree of [http://en.wikipedia.org/wiki/Anisotropic_filtering anisotropic filtering] to use. Anisotropic filtering is used to reduce blurriness of MIP mapped textures shown at an angle (and thus only applies to textures whose '''min_filter''' is '''mipmap''' or '''default'''). The '''anisotropy''' setting is multiplied by the maximum anisotropy level specified by the system, and anisotropic filtering is used only if the result is greater than 1. (For example, on a GeForce FX 5200 card, the maximum level is 8, so an anisotropy value of 0.5 means an effective anisotropic filtering strength of 4. The precise meaning of this number is hardware-dependant. Fun, eh?) Anisotropic filtering is disabled in Reduced Detail mode and is not available on all hardware. Default: 0.5.&lt;br /&gt;
|-&lt;br /&gt;
| '''cube_map''' || boolean || If this is true, and the texture file is six times as high as it is wide, the texture will be treated as a cube map. If cube maps are not supported, it will be converted to a latitude/longitude map; if used as a diffuse map or emission/illumination map, you must ensure the model has appropriate texture coordinates. Note that cube maps are always available if shaders are supported, so custom shaders do not need to worry about this.&lt;br /&gt;
&lt;br /&gt;
'''cube_map''' is always true for planet textures. To convert textures to and from cube maps, see [[planettool]].&lt;br /&gt;
|-&lt;br /&gt;
| '''extract_channel''' || string || Indicates that one of the channels of the texture should be extracted into a new greyscale texture. Allowed values: '''r''', '''g''', '''b''' and '''a'''.&lt;br /&gt;
&lt;br /&gt;
This obviously involves extra work for Oolite, which is always a bad thing, but it makes it possible to combine multiple effect maps in a single texture for shaders and then extract channels for use as emission or illumination maps without shipping a redundant texture. If this means nothing to you, you probably don’t want to use '''extract_channel'''.&lt;br /&gt;
|-&lt;br /&gt;
| '''mag_filter''' || string || Specifies how to scale up the texture when it is near the camera. Either of:&lt;br /&gt;
* '''nearest''' (use nearest-neighbour sampling, which produces a pixellated effect)&lt;br /&gt;
* '''linear''' (use linear interpolation, which produces a blurry effect).&lt;br /&gt;
Default: '''linear'''.&lt;br /&gt;
|-&lt;br /&gt;
| '''min_filter''' || string || Specifies how to scale down the texture when it is far from the camera. One of:&lt;br /&gt;
* '''nearest''': nearest-neighbour sampling; generally very ugly, but sometimes useful for shaders using textures for special purposes.&lt;br /&gt;
* '''linear''': efficient, but rather ugly for textures with significant contrast or details.&lt;br /&gt;
* '''mipmap''': use trilinear MIP map filtering to improve scaling quality; generally also fast and least ugly, but uses 1/3 more memory, potentially slowing down systems with limited RAM or video memory.&lt;br /&gt;
* '''default''': '''linear''' in reduced detail mode, otherwise '''mipmap'''.&lt;br /&gt;
Default: '''default'''.&lt;br /&gt;
|-&lt;br /&gt;
| '''name''' || string || The file name of the texture to use. Must be a PNG image, in the Textures folder of Oolite or an OXP. In the specific case of '''diffuse_map''' textures, '''name''' is implicitly the same as the material key; to use no texture, you must specify &amp;lt;code&amp;gt;diffuse_map = &amp;quot;&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| '''no_shrink''' || boolean || Indicates that Oolite should not scale the texture down, except to meet hardware requirements. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''repeat_s''' || boolean || Whether Oolite should repeat the texture in the ''s'' (or ''u'') co-ordinate, rather than clamping it. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''repeat_t''' || boolean || Whether Oolite should repeat the texture in the ''t'' (or ''v'') co-ordinate, rather than clamping it. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''texture_LOD_bias''' || real || tweak factor for MIP mapping (which does not apply to other '''min_filter''' modes). MIP mapping involves a trade-off between scaling artefacts and blurriness; the LOD (level of detail) bias affects this. Positive values mean more blur, negative ones mean more artefacts. The default value is −0.25 (mostly so people won’t say “hey, why is everything blurrier in the new Oolite?”). Texture LOD bias is not available on all hardware.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Uniform specifiers ===&lt;br /&gt;
:''Main article: [[Shaders in Oolite: uniforms]]''&lt;br /&gt;
A ''uniform specifier'' is used to specify game information to pass to a [[Shaders in Oolite|shader program]]. As with [[#Texture specifiers|texture specifiers]], the simple case is a string, which is treated as &amp;lt;code&amp;gt;{ binding = &amp;quot;the string&amp;quot; }&amp;lt;/code&amp;gt;. For instance, uHullHeatLevel = hullHeatLevel&amp;lt;/code&amp;gt; will bind a shader’s &amp;lt;code&amp;gt;uHullHeatLevel&amp;lt;/code&amp;gt; uniform to a ship’s &amp;lt;code&amp;gt;hullHeatLevel&amp;lt;/code&amp;gt; property. Additional properties can be specified in a dictionary.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|+ Texture specifier attributes&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| '''asMatrix''' || boolean || For a '''binding''' uniform whose bound property is of type ''quaternion'', setting '''asMatrix''' to true causes the value to be converted to a rotation matrix. If '''asMatrix''' is false, the quaternion will be converted to a vector, whose w, x, y and z values match those of the quaternion. For any other type of uniform, '''asMatrix''' is ignored. Default: true.&lt;br /&gt;
|-&lt;br /&gt;
| '''binding''' || string || The entity property to bind to, for a '''binding''' uniform. Ignored for other types of uniform.&lt;br /&gt;
|-&lt;br /&gt;
| '''clamped''' || boolean || For a '''binding''' uniform whose bound property is of type ''float'', setting '''clamped''' to true causes the value to be restricted to the range 0 to 1, inclusive. For a binding of type ''int'', causes the value to be set to either 0 or 1; 1 indicates that the underlying property has any value other than 0. For any other type of uniform, '''clamped''' is ignored. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''normalized''' || boolean || For a '''binding''' uniform whose bound property is of type ''vector'', setting '''normalized''' to true causes the value to be normalized, that is, scaled to a length of 1. For any other type of uniform, '''normalized''' is ignored. The spelling '''normalised''' is also accepted. Default: false.&lt;br /&gt;
|-&lt;br /&gt;
| '''type''' || string || One of:&lt;br /&gt;
* '''binding''': indicates that the '''binding''' property specifies an entity property to be set dynamically each time the shader is used.&lt;br /&gt;
* '''float''' or '''real''': indicates that the '''value''' property is an floating-point number.&lt;br /&gt;
* '''int''' or '''integer''': indicates that the '''value''' property is an integer, or whole number.&lt;br /&gt;
* '''texture''': indicates that the '''value''' property is an integer specifying a texture unit, that is, an index in the '''textures''' array.&lt;br /&gt;
Default: '''float'''.&lt;br /&gt;
|-&lt;br /&gt;
| '''value''' || number || The value to use for a '''float''', '''int''' or '''texture''' uniform. Ignored for '''binding''' uniforms.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Material dictionary example ===&lt;br /&gt;
Here is an example from the [[Material Test Suite OXP]]:&lt;br /&gt;
 materials =&lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;cube-face&amp;quot; =&lt;br /&gt;
     {&lt;br /&gt;
         diffuse_map = &amp;quot;oolite_shader_test_suite_7_diffuse.png&amp;quot;;&lt;br /&gt;
         emission_and_illumination_map = &amp;quot;oolite_shader_test_suite_emission_and_illumination.png&amp;quot;;&lt;br /&gt;
         emission_modulate_color = (160, 255, 160);&lt;br /&gt;
         illumination_modulate_color = (180, 180, 200);&lt;br /&gt;
     };&lt;br /&gt;
 };&lt;br /&gt;
Here, the “cube-face” material is assigned the diffuse texture “oolite_shader_test_suite_7_diffuse.png” and a combined emission and illumination map (which is a greyscale+alpha texture). The emission and illumination components are then given coloured tints (slightly green and slightly blue, respectively), producing this:&lt;br /&gt;
&lt;br /&gt;
[[File:Oolite Material Test Suite 7.png|320px]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Material Test Suite OXP]] — demonstrates most material properties.&lt;br /&gt;
&lt;br /&gt;
[[Category: Oolite]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=28417</id>
		<title>Debug OXP</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Debug_OXP&amp;diff=28417"/>
		<updated>2011-07-10T18:36:05Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Debug.oxp''' is a special OXP that enables JavaScript console support in test releases of Oolite (1.70 and later). It also adds a menu with various debug facilities under Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
[http://jens.ayton.se/oolite/files/debug-oxp-1.75-3.zip Debug OXP for Oolite 1.75.3]&lt;br /&gt;
&lt;br /&gt;
== External JavaScript console support ==&lt;br /&gt;
On all platforms, installing Debug.oxp enables support for external console applications using the [[Oolite debug console TCP protocol]]. By default, it will attempt to connect to a console running on the same computer, but this can be changed by specifying a different &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; (and, optionally, &amp;lt;code&amp;gt;console-port&amp;lt;/code&amp;gt;) in ''debugConfig.plist''. For external console support on the same computer under Mac OS X, &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; must be explicitly set to “127.0.0.1”; if this is not done, the [[#Integrated JavaScript console|integrated JavaScript console]] will be used instead. For information on using a console (integrated or external), see [[#Using the JavaScript console|Using the JavaScript console]] below.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' A cross-platform, python based, external console application is available in the [http://developer.berlios.de/project/showfiles.php?group_id=3577 Berlios Oolite files] area.&lt;br /&gt;
&lt;br /&gt;
It contains a precompiled console for windows based computers, and the original python based console for Linux and Posix compliant computers.&lt;br /&gt;
&lt;br /&gt;
On Debian or Ubuntu Linux you will need python 2.6.x installed and (at least) the packages &amp;lt;code&amp;gt;blt python-tk tk8.5&amp;lt;/code&amp;gt; (or the equivalents in other distros.)&lt;br /&gt;
&lt;br /&gt;
== Mac OS X-specific features ==&lt;br /&gt;
Under Mac OS X, the Debug OXP provides a menu with various debugging options and an integrated JavaScript console, as well as enabling external console support as on all platforms.&lt;br /&gt;
&lt;br /&gt;
=== Debug menu ===&lt;br /&gt;
[[Image:Oolite-debug-menu.png|494px]]&lt;br /&gt;
&lt;br /&gt;
The Debug menu provides options to&lt;br /&gt;
* Show the Oolite run log in the standard Console application.&lt;br /&gt;
* Enable or disable various classes of log message at runtime (like editing ''logcontrol.plist'', without the need to restart Oolite).&lt;br /&gt;
* Enable various testing features, such as drawing of bounding boxes.&lt;br /&gt;
* Show the JavaScript console, and specify when it should be shown automatically. (This may not have any effect with external consoles, depending on the external console implementation.)&lt;br /&gt;
* Create a ship of any role near the main station (equivalent to the &amp;lt;code&amp;gt;:spawn&amp;lt;/code&amp;gt; [[#Macros|macro]]).&lt;br /&gt;
Note: some of these features are implemented by sending JavaScript messages to the [[#The console script|console script]]. If the script has been modified, some features may not work properly.&lt;br /&gt;
&lt;br /&gt;
The Log Message Classes submenu can be modified by editing ''debugLogMessageClassesMenu.plist'', found inside the OXP. This is merged from Config directories in the usual fashion.&lt;br /&gt;
&lt;br /&gt;
=== Integrated JavaScript console ===&lt;br /&gt;
[[Image:Oolite debug protocol example 1.png|594px]]&lt;br /&gt;
&lt;br /&gt;
The integrated JavaScript console provides a window within Oolite which acts as a [[#Using the JavaScript console|JavaScript console]]. It can be shown using the Show JavaScript Console command in the Debug menu, unless external console mode has been enabled by setting &amp;lt;code&amp;gt;console-host&amp;lt;/code&amp;gt; in ''debugConfig.plist''.&lt;br /&gt;
&lt;br /&gt;
The integrated console has a 100-line memory. To see previous commands, press ⇞ (Page Up) or ⌥↑ (Option-Up Arrow). You can go the other way in the obvious manner.&lt;br /&gt;
&lt;br /&gt;
== Using the JavaScript console ==&lt;br /&gt;
The JavaScript console, whether integrated or external, provides a powerful mechanism for interactively manipulating the game world. It can be used to issue simple commands, like &amp;lt;code&amp;gt;player.awardEquipment(&amp;quot;EQ_FUEL_INJECTION&amp;quot;)&amp;lt;/code&amp;gt;. It can be used to inspect properties of entities in the game world. And it can be used to develop scripts, by rewriting and testing methods of live ship scripts and world scripts.&lt;br /&gt;
&lt;br /&gt;
=== Macros ===&lt;br /&gt;
Macros are a special type of command prefixed with a colon. Instead of being interpreted as a JavaScript command, a macro is looked up in a dictionary, and the result is used as the “real” command. For instance, if you enter the command &amp;lt;code&amp;gt;:listM&amp;lt;/code&amp;gt; (short for “list macros”), the macro dictionary is queried for the string “listM”, and (by default) the code &amp;lt;code&amp;gt;for (let prop in macros) { ConsoleMessage('macro-list', ':' + prop) }&amp;lt;/code&amp;gt; is found and executed. This code is called the ''expansion'' of the macro. The result is a list of macros being printed:&lt;br /&gt;
 :clr&lt;br /&gt;
 :clear&lt;br /&gt;
 :spawn&lt;br /&gt;
 :bgColor&lt;br /&gt;
 :showM&lt;br /&gt;
 :rmFgColor&lt;br /&gt;
 ::&lt;br /&gt;
 :d&lt;br /&gt;
 :ds&lt;br /&gt;
 :listM&lt;br /&gt;
 :setM&lt;br /&gt;
 :delM&lt;br /&gt;
 :fgColor&lt;br /&gt;
 :rmBgColor&lt;br /&gt;
 :resetM&lt;br /&gt;
&lt;br /&gt;
As you can see in the example, To see the expansion of a macro without executing it, use &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt;:&lt;br /&gt;
 &amp;gt; :showM :delM&lt;br /&gt;
 :delM = deleteMacro(PARAM)&lt;br /&gt;
&lt;br /&gt;
When a macro with the word &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is executed, &amp;lt;code&amp;gt;PARAM&amp;lt;/code&amp;gt; is replaced with any text following the macro name, surrounded in quotation marks. This is how &amp;lt;code&amp;gt;:showM&amp;lt;/code&amp;gt; functions, for example; the string “:showM :delM” is expanded to “showMacro(&amp;quot;:delM&amp;quot;)”, causing the JavaScript function &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt;, which is part of the [[#The console script|console script]], to be called. You can see the implementation of &amp;lt;code&amp;gt;showMacro()&amp;lt;/code&amp;gt; by entering &amp;lt;code&amp;gt;showMacro&amp;lt;/code&amp;gt; – without any parentheses – into the console.&lt;br /&gt;
&lt;br /&gt;
An initial set of macros is loaded from ''debugConfig.plist''. If you edit any macros, using &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;:delM&amp;lt;/code&amp;gt;, all macros are saved in Oolite’s preferences from that point forwards. This means that you don’t have to re-enter any macros you write with &amp;lt;code&amp;gt;:setM&amp;lt;/code&amp;gt; after restarting Oolite.&lt;br /&gt;
&lt;br /&gt;
The following example creates a simple :msg macro:&lt;br /&gt;
 &amp;gt; :setM msg ConsoleMessage(' ',PARAM)&lt;br /&gt;
If you then type:&lt;br /&gt;
 &amp;gt; :msg Hello World&lt;br /&gt;
The macro will be expanded, and you'll see “Hello World” on the console. However, macros are not functions, so you cannot use macros in the middle of javascript, or as part of another macro.&lt;br /&gt;
&lt;br /&gt;
=== The console script ===&lt;br /&gt;
While an external or integrated console is required to provide a means of user interaction, most of the actual behaviour of the console is implemented in JavaScript, in a script called ''oolite-debug-console.js''. Input typed into the console is passed to the console script, which then generates output. The console script is also informed of log messages and JavaScript errors, and provides a global function, &amp;lt;code&amp;gt;ConsoleMessage(colorCode: String, message: String)&amp;lt;/code&amp;gt;, to write messages to the console using its background colour support. Lastly, the console script implements the entire macro system.&lt;br /&gt;
&lt;br /&gt;
This means that the console’s behaviour can be extensively customized, for instance, by replacing the macro system with something more powerful. There are two basic approaches to doing this:&lt;br /&gt;
* Creating a custom script (or a copy) with the same name, in an OXP which loads later than Debug.oxp (e.g., one which has a name which comes later in alphabetical order).&lt;br /&gt;
* Using a normal world script, and changing the console script object at startup.&lt;br /&gt;
The latter approach has the advantage that it can continue to work with future versions of the console script, and multiple patches can coexist. For example, a modification to supplement the macro system with a better one might look as follows:&lt;br /&gt;
 this.name = &amp;quot;my-super-console-macros&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 this.startUp = function()&lt;br /&gt;
 {&lt;br /&gt;
     // Ensure debug console is installed&lt;br /&gt;
     if (!debugConsole)  return&lt;br /&gt;
     &lt;br /&gt;
     // Save original implementation of consolePerformJSCommand&lt;br /&gt;
     // Note the prefix, used to ensure uniqueness. If several scripts patch&lt;br /&gt;
     // the same method, it's important that they use different names.&lt;br /&gt;
     debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand = debugConsole.consolePerformJSCommand&lt;br /&gt;
     &lt;br /&gt;
     // Replace debugConsole.consolePerformJSCommand with custom function&lt;br /&gt;
     debugConsole.consolePerformJSCommand = function(command)&lt;br /&gt;
     {&lt;br /&gt;
         // Note that in this function &amp;quot;this&amp;quot; will refer to debugconsole, not&lt;br /&gt;
         // my-super-console-macros, since the function will be called as a&lt;br /&gt;
         // method of debugConsole.&lt;br /&gt;
         &lt;br /&gt;
         // Strip leading spaces, same code as original function.&lt;br /&gt;
         while (command.charAt(0) == &amp;quot; &amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             command = command.substring(1)&lt;br /&gt;
         }&lt;br /&gt;
         &lt;br /&gt;
         if (command.charAt(0) == &amp;quot;!&amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
             // Super macro call detected.&lt;br /&gt;
             // Insert super macro system here.&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
             // Otherwise, call through to original method.&lt;br /&gt;
             debugConsole.mySuperConsoleMacros_original_consolePerformJSCommand(command)&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
This same patching technique, incidentally, can be used to modify scripts at runtime, either from the console or from other scripts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{misc-OXP}}&lt;br /&gt;
[[Category:Oolite utilities]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Misjump_Analyzer&amp;diff=27985</id>
		<title>Misjump Analyzer</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Misjump_Analyzer&amp;diff=27985"/>
		<updated>2011-05-29T13:57:51Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Redirected page to Misjump Analyser&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Misjump Analyser]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Missile_Analyzer&amp;diff=27984</id>
		<title>Missile Analyzer</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Missile_Analyzer&amp;diff=27984"/>
		<updated>2011-05-29T13:56:49Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Redirected page to Missile Analyser&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Missile Analyser]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=File:Oolite-logo2.png&amp;diff=27584</id>
		<title>File:Oolite-logo2.png</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=File:Oolite-logo2.png&amp;diff=27584"/>
		<updated>2011-05-07T13:03:36Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Former [[Oolite]] icon (versions 1.74 and earlier).&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=File:Oolite-logo2.png&amp;diff=27583</id>
		<title>File:Oolite-logo2.png</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=File:Oolite-logo2.png&amp;diff=27583"/>
		<updated>2011-05-07T13:03:24Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Former Oolite icon (versions 1.74 and earlier).&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Category:Oolite_Ship_Lists&amp;diff=27582</id>
		<title>Category:Oolite Ship Lists</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Category:Oolite_Ship_Lists&amp;diff=27582"/>
		<updated>2011-05-07T13:02:51Z</updated>

		<summary type="html">&lt;p&gt;Ahruman: Updated icon.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the category for articles related to [[Oolite Ships|ship]] lists in the game Oolite. For information on the game, see the game’s page, [[Oolite]].&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:oolite-logo3.png|196px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite ships| Oolite Ship Lists]]&lt;br /&gt;
[[Category:Oolite| Oolite Ship Lists]]&lt;/div&gt;</summary>
		<author><name>Ahruman</name></author>
		
	</entry>
</feed>