<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alioth.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Massively+Locked</id>
	<title>Elite Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alioth.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Massively+Locked"/>
	<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php/Special:Contributions/Massively_Locked"/>
	<updated>2026-05-07T04:43:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.06.oxz&amp;diff=77724</id>
		<title>File:LitF+v0.06.oxz</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.06.oxz&amp;diff=77724"/>
		<updated>2022-12-15T18:30:33Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: dev ver 0.06&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
dev ver 0.06&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=User_talk:Massively_Locked&amp;diff=77330</id>
		<title>User talk:Massively Locked</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=User_talk:Massively_Locked&amp;diff=77330"/>
		<updated>2022-11-29T22:41:06Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* The Programming Pages (General) */ reply&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&lt;br /&gt;
So this is a comment, huh?  Roomy.  I like it.&lt;br /&gt;
Can I get a hazelnut coffee?  Cream, no sugar.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
I wuz told to come here to tawk.  Why the hell is it so dark in here?&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;Stumbles around.  Stubs toe on a wiki&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Ouch!  Damn it!'''  People shouldn't leave ''wikis'' just lying around...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;Click&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Much better.  Wow- very roomy.  Let's see what I can fill this with...&lt;br /&gt;
==In the beginning...==&lt;br /&gt;
And so it begins.  But then that should go without saying considering the headline...&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Ahem...  To be, or...  Damn it- line?&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Thank you.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Requests ==&lt;br /&gt;
=== setShipInfoForKey ===&lt;br /&gt;
Just came across this:&lt;br /&gt;
[http://www.aegidian.org/bb/viewtopic.php?p=274534#p274534 setShipInfoForKey] which Tsoj added to Oolite v.1.91 many months ago. His discussion seems to start [http://www.aegidian.org/bb/viewtopic.php?p=274524#p274524 8 posts earlier]&lt;br /&gt;
&lt;br /&gt;
It's not yet on the wiki...&lt;br /&gt;
&lt;br /&gt;
:''Cholmondeley 19:56, 18 October 2022 (BST)''&lt;br /&gt;
&lt;br /&gt;
[[Oolite JavaScript Reference: Ship#setShipDataForKey|Just posted]].  Took me a little while to verify &amp;amp; play around with it.&lt;br /&gt;
&lt;br /&gt;
:[[User:Massively Locked|Massively Locked]] ([[User talk:Massively Locked|talk]]) 04:03, 19 October 2022 (BST)&lt;br /&gt;
&lt;br /&gt;
Thank You!&lt;br /&gt;
:''Cholmondeley 10:07, 19 October 2022 (BST)''&lt;br /&gt;
&lt;br /&gt;
=== Escorts ===&lt;br /&gt;
I added some gubbins to [[https://wiki.alioth.net/index.php?title=Escort_Instructions&amp;amp;action=history|Escort Instructions]] - my dumb pilot understanding of it is that the page purely deals with ships being protected by escorts, all of which are NPC's.&lt;br /&gt;
&lt;br /&gt;
I added some links to OXP's which allow the player to escort other ships.&lt;br /&gt;
&lt;br /&gt;
Can you please just run your eye over it to see that I didn't get the wrong end of the stick? Thank you!&lt;br /&gt;
&lt;br /&gt;
:''Cholmondeley 17:12, 20 October 2022 (BST)''&lt;br /&gt;
&lt;br /&gt;
OK- here's my suggestion:&lt;br /&gt;
&lt;br /&gt;
For the line: ''Only for ships added with the role 'trader'...''&lt;br /&gt;
&lt;br /&gt;
Change it to something like this: ''Prior to v1.79, for &amp;quot;mother&amp;quot; ships added with the role 'trader'...''&lt;br /&gt;
&lt;br /&gt;
After that sentence, add something like this: ''From v1.79 onwards, Oolite allows more flexibility in the type and number of ships escorting the &amp;quot;mother&amp;quot; ship.''&lt;br /&gt;
&lt;br /&gt;
The '''Escorting ''other'' ships''' section looks good and (to me, at least) is entirely appropriate!&lt;br /&gt;
:[[User:Massively Locked|Massively Locked]] ([[User talk:Massively Locked|talk]]) 18:22, 20 October 2022 (BST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== The Programming Pages (General) ==&lt;br /&gt;
Just to recap from our conversation last week, &lt;br /&gt;
&lt;br /&gt;
1) I feel that more examples are needed in our programming pages - as proved by your answer to [http://www.aegidian.org/bb/viewtopic.php?p=287634#p287634 Reval on checking ship equipment].&lt;br /&gt;
&lt;br /&gt;
2) I also feel that several worked examples of Javascript code, explaining &amp;quot;which bit of code is what&amp;quot; and commenting on the syntax (,_;==) would be of great use to us dumb pilots. Hence my bizarre pm with all the pictures of medieval commentaries! I'm not sure that one can do this on a wiki page...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, I stumbled across [http://www.aegidian.org/bb/viewtopic.php?f=2&amp;amp;t=2619 ''this''] which I've added here ([[The Dark Side]]) under &amp;quot;Understanding what really goes on&amp;quot;. I don't know if you might want to refer to it in your essay. This dumb pilot found it most informative. The fourth thing I have found informative (after your essay, Ahruman's essay and LittleBear's piece) was [http://www.aegidian.org/bb/viewtopic.php?p=278061#p278061 this conversation] with phkb.&lt;br /&gt;
&lt;br /&gt;
:''Cholmondeley 09:52, 29 November 2022 (UTC)''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Hence my bizarre pm with all the pictures of medieval commentaries!''&lt;br /&gt;
&lt;br /&gt;
:LOL!  Yes, that did leave me scratching my head.  &lt;br /&gt;
&lt;br /&gt;
''this conversation with phkb''&lt;br /&gt;
&lt;br /&gt;
:I just skimmed it, but it looks like a great thread.  I never saw it before- will have to give it a careful read-thru.&lt;br /&gt;
&lt;br /&gt;
We also talked about a guide to the JS reference pages.  Someone who's completely new to JS in general and Oolite JS in particular would probably get a migraine just blindly wading thru the pages.&lt;br /&gt;
&lt;br /&gt;
:[[User:Massively Locked|Massively Locked]] ([[User talk:Massively Locked|talk]]) 22:41, 29 November 2022 (UTC)&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.05.oxz&amp;diff=77329</id>
		<title>File:LitF+v0.05.oxz</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.05.oxz&amp;diff=77329"/>
		<updated>2022-11-29T21:58:19Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: dev ver 0.05&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
dev ver 0.05&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.04.oxz&amp;diff=77154</id>
		<title>File:LitF+v0.04.oxz</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.04.oxz&amp;diff=77154"/>
		<updated>2022-11-24T23:25:39Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: dev ver 0.04&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
dev ver 0.04&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=User_talk:Cholmondely&amp;diff=77025</id>
		<title>User talk:Cholmondely</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=User_talk:Cholmondely&amp;diff=77025"/>
		<updated>2022-11-19T20:31:52Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Comms */ added note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Cholmondeley Avatar.png|left]]&lt;br /&gt;
[[File:Nuitstations.jpg|thumb|right|320px|Nuit was built to allow external docking back in 2010, but the game does not yet allow that. If this could be sorted out, we could emulate more scifi scenarios in Oolite - such as the CJ Cherryh novels]]&lt;br /&gt;
[[File:Litf stationmap.png|thumb|right|320px|Life in the Frontier really helps bring the stations to life. But every station seems very similar - and has the identical map. I'd love to help develop this, but lack the skills]]&lt;br /&gt;
[[File:Sotl-hyperspace.png|thumb|right|320px|The SOTL Exploration scenario oxp rejigs the hyperspace/witchspace jumps so that they need skill to accomplish. As Cody has opined, it would be nice to add this to the game as a non-scenario oxp. It would also impact on trade and travel due to making the jumps much more dangerous (as in Cherryh's books, for example)]]&lt;br /&gt;
::::::::*The top half of this page contains my musings about the game.&lt;br /&gt;
::::::::*Then a short reminder for myself of projects needing more work&lt;br /&gt;
::::::::*The bottom half is a resource for wiki editors&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
== Musings about Oolite: What I would like to see changed ==&lt;br /&gt;
:''By in large I am extremely happy with Oolite the way that it is. While I find a number of &amp;quot;faults&amp;quot; in the Vanilla game these are almost all fixed by OXPs. My remaining issues are:''&lt;br /&gt;
* Oolite only offers '''2-dimensional''' F6 charts with exactly '''256''' systems in each (thanks to Pleb for working on this one). Ahruman started fixing the 2D thing [https://github.com/JensAyton/OoliteGalaxyExtruder back in 2011] - [http://aegidian.org/bb/viewtopic.php?p=191913#p191913 GG Shinobi's collection] of 3D possibilities for an F7F7 screen&lt;br /&gt;
* '''Pocket universes''': the inability to travel from one system to another without using a witchdrive jump&lt;br /&gt;
* Planet, sun &amp;amp; moon '''surfaces''' to show on the IFF scanner (Quirum Bombs show up, so why not planet surfaces?)&lt;br /&gt;
* The overly-simplified '''prices/economics''' system (thanks to Stranger &amp;amp; Phasted for helping improve things)&lt;br /&gt;
* The bizarre [[Distance (Oolite)|distance scales]] (thanks to Redspear for working on sorting this one out!)&lt;br /&gt;
* More '''NPC interaction''' (family, friends, Academy chums, engineers, lovers ''etc''.) &lt;br /&gt;
* More to do '''outside the ship''': [[Life in the Frontier]] starts addressing this, but has a long way to go!&lt;br /&gt;
* More realistic '''dockings'''/launches - including mooring ''outside'' the space stations on pylons (as [[Nuit Space Station OXP|Nuit]] theoretically offers on the lower struts)&lt;br /&gt;
* More '''control buttons''' for OXP equipment. For OXP equipment we just have Tab/0/N &amp;amp; ctrl-N to select the equipment; n &amp;amp; b to activate; and the four &amp;quot;controlled&amp;quot; colons to operate MFDs. Personally speaking, I really need another 2 equipment priming buttons and for Autolock &amp;amp; ILS to be made primable rather than automatic and suicidal. Thanks to Milo [http://www.aegidian.org/bb/viewtopic.php?f=6&amp;amp;t=20668 (see #13)] &amp;amp; Phkb for working on this one.&lt;br /&gt;
* The ability to add a second player helping run one's ship. See the discussion [http://www.aegidian.org/bb/viewtopic.php?p=274564#p274564 here] (uses for a second monitor) and [http://www.aegidian.org/bb/viewtopic.php?p=275198#p275198 here] (things to do en-route from Witchpoint to Station).&lt;br /&gt;
&lt;br /&gt;
== OXP's which ''really'' change the game ==&lt;br /&gt;
* Phkb's [[Hermitage]]. Phkb's [[Ship Configuration]]. Phkb's [[Smugglers]]. Phkb's [[Home System]]. Day's [[Diplomancy]]. Redspear's [[Weapon Laws]]. Norby's [[Telescope]]. The [[Strangers World]] suite.&lt;br /&gt;
&lt;br /&gt;
== OXP's needing work ==&lt;br /&gt;
Or - what I'd love to do if I had the skills...&lt;br /&gt;
=== Minor Tweaks ===&lt;br /&gt;
*MFD's which need tagging for HUDSelector so that they are remembered in the save files:&lt;br /&gt;
::[[Advanced System Data MFD]] (Strangers World)&lt;br /&gt;
::[[Station Dock Control]] MFD&lt;br /&gt;
::[[Ship's Library]] MFD&lt;br /&gt;
*[[Mining OXP]] - needs debugging (whizzing asteroids emitting sparks which are undockable with) - looks (to this dumb pilot) like a simple fix&lt;br /&gt;
&lt;br /&gt;
=== Major Tweaks ===&lt;br /&gt;
*[[Diplomancy]] needs sorting out: generates massively long lists of peace treaties between just two states... '''This oxp has a lot of potential''' - it would give depth to wars&lt;br /&gt;
*[[SW Economy]] mislabels mining worlds as agricultural and their markets are identical, the only difference being in quantities for sale. It would be super to see this sorted out.&lt;br /&gt;
*[[Real-Life Economics]] (prices move as you watch) is faulty - the dynamic price changes tend towards zero.&lt;br /&gt;
*'''Gsagostinho's station experiments''' [http://www.aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=18977 here]: unfinished - need texturing.&lt;br /&gt;
*[[Cloud City OXP]] - (for gas giant planets) - needs finishing &amp;amp; updated textures&lt;br /&gt;
&lt;br /&gt;
=== Lots of work ===&lt;br /&gt;
*[[Life in the Frontier]] (fleshes out stations) needs adding to to create more differences between the various stations. '''This oxp has a lot of potential'''&lt;br /&gt;
*[[Hotrods OXP]] - (gangs) there is only the one real &amp;quot;gang&amp;quot;. It would be super to see the others added and gang warfare between them. And a sensible link between the gangs and the vanilla pirates. Also needs new textures.&lt;br /&gt;
*[[Refugee Adder]] - (fleeing refugees) Murgh is hopefully still updating this (2022)&lt;br /&gt;
*[[Hathor Trade Station]] - beautiful! Just beautiful! But needs finishing (markets ''etc''.) &lt;br /&gt;
*[[Colonization]] - (hollow space station activity) needs texturing and a reason for its existence if the original activity is not created&lt;br /&gt;
*[[New Deal]] - (4-polar trade model) needs finishing&lt;br /&gt;
*[http://aegidian.org/bb/viewtopic.php?p=287021#p287021 Montana's Monumentally Murderous Modification] (War!) - he's hopefully still working on this (2022)&lt;br /&gt;
*[[Galactic Misjump OXP]]: needs inspiration (what might happen?) and coding&lt;br /&gt;
:'''Missions'''&lt;br /&gt;
*[[Amber Moon Chronicles]] - (aliens!) needs finishing&lt;br /&gt;
*Svengali's missions: [[Vector]] &amp;amp; [[Localhero OXP]] need updating, as does McLane's mission, [[Cataclysm OXP]]&lt;br /&gt;
*[[TheCollector|The Collector]] - needs more missions&lt;br /&gt;
&lt;br /&gt;
=== Done! ===&lt;br /&gt;
*[[Useful MFDs]] needed sorting out ([[Solar Wind Flux]] gauge was faulty, and the .oxp itself [http://www.aegidian.org/bb/viewtopic.php?p=280607#p280607 generates too much rubbish]).&lt;br /&gt;
:STOP PRESS: '''DONE!''' Thank you, Dybal!&lt;br /&gt;
*[[Strangers World]] moves the stations from Commies, Taxi Galactica, ''etc'' to bizarre locations. But not HIMSN's stations.&lt;br /&gt;
:STOP PRESS: '''DONE!''' Thank you, Alnivel!&lt;br /&gt;
*I'd dearly love to see the spiderweb jump sequence from [[BGS]] v.1.10.9 added in as an option to the newer BGS.&lt;br /&gt;
:STOP PRESS: '''DONE!''' Thank you, Tsoj!&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== For Me: List of my Wiki (WIP) pages under construction ==&lt;br /&gt;
*[[Immersion]]&lt;br /&gt;
*[[Realism]]&lt;br /&gt;
=== Other WIP pages ===&lt;br /&gt;
*[[Gameplay and Balance Indicator]]&lt;br /&gt;
*Various [[Ulite]] pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
= Cholly's Library of formatting bits &amp;amp; bobs =&lt;br /&gt;
&lt;br /&gt;
== Format for Table Of Contents ==&lt;br /&gt;
&lt;br /&gt;
If you have three or fewer headings but want to have a TOC, write either the magic word __FORCETOC__ anywhere on the page to make it display at the default location, or __TOC__ at the preferred position. &lt;br /&gt;
&lt;br /&gt;
Or use __NOTOC__ 	Hides the table of contents (TOC). &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for Broken-OXP banners ==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{Broken-OXP}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{{Broken-OXP|This OXP is deprecated and buggy, please use the [[Galactic Navy OXP]] instead if you are using a pre-!.82 version of Oolite}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{{OXPNote|This OXP does ''not'' work on AppleMacs: see BB Discussion below for possible tweaks}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for invisible comments ==&lt;br /&gt;
&amp;lt;!-- This is a comment --&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;!-- This is a comment --&amp;gt; &amp;lt;/nowiki&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Only visible when editing the page&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for footnotes ==&lt;br /&gt;
&lt;br /&gt;
The Sun is pretty big.&amp;lt;ref&amp;gt;E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23–25.&amp;lt;/ref&amp;gt; The Moon, however, is not so big.&amp;lt;ref&amp;gt;R. Smith, &amp;quot;Size of the Moon&amp;quot;, ''Scientific American'', 46 (April 1978): 44–46.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes on Footnotes ===&lt;br /&gt;
:I tried the &amp;lt;ref&amp;gt;, &amp;lt;/ref&amp;gt; &amp;amp; &amp;lt;references /&amp;gt; tags, but to no avail. None of them seem to do anything. According to Mediawiki, all this should work...&lt;br /&gt;
&lt;br /&gt;
:Footnoting is currently impossible as the necessary add-on for the wiki has not been loaded into it: ...There are no references on Wikipedia. The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tags don't work. Apparently the [https://www.mediawiki.org/wiki/Extension:Cite Cite Extension] has not been installed.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for Transclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--- Note that the next three commands include all the details of the ships via transclusion, i.e. by importing it from their own pages. ---&amp;gt;&lt;br /&gt;
{{:Asp-X}}{{:Cobra2}}{{:Sidewinder-X}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for Colours ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;Green&amp;quot;&amp;gt;Live long and prosper, and may the Great Bird of the Galaxy bless your planet!&amp;lt;/font&amp;gt;         [[User:Phoenix|&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;&amp;lt;sup&amp;gt;&amp;lt;/sup&amp;gt;           —THE PHOENIX &amp;lt;sup&amp;gt;&amp;lt;/sup&amp;gt;&amp;lt;/font&amp;gt;]]'''[[User_talk:Phoenix|{Talk to me!}]] 01:11, 21 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;Green&amp;quot;&amp;gt;      !       &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;        !       &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;'''     !       '''&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Yellow&amp;quot;&amp;gt;'''     !       '''&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Blue&amp;quot;&amp;gt;'''     !       '''&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Brown&amp;quot;&amp;gt;'''      !       '''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Format for Size ==&lt;br /&gt;
&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;4&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;4&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for different font ==&lt;br /&gt;
These three methods all make a difference: &amp;lt;br&amp;gt;&lt;br /&gt;
1) &amp;lt;tt&amp;gt;Different font!&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
2) {{CodeEx|codeex=This sort of thing seems only to have been used for programming code (2022 note)}} &amp;lt;br&amp;gt;&lt;br /&gt;
3) &amp;lt;br&amp;gt;&lt;br /&gt;
   This method (introducing one or more spaces at the beginning of the line) also has consequences for formatting.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Format for Equipment Infobox ==&lt;br /&gt;
&lt;br /&gt;
{{Infobox EquipStats Oolite| title = Wine Cooler OXP&lt;br /&gt;
|image = &lt;br /&gt;
|equipName =  Wine Cooler&lt;br /&gt;
|equipCost = 10₢&lt;br /&gt;
|equipTL = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Format for Collapsible whatnots ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;'''initial text'''&amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;  data-expandtext=&amp;quot;Show older&amp;quot; data-collapsetext=&amp;quot;Hide older&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;'''later text!'''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Lifted from Phkb's [[BroadcastComms MFD]] page&lt;br /&gt;
&lt;br /&gt;
== Format for Quotations ==&lt;br /&gt;
{{QuoteText|Text=&lt;br /&gt;
I don't really see the need for a timeline or a backstory. &amp;lt;br&amp;gt;&lt;br /&gt;
The way things are is just the way things are; I don't need to know where Earth is, or how human beings got from there (if they did) to where they are now. For me, a large part of the appeal of the game is its vagueness. It's as close to a blank slate as we can get, and it's built to be modded all over the shop to everyone's individual preferences. &amp;lt;br&amp;gt;&lt;br /&gt;
Too much backstory just gets in the way.&lt;br /&gt;
|Source=([http://aegidian.org/bb/viewtopic.php?p=273999#p273999 Disembodied])}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Sandbox ==&lt;br /&gt;
----&lt;br /&gt;
== Knotty's natty gallery ==&lt;br /&gt;
[[File:Screen_Shot_2012-11-04_at_21.22.16.png]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Screen_Shot_2012-11-04_at_21.19.59.png]]&lt;br /&gt;
[[File:Screen_Shot_2012-11-04_at_21.18.26.png]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Screen_Shot_2012-11-04_at_21.04.50.png]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Sandbox ==&lt;br /&gt;
&lt;br /&gt;
== Table for HUD page ==&lt;br /&gt;
&lt;br /&gt;
=== List of HUDs ===&lt;br /&gt;
1 Aad HUD&lt;br /&gt;
2 Another HUD&lt;br /&gt;
3 CB-HUD&lt;br /&gt;
4 ChupacabraHUD&lt;br /&gt;
5 Coluber HUD CH01&lt;br /&gt;
6 CombatHUD&lt;br /&gt;
7 Compact HUD&lt;br /&gt;
8 CRR-HUD&lt;br /&gt;
9 Dangerous HUD&lt;br /&gt;
10 DeeperSpace HUD&lt;br /&gt;
11 Deepspace HUD&lt;br /&gt;
12 Deepspace Retro HUD&lt;br /&gt;
13 Dr HUD&lt;br /&gt;
14 ExtraLarge HUD&lt;br /&gt;
15 Fighter HUD&lt;br /&gt;
16 G-HUD&lt;br /&gt;
17 Isis HUD&lt;br /&gt;
18 KeeperHUD&lt;br /&gt;
19 Klepto HUD&lt;br /&gt;
20 Large HUD&lt;br /&gt;
21 Medusa HUD&lt;br /&gt;
22 Mega Walnut Dash HUD&lt;br /&gt;
23 MilHUD 4000&lt;br /&gt;
24 MilHUD (Military Specification HUD)&lt;br /&gt;
25 MillHUD Refit&lt;br /&gt;
26 Mod HUD&lt;br /&gt;
27 Nova Lux HUD&lt;br /&gt;
28 Numeric Style HUDs&lt;br /&gt;
29 OrangED HUD&lt;br /&gt;
30 Pie Chart Style HUDs&lt;br /&gt;
31 Small HUD&lt;br /&gt;
32 Smart HUD&lt;br /&gt;
33 Sniper Camera System HUD&lt;br /&gt;
34 Steampunk HUD&lt;br /&gt;
35 SW (CAI/DAI) HUD&lt;br /&gt;
36 Trek HUD&lt;br /&gt;
37 Venom Cockpit HUD&lt;br /&gt;
38 Vimana HUD&lt;br /&gt;
39 Wide-Screen HUD&lt;br /&gt;
40 Wolfwood HUD&lt;br /&gt;
41 Xenon HUD&lt;br /&gt;
42 Yet Another HUD&lt;br /&gt;
43 Z-GrOovY MiLHUD&lt;br /&gt;
&lt;br /&gt;
=== Considerations ===&lt;br /&gt;
Date&lt;br /&gt;
Author&lt;br /&gt;
Actual speed shown?&lt;br /&gt;
Actual Torus speed shown?&lt;br /&gt;
Different HUDs for different green/yellow/red conditions/alerts?&lt;br /&gt;
Range of alerts shown&lt;br /&gt;
Docked HUD?&lt;br /&gt;
HUD Selector compatible?&lt;br /&gt;
# of MFDs?&lt;br /&gt;
Extras? (eg Vimana HUD's cornucopia of goodies, DeeperSpace's Risk Assessment, Xenon HUD's sights, Dangerous HUD's noises).&lt;br /&gt;
Precision Joystick Indicator?&lt;br /&gt;
Glare filter?&lt;br /&gt;
Glare contrast? (for reading HUD in Glare - cf Xenon HUD)&lt;br /&gt;
Current Location Display &amp;amp; Current Risk Notifier (Deeper Space HUD)&lt;br /&gt;
Distance from Compass target?&lt;br /&gt;
Weapons Bay Missile identifier? (ChupacabraHUD)&lt;br /&gt;
Extra reticles for other lasers (Xenon)&lt;br /&gt;
Choice of Colours? (Dangerous HUD &amp;amp; Xenon HUD)&lt;br /&gt;
Choice of Cockpits? (Dangerous HUD)&lt;br /&gt;
Natural materials? (Mega Walnut Dash)&lt;br /&gt;
&lt;br /&gt;
== Table ==&lt;br /&gt;
== Sortable Table ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border: 1px solid #cfcfbf; background-color: #f0f0ff; color: #000000; vertical-align: top; text-align: left;&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; bgcolor=&amp;quot;#e7e7ff&amp;quot;&lt;br /&gt;
! valign=&amp;quot;center&amp;quot; style=&amp;quot;width: 150px;&amp;quot;|[[Alphabetical Ship List (Oolite)|Ship]]&lt;br /&gt;
! style=&amp;quot;width: 100px;&amp;quot;|[[Fastest Ships (Oolite)|Max Speed]]&amp;lt;br&amp;gt;(LM)&lt;br /&gt;
! style=&amp;quot;width: 100px;&amp;quot;|[[Largest Ships (Oolite)|Cargo Capacity]]&amp;lt;br&amp;gt;(TC)&lt;br /&gt;
! style=&amp;quot;width: 100px;&amp;quot;|[[Expensive Ships (Oolite)|Base Cost]]&amp;lt;br&amp;gt;(CR)&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot; style=&amp;quot;width: 100px;&amp;quot;|OXP or Standard&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot; style=&amp;quot;width: 100px;&amp;quot;|Available to Player&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot; style=&amp;quot;width: 150px;&amp;quot;|Size&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(metres, W×H×L)&amp;lt;/small&amp;gt;&lt;br /&gt;
! style=&amp;quot;width: 150px;&amp;quot;|Cubic Meters&lt;br /&gt;
|-&lt;br /&gt;
|[[Firefly]]&lt;br /&gt;
|0.755&lt;br /&gt;
|35&lt;br /&gt;
|775k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|12 x 11 x 22&lt;br /&gt;
|2904&lt;br /&gt;
|- &lt;br /&gt;
|[[Dragster Mk II]]&lt;br /&gt;
|0.610&lt;br /&gt;
|0&lt;br /&gt;
|570k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|33 x 9 x 83&lt;br /&gt;
|24,651&lt;br /&gt;
|-&lt;br /&gt;
|[[Dragster Mk I]]&lt;br /&gt;
|0.601&lt;br /&gt;
|0&lt;br /&gt;
|560k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|33 x 9 x 83&lt;br /&gt;
|24,651&lt;br /&gt;
|- &lt;br /&gt;
|[[Constrictor (Oolite)|Constrictor]]&lt;br /&gt;
|0.60&lt;br /&gt;
|15&lt;br /&gt;
|N/A&lt;br /&gt;
|Standard&lt;br /&gt;
|No&lt;br /&gt;
|54 × 10 × 60&lt;br /&gt;
|32,400 &lt;br /&gt;
|-&lt;br /&gt;
|[[A-Wing]]&lt;br /&gt;
|0.60&lt;br /&gt;
|0&lt;br /&gt;
|570k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|79 × 48 × 122 &lt;br /&gt;
|462,624&lt;br /&gt;
|- &lt;br /&gt;
|[[Fer de Lance NG]]&lt;br /&gt;
|0.60&lt;br /&gt;
|2&lt;br /&gt;
|585k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|45 × 20 × 85&lt;br /&gt;
|76,500 &lt;br /&gt;
|-&lt;br /&gt;
|[[Generation_Ships_OXP|Generation Ship]]&lt;br /&gt;
|0.60&lt;br /&gt;
|0&lt;br /&gt;
|N/A&lt;br /&gt;
|OXP&lt;br /&gt;
|No&lt;br /&gt;
|6413 x 6416 x 30277&lt;br /&gt;
|1,245,771,628,816&lt;br /&gt;
|- &lt;br /&gt;
|[[Kestrel]]&lt;br /&gt;
|0.555&lt;br /&gt;
|8&lt;br /&gt;
|675k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|13 x 3 x 12&lt;br /&gt;
|468 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Future wiki work ==&lt;br /&gt;
=== New Region Page '''The Lizard's Claw''' ===&lt;br /&gt;
Need to sort out what on earth the &amp;quot;|XPosRel=13|YPosRel=61&amp;quot; is all about for the map!&lt;br /&gt;
:See [http://www.aegidian.org/bb/viewtopic.php?f=2&amp;amp;t=17175 Light year distance calculation] - especially Phantorgorth's key comment&lt;br /&gt;
&lt;br /&gt;
=== Add in Exposure/Gamma Correction for Oolite v.1.91/2 ==&lt;br /&gt;
When the details are added to the wiki, this needs to be linked to it:&lt;br /&gt;
:[http://oolite.aegidian.org/bb/viewtopic.php?p=284327#p284327 Link] with pretty pictures&lt;br /&gt;
&lt;br /&gt;
=== Add in limits of Oolite game ===&lt;br /&gt;
Somewhere on the BB is a thread with my list of 7 or so derived from Phkb's response and with an a_c comment&lt;br /&gt;
*[http://aegidian.org/bb/viewtopic.php?f=2&amp;amp;t=13152 Boarding abandoned ships?] 2012&lt;br /&gt;
&lt;br /&gt;
== Comms ==&lt;br /&gt;
&lt;br /&gt;
Hey- &lt;br /&gt;
&lt;br /&gt;
I have a problem.  I'm locked out of my BB account.  I tried changing my listed e-mail since it's no longer active.  That rendered my BB acct inactive (it sent a registration e-mail to my long-dead e-mail).  Could you check with Cody or someone to see if anything can be done?&lt;br /&gt;
&lt;br /&gt;
:::[[User:Massively Locked|Massively Locked]] ([[User talk:Massively Locked|talk]]) 16:40, 19 November 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BTW, feel free to delete this section.  This is a lovely page &amp;amp; I'd hate to spoil it because I tripped over my own shoelaces.&lt;br /&gt;
&lt;br /&gt;
:::[[User:Massively Locked|Massively Locked]] ([[User talk:Massively Locked|talk]]) 20:31, 19 November 2022 (UTC)&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=User_talk:Cholmondely&amp;diff=77021</id>
		<title>User talk:Cholmondely</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=User_talk:Cholmondely&amp;diff=77021"/>
		<updated>2022-11-19T16:40:05Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Comms */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Cholmondeley Avatar.png|left]]&lt;br /&gt;
[[File:Nuitstations.jpg|thumb|right|320px|Nuit was built to allow external docking back in 2010, but the game does not yet allow that. If this could be sorted out, we could emulate more scifi scenarios in Oolite - such as the CJ Cherryh novels]]&lt;br /&gt;
[[File:Litf stationmap.png|thumb|right|320px|Life in the Frontier really helps bring the stations to life. But every station seems very similar - and has the identical map. I'd love to help develop this, but lack the skills]]&lt;br /&gt;
[[File:Sotl-hyperspace.png|thumb|right|320px|The SOTL Exploration scenario oxp rejigs the hyperspace/witchspace jumps so that they need skill to accomplish. As Cody has opined, it would be nice to add this to the game as a non-scenario oxp. It would also impact on trade and travel due to making the jumps much more dangerous (as in Cherryh's books, for example)]]&lt;br /&gt;
::::::::*The top half of this page contains my musings about the game.&lt;br /&gt;
::::::::*Then a short reminder for myself of projects needing more work&lt;br /&gt;
::::::::*The bottom half is a resource for wiki editors&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
== Musings about Oolite: What I would like to see changed ==&lt;br /&gt;
:''By in large I am extremely happy with Oolite the way that it is. While I find a number of &amp;quot;faults&amp;quot; in the Vanilla game these are almost all fixed by OXPs. My remaining issues are:''&lt;br /&gt;
* Oolite only offers '''2-dimensional''' F6 charts with exactly '''256''' systems in each (thanks to Pleb for working on this one). Ahruman started fixing the 2D thing [https://github.com/JensAyton/OoliteGalaxyExtruder back in 2011] - [http://aegidian.org/bb/viewtopic.php?p=191913#p191913 GG Shinobi's collection] of 3D possibilities for an F7F7 screen&lt;br /&gt;
* '''Pocket universes''': the inability to travel from one system to another without using a witchdrive jump&lt;br /&gt;
* Planet, sun &amp;amp; moon '''surfaces''' to show on the IFF scanner (Quirum Bombs show up, so why not planet surfaces?)&lt;br /&gt;
* The overly-simplified '''prices/economics''' system (thanks to Stranger &amp;amp; Phasted for helping improve things)&lt;br /&gt;
* The bizarre [[Distance (Oolite)|distance scales]] (thanks to Redspear for working on sorting this one out!)&lt;br /&gt;
* More '''NPC interaction''' (family, friends, Academy chums, engineers, lovers ''etc''.) &lt;br /&gt;
* More to do '''outside the ship''': [[Life in the Frontier]] starts addressing this, but has a long way to go!&lt;br /&gt;
* More realistic '''dockings'''/launches - including mooring ''outside'' the space stations on pylons (as [[Nuit Space Station OXP|Nuit]] theoretically offers on the lower struts)&lt;br /&gt;
* More '''control buttons''' for OXP equipment. For OXP equipment we just have Tab/0/N &amp;amp; ctrl-N to select the equipment; n &amp;amp; b to activate; and the four &amp;quot;controlled&amp;quot; colons to operate MFDs. Personally speaking, I really need another 2 equipment priming buttons and for Autolock &amp;amp; ILS to be made primable rather than automatic and suicidal. Thanks to Milo [http://www.aegidian.org/bb/viewtopic.php?f=6&amp;amp;t=20668 (see #13)] &amp;amp; Phkb for working on this one.&lt;br /&gt;
* The ability to add a second player helping run one's ship. See the discussion [http://www.aegidian.org/bb/viewtopic.php?p=274564#p274564 here] (uses for a second monitor) and [http://www.aegidian.org/bb/viewtopic.php?p=275198#p275198 here] (things to do en-route from Witchpoint to Station).&lt;br /&gt;
&lt;br /&gt;
== OXP's which ''really'' change the game ==&lt;br /&gt;
* Phkb's [[Hermitage]]. Phkb's [[Ship Configuration]]. Phkb's [[Smugglers]]. Phkb's [[Home System]]. Day's [[Diplomancy]]. Redspear's [[Weapon Laws]]. Norby's [[Telescope]]. The [[Strangers World]] suite.&lt;br /&gt;
&lt;br /&gt;
== OXP's needing work ==&lt;br /&gt;
Or - what I'd love to do if I had the skills...&lt;br /&gt;
=== Minor Tweaks ===&lt;br /&gt;
*MFD's which need tagging for HUDSelector so that they are remembered in the save files:&lt;br /&gt;
::[[Advanced System Data MFD]] (Strangers World)&lt;br /&gt;
::[[Station Dock Control]] MFD&lt;br /&gt;
::[[Ship's Library]] MFD&lt;br /&gt;
*[[Mining OXP]] - needs debugging (whizzing asteroids emitting sparks which are undockable with) - looks (to this dumb pilot) like a simple fix&lt;br /&gt;
&lt;br /&gt;
=== Major Tweaks ===&lt;br /&gt;
*[[Diplomancy]] needs sorting out: generates massively long lists of peace treaties between just two states... '''This oxp has a lot of potential''' - it would give depth to wars&lt;br /&gt;
*[[SW Economy]] mislabels mining worlds as agricultural and their markets are identical, the only difference being in quantities for sale. It would be super to see this sorted out.&lt;br /&gt;
*[[Real-Life Economics]] (prices move as you watch) is faulty - the dynamic price changes tend towards zero.&lt;br /&gt;
*'''Gsagostinho's station experiments''' [http://www.aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=18977 here]: unfinished - need texturing.&lt;br /&gt;
*[[Cloud City OXP]] - (for gas giant planets) - needs finishing &amp;amp; updated textures&lt;br /&gt;
&lt;br /&gt;
=== Lots of work ===&lt;br /&gt;
*[[Life in the Frontier]] (fleshes out stations) needs adding to to create more differences between the various stations. '''This oxp has a lot of potential'''&lt;br /&gt;
*[[Hotrods OXP]] - (gangs) there is only the one real &amp;quot;gang&amp;quot;. It would be super to see the others added and gang warfare between them. And a sensible link between the gangs and the vanilla pirates. Also needs new textures.&lt;br /&gt;
*[[Refugee Adder]] - (fleeing refugees) Murgh is hopefully still updating this (2022)&lt;br /&gt;
*[[Hathor Trade Station]] - beautiful! Just beautiful! But needs finishing (markets ''etc''.) &lt;br /&gt;
*[[Colonization]] - (hollow space station activity) needs texturing and a reason for its existence if the original activity is not created&lt;br /&gt;
*[[New Deal]] - (4-polar trade model) needs finishing&lt;br /&gt;
*[http://aegidian.org/bb/viewtopic.php?p=287021#p287021 Montana's Monumentally Murderous Modification] (War!) - he's hopefully still working on this (2022)&lt;br /&gt;
*[[Galactic Misjump OXP]]: needs inspiration (what might happen?) and coding&lt;br /&gt;
:'''Missions'''&lt;br /&gt;
*[[Amber Moon Chronicles]] - (aliens!) needs finishing&lt;br /&gt;
*Svengali's missions: [[Vector]] &amp;amp; [[Localhero OXP]] need updating, as does McLane's mission, [[Cataclysm OXP]]&lt;br /&gt;
*[[TheCollector|The Collector]] - needs more missions&lt;br /&gt;
&lt;br /&gt;
=== Done! ===&lt;br /&gt;
*[[Useful MFDs]] needed sorting out ([[Solar Wind Flux]] gauge was faulty, and the .oxp itself [http://www.aegidian.org/bb/viewtopic.php?p=280607#p280607 generates too much rubbish]).&lt;br /&gt;
:STOP PRESS: '''DONE!''' Thank you, Dybal!&lt;br /&gt;
*[[Strangers World]] moves the stations from Commies, Taxi Galactica, ''etc'' to bizarre locations. But not HIMSN's stations.&lt;br /&gt;
:STOP PRESS: '''DONE!''' Thank you, Alnivel!&lt;br /&gt;
*I'd dearly love to see the spiderweb jump sequence from [[BGS]] v.1.10.9 added in as an option to the newer BGS.&lt;br /&gt;
:STOP PRESS: '''DONE!''' Thank you, Tsoj!&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== For Me: List of my Wiki (WIP) pages under construction ==&lt;br /&gt;
*[[Immersion]]&lt;br /&gt;
*[[Realism]]&lt;br /&gt;
=== Other WIP pages ===&lt;br /&gt;
*[[Gameplay and Balance Indicator]]&lt;br /&gt;
*Various [[Ulite]] pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
= Cholly's Library of formatting bits &amp;amp; bobs =&lt;br /&gt;
&lt;br /&gt;
== Format for Table Of Contents ==&lt;br /&gt;
&lt;br /&gt;
If you have three or fewer headings but want to have a TOC, write either the magic word __FORCETOC__ anywhere on the page to make it display at the default location, or __TOC__ at the preferred position. &lt;br /&gt;
&lt;br /&gt;
Or use __NOTOC__ 	Hides the table of contents (TOC). &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for Broken-OXP banners ==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{Broken-OXP}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{{Broken-OXP|This OXP is deprecated and buggy, please use the [[Galactic Navy OXP]] instead if you are using a pre-!.82 version of Oolite}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{{OXPNote|This OXP does ''not'' work on AppleMacs: see BB Discussion below for possible tweaks}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for invisible comments ==&lt;br /&gt;
&amp;lt;!-- This is a comment --&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;!-- This is a comment --&amp;gt; &amp;lt;/nowiki&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Only visible when editing the page&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for footnotes ==&lt;br /&gt;
&lt;br /&gt;
The Sun is pretty big.&amp;lt;ref&amp;gt;E. Miller, ''The Sun'', (New York: Academic Press, 2005), 23–25.&amp;lt;/ref&amp;gt; The Moon, however, is not so big.&amp;lt;ref&amp;gt;R. Smith, &amp;quot;Size of the Moon&amp;quot;, ''Scientific American'', 46 (April 1978): 44–46.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Notes on Footnotes ===&lt;br /&gt;
:I tried the &amp;lt;ref&amp;gt;, &amp;lt;/ref&amp;gt; &amp;amp; &amp;lt;references /&amp;gt; tags, but to no avail. None of them seem to do anything. According to Mediawiki, all this should work...&lt;br /&gt;
&lt;br /&gt;
:Footnoting is currently impossible as the necessary add-on for the wiki has not been loaded into it: ...There are no references on Wikipedia. The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tags don't work. Apparently the [https://www.mediawiki.org/wiki/Extension:Cite Cite Extension] has not been installed.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for Transclusion ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--- Note that the next three commands include all the details of the ships via transclusion, i.e. by importing it from their own pages. ---&amp;gt;&lt;br /&gt;
{{:Asp-X}}{{:Cobra2}}{{:Sidewinder-X}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for Colours ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;Green&amp;quot;&amp;gt;Live long and prosper, and may the Great Bird of the Galaxy bless your planet!&amp;lt;/font&amp;gt;         [[User:Phoenix|&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;&amp;lt;sup&amp;gt;&amp;lt;/sup&amp;gt;           —THE PHOENIX &amp;lt;sup&amp;gt;&amp;lt;/sup&amp;gt;&amp;lt;/font&amp;gt;]]'''[[User_talk:Phoenix|{Talk to me!}]] 01:11, 21 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;Green&amp;quot;&amp;gt;      !       &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;        !       &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;'''     !       '''&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Yellow&amp;quot;&amp;gt;'''     !       '''&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Blue&amp;quot;&amp;gt;'''     !       '''&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;Brown&amp;quot;&amp;gt;'''      !       '''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Format for Size ==&lt;br /&gt;
&amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;1&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;3&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;4&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;4&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt; s &amp;lt;/font&amp;gt;    &amp;lt;font size=&amp;quot;5&amp;quot;&amp;gt; '''s''' &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Format for different font ==&lt;br /&gt;
These three methods all make a difference: &amp;lt;br&amp;gt;&lt;br /&gt;
1) &amp;lt;tt&amp;gt;Different font!&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt; &lt;br /&gt;
2) {{CodeEx|codeex=This sort of thing seems only to have been used for programming code (2022 note)}} &amp;lt;br&amp;gt;&lt;br /&gt;
3) &amp;lt;br&amp;gt;&lt;br /&gt;
   This method (introducing one or more spaces at the beginning of the line) also has consequences for formatting.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Format for Equipment Infobox ==&lt;br /&gt;
&lt;br /&gt;
{{Infobox EquipStats Oolite| title = Wine Cooler OXP&lt;br /&gt;
|image = &lt;br /&gt;
|equipName =  Wine Cooler&lt;br /&gt;
|equipCost = 10₢&lt;br /&gt;
|equipTL = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Format for Collapsible whatnots ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;'''initial text'''&amp;lt;/font&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;  data-expandtext=&amp;quot;Show older&amp;quot; data-collapsetext=&amp;quot;Hide older&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;Red&amp;quot;&amp;gt;'''later text!'''&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Lifted from Phkb's [[BroadcastComms MFD]] page&lt;br /&gt;
&lt;br /&gt;
== Format for Quotations ==&lt;br /&gt;
{{QuoteText|Text=&lt;br /&gt;
I don't really see the need for a timeline or a backstory. &amp;lt;br&amp;gt;&lt;br /&gt;
The way things are is just the way things are; I don't need to know where Earth is, or how human beings got from there (if they did) to where they are now. For me, a large part of the appeal of the game is its vagueness. It's as close to a blank slate as we can get, and it's built to be modded all over the shop to everyone's individual preferences. &amp;lt;br&amp;gt;&lt;br /&gt;
Too much backstory just gets in the way.&lt;br /&gt;
|Source=([http://aegidian.org/bb/viewtopic.php?p=273999#p273999 Disembodied])}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Sandbox ==&lt;br /&gt;
----&lt;br /&gt;
== Knotty's natty gallery ==&lt;br /&gt;
[[File:Screen_Shot_2012-11-04_at_21.22.16.png]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Screen_Shot_2012-11-04_at_21.19.59.png]]&lt;br /&gt;
[[File:Screen_Shot_2012-11-04_at_21.18.26.png]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Screen_Shot_2012-11-04_at_21.04.50.png]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Sandbox ==&lt;br /&gt;
&lt;br /&gt;
== Table for HUD page ==&lt;br /&gt;
&lt;br /&gt;
=== List of HUDs ===&lt;br /&gt;
1 Aad HUD&lt;br /&gt;
2 Another HUD&lt;br /&gt;
3 CB-HUD&lt;br /&gt;
4 ChupacabraHUD&lt;br /&gt;
5 Coluber HUD CH01&lt;br /&gt;
6 CombatHUD&lt;br /&gt;
7 Compact HUD&lt;br /&gt;
8 CRR-HUD&lt;br /&gt;
9 Dangerous HUD&lt;br /&gt;
10 DeeperSpace HUD&lt;br /&gt;
11 Deepspace HUD&lt;br /&gt;
12 Deepspace Retro HUD&lt;br /&gt;
13 Dr HUD&lt;br /&gt;
14 ExtraLarge HUD&lt;br /&gt;
15 Fighter HUD&lt;br /&gt;
16 G-HUD&lt;br /&gt;
17 Isis HUD&lt;br /&gt;
18 KeeperHUD&lt;br /&gt;
19 Klepto HUD&lt;br /&gt;
20 Large HUD&lt;br /&gt;
21 Medusa HUD&lt;br /&gt;
22 Mega Walnut Dash HUD&lt;br /&gt;
23 MilHUD 4000&lt;br /&gt;
24 MilHUD (Military Specification HUD)&lt;br /&gt;
25 MillHUD Refit&lt;br /&gt;
26 Mod HUD&lt;br /&gt;
27 Nova Lux HUD&lt;br /&gt;
28 Numeric Style HUDs&lt;br /&gt;
29 OrangED HUD&lt;br /&gt;
30 Pie Chart Style HUDs&lt;br /&gt;
31 Small HUD&lt;br /&gt;
32 Smart HUD&lt;br /&gt;
33 Sniper Camera System HUD&lt;br /&gt;
34 Steampunk HUD&lt;br /&gt;
35 SW (CAI/DAI) HUD&lt;br /&gt;
36 Trek HUD&lt;br /&gt;
37 Venom Cockpit HUD&lt;br /&gt;
38 Vimana HUD&lt;br /&gt;
39 Wide-Screen HUD&lt;br /&gt;
40 Wolfwood HUD&lt;br /&gt;
41 Xenon HUD&lt;br /&gt;
42 Yet Another HUD&lt;br /&gt;
43 Z-GrOovY MiLHUD&lt;br /&gt;
&lt;br /&gt;
=== Considerations ===&lt;br /&gt;
Date&lt;br /&gt;
Author&lt;br /&gt;
Actual speed shown?&lt;br /&gt;
Actual Torus speed shown?&lt;br /&gt;
Different HUDs for different green/yellow/red conditions/alerts?&lt;br /&gt;
Range of alerts shown&lt;br /&gt;
Docked HUD?&lt;br /&gt;
HUD Selector compatible?&lt;br /&gt;
# of MFDs?&lt;br /&gt;
Extras? (eg Vimana HUD's cornucopia of goodies, DeeperSpace's Risk Assessment, Xenon HUD's sights, Dangerous HUD's noises).&lt;br /&gt;
Precision Joystick Indicator?&lt;br /&gt;
Glare filter?&lt;br /&gt;
Glare contrast? (for reading HUD in Glare - cf Xenon HUD)&lt;br /&gt;
Current Location Display &amp;amp; Current Risk Notifier (Deeper Space HUD)&lt;br /&gt;
Distance from Compass target?&lt;br /&gt;
Weapons Bay Missile identifier? (ChupacabraHUD)&lt;br /&gt;
Extra reticles for other lasers (Xenon)&lt;br /&gt;
Choice of Colours? (Dangerous HUD &amp;amp; Xenon HUD)&lt;br /&gt;
Choice of Cockpits? (Dangerous HUD)&lt;br /&gt;
Natural materials? (Mega Walnut Dash)&lt;br /&gt;
&lt;br /&gt;
== Table ==&lt;br /&gt;
== Sortable Table ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border: 1px solid #cfcfbf; background-color: #f0f0ff; color: #000000; vertical-align: top; text-align: left;&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot; bgcolor=&amp;quot;#e7e7ff&amp;quot;&lt;br /&gt;
! valign=&amp;quot;center&amp;quot; style=&amp;quot;width: 150px;&amp;quot;|[[Alphabetical Ship List (Oolite)|Ship]]&lt;br /&gt;
! style=&amp;quot;width: 100px;&amp;quot;|[[Fastest Ships (Oolite)|Max Speed]]&amp;lt;br&amp;gt;(LM)&lt;br /&gt;
! style=&amp;quot;width: 100px;&amp;quot;|[[Largest Ships (Oolite)|Cargo Capacity]]&amp;lt;br&amp;gt;(TC)&lt;br /&gt;
! style=&amp;quot;width: 100px;&amp;quot;|[[Expensive Ships (Oolite)|Base Cost]]&amp;lt;br&amp;gt;(CR)&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot; style=&amp;quot;width: 100px;&amp;quot;|OXP or Standard&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot; style=&amp;quot;width: 100px;&amp;quot;|Available to Player&lt;br /&gt;
! class=&amp;quot;unsortable&amp;quot; style=&amp;quot;width: 150px;&amp;quot;|Size&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(metres, W×H×L)&amp;lt;/small&amp;gt;&lt;br /&gt;
! style=&amp;quot;width: 150px;&amp;quot;|Cubic Meters&lt;br /&gt;
|-&lt;br /&gt;
|[[Firefly]]&lt;br /&gt;
|0.755&lt;br /&gt;
|35&lt;br /&gt;
|775k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|12 x 11 x 22&lt;br /&gt;
|2904&lt;br /&gt;
|- &lt;br /&gt;
|[[Dragster Mk II]]&lt;br /&gt;
|0.610&lt;br /&gt;
|0&lt;br /&gt;
|570k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|33 x 9 x 83&lt;br /&gt;
|24,651&lt;br /&gt;
|-&lt;br /&gt;
|[[Dragster Mk I]]&lt;br /&gt;
|0.601&lt;br /&gt;
|0&lt;br /&gt;
|560k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|33 x 9 x 83&lt;br /&gt;
|24,651&lt;br /&gt;
|- &lt;br /&gt;
|[[Constrictor (Oolite)|Constrictor]]&lt;br /&gt;
|0.60&lt;br /&gt;
|15&lt;br /&gt;
|N/A&lt;br /&gt;
|Standard&lt;br /&gt;
|No&lt;br /&gt;
|54 × 10 × 60&lt;br /&gt;
|32,400 &lt;br /&gt;
|-&lt;br /&gt;
|[[A-Wing]]&lt;br /&gt;
|0.60&lt;br /&gt;
|0&lt;br /&gt;
|570k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|79 × 48 × 122 &lt;br /&gt;
|462,624&lt;br /&gt;
|- &lt;br /&gt;
|[[Fer de Lance NG]]&lt;br /&gt;
|0.60&lt;br /&gt;
|2&lt;br /&gt;
|585k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|45 × 20 × 85&lt;br /&gt;
|76,500 &lt;br /&gt;
|-&lt;br /&gt;
|[[Generation_Ships_OXP|Generation Ship]]&lt;br /&gt;
|0.60&lt;br /&gt;
|0&lt;br /&gt;
|N/A&lt;br /&gt;
|OXP&lt;br /&gt;
|No&lt;br /&gt;
|6413 x 6416 x 30277&lt;br /&gt;
|1,245,771,628,816&lt;br /&gt;
|- &lt;br /&gt;
|[[Kestrel]]&lt;br /&gt;
|0.555&lt;br /&gt;
|8&lt;br /&gt;
|675k&lt;br /&gt;
|OXP&lt;br /&gt;
|Yes&lt;br /&gt;
|13 x 3 x 12&lt;br /&gt;
|468 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Future wiki work ==&lt;br /&gt;
=== New Region Page '''The Lizard's Claw''' ===&lt;br /&gt;
Need to sort out what on earth the &amp;quot;|XPosRel=13|YPosRel=61&amp;quot; is all about for the map!&lt;br /&gt;
:See [http://www.aegidian.org/bb/viewtopic.php?f=2&amp;amp;t=17175 Light year distance calculation] - especially Phantorgorth's key comment&lt;br /&gt;
&lt;br /&gt;
=== Add in Exposure/Gamma Correction for Oolite v.1.91/2 ==&lt;br /&gt;
When the details are added to the wiki, this needs to be linked to it:&lt;br /&gt;
:[http://oolite.aegidian.org/bb/viewtopic.php?p=284327#p284327 Link] with pretty pictures&lt;br /&gt;
&lt;br /&gt;
=== Add in limits of Oolite game ===&lt;br /&gt;
Somewhere on the BB is a thread with my list of 7 or so derived from Phkb's response and with an a_c comment&lt;br /&gt;
*[http://aegidian.org/bb/viewtopic.php?f=2&amp;amp;t=13152 Boarding abandoned ships?] 2012&lt;br /&gt;
&lt;br /&gt;
== Comms ==&lt;br /&gt;
&lt;br /&gt;
Hey- &lt;br /&gt;
&lt;br /&gt;
I have a problem.  I'm locked out of my BB account.  I tried changing my listed e-mail since it's no longer active.  That rendered my BB acct inactive (it sent a registration e-mail to my long-dead e-mail).  Could you check with Cody or someone to see if anything can be done?&lt;br /&gt;
&lt;br /&gt;
:::[[User:Massively Locked|Massively Locked]] ([[User talk:Massively Locked|talk]]) 16:40, 19 November 2022 (UTC)&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Life_in_the_Frontier&amp;diff=77020</id>
		<title>Life in the Frontier</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Life_in_the_Frontier&amp;diff=77020"/>
		<updated>2022-11-19T05:26:08Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Download */ Oh no- I'm not taking the entire blame for this  :-)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OXPNote|Initiated by BeeTLe BeTHLeHeM, then tweaked by [[User:Norby|Norby]], this OXP could do with some more work! All the stations have the same map - they should vary... (the encounters ''do'' vary)}}&lt;br /&gt;
[[Image:Litf_stationmap.png|300px|right]]&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
At the moment, players roleplay their game session, depending on the career they choose, and the events in-flight. But, space stations, on the contrary, are still rather static (without considering OXPs) and act more like a transition between two flights.&lt;br /&gt;
&lt;br /&gt;
So I thought to help stations offer more variety, giving a player the chance to encounter random events while docked, an event that could require a player choice and with effects (good and bad) on the player.&lt;br /&gt;
&lt;br /&gt;
[[File:Life in the Frontier (Park).png|thumb|400px|right]]&lt;br /&gt;
[[File:Life in the Frontier (Medical Centre).png|thumb|400px|right]]&lt;br /&gt;
[[File:Life in the Frontier (Bar).png|thumb|400px|right|Unfortunate blue text thanks to [[Dangerous HUD]] (blue)!]]&lt;br /&gt;
== How it works ==&lt;br /&gt;
=== Events ===&lt;br /&gt;
When the player is docked at a station, he will find in the F4 screen a new item, '''Disembark from your ship'''. If selected, the OXP will choose a random event from a list, and the player will have to confront it. Some events will be a mere description of something that happens in the vicinity of the player, while others will require choices and decisions, and usually offer multiple resolutions.&lt;br /&gt;
&lt;br /&gt;
The events are categorized depending on various factors: the system government, economy and TL, plus one &amp;quot;generic&amp;quot; category for events that can happen anywhere. Instead the specific categories are intended to create a precise atmosphere, so in dictatorial systems there will be a more oppressive feeling, and in low tech worlds it will possible to see more malfunctioning in systems.&lt;br /&gt;
&lt;br /&gt;
Every category has a defined background - I have taken shots from corridors in old sci-fi movies but I don't know if I can use them, so in case I will remove them. For now consider them as placeholders.&lt;br /&gt;
&lt;br /&gt;
The resolution of an event can include: variation in money, in bounty level, in ship fuel or cargo goods. In these case will be displayed a report screen showing what is changed.&lt;br /&gt;
&lt;br /&gt;
Sometimes the eventuation of an event will require a check on one of those properties, for example to avoid the player losing more money than he actually has!&lt;br /&gt;
&lt;br /&gt;
The player can initiate an event by docking, to initiate another event he will need to leave and dock at another (or the same) station - in this way the mechanic shouldn't be abused.&lt;br /&gt;
&lt;br /&gt;
=== The map ===&lt;br /&gt;
One can move around and explore the station, and encounter more events as one does so, both during travel and in, say, the bar. There is something to be found at each location (dust in the bookshop...).&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;  data-expandtext=&amp;quot;Show details from the Dark Side&amp;quot; data-collapsetext=&amp;quot;Hide details&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
0.7.3&lt;br /&gt;
-Disembark is possible after load game in additional stations.&lt;br /&gt;
-Fixed step back from life status screen in non-galcop stations.&lt;br /&gt;
-Fixed mission.screenID error message in non-galcop stations.&lt;br /&gt;
&lt;br /&gt;
0.7.2&lt;br /&gt;
- Fixed bounty clearing at galcop terminal (by Norby).&lt;br /&gt;
- Non-galcop stations are limited to the hangar.&lt;br /&gt;
- HD BackGrounds OXP is used in life status screen and non-galcop hangar.&lt;br /&gt;
- Able to use hd background images made in any resolution (fit to height).&lt;br /&gt;
&lt;br /&gt;
0.7.1&lt;br /&gt;
- Fixed action on Museum exit.&lt;br /&gt;
&lt;br /&gt;
0.7&lt;br /&gt;
- Completed STORAGE, special location on Docks with restricted access: &lt;br /&gt;
  25 credits or legal stance &amp;lt;= -25 (friendly with criminals)&lt;br /&gt;
- Placed PASSENGERS LOUNGE, special location on Concourse-A&lt;br /&gt;
- Placed CHURCH OF THE COSMIC WANDERER, special location on Concourse-B&lt;br /&gt;
- Placed BOOKSHOP, special location on Concourse-B&lt;br /&gt;
- Placed MUSEUM, special location on Delight Avenue&lt;br /&gt;
- Placed FIT CENTER, special location on Olympian Square&lt;br /&gt;
- Implemented Station Map, visible from every lobby&lt;br /&gt;
- Commander stats and OXP flags are stored as a map (string with format name1=value1,name2=value2,name3=value3...) &lt;br /&gt;
  instead of an array. This should definitely fix every issue with loading and saving data.&lt;br /&gt;
- Placed BRIEFING ROOM, special location on Galcop Precinct.&lt;br /&gt;
- Placed DETAINMENT ZONE, special location on Galcop Precinct.&lt;br /&gt;
- Placed SOCIAL SERVICES, special location on Galcop Precinct.&lt;br /&gt;
- Placed PILOT COURSE ROOM, special location on Galcop Precinct.&lt;br /&gt;
&lt;br /&gt;
- Implemented SOCIAL SERVICES mechanics:&lt;br /&gt;
	* Player can spend 4 hours doing social services. His reputation will increase of a small amount. &lt;br /&gt;
	  His bounty will decrease of an amount. There's a chance of getting hurt during the work. &lt;br /&gt;
	  In this case the time spent and bounty decrease are reduced.&lt;br /&gt;
&lt;br /&gt;
- Implemented FIT CENTER mechanics:&lt;br /&gt;
	* The first time the commander visits a Fit Center, he must buy an Universal Fitness Badge for 15cr. &lt;br /&gt;
	  This purchase include a month subscription.&lt;br /&gt;
	* The subscription can be renewed monthly for 10cr.&lt;br /&gt;
	* Commander mustn't be wounded or sick to enter the gym.&lt;br /&gt;
	* Every gym session increase commander strength.&lt;br /&gt;
	* If commander exercise more than once in two days, a chance of getting wounded while exercising increase.&lt;br /&gt;
	* If the commander get wounded, he'll must get healed before starting a new gym session.&lt;br /&gt;
	* If the commander get wounded, the maximum strength cap get lowered of a small amount. &lt;br /&gt;
	  If this amount get very low (it requires a lot of accidents, though...) the commander can't access &lt;br /&gt;
	  the gym anymore until he get a recovering therapy from an hi-tech Medical Center.&lt;br /&gt;
	* If the commander doesn't go to the gym for more than a week, strength will lower of a small amount after every dock.&lt;br /&gt;
	* If commander can't access the gym because he has endured too much damage, he can go to a hi-tech system &lt;br /&gt;
	  Medical Center and get into a Recovery Therapy for 400cr. This therapy is available only when the player &lt;br /&gt;
	  has sustained a lot of damage (only in the gym for now).&lt;br /&gt;
	* The status screen (access from the hangar) report the Universal Fitness expiration status, when the player buys it.&lt;br /&gt;
&lt;br /&gt;
0.6.1&lt;br /&gt;
- Fixed corridor background name - this should avoid log warning messages about texture files not found.&lt;br /&gt;
- Fixed paytreatment action, MedCenter treatment should give no exception now.&lt;br /&gt;
- Deleted useless number from OXP versioning - better late then never. (Current model: MajorVersion.MinorVersion.Fix)&lt;br /&gt;
&lt;br /&gt;
0.1.6 (0.6)&lt;br /&gt;
- When accessing the OXP from the F4 screen, the player goes directly to the Hangar.&lt;br /&gt;
- The player can display the Commander Status screen from the Hangar.&lt;br /&gt;
- Station layout updated following forum discussion on the current design.&lt;br /&gt;
- Changed some definitions for station locations.&lt;br /&gt;
- Lobby indications are more schematic.&lt;br /&gt;
- The Storage location has been promoted to special location.&lt;br /&gt;
- Implemented Hotel, moved location to Main Concourse-A because Delight Avenue has already 3 planned locations.&lt;br /&gt;
- Implemented the Wild Worlds Virtual Tour, on the Delight Avenue (Recreation Bridge).&lt;br /&gt;
&lt;br /&gt;
0.1.5.1 (0.5.1)&lt;br /&gt;
- Fixed check on the variables introduced in 0.1.5.&lt;br /&gt;
- Fixed check on varStore array items before setting values.&lt;br /&gt;
&lt;br /&gt;
0.1.5 (0.5)&lt;br /&gt;
- Added background to Docks Area;&lt;br /&gt;
- Add text snippet for drunken status (along with wounds and sickness);&lt;br /&gt;
- Implemented event-checks for &amp;quot;government&amp;quot;, &amp;quot;tech&amp;quot; and &amp;quot;economy&amp;quot;. The government check can take a list of governments,&lt;br /&gt;
  separated by &amp;quot;-&amp;quot; character. If the system government is in the list, the check is valid;&lt;br /&gt;
- Added events: ROBO-BARD, HUNTERS, DELIRIOUS DROID, COMMERCIAL DROID, SUPERCELEBRITY, LIGHTS MALFUNCTION, &lt;br /&gt;
  WATER MALFUNCTION, AIR MALFUNCTION, DEFACING KIDS&lt;br /&gt;
- &amp;quot;her/him/his&amp;quot; not capitalized anymore;&lt;br /&gt;
- Commander stats are saved as a string with comma-separated values rather than 5 missionVariables.&lt;br /&gt;
- Game flags are saved as a string with comma-separated values rather than 8 missionVariables.&lt;br /&gt;
- Variables still not used aren't loaded anymore from the savegame, and are saved with null values to purge them from the file.&lt;br /&gt;
- Refactored method for checks on event/choice requirements: it's now possible to interrogate a parameter with operators&lt;br /&gt;
  =, !=, &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=. The requirement syntax changes. E.g.: no more credits:500, but credits=500, or credits&amp;lt;500 etc.&lt;br /&gt;
- Event text can be present as parameter &amp;quot;text&amp;quot; (static text, always displayed) *OR* as indexed parameters &lt;br /&gt;
  (text0, text1, text2): in the latter case, it's possible to specify display conditions, with syntax&lt;br /&gt;
  &amp;quot;condition|text to display&amp;quot;. If an indexed text has no condition is considered static (always displayed). &lt;br /&gt;
  The validated indexed text are concatenated.&lt;br /&gt;
- Event property &amp;quot;choiceRequires&amp;quot; has been removed. It has been replaced by &amp;quot;r&amp;quot;(+ choice index), that contains &lt;br /&gt;
  the facultative requirements for the single choice. If a choice has no requirements (no &amp;quot;r&amp;quot; property), &lt;br /&gt;
  the choice is always displayed.&lt;br /&gt;
- I believe I have removed the end-event resume screen at least one release ago, forgot to write it down.&lt;br /&gt;
- To avoid confusion, in the event properties requires and r I don't use the ':' char as separator anymore, &lt;br /&gt;
  but the equal sign '='.&lt;br /&gt;
- Refactored action executions when player select an event or a location choice. There are some differences &lt;br /&gt;
  in some actions, so I had to differentitate: go (random event) and goNav (navigation), end (random event) &lt;br /&gt;
  and endNav (navigation).&lt;br /&gt;
- Implemented condition if to the events action. Now it's possible to define a condition (or multiple conditions, &lt;br /&gt;
  comma-separated), and to link it to two results: the &amp;quot;valid condition&amp;quot; and the &amp;quot;else&amp;quot;. &lt;br /&gt;
  I'm going to read again the various random events to introduce conditions when necessary, to streamline the event flow.&lt;br /&gt;
  Syntax is: if:&amp;lt;conditions&amp;gt;?&amp;lt;actions&amp;gt;;&amp;lt;elseActions&amp;gt;&lt;br /&gt;
- I've lost some features (the hotel, the wild world virtual tour and the new Medical Center text), &lt;br /&gt;
  so I'll have to rethink them in the next days. Actually I have changed the Medicla Center concept,&lt;br /&gt;
  so the options are always displayed but if the player isn't sick or wounded or drunk the receptionist &lt;br /&gt;
  will refuse to start the treatment.&lt;br /&gt;
- Fixed: the Galcop terminal didn't show the price for cleaning the criminal record.&lt;br /&gt;
- The DEFACING KIDS event can enable a flag - eventually the consequence will be shown when the player reach the docks area.&lt;br /&gt;
&lt;br /&gt;
0.1.4 (0.4)&lt;br /&gt;
- Code optimization and refactoring. Creation of new js files for common methods, for mission-related methods, &lt;br /&gt;
  and for inside-station navigation methods.&lt;br /&gt;
- Restarted from scratch (taking the old code piece for piece).&lt;br /&gt;
- The F4 link shows a literal resume of the player. From this screen, the player can &amp;quot;disembark&amp;quot; from the ship &lt;br /&gt;
  and wander into the space station.&lt;br /&gt;
- &amp;quot;Tubes Stop&amp;quot; locations allow player to move across five different levels. Every level has a theme and &lt;br /&gt;
  several inner locations. The levels are to be intended as concentric.&lt;br /&gt;
- Events are not fired by player anymore. But moving into the station there is a 20% chance (not definitive) &lt;br /&gt;
  of firing a random event. They act like an intermission, basically.&lt;br /&gt;
- Added random snippet (from a list of 20) of texts when at a Tube Stop.&lt;br /&gt;
&lt;br /&gt;
- Added all the events already implemented in 0.1.3 (beside the bar ones)&lt;br /&gt;
- Added the bar events: the gossip option has been moved to the &amp;quot;talk with bartender one&amp;quot;. &lt;br /&gt;
  Bartender doesn't give hints about contractors anymore.&lt;br /&gt;
- It's possible to clean own criminal record at the Galcop termminal (in the Galcop precinct) &lt;br /&gt;
  paying a fine of (500cr x current bounty).&lt;br /&gt;
- Added the Art Gallery and the art genre random generator.&lt;br /&gt;
- Added the Opera House and the music genre random generator.&lt;br /&gt;
- Added the Cinema Hall and the movie genre random generator.&lt;br /&gt;
- If player is wounded or sick, randomly add short descriptive snippet of text while moving around the station.&lt;br /&gt;
- Added a short single-row-status text to show on top of the locations screens.&lt;br /&gt;
- Added two backgrounds for the &amp;quot;Tubes&amp;quot;.&lt;br /&gt;
- Changed &amp;quot;Tube Stop&amp;quot; to &amp;quot;Lift Station&amp;quot;, and &amp;quot;Tubes&amp;quot; to &amp;quot;Lift&amp;quot;. &lt;br /&gt;
  The direction is relative, it's not necessary an up-down transport.&lt;br /&gt;
&lt;br /&gt;
- The property background can contain more background file names separated by comma: &lt;br /&gt;
  the OXP will choose a random background between those specified.&lt;br /&gt;
- Added some more backgrounds, I'm trying to add variety and get an &amp;quot;identity&amp;quot; for the various levels.&lt;br /&gt;
- Added medical center location: here the player can cure wounds and sickness for a price. &lt;br /&gt;
  Price and amount of cure changes in relation to system tech level. &lt;br /&gt;
  The medical center can also rid of drunken status for free, but with a chance for a slight sickness.&lt;br /&gt;
&lt;br /&gt;
- Added health/sickness management, with the following rules being checked every time the player docks to a station:&lt;br /&gt;
1) if sickness &amp;gt; 1, chance 10% of worsening (sickness +1);&lt;br /&gt;
2) if sickness = 1, chance 10% of healing (sickness = 0);&lt;br /&gt;
3) if health &amp;gt; 1, chance 10% of worsening (health + 1);&lt;br /&gt;
4) if health = 1, chance 10% of healing (health = 0);&lt;br /&gt;
5) if health &amp;gt; 2 and sickness &amp;lt; 2, chance 10% of infection (sickness +1);&lt;br /&gt;
6) if health &amp;gt; 2 or sickness &amp;gt; 2, chance 10% of physical shape reduction&lt;br /&gt;
- If player has health or sickness in critical conditions (&amp;gt;= 5), has a 50% of pass-out. &lt;br /&gt;
  In this case he will be automatically transported to the station Medical Center and cured (with system TL limitations).&lt;br /&gt;
  Player will receive a decrease in reputation (for careless behaviour) and the price of the opeation &lt;br /&gt;
  will be automatically withdrawn from his account - if he has't enough money his bounty will be &lt;br /&gt;
  slightly increased (for debt insolvency).&lt;br /&gt;
&lt;br /&gt;
0.1.3 (0.3)&lt;br /&gt;
- implemented a time variable for events. It's now possible to define how much time will be spent when executing an event.&lt;br /&gt;
  Instead of creating a separate property, the variabile is set in the &amp;quot;end:x&amp;quot; command, where x is the time spent &lt;br /&gt;
  in seconds. So &amp;quot;end:600&amp;quot; means &amp;quot;terminate the event and go forward 10 minutes in time&amp;quot;. &lt;br /&gt;
  Use &amp;quot;end:0&amp;quot; to avoid spending game-time;&lt;br /&gt;
- As a general rule for numeric command parameters, two values comma-separated will be interpreted as a range, &lt;br /&gt;
  and a random number between the specified values will be extracted. This applies even to the time variable above;&lt;br /&gt;
- Added a new resolution to the &amp;quot;elixir peddler&amp;quot; event, that use the time variable above;&lt;br /&gt;
&lt;br /&gt;
- implemented the constants $SPECIES_S$ (singular) and $SPECIES_P$ (plural), that set a random species &lt;br /&gt;
  if requested by the event text. The species value remain fixed until the end of the event;&lt;br /&gt;
- implemented the constants $GENDERSUBJ$ (he/she), $GENDEROBJ$ (him/her), $GENDERPOSS$ (his/her). &lt;br /&gt;
  The random chosen gender remain fixed untile the end of the event. &lt;br /&gt;
  The gender-values are correlated to maintain coherence throughout the text;&lt;br /&gt;
- fixed the text of all the events implemented until now;&lt;br /&gt;
- added five &amp;quot;no-events&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
- added a new script file (LITF_RPGElements.js) to keep together the RPG-lite functions;&lt;br /&gt;
- changed the F4 link in &amp;quot;Visit the station hub&amp;quot;: it show a main screen with player current RPG-lite status &lt;br /&gt;
  (reputation, health, sickness, strength), the link to the random event and something more...;&lt;br /&gt;
- added description for all the status variables;&lt;br /&gt;
- added arrays of &amp;quot;minor&amp;quot; cargo types to be inserted in missions text: these aren't new cargo types, &lt;br /&gt;
  they will only be treated as random labels to differentiate the text depending on player reputation;&lt;br /&gt;
&lt;br /&gt;
- The link on the F4 page has been changed to &amp;quot;Visit the station hub&amp;quot; and if selected shows the &amp;quot;main screen&amp;quot;;&lt;br /&gt;
- The &amp;quot;main screen&amp;quot; displays the player status (a literal description for the LITF variables);&lt;br /&gt;
- Added variables: reputation, health (wounds, bruises etc.), sickness, strength (physical shape);&lt;br /&gt;
- Added variable: stance. Positive stance = the law; negative stance = the criminals. &lt;br /&gt;
  Similar to reputation, but to be considered more like &amp;quot;word on the street is&amp;quot;; &lt;br /&gt;
- Available choices for the &amp;quot;main screen&amp;quot;;&lt;br /&gt;
	* &amp;quot;Take a walk to the Main Concourse&amp;quot;. This fires a random event, as before;&lt;br /&gt;
&lt;br /&gt;
- The player won't find the locations (bar, fit center, church, med center) on every system. &lt;br /&gt;
  I wrote a basic rule to distribute their presence in the galaxy. &lt;br /&gt;
  The rule is mathematical and based on the system ID, so the final results are fixed - for now only the bar is enabled;&lt;br /&gt;
- Re-edited the implemented events to use the variables in effects and requirements;&lt;br /&gt;
- Added constant $LIQUORS$ (with an array of 20 liquor random names), $SYSTEM$ (get random system name), &lt;br /&gt;
  $COMMODITY$ (get random vanilla commodity name), $GOSSIP$ (get a random gossip), &lt;br /&gt;
  $NAME$ (for random NPC name), $MINORCARGO$ (for transport missions);&lt;br /&gt;
- Added flag management (not mission flags), checks and manipulation;&lt;br /&gt;
- Added command &amp;quot;time:x&amp;quot;, if you don't want to end the events but only to spend time;&lt;br /&gt;
&lt;br /&gt;
- Implemented first version mission generation. It works in two steps. First step: an NPC &lt;br /&gt;
  (in this case, the bartender) tells the player that another NPC has a job available: &lt;br /&gt;
  I store data about the NPC name, the system where he is, the type of mission and a &lt;br /&gt;
  generous time limite to reach him. When the player docks to a station I check if it's &lt;br /&gt;
  the right station and if the NPC hasn't expired: if everything's good, when the player &lt;br /&gt;
  enter the main concourse I switch to an alternate event: meeting the NPC, that introduce &lt;br /&gt;
  the job (a cargo transport), with a destination, a time limit and a type of &amp;quot;minor cargo&amp;quot; &lt;br /&gt;
  (see above). If the player accepts, I use this data to generate a real mission.&lt;br /&gt;
- Removed sickness effect when getting drunk, it's counter-productive. &lt;br /&gt;
  When I'll implement medical centers, player have the chance to pay to get sober.&lt;br /&gt;
  For now he can leave the station and dock to another station to rid of the drunkenness.&lt;br /&gt;
&lt;br /&gt;
- Modified the cargo mission management: I don't use specialCargo or awardContract, &lt;br /&gt;
  but the OXP do the checks and display the page for completing a contract (always from the Main Concourse). &lt;br /&gt;
  It's not definitive, but it seems to work.&lt;br /&gt;
- Added events: CHARMING PARTNER, MUGGING, THE LOST DRUNKARD, MEDICAL CAMP&lt;br /&gt;
&lt;br /&gt;
0.1.2 (0.2)&lt;br /&gt;
- enabled the one-event-for-dock flag (it was disabled for showing various events without leaving a station).&lt;br /&gt;
- changed the event management, I moved the events data from missionscript.plist to &lt;br /&gt;
  LITF_ActionsCatalog.js (renamed in LITF_EventsCatalog.js). &lt;br /&gt;
  In this way I can group everything related to an event in one object &lt;br /&gt;
  (text, requirements, choices and actions), and eventually I can make them more dynamic;&lt;br /&gt;
- renamed property &amp;quot;check&amp;quot; (property-checks that allow the event to happens) in &amp;quot;requires&amp;quot;;&lt;br /&gt;
- added property &amp;quot;choiceRequires&amp;quot;, contains pipe-concatenated string with checks for every event choice &lt;br /&gt;
  (see check property list) for selecting choices to display under particular circumstances; &lt;br /&gt;
  use &amp;quot;valid:1&amp;quot; for always display a choice, and &amp;quot;valid:0&amp;quot; to always hide it;&lt;br /&gt;
- added events:&lt;br /&gt;
	GENERIC: charity&lt;br /&gt;
	GENERIC: alien discussion&lt;br /&gt;
- implemented code for replace constants in event/choice text with a random element &lt;br /&gt;
  from a related array: actually used in the charity event, constant $CHARITY$.&lt;br /&gt;
&lt;br /&gt;
0.1.1 (0.1)&lt;br /&gt;
- events category list:&lt;br /&gt;
	&amp;quot;generic&amp;quot; category&lt;br /&gt;
	station allegiance (disabled)&lt;br /&gt;
	system government (gov_0 - gov_7)&lt;br /&gt;
	system tech level (ltech, htech), values 5-9 are converted to &amp;quot;generic&amp;quot;&lt;br /&gt;
	system economy (ind, agri), values 3-4 are converted to &amp;quot;generic&amp;quot;&lt;br /&gt;
	OXP choose a value from an array with the values [ generic, gov_x, tl_x, eco_x]&lt;br /&gt;
	Maybe in the future I could add as new categories ranges for player rank or player bounty&lt;br /&gt;
- specific background picture depending on event category: system government, tech level &lt;br /&gt;
  (low tech, high tech) and economy (industrial, agricolture). &amp;quot;Generic&amp;quot; events will show &lt;br /&gt;
  the related system government background;&lt;br /&gt;
- event one-click for docking disabled for testing and showing OXP workings;&lt;br /&gt;
- passing time for events temporarily disabled: to be reintroduced it as an event property;&lt;br /&gt;
- event effects list:&lt;br /&gt;
	mt_[name]:[value] add [value] to the player ship manifest good identified by [name]. &lt;br /&gt;
	bounty:[value] add [value] to the current player bounty.&lt;br /&gt;
	fuel:[value] add [value] to the current player ship fuel amount.&lt;br /&gt;
	credits[value] add [value] to the current player credits.&lt;br /&gt;
	go:[label] fire the event identified by [label]&lt;br /&gt;
	end:0 end the event&lt;br /&gt;
	[value] can be positive or negative. There are checks to avoid negative results or values exceeding cargo space.&lt;br /&gt;
- check property list:&lt;br /&gt;
	mt[name]:[value] check for player ship manifest good identified by [name] &amp;gt;= [value]&lt;br /&gt;
	mt&amp;lt;[name]:[value] check for player ship manifest good identified by [name] &amp;lt; [value]&lt;br /&gt;
	fuel:[value] check for player ship fuel amount &amp;gt;= [value]&lt;br /&gt;
	fuel&amp;lt;:[value] check for player ship fuel amount &amp;lt; [value]&lt;br /&gt;
	bounty:[value] check for current player bounty &amp;gt;= [value]&lt;br /&gt;
	bounty&amp;lt;:[value] check for current player bounty &amp;lt; [value]&lt;br /&gt;
	credits:[value] check for current player credits &amp;gt;= [value]&lt;br /&gt;
	credits&amp;lt;:[value] check for current player credits &amp;lt; [value]&lt;br /&gt;
- added events:&lt;br /&gt;
	GENERIC: beggar&lt;br /&gt;
	GENERIC: weird password guy&lt;br /&gt;
	GENERIC: fire&lt;br /&gt;
	GENERIC: fire + gossip&lt;br /&gt;
	GENERIC: shady seller&lt;br /&gt;
	GENERIC: partygoers&lt;br /&gt;
	GENERIC: running fugitive&lt;br /&gt;
	GENERIC: thief&lt;br /&gt;
	GENERIC: stranded crew (2 variants)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== License ==&lt;br /&gt;
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License version 4.0.&lt;br /&gt;
&lt;br /&gt;
If you are re-using any piece of this OXP, please let me know by sending an e-mail to norbylite at gmail.com.&lt;br /&gt;
&lt;br /&gt;
Author: BeeTLe BeTHLeHeM&lt;br /&gt;
&lt;br /&gt;
[[File:Life in the Frontier - Revival.png|thumb|right|400px|Life in the Frontier - Revival (BeeTLe BeTHLeHeM's second OXP)]]&lt;br /&gt;
&lt;br /&gt;
== Musings ==&lt;br /&gt;
*These stations are massive! There should be many more facilities - restaurants, many more bars, more hotels, ''etc''.&lt;br /&gt;
*There should be different maps for different stations (Coriolis, Dodo, Ico ''etc'').&lt;br /&gt;
*Might one be able to sit in a bar and watch the planet and local ships move beneath on a screen or even through a window! And watch [[GNN]] on another screen!&lt;br /&gt;
*Could be combined with the bar in [[Hints]], with the bar and trade floor ''etc''. in [[New Cargoes]], the Embassy district in [[Diplomancy]], the Guild of Elite Traders in [[Elite Trader OXZ]], a Lave First Finance Corp office for [[First Finance OXP]], the Black Market, bribeable station officials' offices and the dock master's office for [[Smugglers - The Galactic Underworld]], GalCop security offices/kiosks for [[Bounty System]] and the storage facility for [[Equipment Storage OXP]]. And [[Hermitage]] could do with a Rock Hermit equivalent!&lt;br /&gt;
*Since one can become meaningfully sick, a meaningful link with plague systems would be a nice addition (determined ''eg'' by [[GNN]]).&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
*Download from the in-game [[Expansions Manager]]!&lt;br /&gt;
*[[Media:Life_In_The_Frontier_0.7.3.oxz|Life_In_The_Frontier_0.7.3.oxz]] (downloaded {{#downloads:Life_In_The_Frontier_0.7.3.oxz}} times).&lt;br /&gt;
*[[Media:Life_In_The_Frontier_0.7.1.oxz|Life_In_The_Frontier_0.7.1.oxz]] (downloaded {{#downloads:Life_In_The_Frontier_0.7.1.oxz}} times).&lt;br /&gt;
&lt;br /&gt;
*Massively Locked's &amp;amp; Cholmondely's updates (experimental).  Note that these are development versions and not recommended for regular play-throughs.&lt;br /&gt;
:[[File:LitF+v0.03.oxz]] - adds fledgling rock hermit layout&lt;br /&gt;
:[[File:LitF+v0.02.oxz]] - adds temples, govt section, RH bookshop&lt;br /&gt;
:[[File:LitF+v0.01.oxz]] - more bookshops, names your ship&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*[http://www.aegidian.org/bb/viewtopic.php?t=17181 BB Thread] (2015-16)&lt;br /&gt;
*[https://www.youtube.com/watch?v=TZx59ShaVtw YouTube film] (2018) - this now seems to link to a film of the second OXP, below.&lt;br /&gt;
*[https://pioneerspacesim.net/forum/viewtopic.php?f=3&amp;amp;t=454 My dream for entering stations / cities] Pioneer's discussion on this (2016-date)&lt;br /&gt;
&lt;br /&gt;
*[[Life In The Frontier - Revival OXP]] - a second, clashing OXP, also by BeeTLe BeTHLeHeM, which creates a message board with things to do...&lt;br /&gt;
&lt;br /&gt;
== Quick Facts ==&lt;br /&gt;
{{OXPLevel|0}}{{Infobox OXPb| title = Life In The Frontier&lt;br /&gt;
|version = 0.7.3&lt;br /&gt;
|release = 2015.07.12&lt;br /&gt;
|features = Walk around in the station&lt;br /&gt;
|license = CC BY-NC-SA 4&lt;br /&gt;
|category = Activities OXPs&lt;br /&gt;
|author = [http://aegidian.org/bb/memberlist.php?mode=viewprofile&amp;amp;u=28786 BeeTLe BeTHLeHeM]&lt;br /&gt;
|feedback = [http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=17181 BB-Link]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Dockables-OXP}}&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Life_in_the_Frontier&amp;diff=77009</id>
		<title>Life in the Frontier</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Life_in_the_Frontier&amp;diff=77009"/>
		<updated>2022-11-18T19:07:02Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: added note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OXPNote|Initiated by BeeTLe BeTHLeHeM, then tweaked by [[User:Norby|Norby]], this OXP could do with some more work! All the stations have the same map - they should vary... (the encounters ''do'' vary)}}&lt;br /&gt;
[[Image:Litf_stationmap.png|300px|right]]&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
At the moment, players roleplay their game session, depending on the career they choose, and the events in-flight. But, space stations, on the contrary, are still rather static (without considering OXPs) and act more like a transition between two flights.&lt;br /&gt;
&lt;br /&gt;
So I thought to help stations offer more variety, giving a player the chance to encounter random events while docked, an event that could require a player choice and with effects (good and bad) on the player.&lt;br /&gt;
&lt;br /&gt;
[[File:Life in the Frontier (Park).png|thumb|400px|right]]&lt;br /&gt;
[[File:Life in the Frontier (Medical Centre).png|thumb|400px|right]]&lt;br /&gt;
[[File:Life in the Frontier (Bar).png|thumb|400px|right|Unfortunate blue text thanks to [[Dangerous HUD]] (blue)!]]&lt;br /&gt;
== How it works ==&lt;br /&gt;
=== Events ===&lt;br /&gt;
When the player is docked at a station, he will find in the F4 screen a new item, '''Disembark from your ship'''. If selected, the OXP will choose a random event from a list, and the player will have to confront it. Some events will be a mere description of something that happens in the vicinity of the player, while others will require choices and decisions, and usually offer multiple resolutions.&lt;br /&gt;
&lt;br /&gt;
The events are categorized depending on various factors: the system government, economy and TL, plus one &amp;quot;generic&amp;quot; category for events that can happen anywhere. Instead the specific categories are intended to create a precise atmosphere, so in dictatorial systems there will be a more oppressive feeling, and in low tech worlds it will possible to see more malfunctioning in systems.&lt;br /&gt;
&lt;br /&gt;
Every category has a defined background - I have taken shots from corridors in old sci-fi movies but I don't know if I can use them, so in case I will remove them. For now consider them as placeholders.&lt;br /&gt;
&lt;br /&gt;
The resolution of an event can include: variation in money, in bounty level, in ship fuel or cargo goods. In these case will be displayed a report screen showing what is changed.&lt;br /&gt;
&lt;br /&gt;
Sometimes the eventuation of an event will require a check on one of those properties, for example to avoid the player losing more money than he actually has!&lt;br /&gt;
&lt;br /&gt;
The player can initiate an event by docking, to initiate another event he will need to leave and dock at another (or the same) station - in this way the mechanic shouldn't be abused.&lt;br /&gt;
&lt;br /&gt;
=== The map ===&lt;br /&gt;
One can move around and explore the station, and encounter more events as one does so, both during travel and in, say, the bar. There is something to be found at each location (dust in the bookshop...).&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;  data-expandtext=&amp;quot;Show details from the Dark Side&amp;quot; data-collapsetext=&amp;quot;Hide details&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
0.7.3&lt;br /&gt;
-Disembark is possible after load game in additional stations.&lt;br /&gt;
-Fixed step back from life status screen in non-galcop stations.&lt;br /&gt;
-Fixed mission.screenID error message in non-galcop stations.&lt;br /&gt;
&lt;br /&gt;
0.7.2&lt;br /&gt;
- Fixed bounty clearing at galcop terminal (by Norby).&lt;br /&gt;
- Non-galcop stations are limited to the hangar.&lt;br /&gt;
- HD BackGrounds OXP is used in life status screen and non-galcop hangar.&lt;br /&gt;
- Able to use hd background images made in any resolution (fit to height).&lt;br /&gt;
&lt;br /&gt;
0.7.1&lt;br /&gt;
- Fixed action on Museum exit.&lt;br /&gt;
&lt;br /&gt;
0.7&lt;br /&gt;
- Completed STORAGE, special location on Docks with restricted access: &lt;br /&gt;
  25 credits or legal stance &amp;lt;= -25 (friendly with criminals)&lt;br /&gt;
- Placed PASSENGERS LOUNGE, special location on Concourse-A&lt;br /&gt;
- Placed CHURCH OF THE COSMIC WANDERER, special location on Concourse-B&lt;br /&gt;
- Placed BOOKSHOP, special location on Concourse-B&lt;br /&gt;
- Placed MUSEUM, special location on Delight Avenue&lt;br /&gt;
- Placed FIT CENTER, special location on Olympian Square&lt;br /&gt;
- Implemented Station Map, visible from every lobby&lt;br /&gt;
- Commander stats and OXP flags are stored as a map (string with format name1=value1,name2=value2,name3=value3...) &lt;br /&gt;
  instead of an array. This should definitely fix every issue with loading and saving data.&lt;br /&gt;
- Placed BRIEFING ROOM, special location on Galcop Precinct.&lt;br /&gt;
- Placed DETAINMENT ZONE, special location on Galcop Precinct.&lt;br /&gt;
- Placed SOCIAL SERVICES, special location on Galcop Precinct.&lt;br /&gt;
- Placed PILOT COURSE ROOM, special location on Galcop Precinct.&lt;br /&gt;
&lt;br /&gt;
- Implemented SOCIAL SERVICES mechanics:&lt;br /&gt;
	* Player can spend 4 hours doing social services. His reputation will increase of a small amount. &lt;br /&gt;
	  His bounty will decrease of an amount. There's a chance of getting hurt during the work. &lt;br /&gt;
	  In this case the time spent and bounty decrease are reduced.&lt;br /&gt;
&lt;br /&gt;
- Implemented FIT CENTER mechanics:&lt;br /&gt;
	* The first time the commander visits a Fit Center, he must buy an Universal Fitness Badge for 15cr. &lt;br /&gt;
	  This purchase include a month subscription.&lt;br /&gt;
	* The subscription can be renewed monthly for 10cr.&lt;br /&gt;
	* Commander mustn't be wounded or sick to enter the gym.&lt;br /&gt;
	* Every gym session increase commander strength.&lt;br /&gt;
	* If commander exercise more than once in two days, a chance of getting wounded while exercising increase.&lt;br /&gt;
	* If the commander get wounded, he'll must get healed before starting a new gym session.&lt;br /&gt;
	* If the commander get wounded, the maximum strength cap get lowered of a small amount. &lt;br /&gt;
	  If this amount get very low (it requires a lot of accidents, though...) the commander can't access &lt;br /&gt;
	  the gym anymore until he get a recovering therapy from an hi-tech Medical Center.&lt;br /&gt;
	* If the commander doesn't go to the gym for more than a week, strength will lower of a small amount after every dock.&lt;br /&gt;
	* If commander can't access the gym because he has endured too much damage, he can go to a hi-tech system &lt;br /&gt;
	  Medical Center and get into a Recovery Therapy for 400cr. This therapy is available only when the player &lt;br /&gt;
	  has sustained a lot of damage (only in the gym for now).&lt;br /&gt;
	* The status screen (access from the hangar) report the Universal Fitness expiration status, when the player buys it.&lt;br /&gt;
&lt;br /&gt;
0.6.1&lt;br /&gt;
- Fixed corridor background name - this should avoid log warning messages about texture files not found.&lt;br /&gt;
- Fixed paytreatment action, MedCenter treatment should give no exception now.&lt;br /&gt;
- Deleted useless number from OXP versioning - better late then never. (Current model: MajorVersion.MinorVersion.Fix)&lt;br /&gt;
&lt;br /&gt;
0.1.6 (0.6)&lt;br /&gt;
- When accessing the OXP from the F4 screen, the player goes directly to the Hangar.&lt;br /&gt;
- The player can display the Commander Status screen from the Hangar.&lt;br /&gt;
- Station layout updated following forum discussion on the current design.&lt;br /&gt;
- Changed some definitions for station locations.&lt;br /&gt;
- Lobby indications are more schematic.&lt;br /&gt;
- The Storage location has been promoted to special location.&lt;br /&gt;
- Implemented Hotel, moved location to Main Concourse-A because Delight Avenue has already 3 planned locations.&lt;br /&gt;
- Implemented the Wild Worlds Virtual Tour, on the Delight Avenue (Recreation Bridge).&lt;br /&gt;
&lt;br /&gt;
0.1.5.1 (0.5.1)&lt;br /&gt;
- Fixed check on the variables introduced in 0.1.5.&lt;br /&gt;
- Fixed check on varStore array items before setting values.&lt;br /&gt;
&lt;br /&gt;
0.1.5 (0.5)&lt;br /&gt;
- Added background to Docks Area;&lt;br /&gt;
- Add text snippet for drunken status (along with wounds and sickness);&lt;br /&gt;
- Implemented event-checks for &amp;quot;government&amp;quot;, &amp;quot;tech&amp;quot; and &amp;quot;economy&amp;quot;. The government check can take a list of governments,&lt;br /&gt;
  separated by &amp;quot;-&amp;quot; character. If the system government is in the list, the check is valid;&lt;br /&gt;
- Added events: ROBO-BARD, HUNTERS, DELIRIOUS DROID, COMMERCIAL DROID, SUPERCELEBRITY, LIGHTS MALFUNCTION, &lt;br /&gt;
  WATER MALFUNCTION, AIR MALFUNCTION, DEFACING KIDS&lt;br /&gt;
- &amp;quot;her/him/his&amp;quot; not capitalized anymore;&lt;br /&gt;
- Commander stats are saved as a string with comma-separated values rather than 5 missionVariables.&lt;br /&gt;
- Game flags are saved as a string with comma-separated values rather than 8 missionVariables.&lt;br /&gt;
- Variables still not used aren't loaded anymore from the savegame, and are saved with null values to purge them from the file.&lt;br /&gt;
- Refactored method for checks on event/choice requirements: it's now possible to interrogate a parameter with operators&lt;br /&gt;
  =, !=, &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=. The requirement syntax changes. E.g.: no more credits:500, but credits=500, or credits&amp;lt;500 etc.&lt;br /&gt;
- Event text can be present as parameter &amp;quot;text&amp;quot; (static text, always displayed) *OR* as indexed parameters &lt;br /&gt;
  (text0, text1, text2): in the latter case, it's possible to specify display conditions, with syntax&lt;br /&gt;
  &amp;quot;condition|text to display&amp;quot;. If an indexed text has no condition is considered static (always displayed). &lt;br /&gt;
  The validated indexed text are concatenated.&lt;br /&gt;
- Event property &amp;quot;choiceRequires&amp;quot; has been removed. It has been replaced by &amp;quot;r&amp;quot;(+ choice index), that contains &lt;br /&gt;
  the facultative requirements for the single choice. If a choice has no requirements (no &amp;quot;r&amp;quot; property), &lt;br /&gt;
  the choice is always displayed.&lt;br /&gt;
- I believe I have removed the end-event resume screen at least one release ago, forgot to write it down.&lt;br /&gt;
- To avoid confusion, in the event properties requires and r I don't use the ':' char as separator anymore, &lt;br /&gt;
  but the equal sign '='.&lt;br /&gt;
- Refactored action executions when player select an event or a location choice. There are some differences &lt;br /&gt;
  in some actions, so I had to differentitate: go (random event) and goNav (navigation), end (random event) &lt;br /&gt;
  and endNav (navigation).&lt;br /&gt;
- Implemented condition if to the events action. Now it's possible to define a condition (or multiple conditions, &lt;br /&gt;
  comma-separated), and to link it to two results: the &amp;quot;valid condition&amp;quot; and the &amp;quot;else&amp;quot;. &lt;br /&gt;
  I'm going to read again the various random events to introduce conditions when necessary, to streamline the event flow.&lt;br /&gt;
  Syntax is: if:&amp;lt;conditions&amp;gt;?&amp;lt;actions&amp;gt;;&amp;lt;elseActions&amp;gt;&lt;br /&gt;
- I've lost some features (the hotel, the wild world virtual tour and the new Medical Center text), &lt;br /&gt;
  so I'll have to rethink them in the next days. Actually I have changed the Medicla Center concept,&lt;br /&gt;
  so the options are always displayed but if the player isn't sick or wounded or drunk the receptionist &lt;br /&gt;
  will refuse to start the treatment.&lt;br /&gt;
- Fixed: the Galcop terminal didn't show the price for cleaning the criminal record.&lt;br /&gt;
- The DEFACING KIDS event can enable a flag - eventually the consequence will be shown when the player reach the docks area.&lt;br /&gt;
&lt;br /&gt;
0.1.4 (0.4)&lt;br /&gt;
- Code optimization and refactoring. Creation of new js files for common methods, for mission-related methods, &lt;br /&gt;
  and for inside-station navigation methods.&lt;br /&gt;
- Restarted from scratch (taking the old code piece for piece).&lt;br /&gt;
- The F4 link shows a literal resume of the player. From this screen, the player can &amp;quot;disembark&amp;quot; from the ship &lt;br /&gt;
  and wander into the space station.&lt;br /&gt;
- &amp;quot;Tubes Stop&amp;quot; locations allow player to move across five different levels. Every level has a theme and &lt;br /&gt;
  several inner locations. The levels are to be intended as concentric.&lt;br /&gt;
- Events are not fired by player anymore. But moving into the station there is a 20% chance (not definitive) &lt;br /&gt;
  of firing a random event. They act like an intermission, basically.&lt;br /&gt;
- Added random snippet (from a list of 20) of texts when at a Tube Stop.&lt;br /&gt;
&lt;br /&gt;
- Added all the events already implemented in 0.1.3 (beside the bar ones)&lt;br /&gt;
- Added the bar events: the gossip option has been moved to the &amp;quot;talk with bartender one&amp;quot;. &lt;br /&gt;
  Bartender doesn't give hints about contractors anymore.&lt;br /&gt;
- It's possible to clean own criminal record at the Galcop termminal (in the Galcop precinct) &lt;br /&gt;
  paying a fine of (500cr x current bounty).&lt;br /&gt;
- Added the Art Gallery and the art genre random generator.&lt;br /&gt;
- Added the Opera House and the music genre random generator.&lt;br /&gt;
- Added the Cinema Hall and the movie genre random generator.&lt;br /&gt;
- If player is wounded or sick, randomly add short descriptive snippet of text while moving around the station.&lt;br /&gt;
- Added a short single-row-status text to show on top of the locations screens.&lt;br /&gt;
- Added two backgrounds for the &amp;quot;Tubes&amp;quot;.&lt;br /&gt;
- Changed &amp;quot;Tube Stop&amp;quot; to &amp;quot;Lift Station&amp;quot;, and &amp;quot;Tubes&amp;quot; to &amp;quot;Lift&amp;quot;. &lt;br /&gt;
  The direction is relative, it's not necessary an up-down transport.&lt;br /&gt;
&lt;br /&gt;
- The property background can contain more background file names separated by comma: &lt;br /&gt;
  the OXP will choose a random background between those specified.&lt;br /&gt;
- Added some more backgrounds, I'm trying to add variety and get an &amp;quot;identity&amp;quot; for the various levels.&lt;br /&gt;
- Added medical center location: here the player can cure wounds and sickness for a price. &lt;br /&gt;
  Price and amount of cure changes in relation to system tech level. &lt;br /&gt;
  The medical center can also rid of drunken status for free, but with a chance for a slight sickness.&lt;br /&gt;
&lt;br /&gt;
- Added health/sickness management, with the following rules being checked every time the player docks to a station:&lt;br /&gt;
1) if sickness &amp;gt; 1, chance 10% of worsening (sickness +1);&lt;br /&gt;
2) if sickness = 1, chance 10% of healing (sickness = 0);&lt;br /&gt;
3) if health &amp;gt; 1, chance 10% of worsening (health + 1);&lt;br /&gt;
4) if health = 1, chance 10% of healing (health = 0);&lt;br /&gt;
5) if health &amp;gt; 2 and sickness &amp;lt; 2, chance 10% of infection (sickness +1);&lt;br /&gt;
6) if health &amp;gt; 2 or sickness &amp;gt; 2, chance 10% of physical shape reduction&lt;br /&gt;
- If player has health or sickness in critical conditions (&amp;gt;= 5), has a 50% of pass-out. &lt;br /&gt;
  In this case he will be automatically transported to the station Medical Center and cured (with system TL limitations).&lt;br /&gt;
  Player will receive a decrease in reputation (for careless behaviour) and the price of the opeation &lt;br /&gt;
  will be automatically withdrawn from his account - if he has't enough money his bounty will be &lt;br /&gt;
  slightly increased (for debt insolvency).&lt;br /&gt;
&lt;br /&gt;
0.1.3 (0.3)&lt;br /&gt;
- implemented a time variable for events. It's now possible to define how much time will be spent when executing an event.&lt;br /&gt;
  Instead of creating a separate property, the variabile is set in the &amp;quot;end:x&amp;quot; command, where x is the time spent &lt;br /&gt;
  in seconds. So &amp;quot;end:600&amp;quot; means &amp;quot;terminate the event and go forward 10 minutes in time&amp;quot;. &lt;br /&gt;
  Use &amp;quot;end:0&amp;quot; to avoid spending game-time;&lt;br /&gt;
- As a general rule for numeric command parameters, two values comma-separated will be interpreted as a range, &lt;br /&gt;
  and a random number between the specified values will be extracted. This applies even to the time variable above;&lt;br /&gt;
- Added a new resolution to the &amp;quot;elixir peddler&amp;quot; event, that use the time variable above;&lt;br /&gt;
&lt;br /&gt;
- implemented the constants $SPECIES_S$ (singular) and $SPECIES_P$ (plural), that set a random species &lt;br /&gt;
  if requested by the event text. The species value remain fixed until the end of the event;&lt;br /&gt;
- implemented the constants $GENDERSUBJ$ (he/she), $GENDEROBJ$ (him/her), $GENDERPOSS$ (his/her). &lt;br /&gt;
  The random chosen gender remain fixed untile the end of the event. &lt;br /&gt;
  The gender-values are correlated to maintain coherence throughout the text;&lt;br /&gt;
- fixed the text of all the events implemented until now;&lt;br /&gt;
- added five &amp;quot;no-events&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
- added a new script file (LITF_RPGElements.js) to keep together the RPG-lite functions;&lt;br /&gt;
- changed the F4 link in &amp;quot;Visit the station hub&amp;quot;: it show a main screen with player current RPG-lite status &lt;br /&gt;
  (reputation, health, sickness, strength), the link to the random event and something more...;&lt;br /&gt;
- added description for all the status variables;&lt;br /&gt;
- added arrays of &amp;quot;minor&amp;quot; cargo types to be inserted in missions text: these aren't new cargo types, &lt;br /&gt;
  they will only be treated as random labels to differentiate the text depending on player reputation;&lt;br /&gt;
&lt;br /&gt;
- The link on the F4 page has been changed to &amp;quot;Visit the station hub&amp;quot; and if selected shows the &amp;quot;main screen&amp;quot;;&lt;br /&gt;
- The &amp;quot;main screen&amp;quot; displays the player status (a literal description for the LITF variables);&lt;br /&gt;
- Added variables: reputation, health (wounds, bruises etc.), sickness, strength (physical shape);&lt;br /&gt;
- Added variable: stance. Positive stance = the law; negative stance = the criminals. &lt;br /&gt;
  Similar to reputation, but to be considered more like &amp;quot;word on the street is&amp;quot;; &lt;br /&gt;
- Available choices for the &amp;quot;main screen&amp;quot;;&lt;br /&gt;
	* &amp;quot;Take a walk to the Main Concourse&amp;quot;. This fires a random event, as before;&lt;br /&gt;
&lt;br /&gt;
- The player won't find the locations (bar, fit center, church, med center) on every system. &lt;br /&gt;
  I wrote a basic rule to distribute their presence in the galaxy. &lt;br /&gt;
  The rule is mathematical and based on the system ID, so the final results are fixed - for now only the bar is enabled;&lt;br /&gt;
- Re-edited the implemented events to use the variables in effects and requirements;&lt;br /&gt;
- Added constant $LIQUORS$ (with an array of 20 liquor random names), $SYSTEM$ (get random system name), &lt;br /&gt;
  $COMMODITY$ (get random vanilla commodity name), $GOSSIP$ (get a random gossip), &lt;br /&gt;
  $NAME$ (for random NPC name), $MINORCARGO$ (for transport missions);&lt;br /&gt;
- Added flag management (not mission flags), checks and manipulation;&lt;br /&gt;
- Added command &amp;quot;time:x&amp;quot;, if you don't want to end the events but only to spend time;&lt;br /&gt;
&lt;br /&gt;
- Implemented first version mission generation. It works in two steps. First step: an NPC &lt;br /&gt;
  (in this case, the bartender) tells the player that another NPC has a job available: &lt;br /&gt;
  I store data about the NPC name, the system where he is, the type of mission and a &lt;br /&gt;
  generous time limite to reach him. When the player docks to a station I check if it's &lt;br /&gt;
  the right station and if the NPC hasn't expired: if everything's good, when the player &lt;br /&gt;
  enter the main concourse I switch to an alternate event: meeting the NPC, that introduce &lt;br /&gt;
  the job (a cargo transport), with a destination, a time limit and a type of &amp;quot;minor cargo&amp;quot; &lt;br /&gt;
  (see above). If the player accepts, I use this data to generate a real mission.&lt;br /&gt;
- Removed sickness effect when getting drunk, it's counter-productive. &lt;br /&gt;
  When I'll implement medical centers, player have the chance to pay to get sober.&lt;br /&gt;
  For now he can leave the station and dock to another station to rid of the drunkenness.&lt;br /&gt;
&lt;br /&gt;
- Modified the cargo mission management: I don't use specialCargo or awardContract, &lt;br /&gt;
  but the OXP do the checks and display the page for completing a contract (always from the Main Concourse). &lt;br /&gt;
  It's not definitive, but it seems to work.&lt;br /&gt;
- Added events: CHARMING PARTNER, MUGGING, THE LOST DRUNKARD, MEDICAL CAMP&lt;br /&gt;
&lt;br /&gt;
0.1.2 (0.2)&lt;br /&gt;
- enabled the one-event-for-dock flag (it was disabled for showing various events without leaving a station).&lt;br /&gt;
- changed the event management, I moved the events data from missionscript.plist to &lt;br /&gt;
  LITF_ActionsCatalog.js (renamed in LITF_EventsCatalog.js). &lt;br /&gt;
  In this way I can group everything related to an event in one object &lt;br /&gt;
  (text, requirements, choices and actions), and eventually I can make them more dynamic;&lt;br /&gt;
- renamed property &amp;quot;check&amp;quot; (property-checks that allow the event to happens) in &amp;quot;requires&amp;quot;;&lt;br /&gt;
- added property &amp;quot;choiceRequires&amp;quot;, contains pipe-concatenated string with checks for every event choice &lt;br /&gt;
  (see check property list) for selecting choices to display under particular circumstances; &lt;br /&gt;
  use &amp;quot;valid:1&amp;quot; for always display a choice, and &amp;quot;valid:0&amp;quot; to always hide it;&lt;br /&gt;
- added events:&lt;br /&gt;
	GENERIC: charity&lt;br /&gt;
	GENERIC: alien discussion&lt;br /&gt;
- implemented code for replace constants in event/choice text with a random element &lt;br /&gt;
  from a related array: actually used in the charity event, constant $CHARITY$.&lt;br /&gt;
&lt;br /&gt;
0.1.1 (0.1)&lt;br /&gt;
- events category list:&lt;br /&gt;
	&amp;quot;generic&amp;quot; category&lt;br /&gt;
	station allegiance (disabled)&lt;br /&gt;
	system government (gov_0 - gov_7)&lt;br /&gt;
	system tech level (ltech, htech), values 5-9 are converted to &amp;quot;generic&amp;quot;&lt;br /&gt;
	system economy (ind, agri), values 3-4 are converted to &amp;quot;generic&amp;quot;&lt;br /&gt;
	OXP choose a value from an array with the values [ generic, gov_x, tl_x, eco_x]&lt;br /&gt;
	Maybe in the future I could add as new categories ranges for player rank or player bounty&lt;br /&gt;
- specific background picture depending on event category: system government, tech level &lt;br /&gt;
  (low tech, high tech) and economy (industrial, agricolture). &amp;quot;Generic&amp;quot; events will show &lt;br /&gt;
  the related system government background;&lt;br /&gt;
- event one-click for docking disabled for testing and showing OXP workings;&lt;br /&gt;
- passing time for events temporarily disabled: to be reintroduced it as an event property;&lt;br /&gt;
- event effects list:&lt;br /&gt;
	mt_[name]:[value] add [value] to the player ship manifest good identified by [name]. &lt;br /&gt;
	bounty:[value] add [value] to the current player bounty.&lt;br /&gt;
	fuel:[value] add [value] to the current player ship fuel amount.&lt;br /&gt;
	credits[value] add [value] to the current player credits.&lt;br /&gt;
	go:[label] fire the event identified by [label]&lt;br /&gt;
	end:0 end the event&lt;br /&gt;
	[value] can be positive or negative. There are checks to avoid negative results or values exceeding cargo space.&lt;br /&gt;
- check property list:&lt;br /&gt;
	mt[name]:[value] check for player ship manifest good identified by [name] &amp;gt;= [value]&lt;br /&gt;
	mt&amp;lt;[name]:[value] check for player ship manifest good identified by [name] &amp;lt; [value]&lt;br /&gt;
	fuel:[value] check for player ship fuel amount &amp;gt;= [value]&lt;br /&gt;
	fuel&amp;lt;:[value] check for player ship fuel amount &amp;lt; [value]&lt;br /&gt;
	bounty:[value] check for current player bounty &amp;gt;= [value]&lt;br /&gt;
	bounty&amp;lt;:[value] check for current player bounty &amp;lt; [value]&lt;br /&gt;
	credits:[value] check for current player credits &amp;gt;= [value]&lt;br /&gt;
	credits&amp;lt;:[value] check for current player credits &amp;lt; [value]&lt;br /&gt;
- added events:&lt;br /&gt;
	GENERIC: beggar&lt;br /&gt;
	GENERIC: weird password guy&lt;br /&gt;
	GENERIC: fire&lt;br /&gt;
	GENERIC: fire + gossip&lt;br /&gt;
	GENERIC: shady seller&lt;br /&gt;
	GENERIC: partygoers&lt;br /&gt;
	GENERIC: running fugitive&lt;br /&gt;
	GENERIC: thief&lt;br /&gt;
	GENERIC: stranded crew (2 variants)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== License ==&lt;br /&gt;
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License version 4.0.&lt;br /&gt;
&lt;br /&gt;
If you are re-using any piece of this OXP, please let me know by sending an e-mail to norbylite at gmail.com.&lt;br /&gt;
&lt;br /&gt;
Author: BeeTLe BeTHLeHeM&lt;br /&gt;
&lt;br /&gt;
[[File:Life in the Frontier - Revival.png|thumb|right|400px|Life in the Frontier - Revival (BeeTLe BeTHLeHeM's second OXP)]]&lt;br /&gt;
&lt;br /&gt;
== Musings ==&lt;br /&gt;
*These stations are massive! There should be many more facilities - restaurants, many more bars, more hotels, ''etc''.&lt;br /&gt;
*There should be different maps for different stations (Coriolis, Dodo, Ico ''etc'').&lt;br /&gt;
*Might one be able to sit in a bar and watch the planet and local ships move beneath on a screen or even through a window! And watch [[GNN]] on another screen!&lt;br /&gt;
*Could be combined with the bar in [[Hints]], with the bar and trade floor ''etc''. in [[New Cargoes]], the Embassy district in [[Diplomancy]], the Guild of Elite Traders in [[Elite Trader OXZ]], a Lave First Finance Corp office for [[First Finance OXP]], the Black Market, bribeable station officials' offices and the dock master's office for [[Smugglers - The Galactic Underworld]], GalCop security offices/kiosks for [[Bounty System]] and the storage facility for [[Equipment Storage OXP]]. And [[Hermitage]] could do with a Rock Hermit equivalent!&lt;br /&gt;
*Since one can become meaningfully sick, a meaningful link with plague systems would be a nice addition (determined ''eg'' by [[GNN]]).&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
*Download from the in-game [[Expansions Manager]]!&lt;br /&gt;
*[[Media:Life_In_The_Frontier_0.7.3.oxz|Life_In_The_Frontier_0.7.3.oxz]] (downloaded {{#downloads:Life_In_The_Frontier_0.7.3.oxz}} times).&lt;br /&gt;
*[[Media:Life_In_The_Frontier_0.7.1.oxz|Life_In_The_Frontier_0.7.1.oxz]] (downloaded {{#downloads:Life_In_The_Frontier_0.7.1.oxz}} times).&lt;br /&gt;
&lt;br /&gt;
*Massively Locked's updates (experimental).  Note that these are development versions and not recommended for regular play-throughs.&lt;br /&gt;
:[[File:LitF+v0.03.oxz]] - adds fledgling rock hermit layout&lt;br /&gt;
:[[File:LitF+v0.02.oxz]] - adds temples, govt section, RH bookshop&lt;br /&gt;
:[[File:LitF+v0.01.oxz]] - more bookshops, names your ship&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*[http://www.aegidian.org/bb/viewtopic.php?t=17181 BB Thread] (2015-16)&lt;br /&gt;
*[https://www.youtube.com/watch?v=TZx59ShaVtw YouTube film] (2018) - this now seems to link to a film of the second OXP, below.&lt;br /&gt;
*[https://pioneerspacesim.net/forum/viewtopic.php?f=3&amp;amp;t=454 My dream for entering stations / cities] Pioneer's discussion on this (2016-date)&lt;br /&gt;
&lt;br /&gt;
*[[Life In The Frontier - Revival OXP]] - a second, clashing OXP, also by BeeTLe BeTHLeHeM, which creates a message board with things to do...&lt;br /&gt;
&lt;br /&gt;
== Quick Facts ==&lt;br /&gt;
{{OXPLevel|0}}{{Infobox OXPb| title = Life In The Frontier&lt;br /&gt;
|version = 0.7.3&lt;br /&gt;
|release = 2015.07.12&lt;br /&gt;
|features = Walk around in the station&lt;br /&gt;
|license = CC BY-NC-SA 4&lt;br /&gt;
|category = Activities OXPs&lt;br /&gt;
|author = [http://aegidian.org/bb/memberlist.php?mode=viewprofile&amp;amp;u=28786 BeeTLe BeTHLeHeM]&lt;br /&gt;
|feedback = [http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=17181 BB-Link]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Dockables-OXP}}&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Life_in_the_Frontier&amp;diff=76981</id>
		<title>Life in the Frontier</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Life_in_the_Frontier&amp;diff=76981"/>
		<updated>2022-11-18T07:00:23Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: :-) Reports of my wealth have been greatly exaggerated, reports of my inebriation have not&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OXPNote|Initiated by BeeTLe BeTHLeHeM, then tweaked by [[User:Norby|Norby]], this OXP could do with some more work! All the stations have the same map - they should vary... (the encounters ''do'' vary)}}&lt;br /&gt;
[[Image:Litf_stationmap.png|300px|right]]&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
At the moment, players roleplay their game session, depending on the career they choose, and the events in-flight. But, space stations, on the contrary, are still rather static (without considering OXPs) and act more like a transition between two flights.&lt;br /&gt;
&lt;br /&gt;
So I thought to help stations offer more variety, giving a player the chance to encounter random events while docked, an event that could require a player choice and with effects (good and bad) on the player.&lt;br /&gt;
&lt;br /&gt;
[[File:Life in the Frontier (Park).png|thumb|400px|right]]&lt;br /&gt;
[[File:Life in the Frontier (Medical Centre).png|thumb|400px|right]]&lt;br /&gt;
[[File:Life in the Frontier (Bar).png|thumb|400px|right|Unfortunate blue text thanks to [[Dangerous HUD]] (blue)!]]&lt;br /&gt;
== How it works ==&lt;br /&gt;
=== Events ===&lt;br /&gt;
When the player is docked at a station, he will find in the F4 screen a new item, '''Disembark from your ship'''. If selected, the OXP will choose a random event from a list, and the player will have to confront it. Some events will be a mere description of something that happens in the vicinity of the player, while others will require choices and decisions, and usually offer multiple resolutions.&lt;br /&gt;
&lt;br /&gt;
The events are categorized depending on various factors: the system government, economy and TL, plus one &amp;quot;generic&amp;quot; category for events that can happen anywhere. Instead the specific categories are intended to create a precise atmosphere, so in dictatorial systems there will be a more oppressive feeling, and in low tech worlds it will possible to see more malfunctioning in systems.&lt;br /&gt;
&lt;br /&gt;
Every category has a defined background - I have taken shots from corridors in old sci-fi movies but I don't know if I can use them, so in case I will remove them. For now consider them as placeholders.&lt;br /&gt;
&lt;br /&gt;
The resolution of an event can include: variation in money, in bounty level, in ship fuel or cargo goods. In these case will be displayed a report screen showing what is changed.&lt;br /&gt;
&lt;br /&gt;
Sometimes the eventuation of an event will require a check on one of those properties, for example to avoid the player losing more money than he actually has!&lt;br /&gt;
&lt;br /&gt;
The player can initiate an event by docking, to initiate another event he will need to leave and dock at another (or the same) station - in this way the mechanic shouldn't be abused.&lt;br /&gt;
&lt;br /&gt;
=== The map ===&lt;br /&gt;
One can move around and explore the station, and encounter more events as one does so, both during travel and in, say, the bar. There is something to be found at each location (dust in the bookshop...).&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;  data-expandtext=&amp;quot;Show details from the Dark Side&amp;quot; data-collapsetext=&amp;quot;Hide details&amp;quot; style=&amp;quot;overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
0.7.3&lt;br /&gt;
-Disembark is possible after load game in additional stations.&lt;br /&gt;
-Fixed step back from life status screen in non-galcop stations.&lt;br /&gt;
-Fixed mission.screenID error message in non-galcop stations.&lt;br /&gt;
&lt;br /&gt;
0.7.2&lt;br /&gt;
- Fixed bounty clearing at galcop terminal (by Norby).&lt;br /&gt;
- Non-galcop stations are limited to the hangar.&lt;br /&gt;
- HD BackGrounds OXP is used in life status screen and non-galcop hangar.&lt;br /&gt;
- Able to use hd background images made in any resolution (fit to height).&lt;br /&gt;
&lt;br /&gt;
0.7.1&lt;br /&gt;
- Fixed action on Museum exit.&lt;br /&gt;
&lt;br /&gt;
0.7&lt;br /&gt;
- Completed STORAGE, special location on Docks with restricted access: &lt;br /&gt;
  25 credits or legal stance &amp;lt;= -25 (friendly with criminals)&lt;br /&gt;
- Placed PASSENGERS LOUNGE, special location on Concourse-A&lt;br /&gt;
- Placed CHURCH OF THE COSMIC WANDERER, special location on Concourse-B&lt;br /&gt;
- Placed BOOKSHOP, special location on Concourse-B&lt;br /&gt;
- Placed MUSEUM, special location on Delight Avenue&lt;br /&gt;
- Placed FIT CENTER, special location on Olympian Square&lt;br /&gt;
- Implemented Station Map, visible from every lobby&lt;br /&gt;
- Commander stats and OXP flags are stored as a map (string with format name1=value1,name2=value2,name3=value3...) &lt;br /&gt;
  instead of an array. This should definitely fix every issue with loading and saving data.&lt;br /&gt;
- Placed BRIEFING ROOM, special location on Galcop Precinct.&lt;br /&gt;
- Placed DETAINMENT ZONE, special location on Galcop Precinct.&lt;br /&gt;
- Placed SOCIAL SERVICES, special location on Galcop Precinct.&lt;br /&gt;
- Placed PILOT COURSE ROOM, special location on Galcop Precinct.&lt;br /&gt;
&lt;br /&gt;
- Implemented SOCIAL SERVICES mechanics:&lt;br /&gt;
	* Player can spend 4 hours doing social services. His reputation will increase of a small amount. &lt;br /&gt;
	  His bounty will decrease of an amount. There's a chance of getting hurt during the work. &lt;br /&gt;
	  In this case the time spent and bounty decrease are reduced.&lt;br /&gt;
&lt;br /&gt;
- Implemented FIT CENTER mechanics:&lt;br /&gt;
	* The first time the commander visits a Fit Center, he must buy an Universal Fitness Badge for 15cr. &lt;br /&gt;
	  This purchase include a month subscription.&lt;br /&gt;
	* The subscription can be renewed monthly for 10cr.&lt;br /&gt;
	* Commander mustn't be wounded or sick to enter the gym.&lt;br /&gt;
	* Every gym session increase commander strength.&lt;br /&gt;
	* If commander exercise more than once in two days, a chance of getting wounded while exercising increase.&lt;br /&gt;
	* If the commander get wounded, he'll must get healed before starting a new gym session.&lt;br /&gt;
	* If the commander get wounded, the maximum strength cap get lowered of a small amount. &lt;br /&gt;
	  If this amount get very low (it requires a lot of accidents, though...) the commander can't access &lt;br /&gt;
	  the gym anymore until he get a recovering therapy from an hi-tech Medical Center.&lt;br /&gt;
	* If the commander doesn't go to the gym for more than a week, strength will lower of a small amount after every dock.&lt;br /&gt;
	* If commander can't access the gym because he has endured too much damage, he can go to a hi-tech system &lt;br /&gt;
	  Medical Center and get into a Recovery Therapy for 400cr. This therapy is available only when the player &lt;br /&gt;
	  has sustained a lot of damage (only in the gym for now).&lt;br /&gt;
	* The status screen (access from the hangar) report the Universal Fitness expiration status, when the player buys it.&lt;br /&gt;
&lt;br /&gt;
0.6.1&lt;br /&gt;
- Fixed corridor background name - this should avoid log warning messages about texture files not found.&lt;br /&gt;
- Fixed paytreatment action, MedCenter treatment should give no exception now.&lt;br /&gt;
- Deleted useless number from OXP versioning - better late then never. (Current model: MajorVersion.MinorVersion.Fix)&lt;br /&gt;
&lt;br /&gt;
0.1.6 (0.6)&lt;br /&gt;
- When accessing the OXP from the F4 screen, the player goes directly to the Hangar.&lt;br /&gt;
- The player can display the Commander Status screen from the Hangar.&lt;br /&gt;
- Station layout updated following forum discussion on the current design.&lt;br /&gt;
- Changed some definitions for station locations.&lt;br /&gt;
- Lobby indications are more schematic.&lt;br /&gt;
- The Storage location has been promoted to special location.&lt;br /&gt;
- Implemented Hotel, moved location to Main Concourse-A because Delight Avenue has already 3 planned locations.&lt;br /&gt;
- Implemented the Wild Worlds Virtual Tour, on the Delight Avenue (Recreation Bridge).&lt;br /&gt;
&lt;br /&gt;
0.1.5.1 (0.5.1)&lt;br /&gt;
- Fixed check on the variables introduced in 0.1.5.&lt;br /&gt;
- Fixed check on varStore array items before setting values.&lt;br /&gt;
&lt;br /&gt;
0.1.5 (0.5)&lt;br /&gt;
- Added background to Docks Area;&lt;br /&gt;
- Add text snippet for drunken status (along with wounds and sickness);&lt;br /&gt;
- Implemented event-checks for &amp;quot;government&amp;quot;, &amp;quot;tech&amp;quot; and &amp;quot;economy&amp;quot;. The government check can take a list of governments,&lt;br /&gt;
  separated by &amp;quot;-&amp;quot; character. If the system government is in the list, the check is valid;&lt;br /&gt;
- Added events: ROBO-BARD, HUNTERS, DELIRIOUS DROID, COMMERCIAL DROID, SUPERCELEBRITY, LIGHTS MALFUNCTION, &lt;br /&gt;
  WATER MALFUNCTION, AIR MALFUNCTION, DEFACING KIDS&lt;br /&gt;
- &amp;quot;her/him/his&amp;quot; not capitalized anymore;&lt;br /&gt;
- Commander stats are saved as a string with comma-separated values rather than 5 missionVariables.&lt;br /&gt;
- Game flags are saved as a string with comma-separated values rather than 8 missionVariables.&lt;br /&gt;
- Variables still not used aren't loaded anymore from the savegame, and are saved with null values to purge them from the file.&lt;br /&gt;
- Refactored method for checks on event/choice requirements: it's now possible to interrogate a parameter with operators&lt;br /&gt;
  =, !=, &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=. The requirement syntax changes. E.g.: no more credits:500, but credits=500, or credits&amp;lt;500 etc.&lt;br /&gt;
- Event text can be present as parameter &amp;quot;text&amp;quot; (static text, always displayed) *OR* as indexed parameters &lt;br /&gt;
  (text0, text1, text2): in the latter case, it's possible to specify display conditions, with syntax&lt;br /&gt;
  &amp;quot;condition|text to display&amp;quot;. If an indexed text has no condition is considered static (always displayed). &lt;br /&gt;
  The validated indexed text are concatenated.&lt;br /&gt;
- Event property &amp;quot;choiceRequires&amp;quot; has been removed. It has been replaced by &amp;quot;r&amp;quot;(+ choice index), that contains &lt;br /&gt;
  the facultative requirements for the single choice. If a choice has no requirements (no &amp;quot;r&amp;quot; property), &lt;br /&gt;
  the choice is always displayed.&lt;br /&gt;
- I believe I have removed the end-event resume screen at least one release ago, forgot to write it down.&lt;br /&gt;
- To avoid confusion, in the event properties requires and r I don't use the ':' char as separator anymore, &lt;br /&gt;
  but the equal sign '='.&lt;br /&gt;
- Refactored action executions when player select an event or a location choice. There are some differences &lt;br /&gt;
  in some actions, so I had to differentitate: go (random event) and goNav (navigation), end (random event) &lt;br /&gt;
  and endNav (navigation).&lt;br /&gt;
- Implemented condition if to the events action. Now it's possible to define a condition (or multiple conditions, &lt;br /&gt;
  comma-separated), and to link it to two results: the &amp;quot;valid condition&amp;quot; and the &amp;quot;else&amp;quot;. &lt;br /&gt;
  I'm going to read again the various random events to introduce conditions when necessary, to streamline the event flow.&lt;br /&gt;
  Syntax is: if:&amp;lt;conditions&amp;gt;?&amp;lt;actions&amp;gt;;&amp;lt;elseActions&amp;gt;&lt;br /&gt;
- I've lost some features (the hotel, the wild world virtual tour and the new Medical Center text), &lt;br /&gt;
  so I'll have to rethink them in the next days. Actually I have changed the Medicla Center concept,&lt;br /&gt;
  so the options are always displayed but if the player isn't sick or wounded or drunk the receptionist &lt;br /&gt;
  will refuse to start the treatment.&lt;br /&gt;
- Fixed: the Galcop terminal didn't show the price for cleaning the criminal record.&lt;br /&gt;
- The DEFACING KIDS event can enable a flag - eventually the consequence will be shown when the player reach the docks area.&lt;br /&gt;
&lt;br /&gt;
0.1.4 (0.4)&lt;br /&gt;
- Code optimization and refactoring. Creation of new js files for common methods, for mission-related methods, &lt;br /&gt;
  and for inside-station navigation methods.&lt;br /&gt;
- Restarted from scratch (taking the old code piece for piece).&lt;br /&gt;
- The F4 link shows a literal resume of the player. From this screen, the player can &amp;quot;disembark&amp;quot; from the ship &lt;br /&gt;
  and wander into the space station.&lt;br /&gt;
- &amp;quot;Tubes Stop&amp;quot; locations allow player to move across five different levels. Every level has a theme and &lt;br /&gt;
  several inner locations. The levels are to be intended as concentric.&lt;br /&gt;
- Events are not fired by player anymore. But moving into the station there is a 20% chance (not definitive) &lt;br /&gt;
  of firing a random event. They act like an intermission, basically.&lt;br /&gt;
- Added random snippet (from a list of 20) of texts when at a Tube Stop.&lt;br /&gt;
&lt;br /&gt;
- Added all the events already implemented in 0.1.3 (beside the bar ones)&lt;br /&gt;
- Added the bar events: the gossip option has been moved to the &amp;quot;talk with bartender one&amp;quot;. &lt;br /&gt;
  Bartender doesn't give hints about contractors anymore.&lt;br /&gt;
- It's possible to clean own criminal record at the Galcop termminal (in the Galcop precinct) &lt;br /&gt;
  paying a fine of (500cr x current bounty).&lt;br /&gt;
- Added the Art Gallery and the art genre random generator.&lt;br /&gt;
- Added the Opera House and the music genre random generator.&lt;br /&gt;
- Added the Cinema Hall and the movie genre random generator.&lt;br /&gt;
- If player is wounded or sick, randomly add short descriptive snippet of text while moving around the station.&lt;br /&gt;
- Added a short single-row-status text to show on top of the locations screens.&lt;br /&gt;
- Added two backgrounds for the &amp;quot;Tubes&amp;quot;.&lt;br /&gt;
- Changed &amp;quot;Tube Stop&amp;quot; to &amp;quot;Lift Station&amp;quot;, and &amp;quot;Tubes&amp;quot; to &amp;quot;Lift&amp;quot;. &lt;br /&gt;
  The direction is relative, it's not necessary an up-down transport.&lt;br /&gt;
&lt;br /&gt;
- The property background can contain more background file names separated by comma: &lt;br /&gt;
  the OXP will choose a random background between those specified.&lt;br /&gt;
- Added some more backgrounds, I'm trying to add variety and get an &amp;quot;identity&amp;quot; for the various levels.&lt;br /&gt;
- Added medical center location: here the player can cure wounds and sickness for a price. &lt;br /&gt;
  Price and amount of cure changes in relation to system tech level. &lt;br /&gt;
  The medical center can also rid of drunken status for free, but with a chance for a slight sickness.&lt;br /&gt;
&lt;br /&gt;
- Added health/sickness management, with the following rules being checked every time the player docks to a station:&lt;br /&gt;
1) if sickness &amp;gt; 1, chance 10% of worsening (sickness +1);&lt;br /&gt;
2) if sickness = 1, chance 10% of healing (sickness = 0);&lt;br /&gt;
3) if health &amp;gt; 1, chance 10% of worsening (health + 1);&lt;br /&gt;
4) if health = 1, chance 10% of healing (health = 0);&lt;br /&gt;
5) if health &amp;gt; 2 and sickness &amp;lt; 2, chance 10% of infection (sickness +1);&lt;br /&gt;
6) if health &amp;gt; 2 or sickness &amp;gt; 2, chance 10% of physical shape reduction&lt;br /&gt;
- If player has health or sickness in critical conditions (&amp;gt;= 5), has a 50% of pass-out. &lt;br /&gt;
  In this case he will be automatically transported to the station Medical Center and cured (with system TL limitations).&lt;br /&gt;
  Player will receive a decrease in reputation (for careless behaviour) and the price of the opeation &lt;br /&gt;
  will be automatically withdrawn from his account - if he has't enough money his bounty will be &lt;br /&gt;
  slightly increased (for debt insolvency).&lt;br /&gt;
&lt;br /&gt;
0.1.3 (0.3)&lt;br /&gt;
- implemented a time variable for events. It's now possible to define how much time will be spent when executing an event.&lt;br /&gt;
  Instead of creating a separate property, the variabile is set in the &amp;quot;end:x&amp;quot; command, where x is the time spent &lt;br /&gt;
  in seconds. So &amp;quot;end:600&amp;quot; means &amp;quot;terminate the event and go forward 10 minutes in time&amp;quot;. &lt;br /&gt;
  Use &amp;quot;end:0&amp;quot; to avoid spending game-time;&lt;br /&gt;
- As a general rule for numeric command parameters, two values comma-separated will be interpreted as a range, &lt;br /&gt;
  and a random number between the specified values will be extracted. This applies even to the time variable above;&lt;br /&gt;
- Added a new resolution to the &amp;quot;elixir peddler&amp;quot; event, that use the time variable above;&lt;br /&gt;
&lt;br /&gt;
- implemented the constants $SPECIES_S$ (singular) and $SPECIES_P$ (plural), that set a random species &lt;br /&gt;
  if requested by the event text. The species value remain fixed until the end of the event;&lt;br /&gt;
- implemented the constants $GENDERSUBJ$ (he/she), $GENDEROBJ$ (him/her), $GENDERPOSS$ (his/her). &lt;br /&gt;
  The random chosen gender remain fixed untile the end of the event. &lt;br /&gt;
  The gender-values are correlated to maintain coherence throughout the text;&lt;br /&gt;
- fixed the text of all the events implemented until now;&lt;br /&gt;
- added five &amp;quot;no-events&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
- added a new script file (LITF_RPGElements.js) to keep together the RPG-lite functions;&lt;br /&gt;
- changed the F4 link in &amp;quot;Visit the station hub&amp;quot;: it show a main screen with player current RPG-lite status &lt;br /&gt;
  (reputation, health, sickness, strength), the link to the random event and something more...;&lt;br /&gt;
- added description for all the status variables;&lt;br /&gt;
- added arrays of &amp;quot;minor&amp;quot; cargo types to be inserted in missions text: these aren't new cargo types, &lt;br /&gt;
  they will only be treated as random labels to differentiate the text depending on player reputation;&lt;br /&gt;
&lt;br /&gt;
- The link on the F4 page has been changed to &amp;quot;Visit the station hub&amp;quot; and if selected shows the &amp;quot;main screen&amp;quot;;&lt;br /&gt;
- The &amp;quot;main screen&amp;quot; displays the player status (a literal description for the LITF variables);&lt;br /&gt;
- Added variables: reputation, health (wounds, bruises etc.), sickness, strength (physical shape);&lt;br /&gt;
- Added variable: stance. Positive stance = the law; negative stance = the criminals. &lt;br /&gt;
  Similar to reputation, but to be considered more like &amp;quot;word on the street is&amp;quot;; &lt;br /&gt;
- Available choices for the &amp;quot;main screen&amp;quot;;&lt;br /&gt;
	* &amp;quot;Take a walk to the Main Concourse&amp;quot;. This fires a random event, as before;&lt;br /&gt;
&lt;br /&gt;
- The player won't find the locations (bar, fit center, church, med center) on every system. &lt;br /&gt;
  I wrote a basic rule to distribute their presence in the galaxy. &lt;br /&gt;
  The rule is mathematical and based on the system ID, so the final results are fixed - for now only the bar is enabled;&lt;br /&gt;
- Re-edited the implemented events to use the variables in effects and requirements;&lt;br /&gt;
- Added constant $LIQUORS$ (with an array of 20 liquor random names), $SYSTEM$ (get random system name), &lt;br /&gt;
  $COMMODITY$ (get random vanilla commodity name), $GOSSIP$ (get a random gossip), &lt;br /&gt;
  $NAME$ (for random NPC name), $MINORCARGO$ (for transport missions);&lt;br /&gt;
- Added flag management (not mission flags), checks and manipulation;&lt;br /&gt;
- Added command &amp;quot;time:x&amp;quot;, if you don't want to end the events but only to spend time;&lt;br /&gt;
&lt;br /&gt;
- Implemented first version mission generation. It works in two steps. First step: an NPC &lt;br /&gt;
  (in this case, the bartender) tells the player that another NPC has a job available: &lt;br /&gt;
  I store data about the NPC name, the system where he is, the type of mission and a &lt;br /&gt;
  generous time limite to reach him. When the player docks to a station I check if it's &lt;br /&gt;
  the right station and if the NPC hasn't expired: if everything's good, when the player &lt;br /&gt;
  enter the main concourse I switch to an alternate event: meeting the NPC, that introduce &lt;br /&gt;
  the job (a cargo transport), with a destination, a time limit and a type of &amp;quot;minor cargo&amp;quot; &lt;br /&gt;
  (see above). If the player accepts, I use this data to generate a real mission.&lt;br /&gt;
- Removed sickness effect when getting drunk, it's counter-productive. &lt;br /&gt;
  When I'll implement medical centers, player have the chance to pay to get sober.&lt;br /&gt;
  For now he can leave the station and dock to another station to rid of the drunkenness.&lt;br /&gt;
&lt;br /&gt;
- Modified the cargo mission management: I don't use specialCargo or awardContract, &lt;br /&gt;
  but the OXP do the checks and display the page for completing a contract (always from the Main Concourse). &lt;br /&gt;
  It's not definitive, but it seems to work.&lt;br /&gt;
- Added events: CHARMING PARTNER, MUGGING, THE LOST DRUNKARD, MEDICAL CAMP&lt;br /&gt;
&lt;br /&gt;
0.1.2 (0.2)&lt;br /&gt;
- enabled the one-event-for-dock flag (it was disabled for showing various events without leaving a station).&lt;br /&gt;
- changed the event management, I moved the events data from missionscript.plist to &lt;br /&gt;
  LITF_ActionsCatalog.js (renamed in LITF_EventsCatalog.js). &lt;br /&gt;
  In this way I can group everything related to an event in one object &lt;br /&gt;
  (text, requirements, choices and actions), and eventually I can make them more dynamic;&lt;br /&gt;
- renamed property &amp;quot;check&amp;quot; (property-checks that allow the event to happens) in &amp;quot;requires&amp;quot;;&lt;br /&gt;
- added property &amp;quot;choiceRequires&amp;quot;, contains pipe-concatenated string with checks for every event choice &lt;br /&gt;
  (see check property list) for selecting choices to display under particular circumstances; &lt;br /&gt;
  use &amp;quot;valid:1&amp;quot; for always display a choice, and &amp;quot;valid:0&amp;quot; to always hide it;&lt;br /&gt;
- added events:&lt;br /&gt;
	GENERIC: charity&lt;br /&gt;
	GENERIC: alien discussion&lt;br /&gt;
- implemented code for replace constants in event/choice text with a random element &lt;br /&gt;
  from a related array: actually used in the charity event, constant $CHARITY$.&lt;br /&gt;
&lt;br /&gt;
0.1.1 (0.1)&lt;br /&gt;
- events category list:&lt;br /&gt;
	&amp;quot;generic&amp;quot; category&lt;br /&gt;
	station allegiance (disabled)&lt;br /&gt;
	system government (gov_0 - gov_7)&lt;br /&gt;
	system tech level (ltech, htech), values 5-9 are converted to &amp;quot;generic&amp;quot;&lt;br /&gt;
	system economy (ind, agri), values 3-4 are converted to &amp;quot;generic&amp;quot;&lt;br /&gt;
	OXP choose a value from an array with the values [ generic, gov_x, tl_x, eco_x]&lt;br /&gt;
	Maybe in the future I could add as new categories ranges for player rank or player bounty&lt;br /&gt;
- specific background picture depending on event category: system government, tech level &lt;br /&gt;
  (low tech, high tech) and economy (industrial, agricolture). &amp;quot;Generic&amp;quot; events will show &lt;br /&gt;
  the related system government background;&lt;br /&gt;
- event one-click for docking disabled for testing and showing OXP workings;&lt;br /&gt;
- passing time for events temporarily disabled: to be reintroduced it as an event property;&lt;br /&gt;
- event effects list:&lt;br /&gt;
	mt_[name]:[value] add [value] to the player ship manifest good identified by [name]. &lt;br /&gt;
	bounty:[value] add [value] to the current player bounty.&lt;br /&gt;
	fuel:[value] add [value] to the current player ship fuel amount.&lt;br /&gt;
	credits[value] add [value] to the current player credits.&lt;br /&gt;
	go:[label] fire the event identified by [label]&lt;br /&gt;
	end:0 end the event&lt;br /&gt;
	[value] can be positive or negative. There are checks to avoid negative results or values exceeding cargo space.&lt;br /&gt;
- check property list:&lt;br /&gt;
	mt[name]:[value] check for player ship manifest good identified by [name] &amp;gt;= [value]&lt;br /&gt;
	mt&amp;lt;[name]:[value] check for player ship manifest good identified by [name] &amp;lt; [value]&lt;br /&gt;
	fuel:[value] check for player ship fuel amount &amp;gt;= [value]&lt;br /&gt;
	fuel&amp;lt;:[value] check for player ship fuel amount &amp;lt; [value]&lt;br /&gt;
	bounty:[value] check for current player bounty &amp;gt;= [value]&lt;br /&gt;
	bounty&amp;lt;:[value] check for current player bounty &amp;lt; [value]&lt;br /&gt;
	credits:[value] check for current player credits &amp;gt;= [value]&lt;br /&gt;
	credits&amp;lt;:[value] check for current player credits &amp;lt; [value]&lt;br /&gt;
- added events:&lt;br /&gt;
	GENERIC: beggar&lt;br /&gt;
	GENERIC: weird password guy&lt;br /&gt;
	GENERIC: fire&lt;br /&gt;
	GENERIC: fire + gossip&lt;br /&gt;
	GENERIC: shady seller&lt;br /&gt;
	GENERIC: partygoers&lt;br /&gt;
	GENERIC: running fugitive&lt;br /&gt;
	GENERIC: thief&lt;br /&gt;
	GENERIC: stranded crew (2 variants)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== License ==&lt;br /&gt;
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License version 4.0.&lt;br /&gt;
&lt;br /&gt;
If you are re-using any piece of this OXP, please let me know by sending an e-mail to norbylite at gmail.com.&lt;br /&gt;
&lt;br /&gt;
Author: BeeTLe BeTHLeHeM&lt;br /&gt;
&lt;br /&gt;
[[File:Life in the Frontier - Revival.png|thumb|right|400px|Life in the Frontier - Revival (BeeTLe BeTHLeHeM's second OXP)]]&lt;br /&gt;
&lt;br /&gt;
== Musings ==&lt;br /&gt;
*These stations are massive! There should be many more facilities - restaurants, many more bars, more hotels, ''etc''.&lt;br /&gt;
*There should be different maps for different stations (Coriolis, Dodo, Ico ''etc'').&lt;br /&gt;
*Might one be able to sit in a bar and watch the planet and local ships move beneath on a screen or even through a window! And watch [[GNN]] on another screen!&lt;br /&gt;
*Could be combined with the bar in [[Hints]], with the bar and trade floor ''etc''. in [[New Cargoes]], the Embassy district in [[Diplomancy]], the Guild of Elite Traders in [[Elite Trader OXZ]], a Lave First Finance Corp office for [[First Finance OXP]], the Black Market, bribeable station officials' offices and the dock master's office for [[Smugglers - The Galactic Underworld]], GalCop security offices/kiosks for [[Bounty System]] and the storage facility for [[Equipment Storage OXP]]. And [[Hermitage]] could do with a Rock Hermit equivalent!&lt;br /&gt;
*Since one can become meaningfully sick, a meaningful link with plague systems would be a nice addition (determined ''eg'' by [[GNN]]).&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
*Download from the in-game [[Expansions Manager]]!&lt;br /&gt;
*[[Media:Life_In_The_Frontier_0.7.3.oxz|Life_In_The_Frontier_0.7.3.oxz]] (downloaded {{#downloads:Life_In_The_Frontier_0.7.3.oxz}} times).&lt;br /&gt;
*[[Media:Life_In_The_Frontier_0.7.1.oxz|Life_In_The_Frontier_0.7.1.oxz]] (downloaded {{#downloads:Life_In_The_Frontier_0.7.1.oxz}} times).&lt;br /&gt;
&lt;br /&gt;
*Massively Locked's updates (experimental)&lt;br /&gt;
:[[File:LitF+v0.03.oxz]] - adds fledgling rock hermit layout&lt;br /&gt;
:[[File:LitF+v0.02.oxz]] - adds temples, govt section, RH bookshop&lt;br /&gt;
:[[File:LitF+v0.01.oxz]] - more bookshops, names your ship&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*[http://www.aegidian.org/bb/viewtopic.php?t=17181 BB Thread] (2015-16)&lt;br /&gt;
*[https://www.youtube.com/watch?v=TZx59ShaVtw YouTube film] (2018) - this now seems to link to a film of the second OXP, below.&lt;br /&gt;
*[https://pioneerspacesim.net/forum/viewtopic.php?f=3&amp;amp;t=454 My dream for entering stations / cities] Pioneer's discussion on this (2016-date)&lt;br /&gt;
&lt;br /&gt;
*[[Life In The Frontier - Revival OXP]] - a second, clashing OXP, also by BeeTLe BeTHLeHeM, which creates a message board with things to do...&lt;br /&gt;
&lt;br /&gt;
== Quick Facts ==&lt;br /&gt;
{{OXPLevel|0}}{{Infobox OXPb| title = Life In The Frontier&lt;br /&gt;
|version = 0.7.3&lt;br /&gt;
|release = 2015.07.12&lt;br /&gt;
|features = Walk around in the station&lt;br /&gt;
|license = CC BY-NC-SA 4&lt;br /&gt;
|category = Activities OXPs&lt;br /&gt;
|author = [http://aegidian.org/bb/memberlist.php?mode=viewprofile&amp;amp;u=28786 BeeTLe BeTHLeHeM]&lt;br /&gt;
|feedback = [http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=17181 BB-Link]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Dockables-OXP}}&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.03.oxz&amp;diff=76976</id>
		<title>File:LitF+v0.03.oxz</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.03.oxz&amp;diff=76976"/>
		<updated>2022-11-17T23:01:01Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: dev ver 0.03&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
dev ver 0.03&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Misc_plists&amp;diff=76864</id>
		<title>Misc plists</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Misc_plists&amp;diff=76864"/>
		<updated>2022-11-12T13:10:44Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Structure */ fixed typo &amp;amp; cleared up wording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=crosshairs.[[plist]]=&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
The file is organized as a dictionary of crosshairs with the weapon name as its key. The key 'OTHER' can be used for weapons not otherwise defined by the crosshairs dictionary. Each weapon crosshair itself consists of an array of line segments. Each line segment is represented by an array of 6 numbers.&lt;br /&gt;
Example of a line segment:&lt;br /&gt;
 (W1, X1, Y1,    W2, X2, Y2)&lt;br /&gt;
The line will start at X1,Y1 with a relative width W1 and ends at X2, Y2 with relative width W2.&lt;br /&gt;
All coordinates must lie between -1 and +1, while the widths are between 0 and 1&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 WEAPON_NONE =&lt;br /&gt;
 (&lt;br /&gt;
 	(0.25, 0.75, 0.0,		0.75, 0.50, 0.0),&lt;br /&gt;
 	(0.25, -0.75, 0.0,		0.75, -0.50, 0.0)&lt;br /&gt;
 );&lt;br /&gt;
The crosshairs.plist is not intended to be changed by an OXP. For custom crosshairs it is intended to add a &amp;lt;code&amp;gt;crosshair&amp;lt;/code&amp;gt; entry in the custom HUD definition itself. This will then override the default crosshairs for that HUD. (See [[hud.plist]]).&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, custom crosshairs files may be defined. These have the same syntax as crosshairs.plist, but should have a different unique name (e.g. &amp;lt;code&amp;gt;oxpname_crosshairs1.plist&amp;lt;/code&amp;gt;). Crosshairs may be included by a HUD definition, or switched in and out by [[Oolite_JavaScript_Reference:_PlayerShip#crosshairs|scripting]].&lt;br /&gt;
&lt;br /&gt;
=descriptions.[[plist]]=&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
&lt;br /&gt;
The file is organized as a dictionary with pairs of key and value (string or array).&lt;br /&gt;
It has the same structure as the [[missiontext.plist]] and it also resides in the config folder inside the OXP.&lt;br /&gt;
&lt;br /&gt;
Example XML:&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
    &amp;lt;key&amp;gt;parcelnumbers&amp;lt;/key&amp;gt;&lt;br /&gt;
    &amp;lt;array&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;two&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;three&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;four&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;five&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;six&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example OpenStep:&lt;br /&gt;
 {&lt;br /&gt;
   parcelnumbers = (&amp;quot;two&amp;quot;, &amp;quot;three&amp;quot;, &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Use  ==&lt;br /&gt;
&lt;br /&gt;
Its use must be seen as a kind of variable. The key part is the variable name and the string part is the content of the variable. If you use an array of strings the variable will return a random choice of one of the strings. And this is the main use of the descriptions.plist: creation of text with variable content. See also [[string expansion]]. Note that for compatibility, the random number used to determine which choice to use from an array is only 1 byte long. Therefore if the array has more than 256 entries there will be some entries which can never be picked, and if it has a number of entries which is not a power of two the entries will not have equal chances of being picked (though if the number of entries is small, the difference in chances is not significant)&lt;br /&gt;
&lt;br /&gt;
The text itself is invoked by using the key-word between square brackets, like: &lt;br /&gt;
&lt;br /&gt;
 You have to pick up [parcelnumbers] parcels.&lt;br /&gt;
&lt;br /&gt;
Whenever Oolite reads in a scriptline, missiontext or description, it first looks for something between brackets. If it finds something it looks to see if it is a mission_variable. If yes, it replaces the name of the variable with its content. Then it looks in the descriptions.plist. If it finds a key, it replaces the name with the string content. If it is an array it picks at random one of the strings.&lt;br /&gt;
&lt;br /&gt;
Be aware that Oolite reads in all descriptions.plist lines on startup in one big file. This means that you can use keywords from other OXPs or from Oolite itself. If there are some keys with duplicate names, it uses the last. This means that you must use [[OXP Distribution#General|unique keywords]].&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
First adding categories to the Ship Library/View Ship specifications screen; ''then'' adding a missile icon; and ''finally'' adding mission text: this is the entire descriptions.plist&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
 	&amp;quot;oolite-ship-library-category-black_mamba&amp;quot;		= &amp;quot;Black Mamba&amp;quot;;&lt;br /&gt;
 	&amp;quot;oolite-ship-library-category-plural-black_mamba&amp;quot;	= &amp;quot;Black Mambas&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 &amp;quot;EQ_X_SWORD_MISSILE&amp;quot; =&lt;br /&gt;
          (&lt;br /&gt;
                  2,  2,&lt;br /&gt;
 	         2,  1,                                 &lt;br /&gt;
                  1,  0,&lt;br /&gt;
 		 2, -1,	&lt;br /&gt;
                  2, -2,                             &lt;br /&gt;
                  1, -2,&lt;br /&gt;
                  0,  0,&lt;br /&gt;
                 -1, -2,&lt;br /&gt;
                 -2, -2,&lt;br /&gt;
                 -2, -1,&lt;br /&gt;
                 -1,  0,&lt;br /&gt;
                 -2,  1,&lt;br /&gt;
                 -2,  2,&lt;br /&gt;
                 -1,  2,&lt;br /&gt;
                  0,  0,&lt;br /&gt;
                  1,  2       &lt;br /&gt;
 	);&lt;br /&gt;
    &amp;quot;XS_MI_STAGE_245&amp;quot; = &amp;quot;The Murderer is at Digebiti.&amp;quot;;&lt;br /&gt;
    &amp;quot;XS_MI_STAGE_G7_1&amp;quot; = &amp;quot;Just in time, Commander. I could use a little help here!&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=demoships.[[plist]]=&lt;br /&gt;
&lt;br /&gt;
In 1.79 and following this is superseded by [[Shiplibrary.plist]] and should no longer be used for OXPs. It was used to project the ship on the new commander screen at game start. Its replacement adds the ship/station ''etc'' to the ship information on the &amp;quot;View Ship Library&amp;quot; page when Oolite starts up (and to the &amp;quot;View ship specifications&amp;quot; page on the docked F4 screen)&lt;br /&gt;
&lt;br /&gt;
==Structure==&lt;br /&gt;
The file is organized as an array. Every entry consists of a string, with the name of a ship. The shipname must correspond with a key inside the [[shipdata.plist]]. It resides in the config folder inside the OXP.&lt;br /&gt;
&lt;br /&gt;
Example XML:&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;my_ship1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;my_ship2&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example OpenStep:&lt;br /&gt;
 (&lt;br /&gt;
   &amp;quot;my_ship1&amp;quot;,&lt;br /&gt;
   &amp;quot;my_ship2&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
==Use==&lt;br /&gt;
Its function is to select which ships to show on the startup screen when a new commander is chosen.&lt;br /&gt;
&lt;br /&gt;
=illegal_goods.[[plist]]=&lt;br /&gt;
'''Note: The commodities.plist file is no longer used from Oolite 1.82 and following.''' It has been superseded by the [[Trade-goods.plist]]&lt;br /&gt;
&lt;br /&gt;
==Structure==&lt;br /&gt;
The file is organized as a dictionary. Every entry consists of a key and a number. The key says which goods are illegal, and the number how illegal the goods are.&lt;br /&gt;
&lt;br /&gt;
Example OpenStep:&lt;br /&gt;
 {&lt;br /&gt;
    Firearms = 1;&lt;br /&gt;
    Narcotics = 2;&lt;br /&gt;
    Slaves = 1;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Use==&lt;br /&gt;
Better never use this as it might change the game to much.&lt;br /&gt;
&lt;br /&gt;
=pirate-victim-roles.[[plist]]=&lt;br /&gt;
&lt;br /&gt;
In 1.79 this is superseded by [[role-categories.plist]] and should no longer be used for new OXPs. Existing files will continue to have the effect documented below.&lt;br /&gt;
&lt;br /&gt;
==Structure==&lt;br /&gt;
The file is organized as an array. Every entry consists of a string, with the name of a shiprole. This plist is introduced with Oolite version 1.70&lt;br /&gt;
&lt;br /&gt;
Example XML:&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;my_shiprole1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;my_shiprole2&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example OpenStep:&lt;br /&gt;
 (&lt;br /&gt;
   &amp;quot;my_shiprole1&amp;quot;,&lt;br /&gt;
   &amp;quot;my_shiprole2&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
==Use==&lt;br /&gt;
Pirates use the function '''scanForNearestMerchantman''' and '''scanForRandomMerchantman'''. With pre 1.70 versions this function only finds ships with role '''trader''' and '''player'''. Starting with 1.70 these two functions finds all ships that are included in the pirate-victim-roles.plist. This makes it possible to add ships in their own role that are recognized by pirates as traders. Ship designers are encouraged to use this pirate-victim-roles.plist and add all private roles that should act trader like for better interaction with pirate groups. &lt;br /&gt;
&lt;br /&gt;
[[Media:pirate-victim-roles.zip|''Download a custom pirate-victim-roles.plist'']]&lt;br /&gt;
&lt;br /&gt;
=OXPMessages.[[plist]]=&lt;br /&gt;
&lt;br /&gt;
==Structure==&lt;br /&gt;
The file is organized as an array of strings. When the plist is present, the content of the strings is written to the log on start-up and the player sees a message on the start-up screen that the oxp &amp;quot;foo&amp;quot; contains a message. This plist is introduced with Oolite version 1.74. It should be placed directly in the main directory level of the oxp where the 'requires.plist' is also situated.&lt;br /&gt;
&lt;br /&gt;
Example OpenStep:&lt;br /&gt;
 (&lt;br /&gt;
   &amp;quot;This is a copy of my own test version of the oxp: &amp;quot;foo&amp;quot;. This oxp is intended for personal use only, don't spread.&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
==Use==&lt;br /&gt;
Only useful for test versions to make the user constantly aware that he is using a test version of the oxp.&lt;br /&gt;
&lt;br /&gt;
=world-scripts.[[plist]]=&lt;br /&gt;
&lt;br /&gt;
==Structure==&lt;br /&gt;
The file is organized as an array. Every entry consists of a string, with the name of a script. The name must correspond with a file inside the Scripts folder inside the OXP.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 (&lt;br /&gt;
   &amp;quot;my_script1.js&amp;quot;,&lt;br /&gt;
   &amp;quot;my_script2.js&amp;quot;,&lt;br /&gt;
   &amp;quot;my_script3.plist&amp;quot;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
==Use==&lt;br /&gt;
Its function is to attach more than one wordScript to an oxp. On startup, Oolite looks first if there is a worldScripts.plist file. When present the scripts inside are used as world scripts. These scripts can be both js script files or legacy script plist files. Even a mix is allowed. Only when the worldScripts.plist is not present, Oolite looks for a file with the name &amp;quot;script.js&amp;quot; in the Config folder. And when that is not present it looks for the file &amp;quot;script.plist&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=whitelist.[[plist]]=&lt;br /&gt;
&lt;br /&gt;
==Structure==&lt;br /&gt;
The file is organized as a dictionary of keys with the values being themselves either arrays of strings or dictionaries of key-value pairs.&lt;br /&gt;
&lt;br /&gt;
==Use==&lt;br /&gt;
The file is included with Oolite.  OXPs are restricted from using legacy features that are not included in the whitelist. As of Oolite 1.89, the file starts with the following comment:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*	Methods that may be used from old-style script actions or conditions.&lt;br /&gt;
	&lt;br /&gt;
	This plist cannot be extended or overriden by OXPs.&lt;br /&gt;
	&lt;br /&gt;
	action_methods				Commands permitted in world scripts.&lt;br /&gt;
	ai_methods					Commands permitted in AIs.&lt;br /&gt;
	ai_and_action_methods		Commands permitted in world scripts and AIs.&lt;br /&gt;
	query_methods				Values that may be queried in script conditions.&lt;br /&gt;
	action_method_aliases		Mappings from script commands (left) to internal names (right).&lt;br /&gt;
	ai_method_aliases			Mappings from AI commands (left) to internal names (right).&lt;br /&gt;
	query_method_aliases		Mappings from script queries (left) to internal names (right).&lt;br /&gt;
	shader_*_binding_methods	Values that may be queried through shader bindings.&lt;br /&gt;
	&lt;br /&gt;
	Most other types of legacy script - ship actions, character scripts,&lt;br /&gt;
	scriptActionOnTarget: - can use both action_methods and ai_methods. The exception is&lt;br /&gt;
	systeminfo scripts, which can't use ai_methods as they aren't run with a ship target.&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite scripting]]&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
* [[OXP howto]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.02.oxz&amp;diff=76836</id>
		<title>File:LitF+v0.02.oxz</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.02.oxz&amp;diff=76836"/>
		<updated>2022-11-11T19:56:04Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: dev ver 0.02&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
dev ver 0.02&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=76798</id>
		<title>Oolite JavaScript Reference: System</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=76798"/>
		<updated>2022-11-11T00:16:59Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* government */ added link&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 star 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;ambientLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''ambientLevel''' : float (read/write)&lt;br /&gt;
Adjusts the level of ambient light in the current system. Values should typically be between 0.0 and 1.0 (1.0 is the default) but can be higher for a flat lit, cartoon-like effect. This is will override the &amp;quot;ambient_level&amp;quot; setting defined in [[Planetinfo.plist]]. The change is not permanent and will be reset when the system is reloaded.&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:''' [[Planetinfo.plist#Economy|Planetinfo.plist]], &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, &amp;lt;code&amp;gt;&amp;quot;Mostly Industrial&amp;quot;&amp;lt;/code&amp;gt;. 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:''' [[Planetinfo.plist#Government|Planetinfo.plist]], &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, &amp;lt;code&amp;gt;&amp;quot;Democracy&amp;quot;&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;&amp;quot;Slimy Blue Frogs&amp;quot;&amp;lt;/code&amp;gt;.&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Planet#isMainPlanet|planet.isMainPlanet]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#isMainStation|station.isMainStation]]&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/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;populatorSettings&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''populatorSettings''' : Dictionary (read-only)&lt;br /&gt;
The current [[Oolite_System_Populator|populator settings]]. This is only useful to read while the system population is being prepared. After that point, further changes are meaningless.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#setPopulator|setPopulator]]&amp;lt;/code&amp;gt;&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;stations&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''stations''' : Array (read-only)&lt;br /&gt;
A list of the stations in the system.&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;
=== &amp;lt;code&amp;gt;wormholes&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''wormholes''' : Array (read-only)&lt;br /&gt;
A list of the [[Oolite_JavaScript_Reference:_Wormhole|wormholes]] in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;waypoints&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''waypoints''' : Array (read-only)&lt;br /&gt;
A dictionary of the [[Oolite_JavaScript_Reference:_Waypoint|waypoints]] in the system by key and value.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#setWaypoint|setWaypoint()]]&amp;lt;/code&amp;gt;&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 [[Oolite_JavaScript_Reference:_Vector3D#fromCoordinateSystem|fromCoordinateSystem]] method to convert legacy type coordinates to absolute coordinates.&lt;br /&gt;
&lt;br /&gt;
If you wish to add ships of a specific shipdata key, pass the key as the &amp;quot;role&amp;quot; parameter, enclosed in square brackets.&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;&amp;quot;wp&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;pw&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ws&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;sw&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;sp&amp;quot;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;quot;ps&amp;quot;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;quot;w&amp;quot;&amp;lt;/code&amp;gt; stands for the witchpoint, &amp;lt;code&amp;gt;&amp;quot;p&amp;quot;&amp;lt;/code&amp;gt; for the planet and &amp;lt;code&amp;gt;&amp;quot;s&amp;quot;&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 methods 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;locationFromCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''locationFromCode'''(code) : Vector&lt;br /&gt;
Returns a random location in the region specified by the code string. The code strings are the same as used by the  [[Oolite_System_Populator|Oolite populator]]&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;
{{QuoteText|Text=scrambledPseudoRandomNumber, was invented to generate 'random' numbers that are always the same for a given system. Useful to only add stations in certain systems and consistently over time. The salt was added to prevent all oxp's selecting the same 'random' choice for a given system. |Source=([http://oolite.aegidian.org/bb/viewtopic.php?p=193483#p193483 Eric Walch])}}&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random math.random]&amp;lt;/code&amp;gt;&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;setPopulator&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setPopulator'''(key : String, definition : Object)&lt;br /&gt;
Sets the [[Oolite_System_Populator|populator settings]] for the specified key to the given definition, or deletes them if the definition is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. Calling this outside of the system population set up is possible but useless. See the populator settings page for more information on the format of the &amp;lt;code&amp;gt;definition&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#populatorSettings|populatorSettings]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setWaypoint&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setWaypoint'''(key : String, position : VectorExpression, orientation : QuaternionExpression, parameters : Object)&lt;br /&gt;
Adds a [[Oolite_JavaScript_Reference:_Waypoint|waypoint]] to the system with the given &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;, placed at the specified &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;orientation&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;parameter&amp;lt;/code&amp;gt; is an object with the following optional keys:&lt;br /&gt;
* '''size''': the radius of the waypoint in metres&lt;br /&gt;
* '''beaconCode''': the beacon code (default &amp;quot;W&amp;quot;)&lt;br /&gt;
* '''beaconLabel''': the beacon label (default &amp;quot;Waypoint&amp;quot;)&lt;br /&gt;
Waypoints will be visible only when the player has a working Advanced Space Compass.&lt;br /&gt;
&lt;br /&gt;
 '''setWaypoint'''(key : String)&lt;br /&gt;
Removes the waypoint with the specified &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;, if it exists.&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.81, waypoints can either be oriented (the 1.80 default) or unoriented. Unoriented waypoints do not display the directional arrows. To create an unoriented waypoint, set its orientation to the zero quaternion (0,0,0,0) either on creation or later.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#waypoints|waypoints]]&amp;lt;/code&amp;gt;&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;[[#shipsWithPrimaryRole|shipsWithPrimaryRole()]]&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;
== 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;lt;code&amp;gt;&amp;quot;This is a dull planet.&amp;quot;&amp;lt;/code&amp;gt;&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;lt;code&amp;gt;&amp;quot;This is a dull planet.&amp;quot;&amp;lt;/code&amp;gt; if called from galaxy 0, and throw an exception if called from the other galaxies.&lt;br /&gt;
&lt;br /&gt;
Of particular note the spelling of the '''techlevel''' property when using the infoForSystem method to extract it. While the property of &amp;lt;code&amp;gt;system.'''techLevel'''&amp;lt;/code&amp;gt; is spelt using camelCase, &amp;lt;code&amp;gt;System.infoForSystem(0, 55).'''techlevel'''&amp;lt;/code&amp;gt; is all lowercase. This is because planetinfo.plist has always had the techlevel key spelt this way.&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 &amp;lt;code&amp;gt;&amp;quot;Inzaan&amp;quot;&amp;lt;/code&amp;gt;. &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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=76797</id>
		<title>Oolite JavaScript Reference: System</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=76797"/>
		<updated>2022-11-11T00:15:29Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* economy */ added link&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 star 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;ambientLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''ambientLevel''' : float (read/write)&lt;br /&gt;
Adjusts the level of ambient light in the current system. Values should typically be between 0.0 and 1.0 (1.0 is the default) but can be higher for a flat lit, cartoon-like effect. This is will override the &amp;quot;ambient_level&amp;quot; setting defined in [[Planetinfo.plist]]. The change is not permanent and will be reset when the system is reloaded.&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:''' [[Planetinfo.plist#Economy|Planetinfo.plist]], &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, &amp;lt;code&amp;gt;&amp;quot;Mostly Industrial&amp;quot;&amp;lt;/code&amp;gt;. 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, &amp;lt;code&amp;gt;&amp;quot;Democracy&amp;quot;&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;&amp;quot;Slimy Blue Frogs&amp;quot;&amp;lt;/code&amp;gt;.&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Planet#isMainPlanet|planet.isMainPlanet]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#isMainStation|station.isMainStation]]&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/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;populatorSettings&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''populatorSettings''' : Dictionary (read-only)&lt;br /&gt;
The current [[Oolite_System_Populator|populator settings]]. This is only useful to read while the system population is being prepared. After that point, further changes are meaningless.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#setPopulator|setPopulator]]&amp;lt;/code&amp;gt;&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;stations&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''stations''' : Array (read-only)&lt;br /&gt;
A list of the stations in the system.&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;
=== &amp;lt;code&amp;gt;wormholes&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''wormholes''' : Array (read-only)&lt;br /&gt;
A list of the [[Oolite_JavaScript_Reference:_Wormhole|wormholes]] in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;waypoints&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''waypoints''' : Array (read-only)&lt;br /&gt;
A dictionary of the [[Oolite_JavaScript_Reference:_Waypoint|waypoints]] in the system by key and value.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#setWaypoint|setWaypoint()]]&amp;lt;/code&amp;gt;&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 [[Oolite_JavaScript_Reference:_Vector3D#fromCoordinateSystem|fromCoordinateSystem]] method to convert legacy type coordinates to absolute coordinates.&lt;br /&gt;
&lt;br /&gt;
If you wish to add ships of a specific shipdata key, pass the key as the &amp;quot;role&amp;quot; parameter, enclosed in square brackets.&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;&amp;quot;wp&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;pw&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ws&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;sw&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;sp&amp;quot;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;quot;ps&amp;quot;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;quot;w&amp;quot;&amp;lt;/code&amp;gt; stands for the witchpoint, &amp;lt;code&amp;gt;&amp;quot;p&amp;quot;&amp;lt;/code&amp;gt; for the planet and &amp;lt;code&amp;gt;&amp;quot;s&amp;quot;&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 methods 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;locationFromCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''locationFromCode'''(code) : Vector&lt;br /&gt;
Returns a random location in the region specified by the code string. The code strings are the same as used by the  [[Oolite_System_Populator|Oolite populator]]&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;
{{QuoteText|Text=scrambledPseudoRandomNumber, was invented to generate 'random' numbers that are always the same for a given system. Useful to only add stations in certain systems and consistently over time. The salt was added to prevent all oxp's selecting the same 'random' choice for a given system. |Source=([http://oolite.aegidian.org/bb/viewtopic.php?p=193483#p193483 Eric Walch])}}&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random math.random]&amp;lt;/code&amp;gt;&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;setPopulator&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setPopulator'''(key : String, definition : Object)&lt;br /&gt;
Sets the [[Oolite_System_Populator|populator settings]] for the specified key to the given definition, or deletes them if the definition is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. Calling this outside of the system population set up is possible but useless. See the populator settings page for more information on the format of the &amp;lt;code&amp;gt;definition&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#populatorSettings|populatorSettings]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setWaypoint&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setWaypoint'''(key : String, position : VectorExpression, orientation : QuaternionExpression, parameters : Object)&lt;br /&gt;
Adds a [[Oolite_JavaScript_Reference:_Waypoint|waypoint]] to the system with the given &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;, placed at the specified &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;orientation&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;parameter&amp;lt;/code&amp;gt; is an object with the following optional keys:&lt;br /&gt;
* '''size''': the radius of the waypoint in metres&lt;br /&gt;
* '''beaconCode''': the beacon code (default &amp;quot;W&amp;quot;)&lt;br /&gt;
* '''beaconLabel''': the beacon label (default &amp;quot;Waypoint&amp;quot;)&lt;br /&gt;
Waypoints will be visible only when the player has a working Advanced Space Compass.&lt;br /&gt;
&lt;br /&gt;
 '''setWaypoint'''(key : String)&lt;br /&gt;
Removes the waypoint with the specified &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;, if it exists.&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.81, waypoints can either be oriented (the 1.80 default) or unoriented. Unoriented waypoints do not display the directional arrows. To create an unoriented waypoint, set its orientation to the zero quaternion (0,0,0,0) either on creation or later.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#waypoints|waypoints]]&amp;lt;/code&amp;gt;&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;[[#shipsWithPrimaryRole|shipsWithPrimaryRole()]]&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;
== 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;lt;code&amp;gt;&amp;quot;This is a dull planet.&amp;quot;&amp;lt;/code&amp;gt;&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;lt;code&amp;gt;&amp;quot;This is a dull planet.&amp;quot;&amp;lt;/code&amp;gt; if called from galaxy 0, and throw an exception if called from the other galaxies.&lt;br /&gt;
&lt;br /&gt;
Of particular note the spelling of the '''techlevel''' property when using the infoForSystem method to extract it. While the property of &amp;lt;code&amp;gt;system.'''techLevel'''&amp;lt;/code&amp;gt; is spelt using camelCase, &amp;lt;code&amp;gt;System.infoForSystem(0, 55).'''techlevel'''&amp;lt;/code&amp;gt; is all lowercase. This is because planetinfo.plist has always had the techlevel key spelt this way.&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 &amp;lt;code&amp;gt;&amp;quot;Inzaan&amp;quot;&amp;lt;/code&amp;gt;. &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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=76756</id>
		<title>Oolite JavaScript Reference: Global</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=76756"/>
		<updated>2022-11-08T13:06:41Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* galaxyNumber */ added link&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: SystemInfo#galaxyID|galaxyID]]&amp;lt;/code&amp;gt;&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;. In 1.76, 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;(F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;(F5F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;(F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;(F3F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LONG_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHORT_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;(F7), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;(F8), &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;. &lt;br /&gt;
&lt;br /&gt;
In 1.77, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTERFACES&amp;quot;&amp;lt;/code&amp;gt;(F4) is added, and &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_CONTRACTS&amp;quot;&amp;lt;/code&amp;gt; is removed.&lt;br /&gt;
&lt;br /&gt;
In 1.81, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKETINFO&amp;quot;&amp;lt;/code&amp;gt;(F8F8) is added.&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;
Do not use &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; in missionVariables! It will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; because it will be parsed as a string. Use 0 or 1 to store boolean values.&lt;br /&gt;
&lt;br /&gt;
You can store arrays using [http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON JSON] stringify and parse methods. For example:&lt;br /&gt;
 this.$MyArray = [];&lt;br /&gt;
 &lt;br /&gt;
 this.startUp = function() {&lt;br /&gt;
        var s = missionVariables.$MyArray;&lt;br /&gt;
        if( s &amp;amp;&amp;amp; s.length &amp;gt; 0 ) this.$MyArray = JSON.parse(s);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 this.playerWillSaveGame = function(message) {&lt;br /&gt;
        missionVariables.$MyArray = JSON.stringify(this.$MyArray);&lt;br /&gt;
 }&lt;br /&gt;
Mission variables can also be used in legacy scripts and in [[descriptions.plist]] string expansions, by prefixing the name with &amp;lt;code&amp;gt;&amp;quot;mission_&amp;quot;&amp;lt;/code&amp;gt;. Example:&lt;br /&gt;
 expandDescription(&amp;quot;My variable is [mission_exampleVar].&amp;quot;)&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;
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;lt;code&amp;gt;for (var i = 0; i &amp;lt; 1000; i++) {}&amp;lt;/code&amp;gt; takes just 0.62 msec, 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, to apply gradual changes in ship state, to build large data structures without risking reaching processing time limits by trying to do it all at once, or to watch variables which need a same-frame response to changes. 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;, and for repeated events with a longer repeat interval, use [[Oolite_JavaScript_Reference:_Timer|Timers]] instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayNameForCommodity&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''displayNameForCommodity'''(commodityName : String) : 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 [[Missiontext.plist#Special_Expansions|string expansions]].&lt;br /&gt;
When local key/value pairs are provided, they take precedence over any other values.&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.79 or later, this method uses a higher quality random number generator which does not have noticeable correlation problems when used for recursive expansion.&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 &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt; 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;
In Oolite 1.79 or later, this method uses a higher quality random number generator which does not have noticeable correlation problems when used for recursive expansion.&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;value&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;value&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;getGuiColorSettingForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.87}}&lt;br /&gt;
 function '''getGuiColorSettingForKey'''(keyname : string) : Array&lt;br /&gt;
Returns the current color for a particular keyname (referenced in the [[gui-settings.plist]] file). Returns an array of RGBA values.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setGuiColorSettingForKey|setGuiColorSettingForKey()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getScreenBackgroundForKey&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''getScreenBackgroundForKey'''(keyname : string) : guiTextureSpecifier&lt;br /&gt;
Returns the guiTextureSpecifier for a particular keyname (referenced in the screenbackgrounds.plist file).&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;
 getScreenBackgroundForKey(&amp;quot;long_range_chart_mission&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setScreenBackgroundForKey|setScreenBackgroundForKey()]]&amp;lt;/code&amp;gt;&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 parameter can be used to specify which type of message is written to the log.  The default messageClass is &amp;lt;code&amp;gt;script.debug.message&amp;lt;/code&amp;gt;. When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the messages will be written to the log file. 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 temporarily enable/disable logging the 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;pauseGame&amp;lt;/code&amp;gt;===&lt;br /&gt;
 function '''pauseGame'''() : Boolean&lt;br /&gt;
Pauses the game.  It does not work on screens that cannot be paused by keyboard: mission screens, long range chart, arrival report, save menu. In those cases, the method returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;. Otherwise, it pauses the game and returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This was added in v1.87 (the exact version is unconfirmed)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [http://aegidian.org/bb/viewtopic.php?f=6&amp;amp;t=18900 Scriptable pause?]&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]) : String&lt;br /&gt;
Returns a random sentient species name, like &amp;lt;code&amp;gt;&amp;quot;Large Red Fat Insects&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;Human Colonials&amp;quot;&amp;lt;/code&amp;gt;, 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) + &amp;quot;. She'll be with a group of &amp;quot; + randomInhabitantsDescription() + &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'''() : String&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;setGuiColorSettingForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.87}}&lt;br /&gt;
 function '''setGuiColorSettingorKey'''(keyname : string , [[Materials_in_Oolite#Colour_specifiers|Colour specifier]] : string) &lt;br /&gt;
Override the color setting for a particular keyname (referenced in the [[gui-settings.plist]] file) with the specified color.  This override is only for the current play-session and does not get written to [[gui-settings.plist]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setGuiColorSettingForKey(&amp;quot;screen_title_color&amp;quot;, &amp;quot;whiteColor&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#getGuiColorSettingForKey|getGuiColorSettingForKey()]]&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: 480 });&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenBackgroundForKey&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''setScreenBackgroundForKey'''(keyname : string, image : ''guiTextureSpecifier'') &lt;br /&gt;
Override the background for a particular keyname (referenced in the screenbackgrounds.plist file) with the specified image. Override is only for the current play-session only and does not get written out to screenbackgrounds.plist.&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;
 setScreenBackgroundForKey(&amp;quot;long_range_chart_mission&amp;quot;, { name: &amp;quot;my_mission_background.png&amp;quot;, height: 480 });&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#getScreenBackgroundForKey|getScreenBackgroundForKey()]]&amp;lt;/code&amp;gt;&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]) : Boolean&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;lt;code&amp;gt;&amp;quot;-&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;_&amp;quot;&amp;lt;/code&amp;gt; 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;lt;code&amp;gt;&amp;quot;-xxx&amp;quot;&amp;lt;/code&amp;gt; is added, starting with &amp;lt;code&amp;gt;&amp;quot;-001&amp;quot;&amp;lt;/code&amp;gt;.&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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_SystemInfo&amp;diff=76754</id>
		<title>Oolite JavaScript Reference: SystemInfo</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_SystemInfo&amp;diff=76754"/>
		<updated>2022-11-08T13:02:44Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* galaxyID */ added link&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 star system. &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt;s can be retrieved for any system in any galaxy as of version 1.82. In previous versions, only systems for the current galaxy could be read.&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#galaxyNumber|galaxyNumber]]&amp;lt;/code&amp;gt;&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;
Warning: in version 1.76 or earlier there is a bug in this method which may cause a crash if either the start or end of the route is in interstellar space (i.e. system ID -1). In later versions this simply returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;samplePrice&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''samplePrice'''(commodity : String) : Array&lt;br /&gt;
Return a sample main market price in decicredits for the commodity with that key in this system. As this requires reading system information, it will only work for systems in the current galaxy. There is of course no guarantee that the price returned by this method will be anywhere near the actual price when the system is next entered.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setProperty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setProperty'''(layer: Number, key : String, value: String [, manifest: String])&lt;br /&gt;
&lt;br /&gt;
This lets you set properties with more control than provided by writing directly to &amp;lt;code&amp;gt;systemInfo.property&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;layer&amp;lt;/code&amp;gt; is the layer from 0 to 3 that the change should be applied at, as in [[planetinfo.plist]]. Layer 2 is the default layer for Javascript-initiated changes, but 3 may be used for changes absolutely crucial for OXP functionality.&lt;br /&gt;
&lt;br /&gt;
It is also possible to make changes on behalf of a different OXP by passing the manifest ID of that OXP as the fourth parameter. Otherwise the OXP responsible for the current script execution context will be used.&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;
== 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;
=== &amp;lt;code&amp;gt;setInterstellarProperty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInterstellarProperty'''(galaxy : Number, fromsystem : Number, tosystem : Number, layer: Number, key : String, value: String, [, manifest: String])&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#setProperty|setProperty]] but for setting properties of interstellar space regions. Changes made to the current interstellar space region will only take effect if the player leaves and returns. &lt;br /&gt;
&lt;br /&gt;
Note that the order of fromsystem (the last real system visited) and tosystem (the target of the latest jump) is significant - 0,7,55 is Lave to Leesti; 0,55,7 is Leesti to Lave. In many cases setting the same change for both directions may be necessary.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Condition_scripts&amp;diff=76703</id>
		<title>Oolite JavaScript Reference: Condition scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Condition_scripts&amp;diff=76703"/>
		<updated>2022-11-07T18:17:47Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: uniform string format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Condition scripts ==&lt;br /&gt;
Condition scripts are used to set conditions on the appearance of ships and equipment beyond the basics possible in [[shipdata.plist]], [[shipyard.plist]], [[shiplibrary.plist]] and [[equipment.plist]]. They have a similar purpose to the &amp;quot;conditions&amp;quot; parameters in those plists, which use the legacy scripting engine, but have the full flexibility of the Javascript scripting engine. If both &amp;quot;conditions&amp;quot; and a condition script are specified for the same item, they will both be tested (but you should never need to do this).&lt;br /&gt;
&lt;br /&gt;
Conditions scripts may define any or all of the following methods. There is a single instance of each condition script regardless of how many ships and equipment items use it, so variables may be shared between calls in &amp;lt;code&amp;gt;this._property&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In 1.81 the scripts are extended slightly to modify ''how'' things may appear as well as whether they may appear.&lt;br /&gt;
&lt;br /&gt;
=== allowAwardEquipment ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
In order for this method to be called, the &amp;lt;code&amp;gt;condition_script&amp;lt;/code&amp;gt; property of an equipment item (as declared in the [[Equipment.plist]] file) must be specified, it must declare the name of the Javascript file where the method exists, and the method must exist in the referenced JavaScript file. The method will only be called for the equipment items which reference the condition script.&lt;br /&gt;
&lt;br /&gt;
This method is called when the game engine needs to know whether a particular ship can have equipment fitted. In other words, it is asking whether to allow equipment to be awarded to a ship. This may be because the player is looking at possible upgrades at a station (on the F3 Equip Ship screen), or from a call to [[Oolite_JavaScript_Reference:_Ship#canAwardEquipment|ship.canAwardEquipment]] or [[Oolite_JavaScript_Reference:_Ship#canAwardEquipment|ship.awardEquipment]], or for other similar reasons. The equipment key and a reference to the ship entity are passed as parameters. You would use this method to control if, and under what conditions, a piece of equipment is offered for purchase and installation. Returning a value of &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; would indicate that the equipment can be installed; returning a value of &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; indicates the equipment can't be installed and so it won't appear on the F3 Equip Ship screen, and any of the JavaScript methods to add the equipment item would fail. If the method does not exist, or returns a value other than &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, then a value of &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; is assumed and the equipment may be added or offered for sale (subject to other conditions, of course, like TL constraints)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;context&amp;lt;/code&amp;gt; will be one of:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;newShip&amp;quot;&amp;lt;/code&amp;gt; - equipment for a ship in a station shipyard (F3 F3)&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;npc&amp;quot;&amp;lt;/code&amp;gt; - awarding equipment to NPC on ship setup&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;purchase&amp;quot;&amp;lt;/code&amp;gt; - equipment for purchase on the F3 screen&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;scripted&amp;quot;&amp;lt;/code&amp;gt; - equipment added by JS or legacy scripts&lt;br /&gt;
(Context can in theory also be &amp;lt;code&amp;gt;&amp;quot;loading&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;damage&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;portable&amp;quot;&amp;lt;/code&amp;gt;, but if you see one of these, it's a bug)&lt;br /&gt;
&lt;br /&gt;
 this.allowAwardEquipment = function(eqKey, ship, context)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return bool;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The standard condition script for the core game equipment allows equipment to be barred using the &amp;lt;code&amp;gt;&amp;quot;oolite-barred-equipment&amp;quot;&amp;lt;/code&amp;gt; key in &amp;lt;code&amp;gt;script_info&amp;lt;/code&amp;gt;. If this key contains an array of equipment keys, then those items of equipment will not be sold at this station. In 1.79 and later, this &amp;lt;code&amp;gt;script_info&amp;lt;/code&amp;gt; key may be applied to any ship, preventing those items being installed onto the ship. For example:&lt;br /&gt;
&lt;br /&gt;
 script_info = {&lt;br /&gt;
   &amp;quot;oolite-barred-equipment&amp;quot; = (&amp;quot;EQ_WEAPON_MILITARY_LASER&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
On a station, this would prevent it selling military lasers. On a ship in 1.79 or later, this would also stop the ship fitting military lasers.&lt;br /&gt;
&lt;br /&gt;
=== allowOfferShip ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
This method is called when the game engine is considering adding a ship managed by this condition script to a shipyard. If the method does not exist, or returns a value other than &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, then the ship may appear for sale (or it may not, for a variety of other reasons). The ship key from shipyard.plist is passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
 this.allowOfferShip = function(shipKey)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return bool;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== allowShowLibraryShip ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
This method is called when the ship library is being shown in-game (rather than on the start screen) and determines whether the ship appears on the list for the player to view. If the method does not exist or returns a value which cannot be interpreted as a boolean, it will be assumed to have returned &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 this.allowShowLibraryShip = function(shipKey)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return bool;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== allowSpawnShip ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
This method is called when the game engine is considering spawning a ship managed by this condition script. If the method does not exist, or returns a value other than &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, then the ship may be spawned (or it may not, if another ship with the appropriate role is selected instead). The ship key from shipdata.plist is passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
 this.allowSpawnShip = function(shipKey)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return bool;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== updateEquipmentPrice ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
This method is called when the game engine needs to know the price of fitting equipment covered by this condition script. The method takes an equipment key and the current price as parameters, and must return a non-negative number for the actual price of the equipment.&lt;br /&gt;
&lt;br /&gt;
 this.updateEquipmentPrice = function(equipmentKey, currentPrice)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return newPrice;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This method is called before [[Shipdata.plist#equipment_price_factor|equipment_price_factor]] is considered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
There is an extended bulletin board discussion with a couple of examples [http://www.aegidian.org/bb/viewtopic.php?p=286037#p286037 here] (2022).&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Clock&amp;diff=76702</id>
		<title>Oolite JavaScript Reference: Clock</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Clock&amp;diff=76702"/>
		<updated>2022-11-07T17:56:41Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* clockString */ uniform string format&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 '''clock''' global object is used to tell the time. Apart from &amp;lt;code&amp;gt;[[#absoluteSeconds|absoluteSeconds]]&amp;lt;/code&amp;gt;, all its properties have to do with [[Time scales in Oolite#Game clock time|game clock time]].&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== absoluteSeconds ===&lt;br /&gt;
 '''absoluteSeconds''' : Number (read-only)&lt;br /&gt;
The [[Time scales in Oolite#Game real time|game real time]] clock. Roughly speaking, this is the number of seconds since the game was started, not counting time in which it was paused.&lt;br /&gt;
&lt;br /&gt;
=== seconds ===&lt;br /&gt;
 '''seconds''' : Number (read-only)&lt;br /&gt;
The current time in [[Time scales in Oolite#Game clock time|game clock time]], in seconds since the epoch. If the current clock time is 2084004:17:13:42, &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; will be at least 180058007622 and less than 180058007623.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#secondsComponent|secondsComponent]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== minutes ===&lt;br /&gt;
 '''minutes''' : Number (read-only)&lt;br /&gt;
The current time in [[Time scales in Oolite#Game clock time|game clock time]], in integer minutes since the epoch. If the current clock time is 2084004:17:13:42, &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; will be 3000966793.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#minutesComponent|minutesComponent]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hours ===&lt;br /&gt;
 '''hours''' : Number (read-only)&lt;br /&gt;
The current time in [[Time scales in Oolite#Game clock time|game clock time]], in integer hours since the epoch. If the current clock time is 2084004:17:13:42, &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; will be 50016113.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#hoursComponent|hoursComponent]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== days ===&lt;br /&gt;
 '''days''' : Number (read-only)&lt;br /&gt;
The current time in [[Time scales in Oolite#Game clock time|game clock time]], in integer days since the epoch. If the current clock time is 2084004:17:13:42, &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; will be 2084004.&lt;br /&gt;
&lt;br /&gt;
=== secondsComponent ===&lt;br /&gt;
 '''secondsComponent''' : Number (read-only)&lt;br /&gt;
The second component of the clock time. If the current clock time is 2084004:17:13:42, &amp;lt;code&amp;gt;secondsComponent&amp;lt;/code&amp;gt; will be 42.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#seconds|seconds]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== minutesComponent ===&lt;br /&gt;
 '''minutesComponent''' : Number (read-only)&lt;br /&gt;
The minute component of the clock time. If the current clock time is 2084004:17:13:42, &amp;lt;code&amp;gt;minutesComponent&amp;lt;/code&amp;gt; will be 13.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#minutes|minutes]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hoursComponent ===&lt;br /&gt;
 '''hoursComponent''' : Number (read-only)&lt;br /&gt;
The hour component of the clock time. If the current clock time is 2084004:17:13:42, &amp;lt;code&amp;gt;hoursComponent&amp;lt;/code&amp;gt; will be 17.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#hours|hours]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== daysComponent ===&lt;br /&gt;
 '''daysComponent''' : Number (read-only)&lt;br /&gt;
Same as &amp;lt;code&amp;gt;[[#days|days]]&amp;lt;/code&amp;gt;, included only for completeness.&lt;br /&gt;
&lt;br /&gt;
=== clockString ===&lt;br /&gt;
 '''clockString''' : String (read-only)&lt;br /&gt;
The clock as displayed in the HUD, including &amp;lt;code&amp;gt;&amp;quot;(adjusting)&amp;quot;&amp;lt;/code&amp;gt; if appropriate. If the current clock time is 2084004:17:13:42 and the clock is not being adjusted, &amp;lt;code&amp;gt;clockString&amp;lt;/code&amp;gt; will be &amp;lt;code&amp;gt;&amp;quot;2084004:17:13:42&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== isAdjusting ===&lt;br /&gt;
 '''isAdjusting''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the clock is being adjusted, i.e. running faster than real time, as happens after witchspace jumps.&lt;br /&gt;
&lt;br /&gt;
=== adjustedSeconds ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''adjustedSeconds''' : Number (read-only)&lt;br /&gt;
The adjusted current time. If the clock is not being adjusted, this will be equal to [[#seconds|seconds]]. Otherwise, it will be &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; plus the number of seconds remaining of the adjustment.&lt;br /&gt;
&lt;br /&gt;
=== legacy_scriptTimer ===&lt;br /&gt;
 '''legacy_scriptTimer''' : Number (read-only)&lt;br /&gt;
The current value of the legacy scriptTimer.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== addSeconds ===&lt;br /&gt;
 function '''addSeconds'''(timeInSeconds : Number)&lt;br /&gt;
Adds &amp;quot;timeInSeconds&amp;quot; to the current time. Value must be positive and no greater than the equivalent of 30 days (60 * 60 * 24 * 30 = 2592000 seconds)&lt;br /&gt;
&lt;br /&gt;
=== clockStringForTime ===&lt;br /&gt;
 function '''clockStringForTime'''(timeInSeconds : Number) : String&lt;br /&gt;
Returns a display string for a given time, specified in seconds, in the same format as &amp;lt;code&amp;gt;[[#clockString|clockString]]&amp;lt;/code&amp;gt;. For instance, to specify that something must be done within a day, you might say:&lt;br /&gt;
 var message = &amp;quot;This task must be completed by &amp;quot; + clock.clockStringForTime(clock.seconds + 24 * 60 * 60) + &amp;quot;, or all will be lost!&amp;quot;&lt;br /&gt;
(Whether such a message should be specified with one-second precision is another matter. More flexible tools for date calculations may be added later.)&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76701</id>
		<title>Oolite JavaScript Reference: Mission</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76701"/>
		<updated>2022-11-07T17:43:00Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: uniform string format, added links (x3) &amp;amp; anchor&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]]. Uses role to identify ship, so be sure to use a unique role if you want a specific ship to be showed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''exitScreen''' : [[Oolite JavaScript Reference: Global#guiScreen|guiScreen]] (read/write)&lt;br /&gt;
&lt;br /&gt;
This can be used to set a new [[#xtScrn|exit screen]] for the current mission screen. Outside of a callback function, the value of this is meaningless, and setting it has no useful effect.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''markedSystems''' : Array (read-only)&lt;br /&gt;
&lt;br /&gt;
An array of the objects currently being used to mark systems. The objects will have the same properties as those used by [[#markSystem|&amp;lt;code&amp;gt;markSystem()&amp;lt;/code&amp;gt;]] and [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''screenID''' : String (read-only)&lt;br /&gt;
&lt;br /&gt;
If there is currently a mission screen running with a defined [[#scrnID|&amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;]], then that &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;. Otherwise, this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;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. Can also be used to add text to other screens like the system data (F7) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageTextKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageTextKey'''(messageKey : String)&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addMessageText|addMessageText()]]&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;
=== &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;. In 1.76 and earlier a system cannot be marked twice, so:&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.unmarkSystem(7);&lt;br /&gt;
will leave the system unmarked.&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, the parameters may be objects instead of numbers. This allows control over the marker's appearance, and allows multiple markers to be placed on the same system. The object takes the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; : The system ID. This is the only required parameter.&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; : A string identifying the group this marker belongs to (which may be the script's name, or something more specific). If omitted, which is not recommended, this defaults to &amp;lt;code&amp;gt;&amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot;&amp;lt;/code&amp;gt; which is also used for marking with numbers and marking carried out by legacy scripts.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerColor&amp;lt;/code&amp;gt; : A string specifying a colour. e.g. &amp;lt;code&amp;gt;&amp;quot;redColor&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;1.0 0.5 0.0&amp;quot;&amp;lt;/code&amp;gt;. If omitted, &amp;lt;code&amp;gt;&amp;quot;redColor&amp;quot;&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerScale&amp;lt;/code&amp;gt; : A number between &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt; specifying the relative size of the marker. Defaults to &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerShape&amp;lt;/code&amp;gt; : A string describing the shape of the marker. Valid values are &amp;lt;code&amp;gt;&amp;quot;MARKER_X&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;MARKER_PLUS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;MARKER_SQUARE&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;MARKER_DIAMOND&amp;quot;&amp;lt;/code&amp;gt;. If this value is invalid or omitted, &amp;lt;code&amp;gt;&amp;quot;MARKER_X&amp;quot;&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
&lt;br /&gt;
Multiple markers may be placed on the same system, provided that they have different names. If a marker with the same system and name already exists, it will be replaced.&lt;br /&gt;
&lt;br /&gt;
 mission.markSystem({&lt;br /&gt;
    system: 55,&lt;br /&gt;
    name: &amp;quot;my_oxp&amp;quot;,&lt;br /&gt;
    markerColor: &amp;quot;cyanColor&amp;quot;,&lt;br /&gt;
    markerScale: 1.5,&lt;br /&gt;
    markerShape: &amp;quot;MARKER_DIAMOND&amp;quot;&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]], [[#markedSystems|&amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runShipLibrary&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''runShipLibrary'''()&lt;br /&gt;
Display the ship library based on [[shiplibrary.plist]], including processing of condition scripts.&lt;br /&gt;
&lt;br /&gt;
This is mainly useful for scenarios which override the standard scripts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''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;backgroundSpecial: String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, special background layer)&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;modelPersonality : Int&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the entityPersonality assigned to the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt;. If unspecified, or in 1.76 or earlier, a random personality is used)&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;choices: Object&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, Object describing [[Oolite_JavaScript_Reference:_Mission#Advanced_choices_.281.77_or_later_only.29|advanced choices]])&lt;br /&gt;
* &amp;lt;code&amp;gt;choicesKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;initialChoicesKey : String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the key from &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt; which is initially selected)&lt;br /&gt;
* &amp;lt;code&amp;gt;allowInterrupt : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;), the mission screen can be interrupted with function keys, which does not call the callback function. Mainly intended for interfaces.)&lt;br /&gt;
* &amp;lt;span id=&amp;quot;xtScrn&amp;quot;&amp;gt;&amp;lt;code&amp;gt;exitScreen&amp;lt;/span&amp;gt;: [[Oolite JavaScript Reference: Global#guiScreen|guiScreen]]&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, a GUI screen to exit on. If omitted, an invalid value is given, or the player is not docked, this will revert to &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt; (F5). Not all GUI screens are selectable for this: only those reachable with function keys F3 to F8.  This property can be changed with &amp;lt;code&amp;gt;[[#exitScreen|exitScreen]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scrnID&amp;quot;&amp;gt;&amp;lt;code&amp;gt;screenID : String&amp;lt;/code&amp;gt;&amp;lt;/span&amp;gt; ({{oolite-prop-added|1.77}}, an optional string which can be read later from &amp;lt;code&amp;gt;[[#screenID|mission.screenID]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;textEntry : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.79}}, if it's &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then you get the text prompt and 'choices' and 'choicesKey' are ignored. Whatever's typed there gets passed as the parameter to the callback function. The [https://github.com/OoliteProject/oolite/blob/master/Resources/Scripts/oolite-registership.js ship registry code] has a simple example.)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartZoom : decimal&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, zoom level of the 'CUSTOM_CHART' backgroundSpecial map)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentre: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, using the internal coordinate system. The z component is always zero. Discouraged in favour of customChartCentreInLY)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentreLY: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, in LY. e.g. for Lave: (8, 34.6, 0). The z component is always zero.)&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;
There are 21 lines available for display of the message and choices combined. (In 1.77, this is extended to 27 lines if the player's HUD is hidden)&lt;br /&gt;
&lt;br /&gt;
==== runScreen callbacks ====&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. The optional &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; parameter will be used as the &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; property of the mission screen callback. It is usually unnecessary to specify this, but if you intend the function which calls runScreen to be called from a different script, and the callback references &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;, you will need to use it.&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;
In 1.77, if &amp;lt;code&amp;gt;allowInterrupt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it is possible that the callback function will not be called. It should therefore only be set for mission screens which can safely be interrupted without the callback. Regardless of this setting, all mission screens may be interrupted by the player launching from the station, and this possibility should be considered (in such case callback function will be called with &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; argument).&lt;br /&gt;
&lt;br /&gt;
==== runScreen special backgrounds (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, 'backgroundSpecial' may be given the following special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the short range chart (as if the player had pressed F6). The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the current long range chart (as if the player had pressed F6 twice). The first 16 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
In 1.87 or later, 'backgroundSpecial' has these additional special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART&amp;lt;/code&amp;gt;: Displays a chart where zoom and centre position can be customised using the 'customChartZoom' and 'customChartCentreInLY' properties. The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_SHORTEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_QUICKEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
With all special chart backgrounds, changes made to destination system, or to markers, will be updated immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
These backgrounds will be displayed above the '&amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt;' (if any) but below everything else.&lt;br /&gt;
&lt;br /&gt;
==== Advanced choices (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, choices may be set either with the 'choicesKey' parameter from missiontext.plist as before, or with the 'choices' parameter. (If both are set, 'choicesKey' will be ignored)&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
 var options = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; : &amp;quot;Take the job&amp;quot;,&lt;br /&gt;
    &amp;quot;02_DECLINE&amp;quot; : &amp;quot;Politely decline&amp;quot;&lt;br /&gt;
 };&lt;br /&gt;
 if (player.bounty == 0) // only clean players have this option&lt;br /&gt;
 {&lt;br /&gt;
    options[&amp;quot;03_REPORT&amp;quot;] = &amp;quot;Call the police&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 mission.runScreen({&lt;br /&gt;
    // title, message, etc.&lt;br /&gt;
    choices: options&lt;br /&gt;
 },function(choice) {&lt;br /&gt;
    // choice handling&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
This is useful where the options available (perhaps depending on the player's ship or equipment, or on previous events in the mission) may vary in a complex fashion, to avoid the need to have a separate missiontext.plist entry for every possibility.&lt;br /&gt;
&lt;br /&gt;
The value (either in &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt;'s missiontext entry or &amp;lt;code&amp;gt;choices&amp;lt;/code&amp;gt;) may either be a text string as in previous versions, or an object itself. If it is an object, it can take four parameters: &lt;br /&gt;
* 'text' is the displayed text for this key. &lt;br /&gt;
* 'alignment' can be 'LEFT', 'RIGHT' or 'CENTER' (the default). &lt;br /&gt;
* 'unselectable' can be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; (the default for non-blank text). Unselectable rows are printed, but are skipped when moving through the options. This can be useful for keeping a consistent interface.&lt;br /&gt;
* 'color' can be any color specification (e.g. &amp;quot;orangeColor&amp;quot;). The default is &amp;quot;yellowColor&amp;quot;, or &amp;quot;darkGrayColor&amp;quot; for unselectable rows.&lt;br /&gt;
For example (missiontext.plist):&lt;br /&gt;
 &amp;quot;my_choice_1&amp;quot; = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; = {&lt;br /&gt;
       text = &amp;quot;Take the job&amp;quot;;&lt;br /&gt;
       alignment = &amp;quot;LEFT&amp;quot;;&lt;br /&gt;
       unselectable = false;&lt;br /&gt;
       color = &amp;quot;greenColor&amp;quot;;&lt;br /&gt;
    };&lt;br /&gt;
    // more options&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
In 1.77, the behaviour for choices which have no text is slightly changed. These will now leave a blank and unselectable line in the option list.&lt;br /&gt;
&lt;br /&gt;
==== Safe usage of runScreen ====&lt;br /&gt;
&lt;br /&gt;
One warning: &amp;lt;code&amp;gt;runScreen()&amp;lt;/code&amp;gt; will overwrite any existing missionscreen or GUI screen. The only safe place is using it inside a &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler or the callback function from a previous mission screen (or in 1.77 onwards, inside an interface callback function), 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;
==== Known issues ====&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.79, only the A-Z, a-z, 0-9 and (space) characters may be reliably entered in the 'textEntry' field. A wider selection, for boring internal reasons, is available on the Mac, and is hoped to also be available on other platforms in later releases.&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;
Note: the &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt; token does not provide a line break (verified in v1.9).&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;
In Oolite 1.81 onwards, the following variant is available&lt;br /&gt;
&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInstructions'''(instructions : Array, [worldScriptName : String])&lt;br /&gt;
&lt;br /&gt;
If this version is used, the first array element will be a heading on the Manifest screen, and the remaining elements will be entered underneath it, rather than being entered under the &amp;quot;Missions&amp;quot; heading.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship Companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...]);&lt;br /&gt;
This will display Ship Companion: in yellow text on the F5F5 screen, and beneath it will show the [[String expansion|expanded]] value of the key &amp;quot;myoxp_currentpet&amp;quot; from the [[missiontext.plist]] associated with the calling world script. If not called from a world script, the worldScriptName (this.name from the script) must be provided also:&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...], &amp;quot;myoxp's script name&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Note that because the first parameter is now an array, the line(s) to be added must be enclosed in brackets and comma separated. Also note the optional use of &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#expandMissionText|expandMissionText()]]&amp;lt;/code&amp;gt; to retrieve text from [[missiontext.plist]]. It is also possible to construct the array before calling setInstructions, for example:&amp;lt;pre&amp;gt;&lt;br /&gt;
if(myoxp_petslist.length == 0) {&lt;br /&gt;
  mission.setInstructions(null); // clear any text previously displayed by this world script on the F5F5 screen&lt;br /&gt;
} else {&lt;br /&gt;
  var textArray = [];&lt;br /&gt;
  textArray.push(&amp;quot;Ship Companion&amp;quot; + (myoxp_petslist.length &amp;gt; 1 ? &amp;quot;s:&amp;quot; : &amp;quot;:&amp;quot;)); // &amp;quot;Ship Companion:&amp;quot; or &amp;quot;Ship Companions:&amp;quot; if more than one&lt;br /&gt;
  var i = myoxp_petslist.length - 1; // pointer to last entry in myoxp_petslist&lt;br /&gt;
  while(i--) { // for each pet in the list, starting from the bottom (probably newest to oldest)&lt;br /&gt;
    textArray.push(myoxp_petslist[i].name); // add the name of the pet to the text we will show on the F5F5 screen&lt;br /&gt;
  }&lt;br /&gt;
  mission.setInstructions(textArray); // our pets list will now be visible on the F5F5 screen until further notice (the next time we call setInstructions or one of its variants, it will replace this)&lt;br /&gt;
}&amp;lt;/pre&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) : Boolean&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.&amp;lt;wbr&amp;gt;unmarkSystem&amp;lt;wbr&amp;gt;(4, 54, 222)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In 1.76 and earlier versions, any script can unmark a system, regardless of which script marked it or how many times it was previously marked. &lt;br /&gt;
&lt;br /&gt;
In 1.77, each marker has a name, and if a system has multiple markers each marker must be removed separately. Parameters in 1.77 may be numbers or objects. Numbers remove the &amp;lt;code&amp;gt;&amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot;&amp;lt;/code&amp;gt; markers. Objects are the same format as in &amp;lt;code&amp;gt;markSystem()&amp;lt;/code&amp;gt; and remove the marker of the corresponding name (the marker style options are ignored when unmarking). In 1.77, this method will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if all requested markers existed and were removed, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if any of the requested markers did not exist.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#markedSystems|markedSystems]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.01.oxz&amp;diff=76662</id>
		<title>File:LitF+v0.01.oxz</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=File:LitF%2Bv0.01.oxz&amp;diff=76662"/>
		<updated>2022-11-06T20:09:26Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: dev ver 0.01 (from release ver 0.7.3)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
dev ver 0.01 (from release ver 0.7.3)&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76571</id>
		<title>Oolite JavaScript Reference: Mission</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76571"/>
		<updated>2022-11-03T23:28:20Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* setInstructions */ uniform string format, deleted redundant link&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]]. Uses role to identify ship, so be sure to use a unique role if you want a specific ship to be showed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''exitScreen''' : [[Oolite JavaScript Reference: Global#guiScreen|guiScreen]] (read/write)&lt;br /&gt;
&lt;br /&gt;
This can be used to set a new exit screen for the current mission screen. Outside of a callback function, the value of this is meaningless, and setting it has no useful effect.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''markedSystems''' : Array (read-only)&lt;br /&gt;
&lt;br /&gt;
An array of the objects currently being used to mark systems. The objects will have the same properties as those used by [[#markSystem|&amp;lt;code&amp;gt;markSystem()&amp;lt;/code&amp;gt;]] and [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''screenID''' : String (read-only)&lt;br /&gt;
&lt;br /&gt;
If there is currently a mission screen running with a defined [[#scrnID|&amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;]], then that &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;. Otherwise, this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;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. Can also be used to add text to other screens like the system data (F7) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageTextKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageTextKey'''(messageKey : String)&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addMessageText|addMessageText()]]&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;
=== &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;. In 1.76 and earlier a system cannot be marked twice, so:&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.unmarkSystem(7);&lt;br /&gt;
will leave the system unmarked.&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, the parameters may be objects instead of numbers. This allows control over the marker's appearance, and allows multiple markers to be placed on the same system. The object takes the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; : The system ID. This is the only required parameter.&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; : A string identifying the group this marker belongs to (which may be the script's name, or something more specific). If omitted, which is not recommended, this defaults to &amp;lt;code&amp;gt;&amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot;&amp;lt;/code&amp;gt; which is also used for marking with numbers and marking carried out by legacy scripts.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerColor&amp;lt;/code&amp;gt; : A string specifying a colour. e.g. &amp;lt;code&amp;gt;&amp;quot;redColor&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;1.0 0.5 0.0&amp;quot;&amp;lt;/code&amp;gt;. If omitted, &amp;lt;code&amp;gt;&amp;quot;redColor&amp;quot;&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerScale&amp;lt;/code&amp;gt; : A number between &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt; specifying the relative size of the marker. Defaults to &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerShape&amp;lt;/code&amp;gt; : A string describing the shape of the marker. Valid values are &amp;lt;code&amp;gt;&amp;quot;MARKER_X&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;MARKER_PLUS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;MARKER_SQUARE&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;MARKER_DIAMOND&amp;quot;&amp;lt;/code&amp;gt;. If this value is invalid or omitted, &amp;lt;code&amp;gt;&amp;quot;MARKER_X&amp;quot;&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
&lt;br /&gt;
Multiple markers may be placed on the same system, provided that they have different names. If a marker with the same system and name already exists, it will be replaced.&lt;br /&gt;
&lt;br /&gt;
 mission.markSystem({&lt;br /&gt;
    system: 55,&lt;br /&gt;
    name: &amp;quot;my_oxp&amp;quot;,&lt;br /&gt;
    markerColor: &amp;quot;cyanColor&amp;quot;,&lt;br /&gt;
    markerScale: 1.5,&lt;br /&gt;
    markerShape: &amp;quot;MARKER_DIAMOND&amp;quot;&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]], [[#markedSystems|&amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runShipLibrary&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''runShipLibrary'''()&lt;br /&gt;
Display the ship library based on [[shiplibrary.plist]], including processing of condition scripts.&lt;br /&gt;
&lt;br /&gt;
This is mainly useful for scenarios which override the standard scripts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''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;backgroundSpecial: String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, special background layer)&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;modelPersonality : Int&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the entityPersonality assigned to the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt;. If unspecified, or in 1.76 or earlier, a random personality is used)&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;choices: Object&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, Object describing [[Oolite_JavaScript_Reference:_Mission#Advanced_choices_.281.77_or_later_only.29|advanced choices]])&lt;br /&gt;
* &amp;lt;code&amp;gt;choicesKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;initialChoicesKey : String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the key from &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt; which is initially selected)&lt;br /&gt;
* &amp;lt;code&amp;gt;allowInterrupt : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;), the mission screen can be interrupted with function keys, which does not call the callback function. Mainly intended for interfaces.)&lt;br /&gt;
* &amp;lt;code&amp;gt;exitScreen : ''guiScreen''&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, a GUI screen to exit on. If omitted, an invalid value is given, or the player is not docked, this will revert to &amp;quot;GUI_SCREEN_STATUS&amp;quot;. Not all GUI screens are selectable for this: only those reachable with function keys F3 to F8)&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scrnID&amp;quot;&amp;gt;&amp;lt;code&amp;gt;screenID : String&amp;lt;/code&amp;gt;&amp;lt;/span&amp;gt; ({{oolite-prop-added|1.77}}, an optional string which can be read later from &amp;lt;code&amp;gt;[[#screenID|mission.screenID]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;textEntry : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.79}}, if it's &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then you get the text prompt and 'choices' and 'choicesKey' are ignored. Whatever's typed there gets passed as the parameter to the callback function. The [https://github.com/OoliteProject/oolite/blob/master/Resources/Scripts/oolite-registership.js ship registry code] has a simple example.)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartZoom : decimal&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, zoom level of the 'CUSTOM_CHART' backgroundSpecial map)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentre: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, using the internal coordinate system. The z component is always zero. Discouraged in favour of customChartCentreInLY)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentreLY: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, in LY. e.g. for Lave: (8, 34.6, 0). The z component is always zero.)&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;
There are 21 lines available for display of the message and choices combined. (In 1.77, this is extended to 27 lines if the player's HUD is hidden)&lt;br /&gt;
&lt;br /&gt;
==== runScreen callbacks ====&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. The optional &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; parameter will be used as the &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; property of the mission screen callback. It is usually unnecessary to specify this, but if you intend the function which calls runScreen to be called from a different script, and the callback references &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;, you will need to use it.&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;
In 1.77, if &amp;lt;code&amp;gt;allowInterrupt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it is possible that the callback function will not be called. It should therefore only be set for mission screens which can safely be interrupted without the callback. Regardless of this setting, all mission screens may be interrupted by the player launching from the station, and this possibility should be considered (in such case callback function will be called with &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; argument).&lt;br /&gt;
&lt;br /&gt;
==== runScreen special backgrounds (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, 'backgroundSpecial' may be given the following special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the short range chart (as if the player had pressed F6). The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the current long range chart (as if the player had pressed F6 twice). The first 16 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
In 1.87 or later, 'backgroundSpecial' has these additional special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART&amp;lt;/code&amp;gt;: Displays a chart where zoom and centre position can be customised using the 'customChartZoom' and 'customChartCentreInLY' properties. The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_SHORTEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_QUICKEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
With all special chart backgrounds, changes made to destination system, or to markers, will be updated immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
These backgrounds will be displayed above the '&amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt;' (if any) but below everything else.&lt;br /&gt;
&lt;br /&gt;
==== Advanced choices (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, choices may be set either with the 'choicesKey' parameter from missiontext.plist as before, or with the 'choices' parameter. (If both are set, 'choicesKey' will be ignored)&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
 var options = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; : &amp;quot;Take the job&amp;quot;,&lt;br /&gt;
    &amp;quot;02_DECLINE&amp;quot; : &amp;quot;Politely decline&amp;quot;&lt;br /&gt;
 };&lt;br /&gt;
 if (player.bounty == 0) // only clean players have this option&lt;br /&gt;
 {&lt;br /&gt;
    options[&amp;quot;03_REPORT&amp;quot;] = &amp;quot;Call the police&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 mission.runScreen({&lt;br /&gt;
    // title, message, etc.&lt;br /&gt;
    choices: options&lt;br /&gt;
 },function(choice) {&lt;br /&gt;
    // choice handling&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
This is useful where the options available (perhaps depending on the player's ship or equipment, or on previous events in the mission) may vary in a complex fashion, to avoid the need to have a separate missiontext.plist entry for every possibility.&lt;br /&gt;
&lt;br /&gt;
The value (either in &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt;'s missiontext entry or &amp;lt;code&amp;gt;choices&amp;lt;/code&amp;gt;) may either be a text string as in previous versions, or an object itself. If it is an object, it can take four parameters: &lt;br /&gt;
* 'text' is the displayed text for this key. &lt;br /&gt;
* 'alignment' can be 'LEFT', 'RIGHT' or 'CENTER' (the default). &lt;br /&gt;
* 'unselectable' can be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; (the default for non-blank text). Unselectable rows are printed, but are skipped when moving through the options. This can be useful for keeping a consistent interface.&lt;br /&gt;
* 'color' can be any color specification (e.g. &amp;quot;orangeColor&amp;quot;). The default is &amp;quot;yellowColor&amp;quot;, or &amp;quot;darkGrayColor&amp;quot; for unselectable rows.&lt;br /&gt;
For example (missiontext.plist):&lt;br /&gt;
 &amp;quot;my_choice_1&amp;quot; = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; = {&lt;br /&gt;
       text = &amp;quot;Take the job&amp;quot;;&lt;br /&gt;
       alignment = &amp;quot;LEFT&amp;quot;;&lt;br /&gt;
       unselectable = false;&lt;br /&gt;
       color = &amp;quot;greenColor&amp;quot;;&lt;br /&gt;
    };&lt;br /&gt;
    // more options&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
In 1.77, the behaviour for choices which have no text is slightly changed. These will now leave a blank and unselectable line in the option list.&lt;br /&gt;
&lt;br /&gt;
==== Safe usage of runScreen ====&lt;br /&gt;
&lt;br /&gt;
One warning: &amp;lt;code&amp;gt;runScreen()&amp;lt;/code&amp;gt; will overwrite any existing missionscreen or GUI screen. The only safe place is using it inside a &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler or the callback function from a previous mission screen (or in 1.77 onwards, inside an interface callback function), 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;
==== Known issues ====&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.79, only the A-Z, a-z, 0-9 and (space) characters may be reliably entered in the 'textEntry' field. A wider selection, for boring internal reasons, is available on the Mac, and is hoped to also be available on other platforms in later releases.&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;
Note: the &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt; token does not provide a line break (verified in v1.9).&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;
In Oolite 1.81 onwards, the following variant is available&lt;br /&gt;
&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInstructions'''(instructions : Array, [worldScriptName : String])&lt;br /&gt;
&lt;br /&gt;
If this version is used, the first array element will be a heading on the Manifest screen, and the remaining elements will be entered underneath it, rather than being entered under the &amp;quot;Missions&amp;quot; heading.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship Companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...]);&lt;br /&gt;
This will display Ship Companion: in yellow text on the F5F5 screen, and beneath it will show the [[String expansion|expanded]] value of the key &amp;quot;myoxp_currentpet&amp;quot; from the [[missiontext.plist]] associated with the calling world script. If not called from a world script, the worldScriptName (this.name from the script) must be provided also:&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...], &amp;quot;myoxp's script name&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Note that because the first parameter is now an array, the line(s) to be added must be enclosed in brackets and comma separated. Also note the optional use of &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#expandMissionText|expandMissionText()]]&amp;lt;/code&amp;gt; to retrieve text from [[missiontext.plist]]. It is also possible to construct the array before calling setInstructions, for example:&amp;lt;pre&amp;gt;&lt;br /&gt;
if(myoxp_petslist.length == 0) {&lt;br /&gt;
  mission.setInstructions(null); // clear any text previously displayed by this world script on the F5F5 screen&lt;br /&gt;
} else {&lt;br /&gt;
  var textArray = [];&lt;br /&gt;
  textArray.push(&amp;quot;Ship Companion&amp;quot; + (myoxp_petslist.length &amp;gt; 1 ? &amp;quot;s:&amp;quot; : &amp;quot;:&amp;quot;)); // &amp;quot;Ship Companion:&amp;quot; or &amp;quot;Ship Companions:&amp;quot; if more than one&lt;br /&gt;
  var i = myoxp_petslist.length - 1; // pointer to last entry in myoxp_petslist&lt;br /&gt;
  while(i--) { // for each pet in the list, starting from the bottom (probably newest to oldest)&lt;br /&gt;
    textArray.push(myoxp_petslist[i].name); // add the name of the pet to the text we will show on the F5F5 screen&lt;br /&gt;
  }&lt;br /&gt;
  mission.setInstructions(textArray); // our pets list will now be visible on the F5F5 screen until further notice (the next time we call setInstructions or one of its variants, it will replace this)&lt;br /&gt;
}&amp;lt;/pre&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) : Boolean&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.&amp;lt;wbr&amp;gt;unmarkSystem&amp;lt;wbr&amp;gt;(4, 54, 222)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In 1.76 and earlier versions, any script can unmark a system, regardless of which script marked it or how many times it was previously marked. &lt;br /&gt;
&lt;br /&gt;
In 1.77, each marker has a name, and if a system has multiple markers each marker must be removed separately. Parameters in 1.77 may be numbers or objects. Numbers remove the &amp;lt;code&amp;gt;&amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot;&amp;lt;/code&amp;gt; markers. Objects are the same format as in &amp;lt;code&amp;gt;markSystem()&amp;lt;/code&amp;gt; and remove the marker of the corresponding name (the marker style options are ignored when unmarking). In 1.77, this method will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if all requested markers existed and were removed, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if any of the requested markers did not exist.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#markedSystems|markedSystems]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76570</id>
		<title>Oolite JavaScript Reference: Mission</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76570"/>
		<updated>2022-11-03T23:19:33Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* unmarkSystem */ fixed syntax, uniform string format, added link &amp;amp; deleted redundant link&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]]. Uses role to identify ship, so be sure to use a unique role if you want a specific ship to be showed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''exitScreen''' : [[Oolite JavaScript Reference: Global#guiScreen|guiScreen]] (read/write)&lt;br /&gt;
&lt;br /&gt;
This can be used to set a new exit screen for the current mission screen. Outside of a callback function, the value of this is meaningless, and setting it has no useful effect.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''markedSystems''' : Array (read-only)&lt;br /&gt;
&lt;br /&gt;
An array of the objects currently being used to mark systems. The objects will have the same properties as those used by [[#markSystem|&amp;lt;code&amp;gt;markSystem()&amp;lt;/code&amp;gt;]] and [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''screenID''' : String (read-only)&lt;br /&gt;
&lt;br /&gt;
If there is currently a mission screen running with a defined [[#scrnID|&amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;]], then that &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;. Otherwise, this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;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. Can also be used to add text to other screens like the system data (F7) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageTextKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageTextKey'''(messageKey : String)&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addMessageText|addMessageText()]]&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;
=== &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;. In 1.76 and earlier a system cannot be marked twice, so:&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.unmarkSystem(7);&lt;br /&gt;
will leave the system unmarked.&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, the parameters may be objects instead of numbers. This allows control over the marker's appearance, and allows multiple markers to be placed on the same system. The object takes the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; : The system ID. This is the only required parameter.&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; : A string identifying the group this marker belongs to (which may be the script's name, or something more specific). If omitted, which is not recommended, this defaults to &amp;lt;code&amp;gt;&amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot;&amp;lt;/code&amp;gt; which is also used for marking with numbers and marking carried out by legacy scripts.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerColor&amp;lt;/code&amp;gt; : A string specifying a colour. e.g. &amp;lt;code&amp;gt;&amp;quot;redColor&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;1.0 0.5 0.0&amp;quot;&amp;lt;/code&amp;gt;. If omitted, &amp;lt;code&amp;gt;&amp;quot;redColor&amp;quot;&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerScale&amp;lt;/code&amp;gt; : A number between &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt; specifying the relative size of the marker. Defaults to &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerShape&amp;lt;/code&amp;gt; : A string describing the shape of the marker. Valid values are &amp;lt;code&amp;gt;&amp;quot;MARKER_X&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;MARKER_PLUS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;MARKER_SQUARE&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;MARKER_DIAMOND&amp;quot;&amp;lt;/code&amp;gt;. If this value is invalid or omitted, &amp;lt;code&amp;gt;&amp;quot;MARKER_X&amp;quot;&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
&lt;br /&gt;
Multiple markers may be placed on the same system, provided that they have different names. If a marker with the same system and name already exists, it will be replaced.&lt;br /&gt;
&lt;br /&gt;
 mission.markSystem({&lt;br /&gt;
    system: 55,&lt;br /&gt;
    name: &amp;quot;my_oxp&amp;quot;,&lt;br /&gt;
    markerColor: &amp;quot;cyanColor&amp;quot;,&lt;br /&gt;
    markerScale: 1.5,&lt;br /&gt;
    markerShape: &amp;quot;MARKER_DIAMOND&amp;quot;&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]], [[#markedSystems|&amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runShipLibrary&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''runShipLibrary'''()&lt;br /&gt;
Display the ship library based on [[shiplibrary.plist]], including processing of condition scripts.&lt;br /&gt;
&lt;br /&gt;
This is mainly useful for scenarios which override the standard scripts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''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;backgroundSpecial: String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, special background layer)&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;modelPersonality : Int&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the entityPersonality assigned to the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt;. If unspecified, or in 1.76 or earlier, a random personality is used)&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;choices: Object&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, Object describing [[Oolite_JavaScript_Reference:_Mission#Advanced_choices_.281.77_or_later_only.29|advanced choices]])&lt;br /&gt;
* &amp;lt;code&amp;gt;choicesKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;initialChoicesKey : String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the key from &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt; which is initially selected)&lt;br /&gt;
* &amp;lt;code&amp;gt;allowInterrupt : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;), the mission screen can be interrupted with function keys, which does not call the callback function. Mainly intended for interfaces.)&lt;br /&gt;
* &amp;lt;code&amp;gt;exitScreen : ''guiScreen''&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, a GUI screen to exit on. If omitted, an invalid value is given, or the player is not docked, this will revert to &amp;quot;GUI_SCREEN_STATUS&amp;quot;. Not all GUI screens are selectable for this: only those reachable with function keys F3 to F8)&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scrnID&amp;quot;&amp;gt;&amp;lt;code&amp;gt;screenID : String&amp;lt;/code&amp;gt;&amp;lt;/span&amp;gt; ({{oolite-prop-added|1.77}}, an optional string which can be read later from &amp;lt;code&amp;gt;[[#screenID|mission.screenID]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;textEntry : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.79}}, if it's &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then you get the text prompt and 'choices' and 'choicesKey' are ignored. Whatever's typed there gets passed as the parameter to the callback function. The [https://github.com/OoliteProject/oolite/blob/master/Resources/Scripts/oolite-registership.js ship registry code] has a simple example.)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartZoom : decimal&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, zoom level of the 'CUSTOM_CHART' backgroundSpecial map)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentre: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, using the internal coordinate system. The z component is always zero. Discouraged in favour of customChartCentreInLY)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentreLY: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, in LY. e.g. for Lave: (8, 34.6, 0). The z component is always zero.)&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;
There are 21 lines available for display of the message and choices combined. (In 1.77, this is extended to 27 lines if the player's HUD is hidden)&lt;br /&gt;
&lt;br /&gt;
==== runScreen callbacks ====&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. The optional &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; parameter will be used as the &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; property of the mission screen callback. It is usually unnecessary to specify this, but if you intend the function which calls runScreen to be called from a different script, and the callback references &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;, you will need to use it.&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;
In 1.77, if &amp;lt;code&amp;gt;allowInterrupt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it is possible that the callback function will not be called. It should therefore only be set for mission screens which can safely be interrupted without the callback. Regardless of this setting, all mission screens may be interrupted by the player launching from the station, and this possibility should be considered (in such case callback function will be called with &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; argument).&lt;br /&gt;
&lt;br /&gt;
==== runScreen special backgrounds (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, 'backgroundSpecial' may be given the following special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the short range chart (as if the player had pressed F6). The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the current long range chart (as if the player had pressed F6 twice). The first 16 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
In 1.87 or later, 'backgroundSpecial' has these additional special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART&amp;lt;/code&amp;gt;: Displays a chart where zoom and centre position can be customised using the 'customChartZoom' and 'customChartCentreInLY' properties. The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_SHORTEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_QUICKEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
With all special chart backgrounds, changes made to destination system, or to markers, will be updated immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
These backgrounds will be displayed above the '&amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt;' (if any) but below everything else.&lt;br /&gt;
&lt;br /&gt;
==== Advanced choices (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, choices may be set either with the 'choicesKey' parameter from missiontext.plist as before, or with the 'choices' parameter. (If both are set, 'choicesKey' will be ignored)&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
 var options = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; : &amp;quot;Take the job&amp;quot;,&lt;br /&gt;
    &amp;quot;02_DECLINE&amp;quot; : &amp;quot;Politely decline&amp;quot;&lt;br /&gt;
 };&lt;br /&gt;
 if (player.bounty == 0) // only clean players have this option&lt;br /&gt;
 {&lt;br /&gt;
    options[&amp;quot;03_REPORT&amp;quot;] = &amp;quot;Call the police&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 mission.runScreen({&lt;br /&gt;
    // title, message, etc.&lt;br /&gt;
    choices: options&lt;br /&gt;
 },function(choice) {&lt;br /&gt;
    // choice handling&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
This is useful where the options available (perhaps depending on the player's ship or equipment, or on previous events in the mission) may vary in a complex fashion, to avoid the need to have a separate missiontext.plist entry for every possibility.&lt;br /&gt;
&lt;br /&gt;
The value (either in &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt;'s missiontext entry or &amp;lt;code&amp;gt;choices&amp;lt;/code&amp;gt;) may either be a text string as in previous versions, or an object itself. If it is an object, it can take four parameters: &lt;br /&gt;
* 'text' is the displayed text for this key. &lt;br /&gt;
* 'alignment' can be 'LEFT', 'RIGHT' or 'CENTER' (the default). &lt;br /&gt;
* 'unselectable' can be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; (the default for non-blank text). Unselectable rows are printed, but are skipped when moving through the options. This can be useful for keeping a consistent interface.&lt;br /&gt;
* 'color' can be any color specification (e.g. &amp;quot;orangeColor&amp;quot;). The default is &amp;quot;yellowColor&amp;quot;, or &amp;quot;darkGrayColor&amp;quot; for unselectable rows.&lt;br /&gt;
For example (missiontext.plist):&lt;br /&gt;
 &amp;quot;my_choice_1&amp;quot; = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; = {&lt;br /&gt;
       text = &amp;quot;Take the job&amp;quot;;&lt;br /&gt;
       alignment = &amp;quot;LEFT&amp;quot;;&lt;br /&gt;
       unselectable = false;&lt;br /&gt;
       color = &amp;quot;greenColor&amp;quot;;&lt;br /&gt;
    };&lt;br /&gt;
    // more options&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
In 1.77, the behaviour for choices which have no text is slightly changed. These will now leave a blank and unselectable line in the option list.&lt;br /&gt;
&lt;br /&gt;
==== Safe usage of runScreen ====&lt;br /&gt;
&lt;br /&gt;
One warning: &amp;lt;code&amp;gt;runScreen()&amp;lt;/code&amp;gt; will overwrite any existing missionscreen or GUI screen. The only safe place is using it inside a &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler or the callback function from a previous mission screen (or in 1.77 onwards, inside an interface callback function), 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;
==== Known issues ====&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.79, only the A-Z, a-z, 0-9 and (space) characters may be reliably entered in the 'textEntry' field. A wider selection, for boring internal reasons, is available on the Mac, and is hoped to also be available on other platforms in later releases.&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;
Note: the &amp;quot;\n&amp;quot; token does not provide a line break (verified in v1.9).&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;
In Oolite 1.81 onwards, the following variant is available&lt;br /&gt;
&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInstructions'''(instructions : Array, [worldScriptName : String])&lt;br /&gt;
&lt;br /&gt;
If this version is used, the first array element will be a heading on the Manifest screen, and the remaining elements will be entered underneath it, rather than being entered under the &amp;quot;Missions&amp;quot; heading.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship Companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...]);&lt;br /&gt;
This will display Ship Companion: in yellow text on the F5F5 screen, and beneath it will show the [[String expansion|expanded]] value of the key &amp;quot;myoxp_currentpet&amp;quot; from the [[missiontext.plist]] associated with the calling world script. If not called from a world script, the worldScriptName (this.name from the script) must be provided also:&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...], &amp;quot;myoxp's script name&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Note that because the first parameter is now an array, the line(s) to be added must be enclosed in brackets and comma separated. Also note the optional use of &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#expandMissionText|expandMissionText()]]&amp;lt;/code&amp;gt; to retrieve text from [[missiontext.plist]]. It is also possible to construct the array before calling setInstructions, for example:&amp;lt;pre&amp;gt;&lt;br /&gt;
if(myoxp_petslist.length == 0) {&lt;br /&gt;
  mission.setInstructions(null); // clear any text previously displayed by this world script on the F5F5 screen&lt;br /&gt;
} else {&lt;br /&gt;
  var textArray = [];&lt;br /&gt;
  textArray.push(&amp;quot;Ship Companion&amp;quot; + (myoxp_petslist.length &amp;gt; 1 ? &amp;quot;s:&amp;quot; : &amp;quot;:&amp;quot;)); // &amp;quot;Ship Companion:&amp;quot; or &amp;quot;Ship Companions:&amp;quot; if more than one&lt;br /&gt;
  var i = myoxp_petslist.length - 1; // pointer to last entry in myoxp_petslist&lt;br /&gt;
  while(i--) { // for each pet in the list, starting from the bottom (probably newest to oldest)&lt;br /&gt;
    textArray.push(myoxp_petslist[i].name); // add the name of the pet to the text we will show on the F5F5 screen&lt;br /&gt;
  }&lt;br /&gt;
  mission.setInstructions(textArray); // our pets list will now be visible on the F5F5 screen until further notice (the next time we call setInstructions or one of its variants, it will replace this)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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) : Boolean&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.&amp;lt;wbr&amp;gt;unmarkSystem&amp;lt;wbr&amp;gt;(4, 54, 222)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In 1.76 and earlier versions, any script can unmark a system, regardless of which script marked it or how many times it was previously marked. &lt;br /&gt;
&lt;br /&gt;
In 1.77, each marker has a name, and if a system has multiple markers each marker must be removed separately. Parameters in 1.77 may be numbers or objects. Numbers remove the &amp;lt;code&amp;gt;&amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot;&amp;lt;/code&amp;gt; markers. Objects are the same format as in &amp;lt;code&amp;gt;markSystem()&amp;lt;/code&amp;gt; and remove the marker of the corresponding name (the marker style options are ignored when unmarking). In 1.77, this method will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if all requested markers existed and were removed, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if any of the requested markers did not exist.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#markedSystems|markedSystems]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76569</id>
		<title>Oolite JavaScript Reference: Mission</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76569"/>
		<updated>2022-11-03T22:41:58Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* markSystem */ uniform string format (x9), added link&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]]. Uses role to identify ship, so be sure to use a unique role if you want a specific ship to be showed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''exitScreen''' : [[Oolite JavaScript Reference: Global#guiScreen|guiScreen]] (read/write)&lt;br /&gt;
&lt;br /&gt;
This can be used to set a new exit screen for the current mission screen. Outside of a callback function, the value of this is meaningless, and setting it has no useful effect.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''markedSystems''' : Array (read-only)&lt;br /&gt;
&lt;br /&gt;
An array of the objects currently being used to mark systems. The objects will have the same properties as those used by [[#markSystem|&amp;lt;code&amp;gt;markSystem()&amp;lt;/code&amp;gt;]] and [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''screenID''' : String (read-only)&lt;br /&gt;
&lt;br /&gt;
If there is currently a mission screen running with a defined [[#scrnID|&amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;]], then that &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;. Otherwise, this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;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. Can also be used to add text to other screens like the system data (F7) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageTextKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageTextKey'''(messageKey : String)&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addMessageText|addMessageText()]]&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;
=== &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;. In 1.76 and earlier a system cannot be marked twice, so:&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.unmarkSystem(7);&lt;br /&gt;
will leave the system unmarked.&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, the parameters may be objects instead of numbers. This allows control over the marker's appearance, and allows multiple markers to be placed on the same system. The object takes the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; : The system ID. This is the only required parameter.&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; : A string identifying the group this marker belongs to (which may be the script's name, or something more specific). If omitted, which is not recommended, this defaults to &amp;lt;code&amp;gt;&amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot;&amp;lt;/code&amp;gt; which is also used for marking with numbers and marking carried out by legacy scripts.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerColor&amp;lt;/code&amp;gt; : A string specifying a colour. e.g. &amp;lt;code&amp;gt;&amp;quot;redColor&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;1.0 0.5 0.0&amp;quot;&amp;lt;/code&amp;gt;. If omitted, &amp;lt;code&amp;gt;&amp;quot;redColor&amp;quot;&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerScale&amp;lt;/code&amp;gt; : A number between &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt; specifying the relative size of the marker. Defaults to &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerShape&amp;lt;/code&amp;gt; : A string describing the shape of the marker. Valid values are &amp;lt;code&amp;gt;&amp;quot;MARKER_X&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;MARKER_PLUS&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;MARKER_SQUARE&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;MARKER_DIAMOND&amp;quot;&amp;lt;/code&amp;gt;. If this value is invalid or omitted, &amp;lt;code&amp;gt;&amp;quot;MARKER_X&amp;quot;&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
&lt;br /&gt;
Multiple markers may be placed on the same system, provided that they have different names. If a marker with the same system and name already exists, it will be replaced.&lt;br /&gt;
&lt;br /&gt;
 mission.markSystem({&lt;br /&gt;
    system: 55,&lt;br /&gt;
    name: &amp;quot;my_oxp&amp;quot;,&lt;br /&gt;
    markerColor: &amp;quot;cyanColor&amp;quot;,&lt;br /&gt;
    markerScale: 1.5,&lt;br /&gt;
    markerShape: &amp;quot;MARKER_DIAMOND&amp;quot;&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]], [[#markedSystems|&amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runShipLibrary&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''runShipLibrary'''()&lt;br /&gt;
Display the ship library based on [[shiplibrary.plist]], including processing of condition scripts.&lt;br /&gt;
&lt;br /&gt;
This is mainly useful for scenarios which override the standard scripts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''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;backgroundSpecial: String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, special background layer)&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;modelPersonality : Int&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the entityPersonality assigned to the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt;. If unspecified, or in 1.76 or earlier, a random personality is used)&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;choices: Object&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, Object describing [[Oolite_JavaScript_Reference:_Mission#Advanced_choices_.281.77_or_later_only.29|advanced choices]])&lt;br /&gt;
* &amp;lt;code&amp;gt;choicesKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;initialChoicesKey : String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the key from &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt; which is initially selected)&lt;br /&gt;
* &amp;lt;code&amp;gt;allowInterrupt : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;), the mission screen can be interrupted with function keys, which does not call the callback function. Mainly intended for interfaces.)&lt;br /&gt;
* &amp;lt;code&amp;gt;exitScreen : ''guiScreen''&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, a GUI screen to exit on. If omitted, an invalid value is given, or the player is not docked, this will revert to &amp;quot;GUI_SCREEN_STATUS&amp;quot;. Not all GUI screens are selectable for this: only those reachable with function keys F3 to F8)&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scrnID&amp;quot;&amp;gt;&amp;lt;code&amp;gt;screenID : String&amp;lt;/code&amp;gt;&amp;lt;/span&amp;gt; ({{oolite-prop-added|1.77}}, an optional string which can be read later from &amp;lt;code&amp;gt;[[#screenID|mission.screenID]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;textEntry : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.79}}, if it's &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then you get the text prompt and 'choices' and 'choicesKey' are ignored. Whatever's typed there gets passed as the parameter to the callback function. The [https://github.com/OoliteProject/oolite/blob/master/Resources/Scripts/oolite-registership.js ship registry code] has a simple example.)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartZoom : decimal&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, zoom level of the 'CUSTOM_CHART' backgroundSpecial map)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentre: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, using the internal coordinate system. The z component is always zero. Discouraged in favour of customChartCentreInLY)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentreLY: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, in LY. e.g. for Lave: (8, 34.6, 0). The z component is always zero.)&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;
There are 21 lines available for display of the message and choices combined. (In 1.77, this is extended to 27 lines if the player's HUD is hidden)&lt;br /&gt;
&lt;br /&gt;
==== runScreen callbacks ====&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. The optional &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; parameter will be used as the &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; property of the mission screen callback. It is usually unnecessary to specify this, but if you intend the function which calls runScreen to be called from a different script, and the callback references &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;, you will need to use it.&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;
In 1.77, if &amp;lt;code&amp;gt;allowInterrupt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it is possible that the callback function will not be called. It should therefore only be set for mission screens which can safely be interrupted without the callback. Regardless of this setting, all mission screens may be interrupted by the player launching from the station, and this possibility should be considered (in such case callback function will be called with &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; argument).&lt;br /&gt;
&lt;br /&gt;
==== runScreen special backgrounds (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, 'backgroundSpecial' may be given the following special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the short range chart (as if the player had pressed F6). The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the current long range chart (as if the player had pressed F6 twice). The first 16 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
In 1.87 or later, 'backgroundSpecial' has these additional special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART&amp;lt;/code&amp;gt;: Displays a chart where zoom and centre position can be customised using the 'customChartZoom' and 'customChartCentreInLY' properties. The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_SHORTEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_QUICKEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
With all special chart backgrounds, changes made to destination system, or to markers, will be updated immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
These backgrounds will be displayed above the '&amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt;' (if any) but below everything else.&lt;br /&gt;
&lt;br /&gt;
==== Advanced choices (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, choices may be set either with the 'choicesKey' parameter from missiontext.plist as before, or with the 'choices' parameter. (If both are set, 'choicesKey' will be ignored)&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
 var options = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; : &amp;quot;Take the job&amp;quot;,&lt;br /&gt;
    &amp;quot;02_DECLINE&amp;quot; : &amp;quot;Politely decline&amp;quot;&lt;br /&gt;
 };&lt;br /&gt;
 if (player.bounty == 0) // only clean players have this option&lt;br /&gt;
 {&lt;br /&gt;
    options[&amp;quot;03_REPORT&amp;quot;] = &amp;quot;Call the police&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 mission.runScreen({&lt;br /&gt;
    // title, message, etc.&lt;br /&gt;
    choices: options&lt;br /&gt;
 },function(choice) {&lt;br /&gt;
    // choice handling&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
This is useful where the options available (perhaps depending on the player's ship or equipment, or on previous events in the mission) may vary in a complex fashion, to avoid the need to have a separate missiontext.plist entry for every possibility.&lt;br /&gt;
&lt;br /&gt;
The value (either in &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt;'s missiontext entry or &amp;lt;code&amp;gt;choices&amp;lt;/code&amp;gt;) may either be a text string as in previous versions, or an object itself. If it is an object, it can take four parameters: &lt;br /&gt;
* 'text' is the displayed text for this key. &lt;br /&gt;
* 'alignment' can be 'LEFT', 'RIGHT' or 'CENTER' (the default). &lt;br /&gt;
* 'unselectable' can be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; (the default for non-blank text). Unselectable rows are printed, but are skipped when moving through the options. This can be useful for keeping a consistent interface.&lt;br /&gt;
* 'color' can be any color specification (e.g. &amp;quot;orangeColor&amp;quot;). The default is &amp;quot;yellowColor&amp;quot;, or &amp;quot;darkGrayColor&amp;quot; for unselectable rows.&lt;br /&gt;
For example (missiontext.plist):&lt;br /&gt;
 &amp;quot;my_choice_1&amp;quot; = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; = {&lt;br /&gt;
       text = &amp;quot;Take the job&amp;quot;;&lt;br /&gt;
       alignment = &amp;quot;LEFT&amp;quot;;&lt;br /&gt;
       unselectable = false;&lt;br /&gt;
       color = &amp;quot;greenColor&amp;quot;;&lt;br /&gt;
    };&lt;br /&gt;
    // more options&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
In 1.77, the behaviour for choices which have no text is slightly changed. These will now leave a blank and unselectable line in the option list.&lt;br /&gt;
&lt;br /&gt;
==== Safe usage of runScreen ====&lt;br /&gt;
&lt;br /&gt;
One warning: &amp;lt;code&amp;gt;runScreen()&amp;lt;/code&amp;gt; will overwrite any existing missionscreen or GUI screen. The only safe place is using it inside a &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler or the callback function from a previous mission screen (or in 1.77 onwards, inside an interface callback function), 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;
==== Known issues ====&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.79, only the A-Z, a-z, 0-9 and (space) characters may be reliably entered in the 'textEntry' field. A wider selection, for boring internal reasons, is available on the Mac, and is hoped to also be available on other platforms in later releases.&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;
Note: the &amp;quot;\n&amp;quot; token does not provide a line break (verified in v1.9).&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;
In Oolite 1.81 onwards, the following variant is available&lt;br /&gt;
&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInstructions'''(instructions : Array, [worldScriptName : String])&lt;br /&gt;
&lt;br /&gt;
If this version is used, the first array element will be a heading on the Manifest screen, and the remaining elements will be entered underneath it, rather than being entered under the &amp;quot;Missions&amp;quot; heading.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship Companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...]);&lt;br /&gt;
This will display Ship Companion: in yellow text on the F5F5 screen, and beneath it will show the [[String expansion|expanded]] value of the key &amp;quot;myoxp_currentpet&amp;quot; from the [[missiontext.plist]] associated with the calling world script. If not called from a world script, the worldScriptName (this.name from the script) must be provided also:&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...], &amp;quot;myoxp's script name&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Note that because the first parameter is now an array, the line(s) to be added must be enclosed in brackets and comma separated. Also note the optional use of &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#expandMissionText|expandMissionText()]]&amp;lt;/code&amp;gt; to retrieve text from [[missiontext.plist]]. It is also possible to construct the array before calling setInstructions, for example:&amp;lt;pre&amp;gt;&lt;br /&gt;
if(myoxp_petslist.length == 0) {&lt;br /&gt;
  mission.setInstructions(null); // clear any text previously displayed by this world script on the F5F5 screen&lt;br /&gt;
} else {&lt;br /&gt;
  var textArray = [];&lt;br /&gt;
  textArray.push(&amp;quot;Ship Companion&amp;quot; + (myoxp_petslist.length &amp;gt; 1 ? &amp;quot;s:&amp;quot; : &amp;quot;:&amp;quot;)); // &amp;quot;Ship Companion:&amp;quot; or &amp;quot;Ship Companions:&amp;quot; if more than one&lt;br /&gt;
  var i = myoxp_petslist.length - 1; // pointer to last entry in myoxp_petslist&lt;br /&gt;
  while(i--) { // for each pet in the list, starting from the bottom (probably newest to oldest)&lt;br /&gt;
    textArray.push(myoxp_petslist[i].name); // add the name of the pet to the text we will show on the F5F5 screen&lt;br /&gt;
  }&lt;br /&gt;
  mission.setInstructions(textArray); // our pets list will now be visible on the F5F5 screen until further notice (the next time we call setInstructions or one of its variants, it will replace this)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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;
In 1.76 and earlier versions, any script can unmark a system, regardless of which script marked it or how many times it was previously marked. &lt;br /&gt;
&lt;br /&gt;
In 1.77, each marker has a name, and if a system has multiple markers each marker must be removed separately. Parameters in 1.77 may be numbers or objects. Numbers remove the &amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot; markers. Objects are the same format as in &amp;lt;code&amp;gt;markSystem&amp;lt;/code&amp;gt; and remove the marker of the corresponding name (the marker style options are ignored when unmarking). In 1.77, this method will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if all requested markers existed and were removed, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if any of the requested markers did not exist.&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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76568</id>
		<title>Oolite JavaScript Reference: Mission</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76568"/>
		<updated>2022-11-03T22:28:00Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* markedSystems */ added links (x2)&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]]. Uses role to identify ship, so be sure to use a unique role if you want a specific ship to be showed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''exitScreen''' : [[Oolite JavaScript Reference: Global#guiScreen|guiScreen]] (read/write)&lt;br /&gt;
&lt;br /&gt;
This can be used to set a new exit screen for the current mission screen. Outside of a callback function, the value of this is meaningless, and setting it has no useful effect.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''markedSystems''' : Array (read-only)&lt;br /&gt;
&lt;br /&gt;
An array of the objects currently being used to mark systems. The objects will have the same properties as those used by [[#markSystem|&amp;lt;code&amp;gt;markSystem()&amp;lt;/code&amp;gt;]] and [[#unmarkSystem|&amp;lt;code&amp;gt;unmarkSystem()&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''screenID''' : String (read-only)&lt;br /&gt;
&lt;br /&gt;
If there is currently a mission screen running with a defined [[#scrnID|&amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;]], then that &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;. Otherwise, this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;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. Can also be used to add text to other screens like the system data (F7) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageTextKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageTextKey'''(messageKey : String)&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addMessageText|addMessageText()]]&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;
=== &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;. In 1.76 and earlier a system cannot be marked twice, so:&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.unmarkSystem(7);&lt;br /&gt;
will leave the system unmarked.&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, the parameters may be objects instead of numbers. This allows control over the marker's appearance, and allows multiple markers to be placed on the same system. The object takes the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; : The system ID. This is the only required parameter.&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; : A string identifying the group this marker belongs to (which may be the script's name, or something more specific). If omitted, which is not recommended, this defaults to &amp;quot;__oolite_legacy_destinations&amp;quot; which is also used for marking with numbers and marking carried out by legacy scripts.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerColor&amp;lt;/code&amp;gt; : A string specifying a colour. e.g. &amp;quot;redColor&amp;quot; or &amp;quot;1.0 0.5 0.0&amp;quot;. If omitted, &amp;quot;redColor&amp;quot; will be used.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerScale&amp;lt;/code&amp;gt; : A number between 0.5 and 2.0 specifying the relative size of the marker. Defaults to 1.0.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerShape&amp;lt;/code&amp;gt; : A string describing the shape of the marker. Valid values are MARKER_X, MARKER_PLUS, MARKER_SQUARE and MARKER_DIAMOND. If this value is invalid or omitted, MARKER_X will be used.&lt;br /&gt;
&lt;br /&gt;
Multiple markers may be placed on the same system, provided that they have different names. If a marker with the same system and name already exists, it will be replaced.&lt;br /&gt;
&lt;br /&gt;
 mission.markSystem({&lt;br /&gt;
    system: 55,&lt;br /&gt;
    name: &amp;quot;my_oxp&amp;quot;,&lt;br /&gt;
    markerColor: &amp;quot;cyanColor&amp;quot;,&lt;br /&gt;
    markerScale: 1.5,&lt;br /&gt;
    markerShape: &amp;quot;MARKER_DIAMOND&amp;quot;&lt;br /&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;runShipLibrary&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''runShipLibrary'''()&lt;br /&gt;
Display the ship library based on [[shiplibrary.plist]], including processing of condition scripts.&lt;br /&gt;
&lt;br /&gt;
This is mainly useful for scenarios which override the standard scripts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''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;backgroundSpecial: String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, special background layer)&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;modelPersonality : Int&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the entityPersonality assigned to the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt;. If unspecified, or in 1.76 or earlier, a random personality is used)&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;choices: Object&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, Object describing [[Oolite_JavaScript_Reference:_Mission#Advanced_choices_.281.77_or_later_only.29|advanced choices]])&lt;br /&gt;
* &amp;lt;code&amp;gt;choicesKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;initialChoicesKey : String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the key from &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt; which is initially selected)&lt;br /&gt;
* &amp;lt;code&amp;gt;allowInterrupt : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;), the mission screen can be interrupted with function keys, which does not call the callback function. Mainly intended for interfaces.)&lt;br /&gt;
* &amp;lt;code&amp;gt;exitScreen : ''guiScreen''&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, a GUI screen to exit on. If omitted, an invalid value is given, or the player is not docked, this will revert to &amp;quot;GUI_SCREEN_STATUS&amp;quot;. Not all GUI screens are selectable for this: only those reachable with function keys F3 to F8)&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scrnID&amp;quot;&amp;gt;&amp;lt;code&amp;gt;screenID : String&amp;lt;/code&amp;gt;&amp;lt;/span&amp;gt; ({{oolite-prop-added|1.77}}, an optional string which can be read later from &amp;lt;code&amp;gt;[[#screenID|mission.screenID]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;textEntry : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.79}}, if it's &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then you get the text prompt and 'choices' and 'choicesKey' are ignored. Whatever's typed there gets passed as the parameter to the callback function. The [https://github.com/OoliteProject/oolite/blob/master/Resources/Scripts/oolite-registership.js ship registry code] has a simple example.)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartZoom : decimal&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, zoom level of the 'CUSTOM_CHART' backgroundSpecial map)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentre: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, using the internal coordinate system. The z component is always zero. Discouraged in favour of customChartCentreInLY)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentreLY: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, in LY. e.g. for Lave: (8, 34.6, 0). The z component is always zero.)&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;
There are 21 lines available for display of the message and choices combined. (In 1.77, this is extended to 27 lines if the player's HUD is hidden)&lt;br /&gt;
&lt;br /&gt;
==== runScreen callbacks ====&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. The optional &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; parameter will be used as the &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; property of the mission screen callback. It is usually unnecessary to specify this, but if you intend the function which calls runScreen to be called from a different script, and the callback references &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;, you will need to use it.&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;
In 1.77, if &amp;lt;code&amp;gt;allowInterrupt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it is possible that the callback function will not be called. It should therefore only be set for mission screens which can safely be interrupted without the callback. Regardless of this setting, all mission screens may be interrupted by the player launching from the station, and this possibility should be considered (in such case callback function will be called with &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; argument).&lt;br /&gt;
&lt;br /&gt;
==== runScreen special backgrounds (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, 'backgroundSpecial' may be given the following special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the short range chart (as if the player had pressed F6). The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the current long range chart (as if the player had pressed F6 twice). The first 16 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
In 1.87 or later, 'backgroundSpecial' has these additional special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART&amp;lt;/code&amp;gt;: Displays a chart where zoom and centre position can be customised using the 'customChartZoom' and 'customChartCentreInLY' properties. The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_SHORTEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_QUICKEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
With all special chart backgrounds, changes made to destination system, or to markers, will be updated immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
These backgrounds will be displayed above the '&amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt;' (if any) but below everything else.&lt;br /&gt;
&lt;br /&gt;
==== Advanced choices (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, choices may be set either with the 'choicesKey' parameter from missiontext.plist as before, or with the 'choices' parameter. (If both are set, 'choicesKey' will be ignored)&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
 var options = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; : &amp;quot;Take the job&amp;quot;,&lt;br /&gt;
    &amp;quot;02_DECLINE&amp;quot; : &amp;quot;Politely decline&amp;quot;&lt;br /&gt;
 };&lt;br /&gt;
 if (player.bounty == 0) // only clean players have this option&lt;br /&gt;
 {&lt;br /&gt;
    options[&amp;quot;03_REPORT&amp;quot;] = &amp;quot;Call the police&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 mission.runScreen({&lt;br /&gt;
    // title, message, etc.&lt;br /&gt;
    choices: options&lt;br /&gt;
 },function(choice) {&lt;br /&gt;
    // choice handling&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
This is useful where the options available (perhaps depending on the player's ship or equipment, or on previous events in the mission) may vary in a complex fashion, to avoid the need to have a separate missiontext.plist entry for every possibility.&lt;br /&gt;
&lt;br /&gt;
The value (either in &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt;'s missiontext entry or &amp;lt;code&amp;gt;choices&amp;lt;/code&amp;gt;) may either be a text string as in previous versions, or an object itself. If it is an object, it can take four parameters: &lt;br /&gt;
* 'text' is the displayed text for this key. &lt;br /&gt;
* 'alignment' can be 'LEFT', 'RIGHT' or 'CENTER' (the default). &lt;br /&gt;
* 'unselectable' can be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; (the default for non-blank text). Unselectable rows are printed, but are skipped when moving through the options. This can be useful for keeping a consistent interface.&lt;br /&gt;
* 'color' can be any color specification (e.g. &amp;quot;orangeColor&amp;quot;). The default is &amp;quot;yellowColor&amp;quot;, or &amp;quot;darkGrayColor&amp;quot; for unselectable rows.&lt;br /&gt;
For example (missiontext.plist):&lt;br /&gt;
 &amp;quot;my_choice_1&amp;quot; = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; = {&lt;br /&gt;
       text = &amp;quot;Take the job&amp;quot;;&lt;br /&gt;
       alignment = &amp;quot;LEFT&amp;quot;;&lt;br /&gt;
       unselectable = false;&lt;br /&gt;
       color = &amp;quot;greenColor&amp;quot;;&lt;br /&gt;
    };&lt;br /&gt;
    // more options&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
In 1.77, the behaviour for choices which have no text is slightly changed. These will now leave a blank and unselectable line in the option list.&lt;br /&gt;
&lt;br /&gt;
==== Safe usage of runScreen ====&lt;br /&gt;
&lt;br /&gt;
One warning: &amp;lt;code&amp;gt;runScreen()&amp;lt;/code&amp;gt; will overwrite any existing missionscreen or GUI screen. The only safe place is using it inside a &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler or the callback function from a previous mission screen (or in 1.77 onwards, inside an interface callback function), 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;
==== Known issues ====&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.79, only the A-Z, a-z, 0-9 and (space) characters may be reliably entered in the 'textEntry' field. A wider selection, for boring internal reasons, is available on the Mac, and is hoped to also be available on other platforms in later releases.&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;
Note: the &amp;quot;\n&amp;quot; token does not provide a line break (verified in v1.9).&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;
In Oolite 1.81 onwards, the following variant is available&lt;br /&gt;
&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInstructions'''(instructions : Array, [worldScriptName : String])&lt;br /&gt;
&lt;br /&gt;
If this version is used, the first array element will be a heading on the Manifest screen, and the remaining elements will be entered underneath it, rather than being entered under the &amp;quot;Missions&amp;quot; heading.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship Companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...]);&lt;br /&gt;
This will display Ship Companion: in yellow text on the F5F5 screen, and beneath it will show the [[String expansion|expanded]] value of the key &amp;quot;myoxp_currentpet&amp;quot; from the [[missiontext.plist]] associated with the calling world script. If not called from a world script, the worldScriptName (this.name from the script) must be provided also:&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...], &amp;quot;myoxp's script name&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Note that because the first parameter is now an array, the line(s) to be added must be enclosed in brackets and comma separated. Also note the optional use of &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#expandMissionText|expandMissionText()]]&amp;lt;/code&amp;gt; to retrieve text from [[missiontext.plist]]. It is also possible to construct the array before calling setInstructions, for example:&amp;lt;pre&amp;gt;&lt;br /&gt;
if(myoxp_petslist.length == 0) {&lt;br /&gt;
  mission.setInstructions(null); // clear any text previously displayed by this world script on the F5F5 screen&lt;br /&gt;
} else {&lt;br /&gt;
  var textArray = [];&lt;br /&gt;
  textArray.push(&amp;quot;Ship Companion&amp;quot; + (myoxp_petslist.length &amp;gt; 1 ? &amp;quot;s:&amp;quot; : &amp;quot;:&amp;quot;)); // &amp;quot;Ship Companion:&amp;quot; or &amp;quot;Ship Companions:&amp;quot; if more than one&lt;br /&gt;
  var i = myoxp_petslist.length - 1; // pointer to last entry in myoxp_petslist&lt;br /&gt;
  while(i--) { // for each pet in the list, starting from the bottom (probably newest to oldest)&lt;br /&gt;
    textArray.push(myoxp_petslist[i].name); // add the name of the pet to the text we will show on the F5F5 screen&lt;br /&gt;
  }&lt;br /&gt;
  mission.setInstructions(textArray); // our pets list will now be visible on the F5F5 screen until further notice (the next time we call setInstructions or one of its variants, it will replace this)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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;
In 1.76 and earlier versions, any script can unmark a system, regardless of which script marked it or how many times it was previously marked. &lt;br /&gt;
&lt;br /&gt;
In 1.77, each marker has a name, and if a system has multiple markers each marker must be removed separately. Parameters in 1.77 may be numbers or objects. Numbers remove the &amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot; markers. Objects are the same format as in &amp;lt;code&amp;gt;markSystem&amp;lt;/code&amp;gt; and remove the marker of the corresponding name (the marker style options are ignored when unmarking). In 1.77, this method will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if all requested markers existed and were removed, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if any of the requested markers did not exist.&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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=File:MoarNews.oxz&amp;diff=76529</id>
		<title>File:MoarNews.oxz</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=File:MoarNews.oxz&amp;diff=76529"/>
		<updated>2022-11-01T01:30:36Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: WiP for Cholmondely to eval&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
WiP for Cholmondely to eval&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76472</id>
		<title>Oolite JavaScript Reference: Mission</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76472"/>
		<updated>2022-10-30T18:49:09Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: added anchor &amp;amp; link&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]]. Uses role to identify ship, so be sure to use a unique role if you want a specific ship to be showed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''exitScreen''' : [[Oolite JavaScript Reference: Global#guiScreen|guiScreen]] (read/write)&lt;br /&gt;
&lt;br /&gt;
This can be used to set a new exit screen for the current mission screen. Outside of a callback function, the value of this is meaningless, and setting it has no useful effect.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''markedSystems''' : Array (read-only)&lt;br /&gt;
&lt;br /&gt;
An array of the objects currently being used to mark systems. The objects will have the same properties as those used by &amp;lt;code&amp;gt;markSystem&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;unmarkSystem&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''screenID''' : String (read-only)&lt;br /&gt;
&lt;br /&gt;
If there is currently a mission screen running with a defined [[#scrnID|&amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;]], then that &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt;. Otherwise, this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;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. Can also be used to add text to other screens like the system data (F7) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageTextKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageTextKey'''(messageKey : String)&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addMessageText|addMessageText()]]&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;
=== &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;. In 1.76 and earlier a system cannot be marked twice, so:&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.unmarkSystem(7);&lt;br /&gt;
will leave the system unmarked.&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, the parameters may be objects instead of numbers. This allows control over the marker's appearance, and allows multiple markers to be placed on the same system. The object takes the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; : The system ID. This is the only required parameter.&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; : A string identifying the group this marker belongs to (which may be the script's name, or something more specific). If omitted, which is not recommended, this defaults to &amp;quot;__oolite_legacy_destinations&amp;quot; which is also used for marking with numbers and marking carried out by legacy scripts.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerColor&amp;lt;/code&amp;gt; : A string specifying a colour. e.g. &amp;quot;redColor&amp;quot; or &amp;quot;1.0 0.5 0.0&amp;quot;. If omitted, &amp;quot;redColor&amp;quot; will be used.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerScale&amp;lt;/code&amp;gt; : A number between 0.5 and 2.0 specifying the relative size of the marker. Defaults to 1.0.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerShape&amp;lt;/code&amp;gt; : A string describing the shape of the marker. Valid values are MARKER_X, MARKER_PLUS, MARKER_SQUARE and MARKER_DIAMOND. If this value is invalid or omitted, MARKER_X will be used.&lt;br /&gt;
&lt;br /&gt;
Multiple markers may be placed on the same system, provided that they have different names. If a marker with the same system and name already exists, it will be replaced.&lt;br /&gt;
&lt;br /&gt;
 mission.markSystem({&lt;br /&gt;
    system: 55,&lt;br /&gt;
    name: &amp;quot;my_oxp&amp;quot;,&lt;br /&gt;
    markerColor: &amp;quot;cyanColor&amp;quot;,&lt;br /&gt;
    markerScale: 1.5,&lt;br /&gt;
    markerShape: &amp;quot;MARKER_DIAMOND&amp;quot;&lt;br /&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;runShipLibrary&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''runShipLibrary'''()&lt;br /&gt;
Display the ship library based on [[shiplibrary.plist]], including processing of condition scripts.&lt;br /&gt;
&lt;br /&gt;
This is mainly useful for scenarios which override the standard scripts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''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;backgroundSpecial: String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, special background layer)&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;modelPersonality : Int&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the entityPersonality assigned to the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt;. If unspecified, or in 1.76 or earlier, a random personality is used)&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;choices: Object&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, Object describing [[Oolite_JavaScript_Reference:_Mission#Advanced_choices_.281.77_or_later_only.29|advanced choices]])&lt;br /&gt;
* &amp;lt;code&amp;gt;choicesKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;initialChoicesKey : String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the key from &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt; which is initially selected)&lt;br /&gt;
* &amp;lt;code&amp;gt;allowInterrupt : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;), the mission screen can be interrupted with function keys, which does not call the callback function. Mainly intended for interfaces.)&lt;br /&gt;
* &amp;lt;code&amp;gt;exitScreen : ''guiScreen''&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, a GUI screen to exit on. If omitted, an invalid value is given, or the player is not docked, this will revert to &amp;quot;GUI_SCREEN_STATUS&amp;quot;. Not all GUI screens are selectable for this: only those reachable with function keys F3 to F8)&lt;br /&gt;
* &amp;lt;span id=&amp;quot;scrnID&amp;quot;&amp;gt;&amp;lt;code&amp;gt;screenID : String&amp;lt;/code&amp;gt;&amp;lt;/span&amp;gt; ({{oolite-prop-added|1.77}}, an optional string which can be read later from &amp;lt;code&amp;gt;[[#screenID|mission.screenID]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;textEntry : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.79}}, if it's &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then you get the text prompt and 'choices' and 'choicesKey' are ignored. Whatever's typed there gets passed as the parameter to the callback function. The [https://github.com/OoliteProject/oolite/blob/master/Resources/Scripts/oolite-registership.js ship registry code] has a simple example.)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartZoom : decimal&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, zoom level of the 'CUSTOM_CHART' backgroundSpecial map)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentre: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, using the internal coordinate system. The z component is always zero. Discouraged in favour of customChartCentreInLY)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentreLY: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, in LY. e.g. for Lave: (8, 34.6, 0). The z component is always zero.)&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;
There are 21 lines available for display of the message and choices combined. (In 1.77, this is extended to 27 lines if the player's HUD is hidden)&lt;br /&gt;
&lt;br /&gt;
==== runScreen callbacks ====&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. The optional &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; parameter will be used as the &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; property of the mission screen callback. It is usually unnecessary to specify this, but if you intend the function which calls runScreen to be called from a different script, and the callback references &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;, you will need to use it.&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;
In 1.77, if &amp;lt;code&amp;gt;allowInterrupt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it is possible that the callback function will not be called. It should therefore only be set for mission screens which can safely be interrupted without the callback. Regardless of this setting, all mission screens may be interrupted by the player launching from the station, and this possibility should be considered (in such case callback function will be called with &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; argument).&lt;br /&gt;
&lt;br /&gt;
==== runScreen special backgrounds (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, 'backgroundSpecial' may be given the following special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the short range chart (as if the player had pressed F6). The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the current long range chart (as if the player had pressed F6 twice). The first 16 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
In 1.87 or later, 'backgroundSpecial' has these additional special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART&amp;lt;/code&amp;gt;: Displays a chart where zoom and centre position can be customised using the 'customChartZoom' and 'customChartCentreInLY' properties. The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_SHORTEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_QUICKEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
With all special chart backgrounds, changes made to destination system, or to markers, will be updated immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
These backgrounds will be displayed above the '&amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt;' (if any) but below everything else.&lt;br /&gt;
&lt;br /&gt;
==== Advanced choices (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, choices may be set either with the 'choicesKey' parameter from missiontext.plist as before, or with the 'choices' parameter. (If both are set, 'choicesKey' will be ignored)&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
 var options = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; : &amp;quot;Take the job&amp;quot;,&lt;br /&gt;
    &amp;quot;02_DECLINE&amp;quot; : &amp;quot;Politely decline&amp;quot;&lt;br /&gt;
 };&lt;br /&gt;
 if (player.bounty == 0) // only clean players have this option&lt;br /&gt;
 {&lt;br /&gt;
    options[&amp;quot;03_REPORT&amp;quot;] = &amp;quot;Call the police&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 mission.runScreen({&lt;br /&gt;
    // title, message, etc.&lt;br /&gt;
    choices: options&lt;br /&gt;
 },function(choice) {&lt;br /&gt;
    // choice handling&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
This is useful where the options available (perhaps depending on the player's ship or equipment, or on previous events in the mission) may vary in a complex fashion, to avoid the need to have a separate missiontext.plist entry for every possibility.&lt;br /&gt;
&lt;br /&gt;
The value (either in &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt;'s missiontext entry or &amp;lt;code&amp;gt;choices&amp;lt;/code&amp;gt;) may either be a text string as in previous versions, or an object itself. If it is an object, it can take four parameters: &lt;br /&gt;
* 'text' is the displayed text for this key. &lt;br /&gt;
* 'alignment' can be 'LEFT', 'RIGHT' or 'CENTER' (the default). &lt;br /&gt;
* 'unselectable' can be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; (the default for non-blank text). Unselectable rows are printed, but are skipped when moving through the options. This can be useful for keeping a consistent interface.&lt;br /&gt;
* 'color' can be any color specification (e.g. &amp;quot;orangeColor&amp;quot;). The default is &amp;quot;yellowColor&amp;quot;, or &amp;quot;darkGrayColor&amp;quot; for unselectable rows.&lt;br /&gt;
For example (missiontext.plist):&lt;br /&gt;
 &amp;quot;my_choice_1&amp;quot; = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; = {&lt;br /&gt;
       text = &amp;quot;Take the job&amp;quot;;&lt;br /&gt;
       alignment = &amp;quot;LEFT&amp;quot;;&lt;br /&gt;
       unselectable = false;&lt;br /&gt;
       color = &amp;quot;greenColor&amp;quot;;&lt;br /&gt;
    };&lt;br /&gt;
    // more options&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
In 1.77, the behaviour for choices which have no text is slightly changed. These will now leave a blank and unselectable line in the option list.&lt;br /&gt;
&lt;br /&gt;
==== Safe usage of runScreen ====&lt;br /&gt;
&lt;br /&gt;
One warning: &amp;lt;code&amp;gt;runScreen()&amp;lt;/code&amp;gt; will overwrite any existing missionscreen or GUI screen. The only safe place is using it inside a &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler or the callback function from a previous mission screen (or in 1.77 onwards, inside an interface callback function), 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;
==== Known issues ====&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.79, only the A-Z, a-z, 0-9 and (space) characters may be reliably entered in the 'textEntry' field. A wider selection, for boring internal reasons, is available on the Mac, and is hoped to also be available on other platforms in later releases.&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;
Note: the &amp;quot;\n&amp;quot; token does not provide a line break (verified in v1.9).&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;
In Oolite 1.81 onwards, the following variant is available&lt;br /&gt;
&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInstructions'''(instructions : Array, [worldScriptName : String])&lt;br /&gt;
&lt;br /&gt;
If this version is used, the first array element will be a heading on the Manifest screen, and the remaining elements will be entered underneath it, rather than being entered under the &amp;quot;Missions&amp;quot; heading.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship Companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...]);&lt;br /&gt;
This will display Ship Companion: in yellow text on the F5F5 screen, and beneath it will show the [[String expansion|expanded]] value of the key &amp;quot;myoxp_currentpet&amp;quot; from the [[missiontext.plist]] associated with the calling world script. If not called from a world script, the worldScriptName (this.name from the script) must be provided also:&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...], &amp;quot;myoxp's script name&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Note that because the first parameter is now an array, the line(s) to be added must be enclosed in brackets and comma separated. Also note the optional use of &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#expandMissionText|expandMissionText()]]&amp;lt;/code&amp;gt; to retrieve text from [[missiontext.plist]]. It is also possible to construct the array before calling setInstructions, for example:&amp;lt;pre&amp;gt;&lt;br /&gt;
if(myoxp_petslist.length == 0) {&lt;br /&gt;
  mission.setInstructions(null); // clear any text previously displayed by this world script on the F5F5 screen&lt;br /&gt;
} else {&lt;br /&gt;
  var textArray = [];&lt;br /&gt;
  textArray.push(&amp;quot;Ship Companion&amp;quot; + (myoxp_petslist.length &amp;gt; 1 ? &amp;quot;s:&amp;quot; : &amp;quot;:&amp;quot;)); // &amp;quot;Ship Companion:&amp;quot; or &amp;quot;Ship Companions:&amp;quot; if more than one&lt;br /&gt;
  var i = myoxp_petslist.length - 1; // pointer to last entry in myoxp_petslist&lt;br /&gt;
  while(i--) { // for each pet in the list, starting from the bottom (probably newest to oldest)&lt;br /&gt;
    textArray.push(myoxp_petslist[i].name); // add the name of the pet to the text we will show on the F5F5 screen&lt;br /&gt;
  }&lt;br /&gt;
  mission.setInstructions(textArray); // our pets list will now be visible on the F5F5 screen until further notice (the next time we call setInstructions or one of its variants, it will replace this)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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;
In 1.76 and earlier versions, any script can unmark a system, regardless of which script marked it or how many times it was previously marked. &lt;br /&gt;
&lt;br /&gt;
In 1.77, each marker has a name, and if a system has multiple markers each marker must be removed separately. Parameters in 1.77 may be numbers or objects. Numbers remove the &amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot; markers. Objects are the same format as in &amp;lt;code&amp;gt;markSystem&amp;lt;/code&amp;gt; and remove the marker of the corresponding name (the marker style options are ignored when unmarking). In 1.77, this method will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if all requested markers existed and were removed, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if any of the requested markers did not exist.&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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_EquipmentInfo&amp;diff=76471</id>
		<title>Oolite JavaScript Reference: EquipmentInfo</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_EquipmentInfo&amp;diff=76471"/>
		<updated>2022-10-30T17:49:38Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Properties */ uniform string format (x2)&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;calculatedPrice&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.89}}&lt;br /&gt;
 '''calculatedPrice''' : Number (read-only nonnegative integer)&lt;br /&gt;
If an equipment item utilises the &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Condition scripts#updateEquipmentPrice|updateEquipmentPrice()]]&amp;lt;/code&amp;gt; condition script, this will be the price as calculated by that script. If no condition script is in use, the value returned will be the same as the &amp;lt;code&amp;gt;[[#price|price]]&amp;lt;/code&amp;gt; property. Divide this by ten for the real value in credits.&lt;br /&gt;
&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 Outfitting (F3) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayColor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.85}}&lt;br /&gt;
 '''displayColor''' : Color (read/write)&lt;br /&gt;
Gets and sets the color to be used for this item on the Outfitting (F3) and Status (F5) screens. Any valid [[Materials in Oolite#Colour specifiers|color specifier]] can be used. Setting a value of &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; will reset the color to use the default.&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&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&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;lt;code&amp;gt;&amp;quot;EQ_MISSILE&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fastAffinityDefensive&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''fastAffinityDefensive''' : Boolean (read-only)&lt;br /&gt;
If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the equipment will be preferentially assigned to the &amp;quot;fast activation (defensive)&amp;quot; key for primable equipment. This is always &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for non-primable equipment.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fastAffinityOffensive&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''fastAffinityOffensive''' : Boolean (read-only)&lt;br /&gt;
If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the equipment will be preferentially assigned to the &amp;quot;fast activation (offensive)&amp;quot; key for primable equipment. This is always &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for non-primable equipment.&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 Status (F5) 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;lt;code&amp;gt;&amp;quot;Missile&amp;quot;&amp;lt;/code&amp;gt;.&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;provides&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''provides''' : Array (read-only)&lt;br /&gt;
Returns an array of equipment keys which define the function(s) this equipment is providing to the ship, as defined in the &amp;lt;code&amp;gt;provides&amp;lt;/code&amp;gt; element in [[equipment.plist]].&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 Outfitting (F3) screen. Starting with 1.77, this key will actually ensure 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;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 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;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=76470</id>
		<title>Oolite JavaScript Reference: Player</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=76470"/>
		<updated>2022-10-30T17:24:32Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* rank */ cleared up wording&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;contractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''contractReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''contractReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s cargo contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards..&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;[[Oolite JavaScript Reference: Ship#contracts|contracts]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&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, float)&lt;br /&gt;
The amount of money the player has, in credits.&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;escapePodRescueTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.89}}&lt;br /&gt;
 '''escapePodRescueTime''' : Number (read-write decimal)&lt;br /&gt;
Number of seconds that will be added to the clock when the player uses an escape pod and is rescued. Default value is 0 (zero), which will utilise the default time calculation that can add up to eight days to the clock.&lt;br /&gt;
Negative numbers will be ignored (and default calculation will apply).&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 mainly for display purposes describing the player’s legal status 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, read/write from 1.79)&lt;br /&gt;
The name of the player’s character (e.g., &amp;lt;code&amp;gt;&amp;quot;Jameson&amp;quot;&amp;lt;/code&amp;gt;). Prior to 1.79, this was also used as the filename for the savegame and so was not writable.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;parcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcelReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''parcelReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s parcel contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#decreaseParcelReputation|decreaseParcelReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseParcelReputation|increaseParcelReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#parcels|parcels]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&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;passengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''passengerReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s passenger contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#decreasePassengerReputation|decreasePassengerReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increasePassengerReputation|increasePassengerReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengers|passengers]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&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 mainly for display purposes describing the player’s rank (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;) based on &amp;lt;code&amp;gt;[[#score|score]]&amp;lt;/code&amp;gt;. Note that it can be localized.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roleWeights&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''roleWeights''' : Array (read-only)&lt;br /&gt;
An array of the player's current role as perceived by the game. Generally NPCs will pick a random entry from this list and treat the player as if they were an NPC of that role. The '&amp;lt;code&amp;gt;player-unknown&amp;lt;/code&amp;gt;' role is the default role. The size of the list depends on the player's current Elite ranking.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setPlayerRole|setPlayerRole()]]&amp;lt;/code&amp;gt;&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;ship&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''ship''' : [[Oolite_JavaScript_Reference:_Ship | Ship]]&lt;br /&gt;
The player’s ship&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 shown immediately after docking. Oolite puts its own stuff on the list immediately after [[Oolite JavaScript Reference: World script event handlers#shipWillDockWithStation|shipWillDockWithStation]] so this is a good moment to add the messages when you know what station will be docked.  [[Oolite JavaScript Reference: World script event handlers#shipDockedWithStation|shipDockedWithStation]] may also be used.  Messages added while in flight or during shipWillDockWithStation will be above Oolite's own arrival messages.  Those added during shipDockedWithStation will be below Oolite's own arrival messages.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#suppressArrivalReports|station.suppressArrivalReports]]&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 [, 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.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.commsMessage(&amp;quot;Hello, cruel universe.&amp;quot;, 6)&lt;br /&gt;
NB, this &amp;lt;code&amp;gt;commsMessage()&amp;lt;/code&amp;gt; is a method of the &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt; object.  &amp;lt;code&amp;gt;player.ship&amp;lt;/code&amp;gt; can also have a &amp;lt;code&amp;gt;[[Oolite_JavaScript_Reference:_Ship#commsMessage|commsMessage()]]&amp;lt;/code&amp;gt; method, but that belongs to the ship and has a different second parameter.&lt;br /&gt;
*[http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=10880 Formatting text msgs on a HUD] (2011)&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;
'''See also''': [http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=10880 Formatting text msgs on a HUD] (2011)&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;decreaseParcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''decreaseParcelReputation'''()&lt;br /&gt;
Give the player a negative reputation point for parcel contracts. Decreases the underlying value for parcelReputation 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;[[#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseParcelReputation|increaseParcelReputation()]]&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;endScenario&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''endScenario'''(key : String) : Boolean&lt;br /&gt;
End the current game immediately and return to the start game screen. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if it succeeds (though this will shortly be irrelevant) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if it fails, which it will do if the key passed in is not the same as the [[scenarios.plist#scenario|scenario key]] in the current game scenario. If the current game scenario has no scenario key, this method will always fail.&lt;br /&gt;
&lt;br /&gt;
There is no way to find out what, if any, the current scenario key is. If you are calling this method, you should be doing so in a context where you already know what it is.&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;increaseParcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''increaseParcelReputation'''()&lt;br /&gt;
Give the player a positive reputation point for parcel contracts. Increases the underlying value for parcelReputation by 1 until a maximum of 7&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreaseParcelReputation|decreaseParcelReputation()]]&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 – mainly from the [[Oolite_JavaScript_Reference:_World_script_event_handlers#escapePodSequenceOver|&amp;lt;code&amp;gt;escapePodSequenceOver&amp;lt;/code&amp;gt;]] event handler. It determines where the player will end up. The &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; parameter may be any station/carrier, 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; (which is the default in interstellar space), the player will die of life support failure.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setPlayerRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setPlayerRole'''(role [,index])&lt;br /&gt;
Sets one of the player's perceived role entries to the specified role. If index is not specified, a random entry will be chosen.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roleWeights|roleWeights]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;replaceShip&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
 function '''replaceShip'''(dataKey [, personality])&lt;br /&gt;
This method can only be called while the player is docked at a station. It discards the player's current ship (including all cargo, passenger contracts, and equipment), and replaces it with the ship defined by the shipyard.plist entry &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; (obviously the key must also be defined in shipyard.plist as a valid player ship). The new ship will have all standard equipment for a ship of that type, and any equipment from the previous ship which was [[Oolite JavaScript Reference: EquipmentInfo#isPortableBetweenShips|isPortableBetweenShips]]. While this may not necessarily be a ship purchase, the [[Oolite JavaScript Reference: World script event handlers#playerBoughtNewShip|playerBoughtNewShip]] will fire to notify other scripts of the change, although this event is being deprecated in favour of [[Oolite JavaScript Reference: World script event handlers#playerReplacedShip|playerReplacedShip]], which was added in Oolite Test Release 1.89.&lt;br /&gt;
&lt;br /&gt;
If the dataKey was not defined in both shipdata.plist and shipyard.plist, or the player is in flight, this method does nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;personality&amp;lt;/code&amp;gt; is optional, and can be between 0 and 32767. The new ship is given that specific [[Oolite_JavaScript_Reference:_Ship#entityPersonality|entityPersonality]], which for some ships may affect its appearance with shaders.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=76469</id>
		<title>Oolite JavaScript Reference: Player</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=76469"/>
		<updated>2022-10-30T17:24:27Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* legalStatus */ cleared up wording&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;contractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''contractReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''contractReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s cargo contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards..&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;[[Oolite JavaScript Reference: Ship#contracts|contracts]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&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, float)&lt;br /&gt;
The amount of money the player has, in credits.&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;escapePodRescueTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.89}}&lt;br /&gt;
 '''escapePodRescueTime''' : Number (read-write decimal)&lt;br /&gt;
Number of seconds that will be added to the clock when the player uses an escape pod and is rescued. Default value is 0 (zero), which will utilise the default time calculation that can add up to eight days to the clock.&lt;br /&gt;
Negative numbers will be ignored (and default calculation will apply).&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 mainly for display purposes describing the player’s legal status 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, read/write from 1.79)&lt;br /&gt;
The name of the player’s character (e.g., &amp;lt;code&amp;gt;&amp;quot;Jameson&amp;quot;&amp;lt;/code&amp;gt;). Prior to 1.79, this was also used as the filename for the savegame and so was not writable.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;parcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcelReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''parcelReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s parcel contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#decreaseParcelReputation|decreaseParcelReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseParcelReputation|increaseParcelReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#parcels|parcels]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&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;passengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''passengerReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s passenger contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#decreasePassengerReputation|decreasePassengerReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increasePassengerReputation|increasePassengerReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengers|passengers]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&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;roleWeights&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''roleWeights''' : Array (read-only)&lt;br /&gt;
An array of the player's current role as perceived by the game. Generally NPCs will pick a random entry from this list and treat the player as if they were an NPC of that role. The '&amp;lt;code&amp;gt;player-unknown&amp;lt;/code&amp;gt;' role is the default role. The size of the list depends on the player's current Elite ranking.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setPlayerRole|setPlayerRole()]]&amp;lt;/code&amp;gt;&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;ship&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''ship''' : [[Oolite_JavaScript_Reference:_Ship | Ship]]&lt;br /&gt;
The player’s ship&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 shown immediately after docking. Oolite puts its own stuff on the list immediately after [[Oolite JavaScript Reference: World script event handlers#shipWillDockWithStation|shipWillDockWithStation]] so this is a good moment to add the messages when you know what station will be docked.  [[Oolite JavaScript Reference: World script event handlers#shipDockedWithStation|shipDockedWithStation]] may also be used.  Messages added while in flight or during shipWillDockWithStation will be above Oolite's own arrival messages.  Those added during shipDockedWithStation will be below Oolite's own arrival messages.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#suppressArrivalReports|station.suppressArrivalReports]]&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 [, 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.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.commsMessage(&amp;quot;Hello, cruel universe.&amp;quot;, 6)&lt;br /&gt;
NB, this &amp;lt;code&amp;gt;commsMessage()&amp;lt;/code&amp;gt; is a method of the &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt; object.  &amp;lt;code&amp;gt;player.ship&amp;lt;/code&amp;gt; can also have a &amp;lt;code&amp;gt;[[Oolite_JavaScript_Reference:_Ship#commsMessage|commsMessage()]]&amp;lt;/code&amp;gt; method, but that belongs to the ship and has a different second parameter.&lt;br /&gt;
*[http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=10880 Formatting text msgs on a HUD] (2011)&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;
'''See also''': [http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=10880 Formatting text msgs on a HUD] (2011)&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;decreaseParcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''decreaseParcelReputation'''()&lt;br /&gt;
Give the player a negative reputation point for parcel contracts. Decreases the underlying value for parcelReputation 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;[[#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseParcelReputation|increaseParcelReputation()]]&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;endScenario&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''endScenario'''(key : String) : Boolean&lt;br /&gt;
End the current game immediately and return to the start game screen. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if it succeeds (though this will shortly be irrelevant) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if it fails, which it will do if the key passed in is not the same as the [[scenarios.plist#scenario|scenario key]] in the current game scenario. If the current game scenario has no scenario key, this method will always fail.&lt;br /&gt;
&lt;br /&gt;
There is no way to find out what, if any, the current scenario key is. If you are calling this method, you should be doing so in a context where you already know what it is.&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;increaseParcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''increaseParcelReputation'''()&lt;br /&gt;
Give the player a positive reputation point for parcel contracts. Increases the underlying value for parcelReputation by 1 until a maximum of 7&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreaseParcelReputation|decreaseParcelReputation()]]&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 – mainly from the [[Oolite_JavaScript_Reference:_World_script_event_handlers#escapePodSequenceOver|&amp;lt;code&amp;gt;escapePodSequenceOver&amp;lt;/code&amp;gt;]] event handler. It determines where the player will end up. The &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; parameter may be any station/carrier, 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; (which is the default in interstellar space), the player will die of life support failure.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setPlayerRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setPlayerRole'''(role [,index])&lt;br /&gt;
Sets one of the player's perceived role entries to the specified role. If index is not specified, a random entry will be chosen.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roleWeights|roleWeights]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;replaceShip&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
 function '''replaceShip'''(dataKey [, personality])&lt;br /&gt;
This method can only be called while the player is docked at a station. It discards the player's current ship (including all cargo, passenger contracts, and equipment), and replaces it with the ship defined by the shipyard.plist entry &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; (obviously the key must also be defined in shipyard.plist as a valid player ship). The new ship will have all standard equipment for a ship of that type, and any equipment from the previous ship which was [[Oolite JavaScript Reference: EquipmentInfo#isPortableBetweenShips|isPortableBetweenShips]]. While this may not necessarily be a ship purchase, the [[Oolite JavaScript Reference: World script event handlers#playerBoughtNewShip|playerBoughtNewShip]] will fire to notify other scripts of the change, although this event is being deprecated in favour of [[Oolite JavaScript Reference: World script event handlers#playerReplacedShip|playerReplacedShip]], which was added in Oolite Test Release 1.89.&lt;br /&gt;
&lt;br /&gt;
If the dataKey was not defined in both shipdata.plist and shipyard.plist, or the player is in flight, this method does nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;personality&amp;lt;/code&amp;gt; is optional, and can be between 0 and 32767. The new ship is given that specific [[Oolite_JavaScript_Reference:_Ship#entityPersonality|entityPersonality]], which for some ships may affect its appearance with shaders.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=76468</id>
		<title>Oolite JavaScript Reference: Global</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=76468"/>
		<updated>2022-10-30T17:03:41Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Methods */ uniform string format (x7), fixed param name (x2)&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;. In 1.76, 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;(F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;(F5F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;(F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;(F3F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LONG_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHORT_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;(F7), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;(F8), &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;. &lt;br /&gt;
&lt;br /&gt;
In 1.77, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTERFACES&amp;quot;&amp;lt;/code&amp;gt;(F4) is added, and &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_CONTRACTS&amp;quot;&amp;lt;/code&amp;gt; is removed.&lt;br /&gt;
&lt;br /&gt;
In 1.81, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKETINFO&amp;quot;&amp;lt;/code&amp;gt;(F8F8) is added.&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;
Do not use &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; in missionVariables! It will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; because it will be parsed as a string. Use 0 or 1 to store boolean values.&lt;br /&gt;
&lt;br /&gt;
You can store arrays using [http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON JSON] stringify and parse methods. For example:&lt;br /&gt;
 this.$MyArray = [];&lt;br /&gt;
 &lt;br /&gt;
 this.startUp = function() {&lt;br /&gt;
        var s = missionVariables.$MyArray;&lt;br /&gt;
        if( s &amp;amp;&amp;amp; s.length &amp;gt; 0 ) this.$MyArray = JSON.parse(s);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 this.playerWillSaveGame = function(message) {&lt;br /&gt;
        missionVariables.$MyArray = JSON.stringify(this.$MyArray);&lt;br /&gt;
 }&lt;br /&gt;
Mission variables can also be used in legacy scripts and in [[descriptions.plist]] string expansions, by prefixing the name with &amp;lt;code&amp;gt;&amp;quot;mission_&amp;quot;&amp;lt;/code&amp;gt;. Example:&lt;br /&gt;
 expandDescription(&amp;quot;My variable is [mission_exampleVar].&amp;quot;)&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;
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;lt;code&amp;gt;for (var i = 0; i &amp;lt; 1000; i++) {}&amp;lt;/code&amp;gt; takes just 0.62 msec, 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, to apply gradual changes in ship state, to build large data structures without risking reaching processing time limits by trying to do it all at once, or to watch variables which need a same-frame response to changes. 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;, and for repeated events with a longer repeat interval, use [[Oolite_JavaScript_Reference:_Timer|Timers]] instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayNameForCommodity&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''displayNameForCommodity'''(commodityName : String) : 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 [[Missiontext.plist#Special_Expansions|string expansions]].&lt;br /&gt;
When local key/value pairs are provided, they take precedence over any other values.&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.79 or later, this method uses a higher quality random number generator which does not have noticeable correlation problems when used for recursive expansion.&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 &amp;lt;code&amp;gt;&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt; 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;
In Oolite 1.79 or later, this method uses a higher quality random number generator which does not have noticeable correlation problems when used for recursive expansion.&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;value&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;value&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;getGuiColorSettingForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.87}}&lt;br /&gt;
 function '''getGuiColorSettingForKey'''(keyname : string) : Array&lt;br /&gt;
Returns the current color for a particular keyname (referenced in the [[gui-settings.plist]] file). Returns an array of RGBA values.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setGuiColorSettingForKey|setGuiColorSettingForKey()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getScreenBackgroundForKey&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''getScreenBackgroundForKey'''(keyname : string) : guiTextureSpecifier&lt;br /&gt;
Returns the guiTextureSpecifier for a particular keyname (referenced in the screenbackgrounds.plist file).&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;
 getScreenBackgroundForKey(&amp;quot;long_range_chart_mission&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setScreenBackgroundForKey|setScreenBackgroundForKey()]]&amp;lt;/code&amp;gt;&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 parameter can be used to specify which type of message is written to the log.  The default messageClass is &amp;lt;code&amp;gt;script.debug.message&amp;lt;/code&amp;gt;. When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the messages will be written to the log file. 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 temporarily enable/disable logging the 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;pauseGame&amp;lt;/code&amp;gt;===&lt;br /&gt;
 function '''pauseGame'''() : Boolean&lt;br /&gt;
Pauses the game.  It does not work on screens that cannot be paused by keyboard: mission screens, long range chart, arrival report, save menu. In those cases, the method returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;. Otherwise, it pauses the game and returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This was added in v1.87 (the exact version is unconfirmed)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [http://aegidian.org/bb/viewtopic.php?f=6&amp;amp;t=18900 Scriptable pause?]&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]) : String&lt;br /&gt;
Returns a random sentient species name, like &amp;lt;code&amp;gt;&amp;quot;Large Red Fat Insects&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;Human Colonials&amp;quot;&amp;lt;/code&amp;gt;, 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) + &amp;quot;. She'll be with a group of &amp;quot; + randomInhabitantsDescription() + &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'''() : String&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;setGuiColorSettingForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.87}}&lt;br /&gt;
 function '''setGuiColorSettingorKey'''(keyname : string , [[Materials_in_Oolite#Colour_specifiers|Colour specifier]] : string) &lt;br /&gt;
Override the color setting for a particular keyname (referenced in the [[gui-settings.plist]] file) with the specified color.  This override is only for the current play-session and does not get written to [[gui-settings.plist]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setGuiColorSettingForKey(&amp;quot;screen_title_color&amp;quot;, &amp;quot;whiteColor&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#getGuiColorSettingForKey|getGuiColorSettingForKey()]]&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: 480 });&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenBackgroundForKey&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''setScreenBackgroundForKey'''(keyname : string, image : ''guiTextureSpecifier'') &lt;br /&gt;
Override the background for a particular keyname (referenced in the screenbackgrounds.plist file) with the specified image. Override is only for the current play-session only and does not get written out to screenbackgrounds.plist.&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;
 setScreenBackgroundForKey(&amp;quot;long_range_chart_mission&amp;quot;, { name: &amp;quot;my_mission_background.png&amp;quot;, height: 480 });&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#getScreenBackgroundForKey|getScreenBackgroundForKey()]]&amp;lt;/code&amp;gt;&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]) : Boolean&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;lt;code&amp;gt;&amp;quot;-&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;_&amp;quot;&amp;lt;/code&amp;gt; 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;lt;code&amp;gt;&amp;quot;-xxx&amp;quot;&amp;lt;/code&amp;gt; is added, starting with &amp;lt;code&amp;gt;&amp;quot;-001&amp;quot;&amp;lt;/code&amp;gt;.&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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=76466</id>
		<title>Oolite JavaScript Reference: Global</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Global&amp;diff=76466"/>
		<updated>2022-10-30T16:51:40Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* missionVariables */ uniform string format, cleared up wording&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;. In 1.76, 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;(F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;(F5F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;(F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;(F3F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LONG_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHORT_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;(F7), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;(F8), &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;. &lt;br /&gt;
&lt;br /&gt;
In 1.77, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTERFACES&amp;quot;&amp;lt;/code&amp;gt;(F4) is added, and &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_CONTRACTS&amp;quot;&amp;lt;/code&amp;gt; is removed.&lt;br /&gt;
&lt;br /&gt;
In 1.81, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKETINFO&amp;quot;&amp;lt;/code&amp;gt;(F8F8) is added.&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;
Do not use &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; in missionVariables! It will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; because it will be parsed as a string. Use 0 or 1 to store boolean values.&lt;br /&gt;
&lt;br /&gt;
You can store arrays using [http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON JSON] stringify and parse methods. For example:&lt;br /&gt;
 this.$MyArray = [];&lt;br /&gt;
 &lt;br /&gt;
 this.startUp = function() {&lt;br /&gt;
        var s = missionVariables.$MyArray;&lt;br /&gt;
        if( s &amp;amp;&amp;amp; s.length &amp;gt; 0 ) this.$MyArray = JSON.parse(s);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 this.playerWillSaveGame = function(message) {&lt;br /&gt;
        missionVariables.$MyArray = JSON.stringify(this.$MyArray);&lt;br /&gt;
 }&lt;br /&gt;
Mission variables can also be used in legacy scripts and in [[descriptions.plist]] string expansions, by prefixing the name with &amp;lt;code&amp;gt;&amp;quot;mission_&amp;quot;&amp;lt;/code&amp;gt;. Example:&lt;br /&gt;
 expandDescription(&amp;quot;My variable is [mission_exampleVar].&amp;quot;)&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;
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;lt;code&amp;gt;for (var i = 0; i &amp;lt; 1000; i++) {}&amp;lt;/code&amp;gt; takes just 0.62 msec, 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, to apply gradual changes in ship state, to build large data structures without risking reaching processing time limits by trying to do it all at once, or to watch variables which need a same-frame response to changes. 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;, and for repeated events with a longer repeat interval, use [[Oolite_JavaScript_Reference:_Timer|Timers]] instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;displayNameForCommodity&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''displayNameForCommodity'''(commodityName : String) : 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 [[Missiontext.plist#Special_Expansions|string expansions]].&lt;br /&gt;
When local key/value pairs are provided, they take precedence over any other values.&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.79 or later, this method uses a higher quality random number generator which does not have noticeable correlation problems when used for recursive expansion.&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;
In Oolite 1.79 or later, this method uses a higher quality random number generator which does not have noticeable correlation problems when used for recursive expansion.&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;getGuiColorSettingForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.87}}&lt;br /&gt;
 function '''getGuiColorSettingForKey'''(keyname : string) : Array&lt;br /&gt;
Returns the current color for a particular keyname (referenced in the [[gui-settings.plist]] file). Returns an array of RGBA values.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setGuiColorSettingForKey|setGuiColorSettingForKey()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getScreenBackgroundForKey&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''getScreenBackgroundForKey'''(keyname : string) : guiTextureSpecifier&lt;br /&gt;
Returns the guiTextureSpecifier for a particular keyname (referenced in the screenbackgrounds.plist file).&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;
 getScreenBackgroundForKey(&amp;quot;long_range_chart_mission&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setScreenBackgroundForKey|setScreenBackgroundForKey()]]&amp;lt;/code&amp;gt;&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 parameter can be used to specify which type of message is written to the log.  The default messageClass is &amp;lt;code&amp;gt;script.debug.message&amp;lt;/code&amp;gt;. When set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the messages will be written to the log file. 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 temporarily enable/disable logging the 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;pauseGame&amp;lt;/code&amp;gt;===&lt;br /&gt;
 function '''pauseGame'''() : Boolean&lt;br /&gt;
Pauses the game.  It does not work on screens that cannot be paused by keyboard: mission screens, long range chart, arrival report, save menu. In those cases, the method returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;. Otherwise, it pauses the game and returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This was added in v1.87 (the exact version is unconfirmed)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [http://aegidian.org/bb/viewtopic.php?f=6&amp;amp;t=18900 Scriptable pause?]&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]) : String&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) + &amp;quot;. She'll be with a group of &amp;quot; + randomInhabitantsDescription() + &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'''() : String&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;setGuiColorSettingForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.87}}&lt;br /&gt;
 function '''setGuiColorSettingorKey'''(keyname : string , [[Materials_in_Oolite#Colour_specifiers|Colour specifier]] : string) &lt;br /&gt;
Override the color setting for a particular keyname (referenced in the [[gui-settings.plist]] file) with the specified color.  This override is only for the current play-session and does not get written to [[gui-settings.plist]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 setGuiColorSettingForKey(&amp;quot;screen_title_color&amp;quot;, &amp;quot;whiteColor&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#getGuiColorSettingForKey|getGuiColorSettingForKey()]]&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: 480 });&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setScreenBackgroundForKey&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''setScreenBackgroundForKey'''(keyname : string, image : ''guiTextureSpecifier'') &lt;br /&gt;
Override the background for a particular keyname (referenced in the screenbackgrounds.plist file) with the specified image. Override is only for the current play-session only and does not get written out to screenbackgrounds.plist.&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;
 setScreenBackgroundForKey(&amp;quot;long_range_chart_mission&amp;quot;, { name: &amp;quot;my_mission_background.png&amp;quot;, height: 480 });&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#getScreenBackgroundForKey|getScreenBackgroundForKey()]]&amp;lt;/code&amp;gt;&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]) : Boolean&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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Script&amp;diff=76465</id>
		<title>Oolite JavaScript Reference: Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Script&amp;diff=76465"/>
		<updated>2022-10-30T15:43:54Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Common properties */ added code tags&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;Script&amp;lt;/code&amp;gt;''' class represents a JavaScript script. There are several categories of scripts: ''ship scripts'' which are attached to individual ships/in-game entities and ''world scripts'' which are effectively attached to the player.  There are also ''[[Oolite JavaScript Reference: Condition scripts| Condition scripts]]'', ''[[Oolite JavaScript Reference: Equipment scripts| Equipment scripts]]'', ''[[Oolite JavaScript Reference: Market Scripts| Market Scripts]]'' and ''[[Oolite JavaScript Reference: VisualEffect#Effect Scripts|Visual Effects Scripts]]''.&lt;br /&gt;
&lt;br /&gt;
==Scripting overview==&lt;br /&gt;
World scripts are run once at game start-up, at which point they may create ''event handlers''. Event handlers are functions with predefined names which are called by the game at specific points. Ship scripts are run when their ship is loaded, and can also create event handlers. An event handler is specified as a property of the &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; object itself. For example, to set up an event handler for the ''willDock'' event, a script would typically look like this:&lt;br /&gt;
 this.willDock = function()&lt;br /&gt;
 {&lt;br /&gt;
     // Do stuff when about to dock&lt;br /&gt;
     log(&amp;quot;Woo, I’m about to dock!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This assigns an anonymous function with no arguments to the &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; object’s &amp;lt;code&amp;gt;willDock&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
A property of the &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; object which is a function is called a '''method'''. The most common use for methods is for event handlers, but a script may assign itself arbitrary methods, and any script may call the methods of another &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; object. For instance, consider the case of a ship which needs to interact with its escorts in an unusual way. The script for the escorts may define a method such as:&lt;br /&gt;
 this._escortPerformSpecialManoeuvre = function (target)&lt;br /&gt;
 {&lt;br /&gt;
     // Do something very clever here&lt;br /&gt;
 }&lt;br /&gt;
which the mothership might do as follows:&lt;br /&gt;
 // Warning: untested code&lt;br /&gt;
 this._makeEscortsPerformSpecialManoeuvre = function (target)&lt;br /&gt;
 {&lt;br /&gt;
     this.ship.escorts.forEach(function(escort){escort.script._escortPerformSpecialManoeuvre(this.target)}, this);&lt;br /&gt;
 }&lt;br /&gt;
I can hear the cries of “huh” now, so let’s expand on that a little:&lt;br /&gt;
 this._makeEscortsPerformSpecialManoeuvre = function (target)&lt;br /&gt;
 {&lt;br /&gt;
     // The function we want to call for each element of the escorts array.&lt;br /&gt;
     function callEscortMethod(escort)&lt;br /&gt;
     {&lt;br /&gt;
         escort.script._escortPerformSpecialManoeuvre(this.target);&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     // Get the list of escorts from our ship.&lt;br /&gt;
     var escorts = this.ship.escorts;&lt;br /&gt;
     &lt;br /&gt;
     // For each element in the list, call callEscortMethod().&lt;br /&gt;
     escorts.forEach(callEscortMethod, this);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; objects do not have many predefined properties. Instead, the script can set whatever properties it needs. Which properties are used by the game depends on the context in which the script is being used. Note that properties not intended to be event handlers should have names starting with an '_' or '$' character, so that future additions of Oolite event handlers do not cause a conflict.&lt;br /&gt;
&lt;br /&gt;
==Predefined properties==&lt;br /&gt;
===&amp;lt;code&amp;gt;ship&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''ship''' : [[Oolite JavaScript Reference: Ship|Ship]] (read-only)&lt;br /&gt;
For ship scripts, this is the ship to which the script is attached.  For world scripts, it is undefined.&lt;br /&gt;
&lt;br /&gt;
'''Note''' that &amp;lt;code&amp;gt;ship&amp;lt;/code&amp;gt; refers to the {{oojsclass|Ship}} object that “owns” the script, which might not be a ship from a player perspective; it may be a station, missile, asteroid etc.&lt;br /&gt;
&lt;br /&gt;
==Common properties==&lt;br /&gt;
These are properties scripts can set on themselves which have a standard meaning. In Oolite 1.79 and later, the &amp;lt;code&amp;gt;author&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;license&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; properties will be set automatically from the [[manifest.plist]] file if one is available, and so do not need to be included in the script file itself.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;author&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''author''' : String&lt;br /&gt;
Who wrote the script. This property is currently not checked by any Oolite core functionality.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;copyright&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''copyright''' : String&lt;br /&gt;
A copyright statement for the script. This property is currently not checked by any Oolite core functionality.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''description''' : String&lt;br /&gt;
A short description of the script. This property is currently not checked by any Oolite core functionality.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;license&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''license''' : String&lt;br /&gt;
A statement of the license for the script. This property is currently not checked by any Oolite core functionality.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''name''' : String&lt;br /&gt;
The name of the script. World scripts must have a unique &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;. It’s a good habit to set a &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; for all scripts. If no &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; is set when the script is first run, Oolite will make one up. While it is possible to set the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; property at any time, the value used after the script is first run is the one Oolite will continue to use.&lt;br /&gt;
&lt;br /&gt;
Starting in Oolite 1.75, any underscores (“_”) or spaces will be removed from the beginning and end of the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''version''' : String&lt;br /&gt;
A string specifying the version of the script. This is used, together with &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, for identification in log messages and similar. While it is possible to set the &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; property at any time, the value used after the script is first run is the one Oolite will continue to use. It is recommended to have this value equal the version of the OXP containing the script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Script&amp;diff=76464</id>
		<title>Oolite JavaScript Reference: Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Script&amp;diff=76464"/>
		<updated>2022-10-30T15:37:09Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* ship */ reworded&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;Script&amp;lt;/code&amp;gt;''' class represents a JavaScript script. There are several categories of scripts: ''ship scripts'' which are attached to individual ships/in-game entities and ''world scripts'' which are effectively attached to the player.  There are also ''[[Oolite JavaScript Reference: Condition scripts| Condition scripts]]'', ''[[Oolite JavaScript Reference: Equipment scripts| Equipment scripts]]'', ''[[Oolite JavaScript Reference: Market Scripts| Market Scripts]]'' and ''[[Oolite JavaScript Reference: VisualEffect#Effect Scripts|Visual Effects Scripts]]''.&lt;br /&gt;
&lt;br /&gt;
==Scripting overview==&lt;br /&gt;
World scripts are run once at game start-up, at which point they may create ''event handlers''. Event handlers are functions with predefined names which are called by the game at specific points. Ship scripts are run when their ship is loaded, and can also create event handlers. An event handler is specified as a property of the &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; object itself. For example, to set up an event handler for the ''willDock'' event, a script would typically look like this:&lt;br /&gt;
 this.willDock = function()&lt;br /&gt;
 {&lt;br /&gt;
     // Do stuff when about to dock&lt;br /&gt;
     log(&amp;quot;Woo, I’m about to dock!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This assigns an anonymous function with no arguments to the &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; object’s &amp;lt;code&amp;gt;willDock&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
A property of the &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; object which is a function is called a '''method'''. The most common use for methods is for event handlers, but a script may assign itself arbitrary methods, and any script may call the methods of another &amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; object. For instance, consider the case of a ship which needs to interact with its escorts in an unusual way. The script for the escorts may define a method such as:&lt;br /&gt;
 this._escortPerformSpecialManoeuvre = function (target)&lt;br /&gt;
 {&lt;br /&gt;
     // Do something very clever here&lt;br /&gt;
 }&lt;br /&gt;
which the mothership might do as follows:&lt;br /&gt;
 // Warning: untested code&lt;br /&gt;
 this._makeEscortsPerformSpecialManoeuvre = function (target)&lt;br /&gt;
 {&lt;br /&gt;
     this.ship.escorts.forEach(function(escort){escort.script._escortPerformSpecialManoeuvre(this.target)}, this);&lt;br /&gt;
 }&lt;br /&gt;
I can hear the cries of “huh” now, so let’s expand on that a little:&lt;br /&gt;
 this._makeEscortsPerformSpecialManoeuvre = function (target)&lt;br /&gt;
 {&lt;br /&gt;
     // The function we want to call for each element of the escorts array.&lt;br /&gt;
     function callEscortMethod(escort)&lt;br /&gt;
     {&lt;br /&gt;
         escort.script._escortPerformSpecialManoeuvre(this.target);&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     // Get the list of escorts from our ship.&lt;br /&gt;
     var escorts = this.ship.escorts;&lt;br /&gt;
     &lt;br /&gt;
     // For each element in the list, call callEscortMethod().&lt;br /&gt;
     escorts.forEach(callEscortMethod, this);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Script&amp;lt;/code&amp;gt; objects do not have many predefined properties. Instead, the script can set whatever properties it needs. Which properties are used by the game depends on the context in which the script is being used. Note that properties not intended to be event handlers should have names starting with an '_' or '$' character, so that future additions of Oolite event handlers do not cause a conflict.&lt;br /&gt;
&lt;br /&gt;
==Predefined properties==&lt;br /&gt;
===&amp;lt;code&amp;gt;ship&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''ship''' : [[Oolite JavaScript Reference: Ship|Ship]] (read-only)&lt;br /&gt;
For ship scripts, this is the ship to which the script is attached.  For world scripts, it is undefined.&lt;br /&gt;
&lt;br /&gt;
'''Note''' that &amp;lt;code&amp;gt;ship&amp;lt;/code&amp;gt; refers to the {{oojsclass|Ship}} object that “owns” the script, which might not be a ship from a player perspective; it may be a station, missile, asteroid etc.&lt;br /&gt;
&lt;br /&gt;
==Common properties==&lt;br /&gt;
These are properties scripts can set on themselves which have a standard meaning. In Oolite 1.79 and later, the &amp;lt;code&amp;gt;author&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;license&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; properties will be set automatically from the [[manifest.plist]] file if one is available, and so do not need to be included in the script file itself.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;author&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''author''' : String&lt;br /&gt;
Who wrote the script. This property is currently not checked by any Oolite core functionality.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;copyright&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''copyright''' : String&lt;br /&gt;
A copyright statement for the script. This property is currently not checked by any Oolite core functionality.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''description''' : String&lt;br /&gt;
A short description of the script. This property is currently not checked by any Oolite core functionality.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;license&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''license''' : String&lt;br /&gt;
A statement of the license for the script. This property is currently not checked by any Oolite core functionality.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''name''' : String&lt;br /&gt;
The name of the script. World scripts must have a unique name. It’s a good habit to set a name for all scripts. If no name is set when the script is first run, Oolite will make one up. While it is possible to set the &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; property at any time, the value used after the script is first run is the one Oolite will continue to use.&lt;br /&gt;
&lt;br /&gt;
Starting in Oolite 1.75, any underscores (“_”) or spaces will be removed from the beginning and end of the name property.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt;===&lt;br /&gt;
 '''version''' : String&lt;br /&gt;
A string specifying the version of the script. This is used, together with name, for identification in log messages and similar. While it is possible to set the &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; property at any time, the value used after the script is first run is the one Oolite will continue to use. It is recommended to have this value equal the version of the OXP containing the script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Oolite&amp;diff=76463</id>
		<title>Oolite JavaScript Reference: Oolite</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Oolite&amp;diff=76463"/>
		<updated>2022-10-30T15:14:40Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* gameSettings */ added code tags, cleared up wording&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;Oolite&amp;lt;/code&amp;gt;''' class represents Oolite itself. It allows scripts to access information about the application. There is a global instance of &amp;lt;code&amp;gt;Oolite&amp;lt;/code&amp;gt;, named &amp;lt;code&amp;gt;oolite&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;gameSettings&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''gameSettings''' : Object(read-only)&lt;br /&gt;
This property allows an [[OXP]] to detect various game settings. It has the following read-only properties:&lt;br /&gt;
&lt;br /&gt;
 autosave : Boolean&lt;br /&gt;
 gameWindow : Object (see below)&lt;br /&gt;
 keyConfig : Object (from v1.77.1 onwards, see below)&lt;br /&gt;
 musicMode : String (&amp;quot;MUSIC_OFF&amp;quot;, &amp;quot;MUSIC_ON&amp;quot;, or &amp;quot;MUSIC_ITUNES&amp;quot;)&lt;br /&gt;
 procedurallyTexturedPlanets : Boolean&lt;br /&gt;
 reducedDetailGraphics : Boolean&lt;br /&gt;
 detailLevel : String (&amp;quot;DETAIL_LEVEL_MINIMUM&amp;quot;, &amp;quot;DETAIL_LEVEL_NORMAL&amp;quot;, &amp;quot;DETAIL_LEVEL_SHADERS&amp;quot;, or &amp;quot;DETAIL_LEVEL_EXTRAS&amp;quot;)&lt;br /&gt;
 speechOn : Boolean&lt;br /&gt;
 wireframeGraphics : Boolean&lt;br /&gt;
&lt;br /&gt;
Before 1.80, there was no &amp;lt;code&amp;gt;detailLevel&amp;lt;/code&amp;gt; property, but there was a &amp;lt;code&amp;gt;shaderEffectsLevel&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;gameWindow&amp;lt;/code&amp;gt; property contains the following properties:&lt;br /&gt;
 height : Number&lt;br /&gt;
 width : Number&lt;br /&gt;
 fullScreen : Boolean&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;keyConfig&amp;lt;/code&amp;gt; property contains numeric (decimal) KeyCode values of all Keyconfig Entries in oolite.app/Resources/Config/keyconfig.plist. Keyconfig Entry - KeyCode pairs are documented in ''[[Oolite_Keyboard_Controls]]''.&lt;br /&gt;
&lt;br /&gt;
You can use the standard Javascript &amp;lt;code&amp;gt;String.fromCharCode()&amp;lt;/code&amp;gt; method to convert KeyCode to a string:&lt;br /&gt;
 var button = String.fromCharCode( oolite.gameSettings.keyConfig.key_ident_system );&lt;br /&gt;
 player.consoleMessage( &amp;quot;Press &amp;quot; + button + &amp;quot; to turn on the ident system.&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Keys like tab, escape, arrow keys, etc. need to be handled separately.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;jsVersion&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''jsVersion''' : Number (read-only)&lt;br /&gt;
The version of the JavaScript language implemented by this version of Oolite, multiplied by 100, as an integer. For instance, for [http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7 JavaScript 1.7] (used in Oolite 1.74), this will be equal to &amp;lt;code&amp;gt;170&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;jsVersionString&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''jsVersionString''' : String (read-only)&lt;br /&gt;
The version of the JavaScript language implemented by this version of Oolite, as a string. For instance, for JavaScript 1.7, this will be equal to &amp;lt;code&amp;gt;&amp;quot;1.7&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;resourcePaths&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.83}}&lt;br /&gt;
 '''resourcePaths''' : Array (read-only)&lt;br /&gt;
Contain full path of loaded config files and expansion packs, including all .oxp folders and .oxz files.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;version&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''version''' : Array (read-only)&lt;br /&gt;
The version of Oolite, as an array of version components. For instance, for Oolite 1.74 this is &amp;lt;code&amp;gt;[1, 74]&amp;lt;/code&amp;gt;. For version 1.73.4, it is &amp;lt;code&amp;gt;[1, 73, 4]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;versionString&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''versionString''' : String (read-only)&lt;br /&gt;
The version of Oolite, as a string. For instance, for Oolite 1.74 this is &amp;lt;code&amp;gt;&amp;quot;1.74&amp;quot;&amp;lt;/code&amp;gt;. For version 1.73.4, it is &amp;lt;code&amp;gt;&amp;quot;1.73.4&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;compareVersion&amp;lt;/code&amp;gt;  ===&lt;br /&gt;
 function '''compareVersion'''(versionSpec) : Number&lt;br /&gt;
Compare the version of Oolite to &amp;lt;code&amp;gt;versionSpec&amp;lt;/code&amp;gt;, which may be either a string or an array (in the format given by &amp;lt;code&amp;gt;[[#version|version]]&amp;lt;/code&amp;gt;). If the current version of Oolite is less than &amp;lt;code&amp;gt;versionSpec&amp;lt;/code&amp;gt;, 1 is returned. If the current version of Oolite is greater than &amp;lt;code&amp;gt;versionSpec&amp;lt;/code&amp;gt;, -1 is returned. If they are equal, 0 is returned. Example:&lt;br /&gt;
 if (0 &amp;lt; oolite.compareVersion(&amp;quot;1.80&amp;quot;))&lt;br /&gt;
 {&lt;br /&gt;
     // Oolite version is older than 1.80.&lt;br /&gt;
     log(this.name, &amp;quot;An old version of Oolite (&amp;quot; + oolite.versionString + &amp;quot;) is in use. Some features of SuperDuperOXP will not be available.&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
     // Enable advanced features here.&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;br /&gt;
&lt;br /&gt;
== Radical changes (new galaxies ''etc'') ==&lt;br /&gt;
[[User:Cim|Cim]] talks [http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=17603 here] about doing this sort of thing.&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_Javascript_Reference:_PriorityAI_Documentation&amp;diff=76462</id>
		<title>Oolite Javascript Reference: PriorityAI Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_Javascript_Reference:_PriorityAI_Documentation&amp;diff=76462"/>
		<updated>2022-10-30T14:35:59Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: uniform null format (x6)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the priority-based Javascript AI system, which allows more flexible behaviour than the old plist-based AIs to be written in fewer lines of code. New programmers may find [[Oolite_PriorityAI_Tutorial|the priority AI tutorial]] to be more useful as an introduction.&lt;br /&gt;
&lt;br /&gt;
Priority-based Javascript AI is available from Oolite 1.79 onwards.&lt;br /&gt;
&lt;br /&gt;
== Constructor and general functions ==&lt;br /&gt;
&lt;br /&gt;
==== Constructor ====&lt;br /&gt;
 '''new PriorityAIController'''(ship : Ship) : PriorityAIController&lt;br /&gt;
Creates a priority AI and attaches it to the specified ship. Using this from anywhere other than that ship's AI script is not recommended.&lt;br /&gt;
&lt;br /&gt;
 var ai = new worldScripts[&amp;quot;oolite-libPriorityAI&amp;quot;].PriorityAIController(this.ship);&lt;br /&gt;
&lt;br /&gt;
=== Properties ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;ship&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 '''ship''' : Ship (read-only)&lt;br /&gt;
The ship to which the priority AI is attached.&lt;br /&gt;
&lt;br /&gt;
=== General Methods ===&lt;br /&gt;
&lt;br /&gt;
Additional methods are described in later sections, sorted by purpose.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;applyHandlers&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''applyHandlers'''(handlers : Object)&lt;br /&gt;
Deletes any existing event handlers applied to the ship's AI Script by a previous invocation of &amp;lt;code&amp;gt;applyHandlers&amp;lt;/code&amp;gt;, and copies the handlers in the argument object to the AI Script. All handlers applied this way run with '&amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;' equal to the PriorityAIController, not to the AI Script.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;clearHandlers&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''clearHandlers'''(handlers : Object)&lt;br /&gt;
Deletes any existing event handlers applied to the ship's AI Script by a previous invocation of &amp;lt;code&amp;gt;applyHandlers&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;communicate&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''communicate'''(key : String, params : Object, priority : Number)&lt;br /&gt;
If the communication &amp;quot;key&amp;quot; has previously been [[#setCommunication|defined]] for this ship's [[#setCommunicationsRole|communications role]] and [[#setCommunicationsPersonality|personality]], retrieves it, calls &amp;lt;code&amp;gt;expandDescription&amp;lt;/code&amp;gt; on it, using the parameters in the object (which can either be a dictionary, or a Ship). This message may then broadcast on the public channel, depending on the priority. If the object is a Ship, it will be converted to a dictionary for expandDescription with the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;oolite_entityClass&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;ship.shipClassName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;oolite_entityName&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;ship.shipUniqueName&amp;lt;/code&amp;gt;&lt;br /&gt;
Other parameters may be added later to this expansion.&lt;br /&gt;
&lt;br /&gt;
The priority can be a number from 1 to 4&lt;br /&gt;
# Always send this message&lt;br /&gt;
# Send this message if no messages sent in the last 10 seconds&lt;br /&gt;
# Send this message if no messages sent or received in the last 10 seconds&lt;br /&gt;
# Send this message if no messages sent or received in the last 60 seconds&lt;br /&gt;
This is used to prevent an overwhelming number of comms messages being sent. While priority 1 is necessary for messages which must be heard by the player, care must be taken to ensure by other means that they cannot be sent repeatedly.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;communicationsPersonality&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''communicationsPersonality'''() : String&lt;br /&gt;
The current communications personality&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;communicationsRole&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''communicationsRole'''() : String&lt;br /&gt;
The current communications role&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;getParameter&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''getParameter'''(key : String) : Value&lt;br /&gt;
If a parameter with that key has previously been set, return its value. Otherwise return &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. Note that the return value can be of any type, so you must be careful when setting and retrieving parameters to avoid type errors.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;getWaypointGenerator&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''getWaypointGenerator'''() : Function&lt;br /&gt;
If a waypoint generation function has previously been set, return it.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;noteCommsHeard&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''noteCommsHeard'''()&lt;br /&gt;
This function is used to reset the timers for [[#communicate|priority 3 and 4 communications]]. The standard event handlers will call this for you, but you may need to call it manually otherwise.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;reconsiderIn&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''reconsiderIn'''(delay : Number)&lt;br /&gt;
Force a reconsideration of the AI's priority list ahead of schedule, if no request for sooner reconsideration has already been received. &amp;lt;code&amp;gt;delay&amp;lt;/code&amp;gt; must be at least 0.1 seconds.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;reconsiderNow&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''reconsiderNow'''()&lt;br /&gt;
Force a reconsideration of the AI's priority list ahead of schedule.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;setCommunicationsRole&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''setCommunicationsRole'''(role : String)&lt;br /&gt;
Sets the ship's communications role to the given value. This is then used to vary the communications messages as defined by [[#setCommunication|_setCommunication]].&lt;br /&gt;
&lt;br /&gt;
If personalities have previously been defined for this role, and the ship's current personality is either &amp;quot;generic&amp;quot; or not one defined for this role, then it will also select a new communications personality at this point, based on [[Oolite_JavaScript_Reference:_Ship#entityPersonality|ship.entityPersonality]]. If the &amp;quot;oolite_personalityMatchesLeader&amp;quot; parameter has been set, then this is a 0..1 chance that the ship will instead take the personality of its group leader (if this ship is the group leader, this instead is the chance it will copy its personality to group members)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;setCommunicationsPersonality&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''setCommunicationsPersonality'''(role : String)&lt;br /&gt;
Sets the ship's communications personality to the given value. This is then used to vary the communications messages as defined by [[#setCommunication|_setCommunication]].&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;setParameter&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''setParameter'''(key : String, value : Value)&lt;br /&gt;
Set the named parameter to the given value. Values may be of any type. To remove a parameter, use a value of &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. See the [[#Parameters|Parameters]] section below for parameter keys used by the core AIs and the standard priority AI library.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;setPriorities&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''setPriorities'''(priorities : Array [, delay: Number])&lt;br /&gt;
Set the priority list for the AI, and evaluate it. The format of the priority list is described in the next section.&lt;br /&gt;
&lt;br /&gt;
An optional delay parameter can be set, which will cause evaluation to start only after this many seconds. If it is unset, the AI will start after a random period between 0 and 1 seconds.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;setWaypointGenerator&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''setWaypointGenerator'''(generator : Function)&lt;br /&gt;
Sets the AI's [[#Waypoint_Generators|Waypoint Generators]] waypoint generator function.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
The following parameters are used by the standard library and accessed using [[#getParameter|getParameter]] and [[#setParameter|setParameter]], but you can also define your own for custom AIs. More detailed documentation will be provided soon.&lt;br /&gt;
&lt;br /&gt;
As with all custom items, prefixing new parameter names with a key unique to your OXP is strongly advised.&lt;br /&gt;
&lt;br /&gt;
==== Flag Parameters ====&lt;br /&gt;
Flag parameters are intended to be set in the AI initialisation routine to vary the behaviour of the AI.&lt;br /&gt;
&lt;br /&gt;
 oolite_flag_allowPlanetaryLanding&lt;br /&gt;
 oolite_flag_autoSpreadMissiles&lt;br /&gt;
 oolite_flag_behaviourLogging&lt;br /&gt;
 oolite_flag_continueUnlikelyPursuits&lt;br /&gt;
 oolite_flag_escortsCoverRetreat&lt;br /&gt;
 oolite_flag_fightsNearHostileStations&lt;br /&gt;
 oolite_flag_fleesPreemptively&lt;br /&gt;
 oolite_flag_likesInterstellarSpace&lt;br /&gt;
 oolite_flag_listenForDistressCall&lt;br /&gt;
 oolite_flag_markOffenders&lt;br /&gt;
 oolite_flag_neverFleeToWitchspace&lt;br /&gt;
 oolite_flag_noDockingUntilDestination&lt;br /&gt;
 oolite_flag_noSpecialThargoidReaction&lt;br /&gt;
 oolite_flag_patrolStation&lt;br /&gt;
 oolite_flag_scanIgnoresUnpowered&lt;br /&gt;
 oolite_flag_selfDestructAbandonedShip&lt;br /&gt;
 oolite_flag_sendsDistressCalls&lt;br /&gt;
 oolite_flag_surrendersEarly&lt;br /&gt;
 oolite_flag_surrendersLate&lt;br /&gt;
 oolite_flag_watchForCargo&lt;br /&gt;
 oolite_flag_witchspacePursuit&lt;br /&gt;
&lt;br /&gt;
==== Other parameters ====&lt;br /&gt;
These parameters are used for storage of long-term state that may need to be kept between runs of the priority tree. In general, Configuration and Response functions set them, and Condition, Behaviour and Response functions read them, but this is only a guideline. Implementors of custom functions may need to get or set these parameters for proper interaction with built-in functions used by the same AI.&lt;br /&gt;
&lt;br /&gt;
 oolite_cargoDropped&lt;br /&gt;
 oolite_cascadeDetected&lt;br /&gt;
 oolite_distressAggressor&lt;br /&gt;
 oolite_distressSender&lt;br /&gt;
 oolite_distressTimestamp&lt;br /&gt;
 oolite_dockingStation&lt;br /&gt;
 oolite_escortRole&lt;br /&gt;
 oolite_friendlyRoles&lt;br /&gt;
 oolite_groupPower&lt;br /&gt;
 oolite_interceptCoordinates&lt;br /&gt;
 oolite_interceptTarget&lt;br /&gt;
 oolite_lastAssist&lt;br /&gt;
 oolite_lastFleeing&lt;br /&gt;
 oolite_lastPirateVictim&lt;br /&gt;
 oolite_leaderRole&lt;br /&gt;
 oolite_personalityMatchesLeader&lt;br /&gt;
 oolite_pirateLurk&lt;br /&gt;
 oolite_playerFriendlyFireAlready&lt;br /&gt;
 oolite_rememberedTarget&lt;br /&gt;
 oolite_scanResults&lt;br /&gt;
 oolite_scanResultSpecific&lt;br /&gt;
 oolite_selectedPlanet&lt;br /&gt;
 oolite_selectedStation&lt;br /&gt;
 oolite_stationPatrolRole&lt;br /&gt;
 oolite_waypoint&lt;br /&gt;
 oolite_waypointRange&lt;br /&gt;
 oolite_waypoints&lt;br /&gt;
 oolite_witchspaceDestination&lt;br /&gt;
 oolite_witchspaceEntry&lt;br /&gt;
 oolite_witchspaceWormhole&lt;br /&gt;
&lt;br /&gt;
== Writing a priority list ==&lt;br /&gt;
&lt;br /&gt;
The priority list is the core of the priority AI. The list will be reevaluated periodically - either timed, or when events occur - and on each reevaluation it will be searched from top to bottom. When a valid priority is found, searching will stop, and that priority will be executed.&lt;br /&gt;
&lt;br /&gt;
If the parameter &amp;quot;oolite_flag_behaviourLogging&amp;quot; is set with [[#setParameter|setParameter]] then verbose information will be written to the log file regarding the processing of the priority list. It is generally advisable to use the debug console to do this for one ship at a time, rather than setting it generally!&lt;br /&gt;
&lt;br /&gt;
=== Basic structure ===&lt;br /&gt;
&lt;br /&gt;
The priority list is an array of objects. Each object contains a set&lt;br /&gt;
of keys and values. The keys are considered in the&lt;br /&gt;
following order and are all optional.&lt;br /&gt;
* '''preconfiguration''': function run unconditionally if this element of the list is reached.&lt;br /&gt;
* '''condition''': function run unconditionally if this element of the list is reached. If it returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the remainder of the object is ignored, and consideration moves to the next list element.&lt;br /&gt;
* '''notcondition''': function run unconditionally if this element of the list is reached. If it returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the remainder of the object is ignored, and consideration moves to the next list element.&lt;br /&gt;
If neither '''condition''' nor '''notcondition''' are set, this is treated as if a condition was set and was &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
* '''configuration''': function run if conditions allow&lt;br /&gt;
* '''behaviour''': function run if conditions allow. If this exists, no further elements of the priority list will be considered.&lt;br /&gt;
* '''reconsider''': A number. If a behaviour is executed, the priority list will next be reconsidered in this many seconds. If this value is absent the priority list will only be considered if an event causes it.&lt;br /&gt;
* '''truebranch''': a priority list array. If there was no behaviour, but the conditions allow one to be run, the truebranch will be evaluated as a priority list. If the truebranch causes a behaviour to be executed, consideration will end here. If the truebranch reaches its end without executing a behaviour, consideration will continue with the next element of the main priority list.&lt;br /&gt;
* '''falsebranch''': a priority list array. This will be executed if the the conditions caused the previous four elements to be skipped.&lt;br /&gt;
&lt;br /&gt;
If evaluation reaches the end of the main priority list without finding a behaviour to execute, an error will be noted in the log. In general the last element of the main priority list should always be unconditional (or have a truebranch and a falsebranch, both of which have an unconditional last element).&lt;br /&gt;
&lt;br /&gt;
Example of simple behaviour: (from thargoid AI)&lt;br /&gt;
  {&lt;br /&gt;
    preconfiguration: ai.configurationCheckScanner,&lt;br /&gt;
    condition: ai.conditionScannerContainsNonThargoid,&lt;br /&gt;
    configuration: ai.configurationAcquireScannedTarget,&lt;br /&gt;
    behaviour: ai.behaviourDestroyCurrentTarget,&lt;br /&gt;
    reconsider: 1&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Example of branch usage: (from police AI)&lt;br /&gt;
  {&lt;br /&gt;
    /* The group leader leads the patrol */&lt;br /&gt;
    condition: ai.conditionIsGroupLeader,&lt;br /&gt;
    truebranch: [&lt;br /&gt;
      /* Nothing interesting here. Patrol for a bit */&lt;br /&gt;
      {&lt;br /&gt;
        condition: ai.conditionHasWaypoint,&lt;br /&gt;
        configuration: ai.configurationSetDestinationToWaypoint,&lt;br /&gt;
        behaviour: ai.behaviourApproachDestination,&lt;br /&gt;
        reconsider: 30&lt;br /&gt;
      },&lt;br /&gt;
      /* No patrol route set up. Make one */&lt;br /&gt;
      {&lt;br /&gt;
        configuration: ai.configurationSetWaypoint,&lt;br /&gt;
        behaviour: ai.behaviourApproachDestination,&lt;br /&gt;
        reconsider: 30&lt;br /&gt;
      }&lt;br /&gt;
    ],&lt;br /&gt;
    /* Other ships in the group will set themselves up&lt;br /&gt;
    * as escorts if possible, or looser followers if&lt;br /&gt;
    * not */&lt;br /&gt;
    falsebranch: [&lt;br /&gt;
      {&lt;br /&gt;
        preconfiguration: ai.configurationEscortGroupLeader,&lt;br /&gt;
        condition: ai.conditionIsEscorting,&lt;br /&gt;
        behaviour: ai.behaviourEscortMothership,&lt;br /&gt;
        reconsider: 30&lt;br /&gt;
      },&lt;br /&gt;
      /* if we can't set up as an escort */&lt;br /&gt;
      {&lt;br /&gt;
        behaviour: ai.behaviourFollowGroupLeader,&lt;br /&gt;
        reconsider: 15&lt;br /&gt;
      }&lt;br /&gt;
    ]&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
The AI Library provides a selection of standard condition,&lt;br /&gt;
configuration and behaviour functions for us in AIs, but you can also&lt;br /&gt;
write your own.&lt;br /&gt;
  /* Ship is unstable and may explode under stress */&lt;br /&gt;
  {&lt;br /&gt;
    condition: function()&lt;br /&gt;
    {&lt;br /&gt;
      return Math.random() &amp;lt; 0.01; // 1% chance per evaluation&lt;br /&gt;
    }				&lt;br /&gt;
    behaviour: function()&lt;br /&gt;
    {&lt;br /&gt;
      this.ship.explode();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== Evaluation context ===&lt;br /&gt;
&lt;br /&gt;
All condition, configuration and behaviour functions are evaluated in the context of the AI object. The '&amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;' variable when one of these functions is run therefore points to the priority AI, '''not''' to the AI Script.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;code&amp;gt;this.ship&amp;lt;/code&amp;gt; is defined and will be equivalent to the this.ship seen by the AI Script. However, if you wish to access properties of the AI Script you must use &amp;lt;code&amp;gt;this.ship.AIScript.''property''&amp;lt;/code&amp;gt;. Properties and methods of the priority AI may be accessed directly, e.g. &amp;lt;code&amp;gt;[[#allied|this.allied]](this.ship,this.ship.target)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Behaviour functions ==&lt;br /&gt;
&lt;br /&gt;
Behaviour functions determine what the ship will do next. They&lt;br /&gt;
generally begin a particular behaviour, and set up event handlers&lt;br /&gt;
(generally aided by the response templates) to allow interruption or&lt;br /&gt;
modification of that behaviour should anything interesting happen.&lt;br /&gt;
&lt;br /&gt;
Behaviour functions take no arguments and return nothing.&lt;br /&gt;
&lt;br /&gt;
=== General behaviours ===&lt;br /&gt;
&lt;br /&gt;
Behaviours intended for ships in general. These mostly use &amp;lt;code&amp;gt;responsesAddStandard&amp;lt;/code&amp;gt;, and occasionally add others.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourApproachDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourApproachDestination'''()&lt;br /&gt;
Travels from the current position to within &amp;lt;code&amp;gt;desiredRange&amp;lt;/code&amp;gt; of &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt;, avoiding obstacles on the way. &lt;br /&gt;
&lt;br /&gt;
If a waypoint is set in the parameters &amp;quot;oolite_waypoint&amp;quot; and &amp;quot;oolite_waypointRange&amp;quot;, it will clear these parameters if when it reaches its destination it is sufficiently close to the waypoint. If the parameter &amp;quot;oolite_flag_patrolStation&amp;quot; is set, and its group leader is a station, it will report in to the station  upon reaching the waypoint.&lt;br /&gt;
&lt;br /&gt;
Temporary waypoints needed to avoid obstacles will be stored in the&lt;br /&gt;
&amp;quot;oolite_waypoints&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourAssassinateCurrentTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourAssassinateCurrentTarget'''()&lt;br /&gt;
This behaviour attacks the current target, only stopping when interrupted or when the target is destroyed. It will potentially send both &amp;quot;oolite_beginningAssassination&amp;quot; and &amp;quot;oolite_beginningFight&amp;quot; communications messages (though if the former is defined, the latter will not be sent due to the communications priority system). This is otherwise identical in behaviour to [[#behaviourCommenceAttackOnCurrentTarget|behaviourCommenceAttackOnCurrentTarget]]&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourAvoidCascadeExplosion&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourAvoidCascadeExplosion'''()&lt;br /&gt;
Fly, using injectors if available, to a safe distance from any nearby quirium cascades (or active mines)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourBecomeInactiveThargon&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourBecomeInactiveThargon'''()&lt;br /&gt;
This behaviour is intended to deactivate thargons and should generally only be used for that purpose. It changes the scan class to CLASS_CARGO, clears the ship's targeting information, brings it to a stop, removes it from its ship groups, and removes it from nearby NPCs targeting systems (it can be retargeted). Unlike the equivalent plist AI command, it does not remove it as a player target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourCollectSalvage&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourCollectSalvage'''()&lt;br /&gt;
This behaviour attempts to scoop the current target. If it is successful, the &amp;quot;oolite_cargoDropped&amp;quot; parameter recording the number of seen cargo pods will be cleared.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourCommenceAttackOnCurrentTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourCommenceAttackOnCurrentTarget'''()&lt;br /&gt;
This behaviour attacks the current target, only stopping when interrupted or when the target is destroyed. Unlike the &amp;lt;code&amp;gt;behaviourDestroyCurrentTarget&amp;lt;/code&amp;gt; behaviour, it may first send the &amp;quot;[[#oolite_beginningFight|oolite_beginningFight]]&amp;quot; communications message, so should only be used when starting a fight with a new target/group - not when in the middle of a fight.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourDestroyCurrentTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourDestroyCurrentTarget'''()&lt;br /&gt;
This behaviour attacks the current target, only stopping when interrupted or when the target is destroyed.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourDockWithStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourDockWithStation'''()&lt;br /&gt;
This behaviour docks with the station specified in the parameter &amp;quot;oolite_dockingStation&amp;quot;. If the target refuses docking or the ship is too big to dock, the parameter will be cleared.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourEnterWitchspace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourEnterWitchspace'''()&lt;br /&gt;
This behaviour attempts to enter witchspace. It can do this in several ways:&lt;br /&gt;
* If the parameter &amp;quot;oolite_witchspaceWormhole&amp;quot; is set to an active wormhole, it will try to fly to and use that wormhole.&lt;br /&gt;
* If the parameter &amp;quot;oolite_witchspaceDestination&amp;quot; is set, then it will try to jump to that destination using its own drive. It will wait for its escorts to be launched, and will start spinning up this drive. Calling this behaviour again after 15 seconds will cause it to jump out.&lt;br /&gt;
* Otherwise, it will wait for a wormhole to be suggested by another member of its group, or for the player to create one.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourEscortMothership&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourEscortMothership'''()&lt;br /&gt;
This behaviour performs non-combat escorting of the ship's group leader, in the formation requested by the lead ship.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourFineCurrentTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourFineCurrentTarget'''()&lt;br /&gt;
If the ship has scan class &amp;quot;CLASS_POLICE&amp;quot; and a current target, mark that target for fines when it next docks.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourFleeCombat&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourFleeCombat'''()&lt;br /&gt;
The ship will flee from hostility, in the following order:&lt;br /&gt;
* Cascade explosions (coordinates from the parameter &amp;quot;oolite_cascadeDetected&amp;quot;)&lt;br /&gt;
* Its current target, if it can see it&lt;br /&gt;
* Its defense targets, if it can see them&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourFollowCurrentTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourFollowCurrentTarget'''()&lt;br /&gt;
The ship will follow the current target, including through a witchspace jump if necessary, and will additionally [[#conditionHasRememberedTarget|remember]] the target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourFollowGroupLeader&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourFollowGroupLeader'''()&lt;br /&gt;
The ship will follow the group leader if there is one, attempting to remain within a few kilometres of it.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourGuardTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourGuardTarget'''()&lt;br /&gt;
The ship will fly to within a few kilometres of its current target. Similar to &amp;lt;code&amp;gt;behaviourFollowCurrentTarget&amp;lt;/code&amp;gt; but will not follow the target into witchspace and will not remember that it was doing so if distracted.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourJoinTargetGroup&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourJoinTargetGroup'''()&lt;br /&gt;
The ship will add itself to its target's ship group. You should previously have used appropriate condition tests to check that this is appropriate behaviour.&lt;br /&gt;
 &lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourLandOnPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourLandOnPlanet'''()&lt;br /&gt;
Lands on the nearest planet. Unlike most behaviours, this one does not include the standard responses, so you should generally wait until the ship is only a few hundred metres above the surface before using it.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourLeaveVicinityOfDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourLeaveVicinityOfDestination'''()&lt;br /&gt;
Moves outside scanner range of the current destination coordinates.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourLeaveVicinityOfTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourLeaveVicinityOfTarget'''()&lt;br /&gt;
Moves outside scanner range of the current target. Unlike fleeing, this does not use fuel injectors if they are fitted, and does not cause the ship to appear hostile to its target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourMineTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourMineTarget'''()&lt;br /&gt;
Attacks the current target with a mining laser to break it into splinters. If the current target is not a rock, this behaviour will be cancelled and the target will be lost.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourOfferToEscort&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourOfferToEscort'''()&lt;br /&gt;
Offers to escort the ship identified by the parameter &amp;quot;oolite_scanResultSpecific&amp;quot;. Unless this parameter has been set by the scanner condition [[#conditionScannerContainsShipNeedingEscort|conditionScannerContainsShipNeedingEscort]] this is extremely likely to fail.&lt;br /&gt;
&lt;br /&gt;
To be accepted as an escort, the ship must have a primary role in the &amp;lt;code&amp;gt;oolite-escorts&amp;lt;/code&amp;gt; [[role-categories.plist|role category]].&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourPayOffPirates&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourPayOffPirates'''()&lt;br /&gt;
If a pirate demand to dump cargo exists, dump that many cargo canisters (or all of them, if fewer), and then switch to [[#behaviourFleeCombat|behaviourFleeCombat]]&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourReconsider&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourReconsider'''()&lt;br /&gt;
Does nothing except schedule a re-evaluation of the priority list.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourRejoinMothership&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourRejoinMothership'''()&lt;br /&gt;
This behaviour flies to rejoin the mothership, and then escorts it as in [[#behaviourEscortMothership|behaviourEscortMothership]].&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourRepelCurrentTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourRepelCurrentTarget'''()&lt;br /&gt;
This behaviour attacks the current target, but will break off the attack (and ask its escorts to do the same) if the target starts fleeing.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourRespondToDistressCall&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourRespondToDistressCall'''()&lt;br /&gt;
If the ship has a valid distress call represented by the parameters &amp;quot;oolite_distressAggressor&amp;quot; and &amp;quot;oolite_distressSender&amp;quot; it will attack the aggressor if it can see it. Otherwise it will fly (with injectors if available) to near the sender, attempting to locate the aggressor.&lt;br /&gt;
&lt;br /&gt;
If the aggressor has a lower bounty than the sender, then the ship will assume that the distress call is &amp;quot;unjust&amp;quot;, and attack the sender instead.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourRobTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourRobTarget'''()&lt;br /&gt;
If an existing group demand for cargo is in effect, attack the current target in the hope that it meets it. Demands are stored with the group leader if possible.&lt;br /&gt;
&lt;br /&gt;
If there is no existing demand for cargo, create one based on the cargo capacity of the target ship, the current system government, the cargo capacity of the group, and other factors.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourSunskim&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourSunskim'''()&lt;br /&gt;
Fly along until fuel tanks are full. In general, this behaviour should not be started until sunskimming height is reached (test with [[#conditionReadyToSunskim|conditionReadyToSunskim]]), and [[#configurationSetDestinationToSunskimEnd|configurationSetDestinationToSunskimEnd]] should be used to set a safe sunskimming direction.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourTumble&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourTumble'''()&lt;br /&gt;
Start tumbling. Unlike most behaviours, this one does not include the standard responses, so you will need to manually request a reconsideration of priorities if one is needed.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourWaitHere&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''behaviourWaitHere'''()&lt;br /&gt;
Stop at (or close to) the current location, and wait for something to happen.&lt;br /&gt;
&lt;br /&gt;
=== Missile behaviours ===&lt;br /&gt;
&lt;br /&gt;
Missile behaviours use &amp;lt;code&amp;gt;responsesAddMissile&amp;lt;/code&amp;gt;. More discussion of setting missile parameters, ECM response, and detonation can be found there.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourMissileInterceptCoordinates&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourMissileInterceptCoordinates'''()&lt;br /&gt;
Close to the desired missile range (default 25m, or specified by the &amp;lt;code&amp;gt;oolite_missile_proximity&amp;lt;/code&amp;gt; key in script info), detonating when reached. The coordinates to close in on are specified in the &amp;quot;oolite_interceptCoordinates&amp;quot;. This is used to track missile targets which cloak.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourMissileInterceptTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourMissileInterceptTarget'''()&lt;br /&gt;
Close to the desired missile range (default 25m, or specified by the &amp;lt;code&amp;gt;oolite_missile_proximity&amp;lt;/code&amp;gt; key in script info), detonating when reached.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourMissileSelfDestruct&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourMissileSelfDestruct'''()&lt;br /&gt;
Destroys the missile without detonating the payload.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Station behaviours ===&lt;br /&gt;
&lt;br /&gt;
Station behaviours use &amp;lt;code&amp;gt;responsesAddStation&amp;lt;/code&amp;gt; to set up their general handlers, as most standard behaviours are unnecessary or unhelpful for a stationary station.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourStationLaunchDefenseShips&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourStationLaunchDefenseShips'''()&lt;br /&gt;
If the station has a target and the target is aggressive, launches a defense ship if any remain, increases the alert condition to Red, and requests a group attack on the target. Otherwise does nothing.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourStationLaunchMiner&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourStationLaunchMiner'''()&lt;br /&gt;
If the station does not currently have a miner in its ship group, launches one. Also reduces the alert condition by one step.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourStationLaunchPatrol&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourStationLaunchPatrol'''()&lt;br /&gt;
If the station does not currently have a ship in its ship group with the primary role equal to the parameter &amp;quot;oolite_stationPatrolRole&amp;quot;, launches one. Also reduces the alert condition by one step.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourStationLaunchSalvager&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourStationLaunchSalvager'''()&lt;br /&gt;
Launches a salvager. Also reduces the alert condition by one step.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourStationManageTraffic&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourStationManageTraffic'''()&lt;br /&gt;
The station idles. If the system repopulator has requested launches that this station can fulfil, it may launch a ship.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;behaviourStationRespondToDistressCall&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''behaviourStationRespondToDistressCall'''()&lt;br /&gt;
Locates the aggressor and sender in the same way as [[#behaviourRespondToDistressCall|behaviourRespondToDistressCall]. If the aggressor is not visible, does nothing, otherwise sets the aggressor as a target, increases alert condition to Red, and launches a defense ship to attack the aggressor.&lt;br /&gt;
&lt;br /&gt;
== Condition functions ==&lt;br /&gt;
&lt;br /&gt;
Condition functions are used to determine whether to execute a&lt;br /&gt;
priority AI behaviour. They take no arguments and return a Boolean.&lt;br /&gt;
&lt;br /&gt;
=== Combat conditions ===&lt;br /&gt;
&lt;br /&gt;
Conditions related to the ship's performance in combat.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionCascadeDetected&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionCascadeDetected'''() : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if a cascade explosion has been detected recently (as given by the parameter &amp;quot;oolite_cascadeDetected&amp;quot; containing the explosion coordinates).&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionCombatOdds*&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionCombatOddsTerrible'''() : Boolean&lt;br /&gt;
 function '''conditionCombatOddsBad'''() : Boolean&lt;br /&gt;
 function '''conditionCombatOddsGood'''() : Boolean&lt;br /&gt;
 function '''conditionCombatOddsExcellent'''() : Boolean&lt;br /&gt;
These functions return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the perceived odds of this ship's group winning a fight against the target ship's group can reasonably be described with the appropriate description. &amp;quot;Good&amp;quot; and &amp;quot;Excellent&amp;quot; require the odds to be better than a particular threshold (so Excellent odds are always also Good), while &amp;quot;Bad&amp;quot; and &amp;quot;Terrible&amp;quot; require the odds to be worse than that threshold.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionGroupAttritionReached&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionGroupAttritionReached'''() : Boolean&lt;br /&gt;
This condition is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is in a group and that group has lost more than a quarter of its initial ships.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionGroupSuppliesLow&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionGroupSuppliesLow'''() : Boolean&lt;br /&gt;
This condition is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship's group is running out of consumables such as missiles or fuel, or has several damaged ships.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionInCombat&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionInCombat'''() : Boolean&lt;br /&gt;
The ship is currently attacking other ships, or a ship in its group or one of its escorts is.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionInCombatWithHostiles&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionInCombatWithHostiles'''() : Boolean&lt;br /&gt;
The ship is currently attacking other ships, or a ship in its group or one of its escorts is. Additionally, at least one of the targets of those ships is itself attacking (though not necessarily attacking anything from this ship's group)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionLosingCombat&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionLosingCombat'''() : Boolean&lt;br /&gt;
The ship is in combat, but is losing. The exact definition of &amp;quot;losing&amp;quot; may vary, and is intended to account for the overall tactical situation.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionMothershipInCombat&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionMothershipInCombat'''() : Boolean&lt;br /&gt;
This ship's group leader is attacking and/or being attacked. Other ships in the group are not considered. This ship must be able to see its leader's target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionMothershipIsAttacking&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionMothershipIsAttacking'''() : Boolean&lt;br /&gt;
This ship's group leader is attacking a target. This ship must be able to see its leader's target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionMothershipIsAttackingHostileTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionMothershipIsAttackingHostileTarget'''() : Boolean&lt;br /&gt;
This ship's group leader is attacking a target which is itself attacking something. This ship must be able to see its leader's target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionMothershipUnderAttack&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionMothershipUnderAttack'''() : Boolean&lt;br /&gt;
This ship's group leader is currently being targeted. This ship must be able to see the attacker.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionSuppliesLow&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionSuppliesLow'''() : Boolean&lt;br /&gt;
This condition is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if this ship is personally running out of consumables such as missiles or fuel, or is damaged. This is effectively a wrapper around &amp;lt;code&amp;gt;ship.damageAssessment()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Navigation conditions ===&lt;br /&gt;
&lt;br /&gt;
Conditions related to the ship's surroundings and navigation through the system.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionCanWitchspaceOnRoute&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionCanWitchspaceOnRoute'''() : Boolean&lt;br /&gt;
The ship has a witchspace drive, a witchspace route, and the next system on its [[#setWitchspaceRouteTowitchspace|route]] is within range with the current fuel supply.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionCanWitchspaceOut&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionCanWitchspaceOut'''() : Boolean&lt;br /&gt;
The ship has a witchspace drive, and at least one other system is within range with the current fuel supply.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionFriendlyStationExists&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionFriendlyStationExists'''() : Boolean&lt;br /&gt;
There is at least one friendly station in the system.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionFriendlyStationNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionFriendlyStationNearby'''() : Boolean&lt;br /&gt;
There is at least one friendly station within scanner range&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionGroupIsSeparated&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionGroupIsSeparated'''() : Boolean&lt;br /&gt;
The ship is in a group and has a group leader, and is out of scanner range of that leader (or out of 2x scanner range if the leader is a station)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasSelectedPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasSelectedPlanet'''() : Boolean&lt;br /&gt;
The ship has a valid planet in the &amp;quot;oolite_selectedPlanet&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasSelectedStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasSelectedStation'''() : Boolean&lt;br /&gt;
The ship has a valid station in the &amp;quot;oolite_selectedStation&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHomeStationExists&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHomeStationExists'''() : Boolean&lt;br /&gt;
The ship's home station still exists&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHomeStationNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHomeStationNearby'''() : Boolean&lt;br /&gt;
The ship's home station is within scanner range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHostileStationNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHostileStationNearby'''() : Boolean&lt;br /&gt;
There is at least one hostile station within scanner range&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionInInterstellarSpace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionInInterstellarSpace'''() : Boolean&lt;br /&gt;
The ship is currently in interstellar space.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionMainPlanetNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionMainPlanetNearby'''() : Boolean&lt;br /&gt;
The ship is within 3 radii of the surface of the main planet&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionNearDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionNearDestination'''() : Boolean&lt;br /&gt;
The ship is closer than the desired range to its destination&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionPlayerNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionPlayerNearby'''() : Boolean&lt;br /&gt;
The player's ship is within scanner range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionReadyToSunskim&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionReadyToSunskim'''() : Boolean&lt;br /&gt;
The ship is close enough to the sun to scoop fuel.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionSelectedStationNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionSelectedStationNearby'''() : Boolean&lt;br /&gt;
The ship has a selected station in the &amp;quot;oolite_selectedStation&amp;quot; parameter, and it is within scanner range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionSelectedStationNearMainPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionSelectedStationNearMainPlanet'''() : Boolean&lt;br /&gt;
The ship has a selected station in the &amp;quot;oolite_selectedStation&amp;quot; parameter, and it is within 3 radii of the surface of the main planet.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionStationNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionStationNearby'''() : Boolean&lt;br /&gt;
There is a station within scanner range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionSunskimPossible&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionSunskimPossible'''() : Boolean&lt;br /&gt;
There is a sun, it's not going nova, it hasn't gone nova, the ship has a non-full fuel tank and fuel scoops, and the ship has sufficient heat insulation to skim safely.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionWormholeNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionWormholeNearby'''() : Boolean&lt;br /&gt;
There is an entry wormhole within scanner range.&lt;br /&gt;
&lt;br /&gt;
=== Piracy-related conditions ===&lt;br /&gt;
&lt;br /&gt;
Conditions involved in piratical activities.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionCargoDemandsMet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionCargoDemandsMet'''() : Boolean&lt;br /&gt;
Since this ship (or an ally) made a cargo demand, this ship has seen enough cargo dropped to meet that demand.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionGroupHasEnoughLoot&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionGroupHasEnoughLoot'''() : Boolean&lt;br /&gt;
The group this ship belongs to has obtained enough cargo to call it a day. Currently this happens when cargo space usage is above 50%, but more sophisticated checks are planned involving damage or lost ships, expenditure of consumables, and so on.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionPiratesCanBePaidOff&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionPiratesCanBePaidOff'''() : Boolean&lt;br /&gt;
Pirates have demanded that this ship dump cargo, and it currently has enough cargo on board to meet that demand.&lt;br /&gt;
&lt;br /&gt;
=== Scanning conditions ===&lt;br /&gt;
&lt;br /&gt;
These conditions check the ship's latest scan ([[#configurationCheckScanner|configurationCheckScanner]]) for ships meeting particular requirements. If a ship is found, it will be placed in the &amp;quot;oolite_scanResultSpecific&amp;quot; parameter, in addition to the condition returning &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsAssassinationTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsAssassinationTarget'''() : Boolean&lt;br /&gt;
The scan contains an assassination target (i.e. an escape capsule)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsCleanShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsCleanShip'''() : Boolean&lt;br /&gt;
The scan contains a clean ship&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsCourier&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsCourier'''() : Boolean&lt;br /&gt;
The scan contains a courier ship&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsEscapePods&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsEscapePods'''() : Boolean&lt;br /&gt;
The scan contains an escape pod travelling slower than this ship's maximum speed, and this ship is able to scoop cargo.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsFineableOffender&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsFineableOffender'''() : Boolean&lt;br /&gt;
The scan contains a piloted ship with an offender legal status at or below the system threshold (varies with government) that has not already been marked for fines.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsFugitive&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsFugitive'''() : Boolean&lt;br /&gt;
The scan contains a fugitive ship&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsHuntableOffender&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsHuntableOffender'''() : Boolean&lt;br /&gt;
The scan contains a piloted ship with an offender legal status not too small to bother with (varies with government).&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsSeriousOffender&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsSeriousOffender'''() : Boolean&lt;br /&gt;
The scan contains a piloted ship with an offender legal status at or above the system threshold for fines (varies with government).&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsHunters&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsHunters'''() : Boolean&lt;br /&gt;
The scan contains a ship with role &amp;quot;hunter&amp;quot;, or a police ship, or the main station.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsLoneVictim&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsLoneVictim'''() : Boolean&lt;br /&gt;
The scan contains a single pirate victim and no other unallied ships.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsMiningOpportunity&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsMiningOpportunity'''() : Boolean&lt;br /&gt;
The scan contains a boulder (preferentially) or an asteroid, and the ship has a mining laser, a fuel scoop, and a non-full hold.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsNonThargoid&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsNonThargoid'''() : Boolean&lt;br /&gt;
The scan contains a ship which is not a Thargoid ship. Rocks and cargo will only be returned if there is nothing more interesting about.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsPirateLeader&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsPirateLeader'''() : Boolean&lt;br /&gt;
The scan contains a pirate leader (usually a heavily-armed freighter)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsPirateVictims&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsPirateVictims'''() : Boolean&lt;br /&gt;
The scan contains a pirate victim (as defined by &amp;lt;code&amp;gt;[[role-categories.plist]]&amp;lt;/code&amp;gt;) which is carrying at least some cargo and has not recently been robbed.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsReadyThargoidMothership&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsReadyThargoidMothership'''() : Boolean&lt;br /&gt;
The scan contains a thargoid mothership which has the capability to control at least one more thargon.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsRocks&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsRocks'''() : Boolean&lt;br /&gt;
The scan contains boulders (preferentially) or asteroids.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsSalvage&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsSalvage'''() : Boolean&lt;br /&gt;
The scan contains cargo which could in theory be scooped.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsSalvageForGroup&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsSalvageForGroup'''() : Boolean&lt;br /&gt;
The scan contains cargo which could in theory be scooped, and it is travelling slowly enough that at least one of the ships in the group with fuel scoops and cargo space can collect it..&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsSalvageForMe&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsSalvageForMe'''() : Boolean&lt;br /&gt;
The scan contains cargo which can be scooped by this ship (travelling slowly enough, and this ship has scoops and space)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsShipNeedingEscort&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsShipNeedingEscort'''() : Boolean&lt;br /&gt;
The scan contains a ship which has fewer escorts than its maximum. If the ship is clean, this will only detect other clean ships. If the ship is not clean, this will only detect other non-clean ships.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsSuspiciousShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsSuspiciousShip'''() : Boolean&lt;br /&gt;
The scan contains a ship with a criminal reputation (whether or not it currently carries a bounty)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsThargoidMothership&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsThargoidMothership'''() : Boolean&lt;br /&gt;
The scan contains a thargoid mothership which has the capability to control thargons. The number of thargons currently being controlled is irrelevant to this scan.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionScannerContainsUnspreadMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionScannerContainsUnspreadMissile'''() : Boolean&lt;br /&gt;
The scan contains a missile which has the same target and owner as this ship, but is closer to the target and within 500 metres of this ship. This is mainly used for &amp;quot;smart&amp;quot; missiles to ensure that impact times for a salvo are spread out.&lt;br /&gt;
&lt;br /&gt;
=== State querying conditions ===&lt;br /&gt;
&lt;br /&gt;
Conditions related to the state of the ship&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionAllEscortsInFlight&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionAllEscortsInFlight'''() : Boolean&lt;br /&gt;
If the ship has living escorts, then this function returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; only if they are all in normal flight (and not docked, launching, or in a wormhole). If the ship has no escorts then this function also returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionCanScoopCargo&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionCanScoopCargo'''() : Boolean&lt;br /&gt;
The ship has a working fuel scoop and at least 1 TC of free space in its hold.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionCargoIsProfitableHere&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionCargoIsProfitableHere'''() : Boolean&lt;br /&gt;
The current contents of the ship's hold can be sold at an above average price at the main station (this is currently determined very approximately - solely asking &amp;quot;is the current system on the right side of the Ind/Agri divide&amp;quot; - rather than checking station prices.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionCoinFlip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionCoinFlip'''() : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; half the time.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionGroupLeaderIsStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionGroupLeaderIsStation'''() : Boolean&lt;br /&gt;
The ship has a group leader and the group leader is a station.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasInterceptCoordinates&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasInterceptCoordinates'''() : Boolean&lt;br /&gt;
The ship has intercept coordinates set in the parameter &amp;quot;oolite_interceptCoordinates&amp;quot;. These are used by missiles to home in on a last-known location if the target cloaks.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasMothership&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasMothership'''() : Boolean&lt;br /&gt;
The ship has a group leader which is not itself.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasNonThargoidTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasNonThargoidTarget'''() : Boolean&lt;br /&gt;
The ship's target is not &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; and is not a thargoid ship (by scan class).&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasReceivedDistressCall&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasReceivedDistressCall'''() : Boolean&lt;br /&gt;
The ship has recently received a distress call. Distress calls expire after 30 seconds, or if the sender is no longer visible, or if the aggressor is dead.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasRememberedTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasRememberedTarget'''() : Boolean&lt;br /&gt;
The ship has a remembered target. This is set by [[#behaviourFollowCurrentTarget|behaviourFollowCurrentTarget]] to allow persistent tracking of a ship.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasTarget'''() : Boolean&lt;br /&gt;
The ship's target is not &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionHasWaypoint&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionHasWaypoint'''() : Boolean&lt;br /&gt;
The ship has a waypoint set by its [[#Waypoint_Generators|waypoint generator]].&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionIsActiveThargon&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionIsActiveThargon'''() : Boolean&lt;br /&gt;
The ship is a thargon (&amp;quot;EQ_THARGON&amp;quot;) and is active.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionIsEscorting&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionIsEscorting'''() : Boolean&lt;br /&gt;
The ship is currently escorting another ship. Stricter than [[#conditionHasMothership|conditionHasMothership]]: this also requires this ship to be in the group leader's escort group.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionIsGroupLeader&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionIsGroupLeader'''() : Boolean&lt;br /&gt;
The ship is in a group and is the leader of the group&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionMissileNeedsLaunchEvasion&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionMissileNeedsLaunchEvasion'''() : Boolean&lt;br /&gt;
This function checks if the &amp;lt;code&amp;gt;oolite_flag_launchAdjustMissile&amp;lt;/code&amp;gt; parameter is set to a non-&amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; value, and returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if so.&lt;br /&gt;
&lt;br /&gt;
Missile AI scripts may find the following code useful to set this flag to avoid collisions with the launching ship.&lt;br /&gt;
&lt;br /&gt;
 this.shipSpawned = function()&lt;br /&gt;
 {&lt;br /&gt;
   /* Launch correction when fired at target in aft arc */&lt;br /&gt;
   var s = this.ship; &lt;br /&gt;
   if(s.target &amp;amp;&amp;amp; s.target.position.subtract(s.position).direction().dot(s.vectorForward) &amp;lt; -0.8)&lt;br /&gt;
   {&lt;br /&gt;
     this.oolite_priorityai.setParameter(&amp;quot;oolite_flag_launchAdjustMissile&amp;quot;,true);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
See also [[#configurationMissileAdjustLaunch|configurationMissileAdjustLaunch]]&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionMissileOutOfFuel&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionMissileOutOfFuel'''() : Boolean&lt;br /&gt;
The ship has travelled beyond the maximum missile range. The default is 30km, but this may be overridden by the &amp;lt;code&amp;gt;oolite_missile_range&amp;lt;/code&amp;gt; parameter in the ship's script info.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionPatrolIsOver&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionPatrolIsOver'''() : Boolean&lt;br /&gt;
The ship's patrol is over (either due to distance travelled or a need to re-arm and repair). Note that the distance threshold is relatively low, so for ships on long patrol routes between system bodies this function should only be called when reaching appropriate waypoints.&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.81, the distance threshold can be changed from the default 200km by setting the &amp;lt;code&amp;gt;oolite_patrolLength&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;conditionWitchspaceEntryRequested&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''conditionWitchspaceEntryRequested'''() : Boolean&lt;br /&gt;
The ship has been requested to enter a wormhole set in the &amp;quot;oolite_witchspaceWormhole&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
== Configuration functions ==&lt;br /&gt;
&lt;br /&gt;
Configuration functions are usually used to set up parameters needed for a behaviour, though some may be used at the preconfiguration stage to set up parameters for a condition test. They take no arguments and do not return anything.&lt;br /&gt;
&lt;br /&gt;
=== Destination configurations ===&lt;br /&gt;
&lt;br /&gt;
These configurations set a destination, a desired range and a desired speed suitable for use with [[#behaviourApproachDestination|behaviourApproachDestination]]. Unless otherwise stated, [[#cruiseSpeed|cruiseSpeed]] will be used as the desired speed.&lt;br /&gt;
&lt;br /&gt;
If they are unable to set a destination, they may set the destination to the ship's current position, or may do nothing. Generally a condition should be used to check that the configuration is sensible.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationMissileAdjustLaunch&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationMissileAdjustLaunch'''()&lt;br /&gt;
This function causes the missile to dive sharply. The intended use is in conjunction with [[#conditionMissileNeedsLaunchEvasion|conditionMissileNeedsLaunchEvasion]] to avoid collisions with the launching ship.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationMissileAdjustSpread&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationMissileAdjustSpread'''()&lt;br /&gt;
This function sets an intermediate destination for &amp;quot;smart&amp;quot; missiles which are adjusting their flight path to spread out a salvo's impacts on target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToHomeStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToHomeStation'''()&lt;br /&gt;
Locates the home station, sets the destination to its position and the desired range to 15km.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToGroupLeader&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToGroupLeader'''()&lt;br /&gt;
Locates the group leader, sets the destination to its position and the desired range to 15km. Maximum flight speed is used.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToMainPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToMainPlanet'''()&lt;br /&gt;
Sets the destination to the main planet's position, and the desired range to 3 radii (i.e. 2 radii from the surface).&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToMainStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToMainStation'''()&lt;br /&gt;
Sets the destination to the main station's position, and the desired range to 15km&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToNearestHostileStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToNearestHostileStation'''()&lt;br /&gt;
Locates the nearest friendly station, sets the destination to its position and the desired range to 15km.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToNearestFriendlyStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToNearestFriendlyStation'''()&lt;br /&gt;
Locates the nearest friendly station, sets the destination to its position and the desired range to 15km.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToNearestStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToNearestStation'''()&lt;br /&gt;
Locates the nearest station, sets the destination to its position and the desired range to 15km.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToNearestWormhole&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToNearestWormhole'''()&lt;br /&gt;
Locates the nearest entry wormhole, sets the destination to its position and the desired range to zero.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToPirateLurk&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToPirateLurk'''()&lt;br /&gt;
If the parameter &amp;quot;oolite_pirateLurk&amp;quot; is set, then set the destination to that. If currently on a lane, set the destination to the current position. Otherwise, pick a random point on one of the lanes (strongly preferring witchpoint-planet). Once a destination is selected, store it to the parameter &amp;quot;oolite_pirateLurk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The desired range is 1km.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToScannedTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToScannedTarget'''()&lt;br /&gt;
Sets the destination to the position of the ship in the parameter &amp;quot;oolite_scanResultSpecific&amp;quot;, and the desired range to 400m. This can be used to follow a ship without targeting it.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToSelectedPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToSelectedPlanet'''()&lt;br /&gt;
Sets the destination to the position of the planet in the parameter &amp;quot;oolite_selectedPlanet&amp;quot;, and the desired range to 100m from the surface.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToSelectedStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToSelectedStation'''()&lt;br /&gt;
Sets the destination to the position of the station in the parameter &amp;quot;oolite_selectedStation&amp;quot;, and the desired range to 15km.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToSunskimEnd&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToSunskimEnd'''()&lt;br /&gt;
Sets the destination to a course parallel to the sun's surface, at a range which should allow the fuel tanks to be completely refilled. The desired range is 0, and the desired speed is maximum speed.&lt;br /&gt;
&lt;br /&gt;
Note: if this function is used above sunskimming height, it will still&lt;br /&gt;
move parallel to the sun's surface, but this will not be much use.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToSunskimStart&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToSunskimStart'''()&lt;br /&gt;
Sets the destination to the sun's position, and the desired range to sunskimming height.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToWaypoint&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToWaypoint'''()&lt;br /&gt;
If the parameters &amp;quot;oolite_waypoint&amp;quot; and &amp;quot;oolite_waypointRange&amp;quot; are set, use those as the destination and desired range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetDestinationToWitchpoint&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetDestinationToWitchpoint'''()&lt;br /&gt;
Sets the destination to the witchpoint and the range to 10km&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetWaypoint&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetWaypoint'''()&lt;br /&gt;
If a waypoint generator function has been registered, runs that function to set the &amp;quot;oolite_waypoint&amp;quot; and &amp;quot;oolite_waypointRange&amp;quot; parameters, then sets the destination from those parameters.&lt;br /&gt;
&lt;br /&gt;
=== Docking configurations ===&lt;br /&gt;
&lt;br /&gt;
Each of these configurations sets the &amp;quot;oolite_dockingStation&amp;quot; parameter used by [[#behaviourDockWithStation|behaviourDockWithStation]]&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetNearbyFriendlyStationForDocking&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetNearbyFriendlyStationForDocking'''()&lt;br /&gt;
Sets the &amp;quot;oolite_dockingStation&amp;quot; parameter to a friendly station in scanner range, if possible.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetHomeStationForDocking&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetHomeStationForDocking'''()&lt;br /&gt;
Sets the &amp;quot;oolite_dockingStation&amp;quot; parameter to the ship's home station.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetSelectedStationForDocking&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetHomeStationForDocking'''()&lt;br /&gt;
Sets the &amp;quot;oolite_dockingStation&amp;quot; parameter to the station in the parameter &amp;quot;oolite_selectedStation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous configurations ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationAppointGroupLeader&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationAppointGroupLeader'''()&lt;br /&gt;
If the ship is in a group but the group has no leader, set one of the ships in the group to be the leader. Witchspace-capable ships will be preferred over those which are not.&lt;br /&gt;
&lt;br /&gt;
If the parameter &amp;quot;oolite_leaderRole&amp;quot; is set, the primary role of the new leader will be changed to that role.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationEscortGroupLeader&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationEscortGroupLeader'''()&lt;br /&gt;
If the ship is in a group and the group has a leader which is not this ship and the ship is not already escorting the group leader, and the parameter &amp;quot;oolite_escortRole&amp;quot; is set, then attempt to escort the group leader. The ship's primary role will be set to &amp;quot;oolite_escortRole&amp;quot; if the escort attempt is successful, and this role must therefore be a valid escort role.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationForgetCargoDemand&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationForgetCargoDemand'''()&lt;br /&gt;
If the ship has a cargo demand active (the demand must be stored on this ship, not just on a group member), discard it, and reset the &amp;quot;oolite_cargoDropped&amp;quot; parameter of this ship and all group members to zero.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationLeaveEscortGroup&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationLeaveEscortGroup'''()&lt;br /&gt;
If the ship is currently escorting another ship, leave the escort group.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationLightsOff&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationLightsOff'''()&lt;br /&gt;
Set the ship's flashers to the 'off' state.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationLightsOn&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationLightsOn'''()&lt;br /&gt;
Set the ship's flashers to the 'on' state.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSetRemoteControl&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSetRemoteControl'''()&lt;br /&gt;
If the ship has a group leader, set its own accuracy to that ship's accuracy. This is used by thargons when the mothership controlling them is changed.&lt;br /&gt;
&lt;br /&gt;
=== Navigation configurations ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSelectPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSelectPlanet'''()&lt;br /&gt;
This function places a randomly selected planet or moon in the parameter &amp;quot;oolite_selectedPlanet&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSelectRandomTradeStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSelectRandomTradeStation'''()&lt;br /&gt;
This function places a suitable station in the parameter &amp;quot;oolite_selectedStation&amp;quot;. If the ship is clean, then 90% of the time this will be the main station. If the ship is an offender, but has a bounty not greater than the fine threshold, then 50% of the time this will be the main station.&lt;br /&gt;
&lt;br /&gt;
If the main station was not selected at the previous step, a random&lt;br /&gt;
friendly station will be selected (which may be the main station&lt;br /&gt;
anyway)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSelectShuttleDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSelectShuttleDestination'''()&lt;br /&gt;
This function selects a random planet or station. The entity selected must be at least 10km from the ship. If any such entities are within 5 times the radius of the main planet from the ship, more distant entities will be ignored.&lt;br /&gt;
&lt;br /&gt;
If the selected entity was a planet, it will be stored in &amp;quot;oolite_selectedPlanet&amp;quot;. Otherwise, it will be stored in &amp;quot;oolite_selectedStation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSelectWitchspaceDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSelectWitchspaceDestination'''()&lt;br /&gt;
If the ship has no witchspace drive, unset the &amp;quot;oolite_witchspaceDestination&amp;quot; parameter. If that parameter is already set, and is not the current system, and the ship has enough fuel to reach that system, do nothing. Otherwise, select a random system in range and place its ID in the &amp;quot;oolite_witchspaceDestination&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSelectWitchspaceDestinationInbound&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSelectWitchspaceDestinationInbound'''()&lt;br /&gt;
If the ship has no witchspace drive, unset the &amp;quot;oolite_witchspaceDestination&amp;quot; parameter. If the ship's home system and destination system are unequal, select the next system on the route to the home system. Otherwise, select a random system in range and place its ID in the &amp;quot;oolite_witchspaceDestination&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationSelectWitchspaceDestinationOutbound&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationSelectWitchspaceDestinationOutbound'''()&lt;br /&gt;
If the ship has no witchspace drive, unset the &amp;quot;oolite_witchspaceDestination&amp;quot; parameter. If the ship's home system and destination system are unequal, select the next system on the route to the destination system. Otherwise, select a random system in range and place its ID in the &amp;quot;oolite_witchspaceDestination&amp;quot; parameter.&lt;br /&gt;
&lt;br /&gt;
=== Station configurations ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationStationReduceAlertLevel&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationStationReduceAlertLevel'''()&lt;br /&gt;
Reduce the alert level of the station by one stage if it is not already Green.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationStationValidateTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationStationValidateTarget'''()&lt;br /&gt;
Check that the station's current target is within scanner range, and discard it if not. This is necessary for stations as unlike ships their low-level behaviour does not generally do this automatically.&lt;br /&gt;
&lt;br /&gt;
=== Target acquisition configurations ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationAcquireCombatTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationAcquireCombatTarget'''()&lt;br /&gt;
If the ship's target is valid, not cargo and not an ally, keep the current target. Otherwise, promote one defense target to a target. If the ship has no defense targets, check to see if any ships in the group or escort group have a combat target (but do not check their defense targets).&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationAcquireDefensiveEscortTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationAcquireDefensiveEscortTarget'''()&lt;br /&gt;
Search the current group leader's target and defense targets for a visible ship attacking the group leader, and target it if one is found. Otherwise, retain current target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationAcquireHostileCombatTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationAcquireHostileCombatTarget'''()&lt;br /&gt;
As [[#configurationAcquireCombatTarget|configurationAcquireCombatTarget]] but only targets which are hostile (i.e. would be valid for [[#behaviourRepelTarget|behaviourRepelTarget]]) will be selected.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationAcquireOffensiveEscortTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationAcquireOffensiveEscortTarget'''()&lt;br /&gt;
If this ship's group leader is attacking a target, and this ship can see that target, acquire that target. Otherwise retain current target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationAcquirePlayerAsTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationAcquirePlayerAsTarget'''()&lt;br /&gt;
Set this ship's target to the player.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationAcquireScannedTarget&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationAcquireScannedTarget'''()&lt;br /&gt;
Set this ship's target to the entity in the parameter &amp;quot;oolite_scanResultSpecific&amp;quot;. This parameter is set by the [[#checkScannerWithPredicate|checkScannerWithPredicate]] function, which is usually called from a &amp;lt;code&amp;gt;conditionScannerContains...&amp;lt;/code&amp;gt; condition.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;configurationCheckScanner&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''configurationCheckScanner'''()&lt;br /&gt;
Scans the ship's scanner range, placing a list of detected targets into the &amp;quot;oolite_scanResults&amp;quot; parameter. This is generally called in a preconfiguration before the first use of a &amp;lt;code&amp;gt;conditionScannerContains...&amp;lt;/code&amp;gt; condition in the priority list. &lt;br /&gt;
&lt;br /&gt;
If the scanner is particularly full, the list will not contain all visible objects. The current scan limit is 16.&lt;br /&gt;
&lt;br /&gt;
== Response definition functions and components ==&lt;br /&gt;
&lt;br /&gt;
=== Response definition functions ===&lt;br /&gt;
&lt;br /&gt;
Response definition functions are used to set up event handlers in the AI script. They take an object as an argument, and add event handlers to that object. They do not return anything as such, but modify their argument.&lt;br /&gt;
&lt;br /&gt;
They are generally used in behaviour functions to set up common responses. &lt;br /&gt;
 var handlers = {}; // new handler object&lt;br /&gt;
 this.responsesAddStandard(handlers); // add standard response set&lt;br /&gt;
 // add a handler for this behaviour&lt;br /&gt;
 handlers.shipEnteredStationAegis = function(station)&lt;br /&gt;
 {&lt;br /&gt;
   this.ship.beaconCode = null; // stop transmitting&lt;br /&gt;
 }&lt;br /&gt;
 this.applyHandlers(handlers);&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;responsesAddDocking&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''responsesAddDocking'''(handlers : Object)&lt;br /&gt;
Provides some additional event handlers for use when docking with a station. &lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;responsesAddEscort&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''responsesAddEscort'''(handlers : Object)&lt;br /&gt;
Provides some additional event handlers for use when escorting a ship, and changes the response to in-group help requests.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;responsesAddMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''responsesAddMissile'''(handlers : Object)&lt;br /&gt;
A standard set of event handlers for missiles, which should be used instead of &amp;lt;code&amp;gt;responsesAddStandard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A number of script info keys are used to modify the responses.&lt;br /&gt;
* oolite_missile_blastPower, oolite_missile_blastRadius, oolite_missile_blastShaping: If oolite_missile_detonation is not set, the default detonation function calls this.ship.dealEnergyDamage with the defined power, radius, and shaping. If these parameters are not set the defaults are power 170, radius 32.5, and shaping 0.25.&lt;br /&gt;
* oolite_missile_detonation: names a function in the AI script. This function will be called when the missile reaches the desired range from its target or destination. If this function is not set, the oolite_missile_blast* keys are used to set up an explosion.&lt;br /&gt;
* oolite_missile_ecmResponse: names a function in the AI script. This function will be called if the missile detects an ECM pulse. If no function is set, the missile will self destruct.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;responsesAddScooping&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''responsesAddScooping'''(handlers : Object)&lt;br /&gt;
Provides some additional event handlers for use when scooping fuel.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;responsesAddStandard&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''responsesAddStandard'''(handlers : Object)&lt;br /&gt;
Sets up standard event handlers to detect and respond to attacks, and to manage other common events. Certain parameter flags are used:&lt;br /&gt;
* oolite_flag_allowPlanetaryLanding: if &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship will land on a planet if it receives the &amp;lt;code&amp;gt;approachingPlanetSurface&amp;lt;/code&amp;gt; event. Otherwise, it will immediately reconsider its behaviour.&lt;br /&gt;
* oolite_flag_listenForDistressCall: if &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship will set the &amp;quot;oolite_distressAggressor&amp;quot;, &amp;quot;oolite_distressSender&amp;quot; and &amp;quot;oolite_distressTimestamp&amp;quot; parameters if it receives a distress call.&lt;br /&gt;
* oolite_flag_markOffenders: if &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship will apply a small bounty increase to ships it sees committing crimes.&lt;br /&gt;
* oolite_flag_sendsDistressCalls: if &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship will send distress calls when attacked.&lt;br /&gt;
* oolite_flag_watchForCargo: if &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship will increment the &amp;quot;oolite_cargoDropped&amp;quot; parameter if cargo is dumped nearby.&lt;br /&gt;
&lt;br /&gt;
If multiple standard responses are being applied, this one should be the first one applied.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;responsesAddStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''responsesAddStation'''(handlers : Object)&lt;br /&gt;
A standard set of event handlers for stations, which should be used instead of &amp;lt;code&amp;gt;responsesAddStandard&amp;lt;/code&amp;gt;. The &amp;quot;oolite_flag_listenForDistressCall&amp;quot; and &amp;quot;oolite_flag_markOffenders&amp;quot; parameters have the same use as in &amp;lt;code&amp;gt;responsesAddStandard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Response definition components ===&lt;br /&gt;
&lt;br /&gt;
The components are standard event handlers used by the standard response functions. The following response components are available. Each is named &amp;quot;&amp;lt;code&amp;gt;responseComponent_''responseGroup''_''handlerName''&amp;lt;/code&amp;gt;&amp;quot;. You can use them in your own handler definition functions for efficiency.&lt;br /&gt;
 var handlers = {};&lt;br /&gt;
 handlers.approachingPlanetSurface = this.responseComponent_standard_approachingPlanetSurface;&lt;br /&gt;
 // .. etc ..&lt;br /&gt;
 this.applyHandlers(handlers);&lt;br /&gt;
&lt;br /&gt;
==== Standard components ====&lt;br /&gt;
Standard event handlers for normal ships.&lt;br /&gt;
 responseComponent_standard_approachingPlanetSurface&lt;br /&gt;
 responseComponent_standard_cargoDumpedNearby&lt;br /&gt;
 responseComponent_standard_cascadeWeaponDetected&lt;br /&gt;
 responseComponent_standard_commsMessageReceived&lt;br /&gt;
 responseComponent_standard_distressMessageReceived&lt;br /&gt;
 responseComponent_standard_escortAccepted&lt;br /&gt;
 responseComponent_standard_helpRequestReceived&lt;br /&gt;
 responseComponent_standard_offenceCommittedNearby&lt;br /&gt;
 responseComponent_standard_playerWillEnterWitchspace&lt;br /&gt;
 responseComponent_standard_shipAcceptedEscort&lt;br /&gt;
 responseComponent_standard_shipAchievedDesiredRange&lt;br /&gt;
 responseComponent_standard_shipAttackedOther&lt;br /&gt;
 responseComponent_standard_shipAttackedWithMissile&lt;br /&gt;
 responseComponent_standard_shipAttackerDistracted&lt;br /&gt;
 responseComponent_standard_shipBeingAttacked&lt;br /&gt;
 responseComponent_standard_shipBeingAttackedUnsuccessfully&lt;br /&gt;
 responseComponent_standard_shipFiredMissile&lt;br /&gt;
 responseComponent_standard_shipKilledOther&lt;br /&gt;
 responseComponent_standard_shipLaunchedEscapePod&lt;br /&gt;
 responseComponent_standard_shipLaunchedFromStation&lt;br /&gt;
 responseComponent_standard_shipScoopedOther&lt;br /&gt;
 responseComponent_standard_shipTargetLost&lt;br /&gt;
 responseComponent_standard_shipWillEnterWormhole&lt;br /&gt;
 responseComponent_standard_shipWitchspaceBlocked&lt;br /&gt;
 responseComponent_standard_wormholeSuggested&lt;br /&gt;
 &lt;br /&gt;
==== Missile components ====&lt;br /&gt;
Standard event handlers for missiles.&lt;br /&gt;
 responseComponent_missile_commsMessageReceived&lt;br /&gt;
 responseComponent_missile_shipHitByECM&lt;br /&gt;
 responseComponent_missile_shipTargetCloaked&lt;br /&gt;
 responseComponent_missile_shipTargetLost&lt;br /&gt;
 responseComponent_missile_shipAchievedDesiredRange&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Station components ====&lt;br /&gt;
Standard event handlers for stations.&lt;br /&gt;
 responseComponent_station_commsMessageReceived&lt;br /&gt;
 responseComponent_station_cascadeWeaponDetected&lt;br /&gt;
 responseComponent_station_shipAttackedWithMissile&lt;br /&gt;
 responseComponent_station_shipBeingAttacked&lt;br /&gt;
 responseComponent_station_shipAttackedOther&lt;br /&gt;
 responseComponent_station_shipFiredMissile&lt;br /&gt;
 responseComponent_station_shipKilledOther&lt;br /&gt;
 responseComponent_station_shipTargetLost&lt;br /&gt;
 responseComponent_station_helpRequestReceived&lt;br /&gt;
 responseComponent_station_distressMessageReceived&lt;br /&gt;
 responseComponent_station_offenceCommittedNearby&lt;br /&gt;
&lt;br /&gt;
==== Docking components ====&lt;br /&gt;
Alternative event handlers for docking ships.&lt;br /&gt;
 responseComponent_docking_shipAchievedDesiredRange&lt;br /&gt;
 responseComponent_docking_stationWithdrewDockingClearance&lt;br /&gt;
 responseComponent_docking_shipAIFrustrated&lt;br /&gt;
&lt;br /&gt;
==== Escort components ====&lt;br /&gt;
Alternative event handlers for escorts.&lt;br /&gt;
 responseComponent_escort_escortDock&lt;br /&gt;
 responseComponent_escort_helpRequestReceived&lt;br /&gt;
&lt;br /&gt;
==== Expect-witchspace components ====&lt;br /&gt;
Alternative event handlers for ships expecting that their target might enter witchspace to escape&lt;br /&gt;
 responseComponent_expectWitchspace_shipTargetLost&lt;br /&gt;
&lt;br /&gt;
==== Scooping components ====&lt;br /&gt;
Alternative event handlers for ships scooping fuel.&lt;br /&gt;
 responseComponent_scooping_shipAchievedDesiredRange&lt;br /&gt;
 responseComponent_scooping_shipScoopedFuel&lt;br /&gt;
&lt;br /&gt;
==== Track-player components ====&lt;br /&gt;
Alternative event handlers for ships following the player.&lt;br /&gt;
 responseComponent_trackPlayer_playerWillEnterWitchspace&lt;br /&gt;
&lt;br /&gt;
== Template functions ==&lt;br /&gt;
&lt;br /&gt;
These functions return standard blocks of priorities for insertion into a priority list. Each of them returns an array, so can be used as a branch in its own right, or concatenated on to an existing array. Remember that unlike a standard priority entry, you need the result of these functions, not a reference to the function.&lt;br /&gt;
 {&lt;br /&gt;
   condition: ai.conditionInCombat,&lt;br /&gt;
   falsebranch: ai.templateReturnToBase()&lt;br /&gt;
 }&lt;br /&gt;
or&lt;br /&gt;
 priorities.concat(ai.templateReturnToBase());&lt;br /&gt;
&lt;br /&gt;
==== templateLeadHuntingMission ====&lt;br /&gt;
 function '''templateLeadHuntingMission'''() : Array&lt;br /&gt;
Return the priorities for leading a patrol between waypoints. Setting the waypoint generator and handling fighting and scanning along the course of the patrol should be handled by higher priorities.&lt;br /&gt;
&lt;br /&gt;
==== templateLeadPirateMission ====&lt;br /&gt;
 function '''templateLeadPirateMission'''() : Array&lt;br /&gt;
Return the priorities for selecting targets to rob if any are about, or moving to a suitable lurk position otherwise.&lt;br /&gt;
&lt;br /&gt;
==== templateReturnToBase ====&lt;br /&gt;
 function '''templateReturnToBase'''() : Array&lt;br /&gt;
Return the priorities for travelling to and docking with a suitable station.&lt;br /&gt;
&lt;br /&gt;
==== templateReturnToBaseOrPlanet ====&lt;br /&gt;
 function '''templateReturnToBaseOrPlanet'''() : Array&lt;br /&gt;
Return the priorities for travelling to and docking with a suitable station, or landing on a planet if no suitable stations are found.&lt;br /&gt;
&lt;br /&gt;
==== templateWitchspaceJumpAnywhere ====&lt;br /&gt;
 function '''templateWitchspaceJumpAnywhere'''() : Array&lt;br /&gt;
Returns priorities for getting the ship out of the current system somehow - either by jumping out, or by finding a wormhole to hitchhike.&lt;br /&gt;
&lt;br /&gt;
==== templateWitchspaceJumpInbound ====&lt;br /&gt;
 function '''templateWitchspaceJumpInbound'''() : Array&lt;br /&gt;
Returns priorities for jumping closer to the home system, sunskimming if fuel is short. You should previously have checked that the ship is not in the home system.&lt;br /&gt;
&lt;br /&gt;
==== templateWitchspaceJumpOutbound ====&lt;br /&gt;
 function '''templateWitchspaceJumpOutbound'''() : Array&lt;br /&gt;
Returns priorities for jumping closer to the destination system, sunskimming if fuel is short. You should previously have checked that the ship is not in the destination system.&lt;br /&gt;
&lt;br /&gt;
== Utility functions ==&lt;br /&gt;
&lt;br /&gt;
These functions are provided to make standardised checks easier to write and to wrap certain ship methods to make them easier to work with in the AI controller.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;allied&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''allied'''(ship1, ship2) : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the two ships are considered allied, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. Ships are considered allied if they are in the same group, or if they are escorts of ships in the same group.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;broadcastDistressMessage&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''broadcastDistressMessage'''()&lt;br /&gt;
Broadcasts a distress message, but with a delay to ensure that [[Oolite_JavaScript_Reference:_Ship#broadcastDistressMessage|ship.broadcastDistressMessage()]] is not called too often.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;checkScannerWithPredicate&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''checkScannerWithPredicate'''(function) : Boolean&lt;br /&gt;
Called after configurationCheckScanner to locate a ship on the scanner matching a particular predicate. The predicate function must take a Ship, and return a Boolean.&lt;br /&gt;
&lt;br /&gt;
If the predicate function matches a ship, the first such match will be stored in the parameter &amp;lt;code&amp;gt;&amp;quot;oolite_scanResultSpecific&amp;quot;&amp;lt;/code&amp;gt;, and the method will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. Otherwise the method returns &amp;lt;code&amp;gt;false&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;
 function '''cruiseSpeed'''() : Number&lt;br /&gt;
Returns a suitable speed for the ship to travel at if it is interested in preserving group or escort coherence. Generally this will be 80% of its maximum speed, but it will be slower if other group members or escorts are slower.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;distance&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''distance'''(position : [[Oolite_JavaScript_Reference:_Vector3D#Vector_Expressions|vectorExpression]])&lt;br /&gt;
Returns the distance to the given coordinates. This is more efficient than calling &amp;lt;code&amp;gt;this.ship.position.distanceTo(position)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;entityCommsParams&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''entityCommsParams'''(entity : Entity) : Object&lt;br /&gt;
Returns an object of communications parameters relating to the given entity. Used internally by [[#communicate|communicate()]] but may be of use elsewhere.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;fineThreshold&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''fineThreshold'''() : Number&lt;br /&gt;
The maximum bounty at which an offender should be fined rather than attacked by police ships. (Ships caught redhanded may be attacked regardless of bounty)  Varies from system to system.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;friendlyStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''friendlyStation'''(station) : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the station is friendly to the current ship, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. The main station is unfriendly to Fugitive ships and Offenders above the current [[#fineThreshold|fineThreshold]]. Other stations are only considered unfriendly to their current combat target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;homeStation&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''homeStation'''() : Boolean&lt;br /&gt;
Returns the home station of this ship. If the ship has an owner, and&lt;br /&gt;
the owner is a station, then that is the home station. Otherwise, the&lt;br /&gt;
first station in the ship's group is returned.&lt;br /&gt;
&lt;br /&gt;
If no home station can be found, returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;ignorePlayerFriendlyFire&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''ignorePlayerFriendlyFire'''() : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if this ship should ignore friendly fire from the player as they would for a known ally. Note that this function's results will change if called repeatedly, so you should only call it once per instance of friendly fire, and never call it speculatively. &lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;isAggressive&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''isAggressive'''() : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is an active danger to its current target (approximately: it is in a combat behaviour other than fleeing)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;isEscaping&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''isEscaping'''() : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is successfully running away from this ship (i.e. it is not attacking, it is travelling faster than this ship can, and it is already outside effective weapons range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;isFighting&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''isFighting'''() : Boolean&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is in combat (including fleeing). Similar to &amp;lt;code&amp;gt;ship.hasHostileTarget&amp;lt;/code&amp;gt; but works for stations as well.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;noteDistraction&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''noteDistraction'''(whom : Entity)&lt;br /&gt;
If this ship is switching combat targets because another ship distracted it, then call this function just before switching. &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt; is the entity that this ship will soon switch to attacking. This calls the &amp;lt;code&amp;gt;shipAttackerDistracted&amp;lt;/code&amp;gt; event handler on the current target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;oddsAssessment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''oddsAssessment'''() : Number&lt;br /&gt;
Carry out an odds assessment of this ship's group versus the target ship's group. This will return a positive number of the ratio between the two values, with a number greater than 1 implying that this ship's group is stronger, and a number less than 1 implying the target's group is stronger. The odds assessment of the target group will omit certain information unless the target is currently in combat. Ships outside of scanner range, whether friendly or hostile, will also be ignored in the assessment.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerRoleAssessment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''playerRoleAssessment'''() : String&lt;br /&gt;
Determines a single perceived role for the player based on [[Oolite_JavaScript_Reference:_Player#roleWeights|player.roleWeights]]. In general, the perception will be the same for all ships in a group. This can then be used with [[Oolite_JavaScript_Reference:_Ship#roleIsInCategory|Ship.roleIsInCategory]] to determine the appropriate response.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;respondToThargoids&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''respondToThargoids'''(whom : Ship, passon : Boolean) : Boolean&lt;br /&gt;
This function causes the ship (and if the &amp;lt;code&amp;gt;passon&amp;lt;/code&amp;gt; parameter is set, its group members) to respond to the appearance of the Thargoid ship &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt;. It will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if this ship responds, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if not.&lt;br /&gt;
&lt;br /&gt;
You must ensure that ships responding to a Thargoid as a result of a notification by a group member do not themselves set &amp;lt;code&amp;gt;passon&amp;lt;/code&amp;gt; as this may cause an infinite loop.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;setWitchspaceRouteTo&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''setWitchspaceRouteTo'''(dest : Number)&lt;br /&gt;
This function sets the &amp;lt;code&amp;gt;oolite_witchspaceDestination&amp;lt;/code&amp;gt; parameter according to the needs of reaching the system with the system ID equal to &amp;lt;code&amp;gt;dest&amp;lt;/code&amp;gt;. As this function involves route planning, which is relatively slow, it should be called only rarely. This can then be used to determine whether to refuel or attempt to jump.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipHasRiskyContracts&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''shipHasRiskyContracts'''(ship : Ship) : Boolean&lt;br /&gt;
Sometimes returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (non-deterministically) if the target ship is carrying contracts that someone might want assassinated or destroyed. The chance of returning &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; increases with the number of risky contracts carried. Currently this will always return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for a non-player ship: you can check these with the &amp;lt;code&amp;gt;oolite-courier&amp;lt;/code&amp;gt; role category instead.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipInRoleCategory&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''shipInRoleCategory'''(ship : Ship, category : String) : Boolean&lt;br /&gt;
This is a wrapper around &amp;lt;code&amp;gt;Ship.roleIsInCategory&amp;lt;/code&amp;gt; which accounts for the player's effective role not being the same as &amp;lt;code&amp;gt;player.ship.primaryRole&amp;lt;/code&amp;gt;. You should generally call this instead of calling &amp;lt;code&amp;gt;Ship.roleIsInCategory&amp;lt;/code&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;stationAllegiance&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''stationAllegiance'''(station : Station) : String&lt;br /&gt;
Returns &amp;lt;code&amp;gt;station.allegiance&amp;lt;/code&amp;gt; for the given station, but if this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; (as it will be for pre-1.79 stations), first sets it using a heuristic calculation.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;threatAssessment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''threatAssessment'''(ship : Ship, full : Boolean) : Number&lt;br /&gt;
This is a wrapper around &amp;lt;code&amp;gt;_threatAssessment&amp;lt;/code&amp;gt; (intentionally not documented) which is itself a wrapper around &amp;lt;code&amp;gt;[[Oolite_JavaScript_Reference:_Ship#threatAssessment|ship.threatAssessment()]]&amp;lt;/code&amp;gt;. The combination of the two ensures that the assessment is correct for the relative combat states of this ship and the ship being assessed, as well as including effects of the player's reputation.&lt;br /&gt;
&lt;br /&gt;
== Waypoint Generators ==&lt;br /&gt;
&lt;br /&gt;
Waypoint generators are used to set patrol or other multipoint routes. When called, they should consider the ship's current position (and possibly other things), and then set the parameters &amp;quot;oolite_waypoint&amp;quot; and &amp;quot;oolite_waypointRange&amp;quot;. These functions have no arguments and no return value.&lt;br /&gt;
&lt;br /&gt;
In general, you should only call a waypoint generator if a waypoint is not already set.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;waypointsSpacelanePatrol&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''waypointsSpacelanePatrol'''()&lt;br /&gt;
If the ship is near the main planet, sun, or witchpoint, pick one of the other two points (biased towards the witchpoint-planet route) and set that as the waypoint. Otherwise, if the ship is on a lane already, pick one end of the lane at random. Otherwise, pick the planet.&lt;br /&gt;
&lt;br /&gt;
Set a waypoint within 7500m of the witchpoint, 2 radii of the centre of the planet, or 2.5 radii of the centre of the sun.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;waypointsStationPatrol&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''waypointsStationPatrol'''()&lt;br /&gt;
If the ship has a station as its group leader, define waypoints from that station. Otherwise define them from the main station. If there is no main station either, set the witchpoint as the waypoint.&lt;br /&gt;
&lt;br /&gt;
If there is a station, pick four points describing a square of diagonal length 50km centred on the station and lying in the station's xy plane. If the ship is not within 500 metres of any of these points, select one of the points as the waypoint. Otherwise, select the next point around the list as the waypoint.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;waypointsWitchpointPatrol&amp;lt;/code&amp;gt; ====&lt;br /&gt;
 function '''waypointsWitchpointPatrol'''()&lt;br /&gt;
&lt;br /&gt;
Pick four points describing a square of diagonal length 30km centred on the witchpoint and lying approximately in the system's xy plane. If the ship is not within 500 metres of any of these points, select one of the points as the waypoint. Otherwise, select the next point around the list as the waypoint.&lt;br /&gt;
&lt;br /&gt;
== Global Configuration ==&lt;br /&gt;
All PriorityAIControllers share a single communications message library. This library may be edited using functions in the priority AI worldscript&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
When a key is asked for, the communications library will be checked in the following order:&lt;br /&gt;
# for a key with the specified role and personality&lt;br /&gt;
# if the role does not start with &amp;quot;_&amp;quot;, a key with the specified personality and the role &amp;quot;generic&amp;quot;&lt;br /&gt;
# if the personality does not start with &amp;quot;_&amp;quot;, a key with the specified role and the personality &amp;quot;generic&amp;quot;&lt;br /&gt;
# if neither role nor personality start with &amp;quot;_&amp;quot;, a key with &amp;quot;generic&amp;quot; role and personality.&lt;br /&gt;
In general, setting keys for the generic role (and especially with a generic personality as well) should be used with caution.&lt;br /&gt;
&lt;br /&gt;
The key's value is then expanded using expandDescription (possibly with added parameters), so entries in [[descriptions.plist]] may be used to add variety to the communications. Alternatively, a static text string also works as the value.&lt;br /&gt;
&lt;br /&gt;
==== Standard Communications Keys ====&lt;br /&gt;
&lt;br /&gt;
The following communications keys are currently defined in standard Oolite, but you can define more. Those with a parameter of Ship can have a Ship object passed to them, which will be replaced with definitions for the parameters &amp;quot;oolite_entityClass&amp;quot;, &amp;quot;oolite_entityCrew&amp;quot; and &amp;quot;oolite_entityName&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===== oolite_agreeingToDumpCargo =====&lt;br /&gt;
 Parameter: &amp;quot;oolite_demandSize&amp;quot; (size of demand in TC)&lt;br /&gt;
 Priority: 1&lt;br /&gt;
Used when a ship dumps cargo to satisfy a pirate demand&lt;br /&gt;
&lt;br /&gt;
===== oolite_attackLowEnergy =====&lt;br /&gt;
 Parameter: Ship,&lt;br /&gt;
 Priority: 2&lt;br /&gt;
Used when requesting help as under attack and close to death&lt;br /&gt;
&lt;br /&gt;
===== oolite_beginningAssassination =====&lt;br /&gt;
 Parameter: Ship, plus &amp;quot;oolite_entityContracts&amp;quot; parameter&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when commencing a fight with the Ship defined in the parameter, like [[#oolite_beginningFight|oolite_beginningFight]], but specifically for an assassination target. The extra communications parameter contains the name of a passenger (or parcel owner) relevant to this ship (for the player, this may intentionally be someone for whom delivery has been completed - either it's a revenge hit, or they're just working from outdated intelligence)&lt;br /&gt;
&lt;br /&gt;
===== oolite_beginningAttack =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when commencing an attack on the Ship defined in the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_beginningAttackInanimate =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when commencing an attack on the Ship (expected to be an uncrewed object like an asteroid, cargo pod, etc.) defined in the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_beginningAttackThargoid =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when commencing an attack on the Ship (expected to be a Thargoid ship) defined in the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_beginningFight =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when commencing a fight with the Ship defined in the parameter. (Beginning Attack means attacking a target previously not under attack but which there may have been a reason to fight from previous combats; Beginning Fight is stronger - this ship is initiating hostilities)&lt;br /&gt;
&lt;br /&gt;
===== oolite_continueFleeing =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when the ship has been unable to reach safety from its attacker.&lt;br /&gt;
&lt;br /&gt;
===== oolite_continuingAttack =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when continuing an attack on the Ship defined in the parameter (the low priority means this is relatively rarely used, of course)&lt;br /&gt;
&lt;br /&gt;
===== oolite_continuingAttackInanimate =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when continuing an attack on the Ship (if likely to be uncrewed) defined in the parameter (the low priority means this is relatively rarely used, of course)&lt;br /&gt;
&lt;br /&gt;
===== oolite_continuingAttackThargoid =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when continuing an attack on the Ship (if Thargoid) defined in the parameter (the low priority means this is relatively rarely used, of course)&lt;br /&gt;
&lt;br /&gt;
===== oolite_distressResponseAggressor =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 2&lt;br /&gt;
Used to threaten the ship a distress call has been sent about.&lt;br /&gt;
&lt;br /&gt;
===== oolite_distressResponseSender =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 2 or 3&lt;br /&gt;
Used to reassure a ship sending a distress call that help is on the way. [[#oolite_distressResponseAggressor|oolite_distressResponseAggressor]] is preferred - this will only be used if the ship sending the message is near the sender but not the aggressor.&lt;br /&gt;
&lt;br /&gt;
===== oolite_dockingWait =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when a ship is waiting in a docking queue.&lt;br /&gt;
&lt;br /&gt;
===== oolite_eject =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 1&lt;br /&gt;
Used when a ship launches an escape pod (the communication comes from the ship, not the pod, as the pod is being launched)&lt;br /&gt;
&lt;br /&gt;
===== oolite_engageWitchspaceDrive =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when a lone ship is beginning its witchspace entry sequence, and is expected to enter witchspace in around 15 seconds.&lt;br /&gt;
&lt;br /&gt;
===== oolite_engageWitchspaceDriveFlee =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 2&lt;br /&gt;
Used when a ship is preparing to escape from a fight by making a witchspace jump&lt;br /&gt;
&lt;br /&gt;
===== oolite_engageWitchspaceDriveGroup =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when a grouped ship is beginning its witchspace entry sequence, and is expected to enter witchspace in around 15 seconds.&lt;br /&gt;
&lt;br /&gt;
===== oolite_escortAccepted =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 2&lt;br /&gt;
Used when a ship accepts a new escort. The new escort will be passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_escortFormation =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when a ship is entering or maintaining escort formation. The mothership will be passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_escortMotherAccepted =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 2&lt;br /&gt;
Used when a ship is accepted as a new escort. The ship being escorted will be passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_firedMissile =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when firing a missile. The target of the missile will be passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_friendlyFire =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 2, 3 or 4 depending on circumstances&lt;br /&gt;
Used when a ship is hit by weapons fire from another ship it considers &amp;quot;on its side&amp;quot; either because of common group or because of similar roles.&lt;br /&gt;
&lt;br /&gt;
===== oolite_groupIsOutnumbered =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 2 if group leader, 4 otherwise&lt;br /&gt;
Used when a ship realises it is in a fight with a group which seriously outclasses it, and therefore should flee.&lt;br /&gt;
&lt;br /&gt;
===== oolite_hitTarget =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when the ship hits its target. The target is passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_incomingMissile =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when the ship has had a missile launched at it and is unable to use ECM. The missile is passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_killedAlly =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when the ship destroys an allied ship. The target is passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_killedTarget =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 2 (3 for stations)&lt;br /&gt;
Used when the ship destroys its current target. The target is passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_killedNonTarget =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when the ship destroys something other than its current target. The target is passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_killedUncrewedTarget =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3 (4 for stations)&lt;br /&gt;
Used when the ship destroys an uncrewed object which is its current target. The target is passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_killedUncrewedNonTarget =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3 (4 for stations)&lt;br /&gt;
Used when the ship destroys an uncrewed object other than its current target. The target is passed as the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_landingOnPlanet =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when beginning final landing approach to a planet.&lt;br /&gt;
&lt;br /&gt;
===== oolite_launchDefenseShips, oolite_launchMiner, oolite_launchPatrol, oolite_launchSalvager =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when a station launches a ship of a particular type. The parameter is the station's current target.&lt;br /&gt;
&lt;br /&gt;
===== oolite_leaveVicinity =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when a ship is executing [[#behaviourLeaveVicinityOfDestination|behaviourLeaveVicinityOfDestination]]. The parameter is the current target.&lt;br /&gt;
&lt;br /&gt;
===== oolite_makeDistressCall =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 2&lt;br /&gt;
Used as the message when a distress call is sent. The parameter is the ship's primary aggressor.&lt;br /&gt;
&lt;br /&gt;
===== oolite_makePirateDemand =====&lt;br /&gt;
 Parameter: Ship and &amp;quot;oolite_demandSize&amp;quot;&lt;br /&gt;
 Priority: 1&lt;br /&gt;
Used when making a piracy demand on a ship. The Ship parameters are from the ship being robbed.&lt;br /&gt;
&lt;br /&gt;
===== oolite_markForFines =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 1&lt;br /&gt;
Used when a police ship is marking another ship for fines on docking. The parameter is the ship being marked.&lt;br /&gt;
&lt;br /&gt;
===== oolite_mining =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when carrying out mining activity&lt;br /&gt;
&lt;br /&gt;
===== oolite_newAssailiant =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when the ship is attacked by someone not previously considered hostile. The attacker is the parameter.&lt;br /&gt;
&lt;br /&gt;
===== oolite_offenceDetected =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3 if this increases the aggressor's bounty, 4 otherwise&lt;br /&gt;
Used when a police ship detects illegal hostilities. The parameter is the aggressor.&lt;br /&gt;
&lt;br /&gt;
===== oolite_patrolReportIn =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when a station patrol ship reaches a waypoint. The parameter is its parent station.&lt;br /&gt;
&lt;br /&gt;
===== oolite_quiriumCascade =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when a quirium cascade or an imminent cascade is detected.&lt;br /&gt;
&lt;br /&gt;
===== oolite_scoopedCargo =====&lt;br /&gt;
 Parameter: &amp;quot;oolite_goodsDescription&amp;quot; is a description of the cargo commodity&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when this ship scoops cargo.&lt;br /&gt;
&lt;br /&gt;
===== oolite_selectedStation =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when a ship selects a station to navigate to (e.g. traders, shuttles). The parameter is the selected station.&lt;br /&gt;
&lt;br /&gt;
===== oolite_selectedWitchspaceDestination =====&lt;br /&gt;
 Parameter: &amp;quot;oolite_witchspaceDestination&amp;quot; is the name of the destination system&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when a ship selects its witchspace destination.&lt;br /&gt;
&lt;br /&gt;
===== oolite_startFleeing =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Used when a ship begins fleeing combat, with the parameter being the ship's current target.&lt;br /&gt;
&lt;br /&gt;
===== oolite_startHelping =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 4&lt;br /&gt;
Used when a ship responds to a request for help from another grouped ship by changing its target. The parameter is the new target.&lt;br /&gt;
&lt;br /&gt;
===== oolite_surrender =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 3&lt;br /&gt;
Messages sent by fleeing ships still being fired upon, in attempt to beg for mercy. [[#oolite_agreeingToDumpCargo|oolite_agreeingToDumpCargo]] is used instead in the one case in the core game where an attacker might accept a surrender (as opposed to breaking off an attack on a fleeing ship to attack a non-fleeing one)&lt;br /&gt;
&lt;br /&gt;
===== oolite_thanksForHelp =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 1 if thanking the player, 3 otherwise&lt;br /&gt;
This message is sent if an attack on this ship's aggressor causes it to break off its own attack. The parameter is the ship helping out.&lt;br /&gt;
&lt;br /&gt;
===== oolite_thargoidAttack =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 2&lt;br /&gt;
This message is sent if the ship is attacked by a Thargoid ship while not previously fighting Thargoids. The parameter is the Thargoid ship. This is generally accompanied by a quick cessation of hostilities between Cooperative vessels for a short-term truce against the invaders.&lt;br /&gt;
&lt;br /&gt;
===== oolite_waypointReached =====&lt;br /&gt;
 Parameter: none&lt;br /&gt;
 Priority: 3&lt;br /&gt;
This message is sent when a ship reaches a waypoint set with the waypoint generator function.&lt;br /&gt;
&lt;br /&gt;
===== oolite_witchspaceBlocked =====&lt;br /&gt;
 Parameter: Ship&lt;br /&gt;
 Priority: 3&lt;br /&gt;
This message is sent when a large nearby mass (usually a station or asteroid) prevents witchspace entry. The parameter is the blocking mass.&lt;br /&gt;
&lt;br /&gt;
==== Standard Communications Roles ====&lt;br /&gt;
&lt;br /&gt;
The following communications roles are used by the standard Oolite AIs. Some of the roles have fallback roles used by the standard AIs, noted below. If the fallback role does not exist, or is not specified, it will fall back to using &amp;quot;generic&amp;quot; as usual.&lt;br /&gt;
&lt;br /&gt;
Note that OXP AIs might not specify the same fallback roles. OXP AIs wishing to can use code like&lt;br /&gt;
&lt;br /&gt;
 if (worldScripts[&amp;quot;oolite-libPriorityAI&amp;quot;]._getCommunicationPersonalities(&amp;quot;hermit&amp;quot;).length &amp;gt; 0)&lt;br /&gt;
 {&lt;br /&gt;
 	ai.setCommunicationsRole(&amp;quot;hermit&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	ai.setCommunicationsRole(&amp;quot;station&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
* '''assassin''' - assassins&lt;br /&gt;
* '''defenseShip''' - defense ships&lt;br /&gt;
* '''escapepod''' - escape pods&lt;br /&gt;
* '''escort''' - escorts&lt;br /&gt;
* '''hermit''' - rock hermits. If no personalities are defined for this role, &amp;quot;station&amp;quot; will be used instead.&lt;br /&gt;
* '''hunter''' - bounty hunters&lt;br /&gt;
* '''pirate''' - pirates&lt;br /&gt;
* '''pirate-aegis-raider''' - pirates showing off by attacking the main station. If no personalities are defined for this role, &amp;quot;pirate&amp;quot; will be used instead.&lt;br /&gt;
* '''pirate-freighter''' - pirate freighters leading a pack. If no personalities are defined for this role, &amp;quot;pirate&amp;quot; will be used instead.&lt;br /&gt;
* '''pirate-interceptor''' - pirates assigned to distract police and hunters. If no personalities are defined for this role, &amp;quot;pirate&amp;quot; will be used instead.&lt;br /&gt;
* '''police''' - police ships&lt;br /&gt;
* '''scavenger''' - scavengers and miners.&lt;br /&gt;
* '''shuttle''' - orbital shuttles (usually unarmed)&lt;br /&gt;
* '''station''' - stations.&lt;br /&gt;
* '''trader''' - traders&lt;br /&gt;
* '''trader-courier''' - couriers. If no personalities are defined for this role, &amp;quot;trader&amp;quot; will be used instead.&lt;br /&gt;
* '''trader-opportunist''' - opportunistic traders. If no personalities are defined for this role, &amp;quot;trader&amp;quot; will be used instead.&lt;br /&gt;
* '''trader-smuggler''' - smugglers. If no personalities are defined for this role, &amp;quot;trader&amp;quot; will be used instead.&lt;br /&gt;
&lt;br /&gt;
Thargoids are set slightly differently: all the core game ones get the &amp;quot;_thargoid&amp;quot; role, with the warships getting the &amp;quot;thargoid&amp;quot; personality, and the drones getting the &amp;quot;tharglet&amp;quot; personality, even if those personalities are not otherwise defined. Note that the underscore in the role prevents fallback to &amp;quot;generic&amp;quot; messages here.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== _getCommunication ====&lt;br /&gt;
 function '''_getCommunication'''(role : String, personality : String, key : String) : StringOrFunction&lt;br /&gt;
This function returns either a string suitable for passing to &amp;lt;code&amp;gt;expandDescription&amp;lt;/code&amp;gt; containing the communications for the specified key, or a function called with key and parameters returning a communications string, if a ship of the specified role and personality is speaking.&lt;br /&gt;
&lt;br /&gt;
==== _getCommunicationPersonalities ====&lt;br /&gt;
 function '''_getCommunicationPersonalities'''(role : String) : Array&lt;br /&gt;
Returns the personalities which have at least one communication key defined for the given role.&lt;br /&gt;
&lt;br /&gt;
==== _setCommunication ====&lt;br /&gt;
 function '''_setCommunication'''(role : String, personality : String, key : String, value : StringOrFunction)&lt;br /&gt;
This function sets the communications values returned by [[#getCommunication|_getCommunication]]. The value may either be:&lt;br /&gt;
* a String, which will be passed to expandDescription&lt;br /&gt;
* a Function, which will be called with two parameters: the key, and the parameters object.&lt;br /&gt;
&lt;br /&gt;
For example&lt;br /&gt;
 worldScripts[&amp;quot;oolite-libPriorityAI&amp;quot;]._setCommunication(&amp;quot;myoxp_role&amp;quot;,&amp;quot;generic&amp;quot;,&lt;br /&gt;
     &amp;quot;oolite_continuingAttack&amp;quot;,&amp;quot;[myoxp_role_continuesAttack]&amp;quot;);&lt;br /&gt;
 worldScripts[&amp;quot;oolite-libPriorityAI&amp;quot;]._setCommunication(&amp;quot;myoxp_role&amp;quot;,&amp;quot;generic&amp;quot;,&lt;br /&gt;
     &amp;quot;oolite_continuingAttack&amp;quot;,function(k,p) { return &amp;quot;Targeting the &amp;quot;+p.oolite_entityName+&amp;quot;. Cover me.&amp;quot;; });&lt;br /&gt;
&lt;br /&gt;
==== _setCommunications ====&lt;br /&gt;
 function '''_setCommunications'''(comms : Object)&lt;br /&gt;
This function can be used to set multiple communications keys at once. The format of the object is&lt;br /&gt;
 comms[role][personality][key] = value;&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_World_script_event_handlers&amp;diff=76443</id>
		<title>Oolite JavaScript Reference: World script event handlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_World_script_event_handlers&amp;diff=76443"/>
		<updated>2022-10-29T21:48:15Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* missionChoiceWasReset */ uniform null format, fixed js method&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a list of event handlers which can be implemented inside world scripts [[Scripting Oolite with JavaScript|JavaScript scripts for Oolite]]. Additionally, ship script handlers called on the player's ship will cause an equivalent world script event.&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 (which will never start with '_' or '$').&lt;br /&gt;
&lt;br /&gt;
=== Game State ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;gamePaused&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
This event is called when the game is paused. This is mainly useful for pausing sound playback which should not continue while the game is paused.&lt;br /&gt;
&lt;br /&gt;
 this.gamePaused = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;gameResumed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
This event is called when the game is resumed from pause. This is mainly useful for resuming sound playback paused in a &amp;lt;code&amp;gt;gamePaused&amp;lt;/code&amp;gt; handler.&lt;br /&gt;
&lt;br /&gt;
 this.gameResumed = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&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, therefore 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;
==== &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. This also means that it is called every time the player loads a game, begins a new game or presses space after dying. It can be used to do one-off initialisation such as copying mission variables into &amp;lt;code&amp;gt;this.*&amp;lt;/code&amp;gt; properties for efficiency or setting up data arrays to be used by the script in other handlers. (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;
Note that from Oolite 1.79 onwards the player is in the main station while this handler runs but may be moved to another station soon after.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;startUpComplete&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;startUpComplete&amp;lt;/code&amp;gt; handler is run at game startup after the initial population of the system has been complete, and after the player has been moved to the station recorded in their save game. The order of world events at game start is therefore:&lt;br /&gt;
* &amp;lt;code&amp;gt;startUp&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;systemWillPopulate&amp;lt;/code&amp;gt; (or an alternative handler specified by the system info)&lt;br /&gt;
* &amp;lt;code&amp;gt;startUpComplete&amp;lt;/code&amp;gt;&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;lt;code&amp;gt;ship.dockedStation == null&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.docked == true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.status == &amp;quot;STATUS_DOCKING&amp;quot;&amp;lt;/code&amp;gt;&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;lt;code&amp;gt;ship.dockedStation == station&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.docked == true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.status == &amp;quot;STATUS_DOCKED&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;guiScreen&amp;lt;/code&amp;gt; is either &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_REPORT&amp;quot;&amp;lt;/code&amp;gt;. 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;
==== &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;lt;code&amp;gt;ship.dockedStation == station&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.docked == false&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.status == &amp;quot;STATUS_LAUNCHING&amp;quot;&amp;lt;/code&amp;gt;.&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. The handler's argument is the station which launched the ship.&lt;br /&gt;
&lt;br /&gt;
 this.shipLaunchedFromStation = function(stationLaunchedFrom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
At this moment &amp;lt;code&amp;gt;ship.dockedStation == null&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.docked == false&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.status == &amp;quot;STATUS_IN_FLIGHT&amp;quot;&amp;lt;/code&amp;gt;.&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. The handler is called with an argument containing the station entity that is the docking target.&lt;br /&gt;
&lt;br /&gt;
 this.playerStartedAutoPilot = function(stationForDocking)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&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;
==== &amp;lt;code&amp;gt;playerDockingClearanceCancelled&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerDockingClearanceCancelled&amp;lt;/code&amp;gt; handler is called when the player withdraws their request to dock at a station. &lt;br /&gt;
&lt;br /&gt;
 this.playerDockingClearanceCancelled = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerDockingClearanceExpired&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.83}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerDockingClearanceExpired&amp;lt;/code&amp;gt; handler is called when the player exceeds the two minute window without requesting an extension&lt;br /&gt;
&lt;br /&gt;
 this.playerDockingClearanceExpired = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerDockingClearanceGranted&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerDockingClearanceGranted&amp;lt;/code&amp;gt; handler is called when the player is given permission to dock at a station. If the player is given immediate clearance to dock, this event will be called immediately after the &amp;lt;code&amp;gt;playerRequestedDockingClearance&amp;lt;/code&amp;gt; event. If, however, the station is unable to give immediate clearance, then there will be some delay between the request to dock and permission being granted. This event will be called when the station actually gives docking clearance.&lt;br /&gt;
&lt;br /&gt;
 this.playerDockingClearanceGranted = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&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;
==== &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;
==== &amp;lt;code&amp;gt;playerRescuedEscapePod&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerRescuedEscapePod&amp;lt;/code&amp;gt; handler is called when the player rescues an escape pod which does not have scripted content (all consequences of scripted content escape pods are assumed to be dealt with by the specified script instead). It has three parameters:&lt;br /&gt;
# the rescue fee, in decicredits&lt;br /&gt;
# the fee reason, which can be &amp;quot;insurance&amp;quot;, &amp;quot;bounty&amp;quot; or &amp;quot;slave&amp;quot; (in the latter case, the fee will always be zero)&lt;br /&gt;
# a dictionary like those in the &amp;lt;code&amp;gt;ship.crew&amp;lt;/code&amp;gt; property describing the pod occupant&lt;br /&gt;
&lt;br /&gt;
 this.playerRescuedEscapePod = function(fee, reason, occupant)&lt;br /&gt;
 {&lt;br /&gt;
     // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This method is called after the escape pod has been processed, but slightly before the arrival report screen giving the results of the processing is displayed to the player.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerCompletedContract&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerCompletedContract&amp;lt;/code&amp;gt; handler is called when a passenger, parcel or cargo contract ends, either successfully or by defaulting on it. It is not called when all contracts are cancelled on a galactic jump. It has four parameters:&lt;br /&gt;
# The type of contract, which can be &amp;quot;cargo&amp;quot;, &amp;quot;parcel&amp;quot; or &amp;quot;passenger&amp;quot;&lt;br /&gt;
# The result of the contract, which can be &amp;quot;success&amp;quot;, &amp;quot;late&amp;quot;, &amp;quot;failed&amp;quot;, or for cargo contracts only &amp;quot;short&amp;quot;&lt;br /&gt;
# The fee paid for the contract in decicredits&lt;br /&gt;
# The contract information dictionary&lt;br /&gt;
Note that the fee actually paid for the contract will often ''not'' match the originally agreed fee in the contract information dictionary, as penalties for late delivery or bonuses for good service are included in the fee parameter.&lt;br /&gt;
&lt;br /&gt;
 this.playerCompletedContract = function(type, result, fee, contract)&lt;br /&gt;
 {&lt;br /&gt;
     // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This method is called after the contract has been processed, but slightly before the arrival report screen giving the results of the processing is displayed to the player.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerEnteredContract&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerEnteredContract&amp;lt;/code&amp;gt; handler is called when a passenger, parcel or cargo contract starts, just after the items have been transferred to the player ship. It has two parameters:&lt;br /&gt;
# The type of contract, which can be &amp;quot;cargo&amp;quot;, &amp;quot;parcel&amp;quot; or &amp;quot;passenger&amp;quot;&lt;br /&gt;
# The contract information dictionary&lt;br /&gt;
&lt;br /&gt;
 this.playerEnteredContract = function(type, contract)&lt;br /&gt;
 {&lt;br /&gt;
     // Your code here&lt;br /&gt;
 }&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;
 // 1.80 or earlier&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;
In 1.81 or later the handler gains a second parameter, describing the jump destination. For standard and wormhole jumps, this will be the system ID of the destination system. For galactic jumps, this will be the galaxy ID of the destination galaxy. (As [[Oolite JavaScript Reference: PlayerShip#galacticHyperspaceBehaviour|player.ship.galacticHyperspaceBehaviour]] may be changed during &amp;lt;code&amp;gt;shipWillEnterWitchspace&amp;lt;/code&amp;gt;, it is not possible to predict in advance of a galactic jump being made what the resulting system ID in the destination galaxy will be)&lt;br /&gt;
&lt;br /&gt;
 // 1.81 or later&lt;br /&gt;
 this.shipWillEnterWitchspace = function(cause, destination)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&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;
*[http://www.aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=18392 Order of JS events when galactic jumping] (2016)&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 &amp;quot;T&amp;quot; (shift-t).&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;
{{oolite-method-added|1.75}}&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.&lt;br /&gt;
&lt;br /&gt;
 this.shipKilledOther = function(whom : ship, damageType : string)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipReleasedEquipment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipReleasedEquipment&amp;lt;/code&amp;gt; handler is called when a ship launches a mine (a pylon-mounted equipment item whose key ends with &amp;quot;_MINE&amp;quot;). &amp;lt;code&amp;gt;mine&amp;lt;/code&amp;gt; contains the launched mine entity.&lt;br /&gt;
&lt;br /&gt;
 this.shipReleasedEquipment = function(mine)&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 by the player. &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;
==== &amp;lt;code&amp;gt;weaponsSystemsToggled&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;weaponsSystemsToggled&amp;lt;/code&amp;gt; handler is called whenever the player toggles their weapons systems on or off. The &amp;lt;code&amp;gt;state&amp;lt;/code&amp;gt; parameter contains the new state of the weapons systems&lt;br /&gt;
&lt;br /&gt;
 this.weaponsSystemsToggled = function(state : boolean)&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;equipmentAdded&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentAdded&amp;lt;/code&amp;gt; handler is called whenever the player ship gains an item of equipment. This includes &amp;quot;gaining&amp;quot; of &amp;lt;code&amp;gt;EQ_SOMETHING_DAMAGED&amp;lt;/code&amp;gt; when an &amp;lt;code&amp;gt;EQ_SOMETHING&amp;lt;/code&amp;gt; is damaged. This event will fire regardless of the reason for the equipment being added to the ship.&lt;br /&gt;
&lt;br /&gt;
 this.equipmentAdded = function(equipmentKey)&lt;br /&gt;
 {&lt;br /&gt;
       // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This is often more convenient than monitoring both &amp;lt;code&amp;gt;equipmentRepaired&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;playerBoughtEquipment&amp;lt;/code&amp;gt;, and will also detect equipment addition by script.&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(equipmentKey)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentRemoved&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentRemoved&amp;lt;/code&amp;gt; handler is called whenever the player ship loses an item of equipment. This includes &amp;quot;losing&amp;quot; of &amp;lt;code&amp;gt;EQ_SOMETHING_DAMAGED&amp;lt;/code&amp;gt; when an &amp;lt;code&amp;gt;EQ_SOMETHING&amp;lt;/code&amp;gt; is repaired. This event will fire regardless of the reason for the equipment being removed from the ship.&lt;br /&gt;
&lt;br /&gt;
 this.equipmentRemoved = function(equipmentKey)&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(equipmentKey)&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, paid)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The 'paid' parameter is added from 1.89 onwards. This is the amount of credits the player paid for the equipment, including any refunds that might have been applied during the purchase (eg when purchasing a laser and installing it in a position where a laser is already fitted, the cost of the current laser will be refunded to the player during the purchase).&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, price)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The 'price' parameter is added from 1.81 onwards. It is the cost of the ship (not counting any trade-in value of the player's old ship) in credits, or zero for changes using [[Oolite JavaScript Reference: Player#replaceShip|&amp;lt;code&amp;gt;player.replaceShip()&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
'''Note:''' In a future release of Oolite, &amp;lt;code&amp;gt;playerBoughtNewShip&amp;lt;/code&amp;gt; will no longer be fired when the ship is replaced using [[Oolite JavaScript Reference: Player#replaceShip|&amp;lt;code&amp;gt;player.replaceShip()&amp;lt;/code&amp;gt;]]. Instead, the &amp;lt;code&amp;gt;[[#playerReplacedShip|playerReplacedShip]]&amp;lt;/code&amp;gt; event should be used. At the moment, both events (&amp;lt;code&amp;gt;playerBoughtNewShip&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;playerReplacedShip&amp;lt;/code&amp;gt;) will fire.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#playerWillBuyNewShip|playerWillBuyNewShip]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerChangedPrimedEquipment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerChangedPrimedEquipment&amp;lt;/code&amp;gt; handler is called whenever the player changes the currently primed equipment (either with shift-n or ctrl-shift-n). The equipment key of the newly primed equipment will be passed as an argument.&lt;br /&gt;
&lt;br /&gt;
 this.playerChangedPrimedEquipment = function(equipmentKey)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerReplacedShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.89}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerReplacedShip&amp;lt;/code&amp;gt; handler is called when the player ship is replaced via the JS method [[Oolite JavaScript Reference: Player#replaceShip|&amp;lt;code&amp;gt;player.replaceShip&amp;lt;/code&amp;gt;]]. May be needed to re-evaluate the old equipment as replacing a ship does not trigger equipment removal.&lt;br /&gt;
&lt;br /&gt;
 this.playerReplacedShip = function(ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#playerWillReplaceShip|playerWillReplaceShip]]&amp;lt;/code&amp;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;
==== &amp;lt;code&amp;gt;playerWillBuyNewShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.89}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerWillBuyNewShip&amp;lt;/code&amp;gt; handler is called just before 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.playerWillBuyNewShip = function(dataKey, shipyard, price, tradeIn)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; is the shipdata.plist &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; for the ship being purchased.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;shipyard&amp;lt;/code&amp;gt; is a dictionary object containing details about the ship being purchased, with information similar to the following:&lt;br /&gt;
 {&lt;br /&gt;
    short_description: &amp;quot;Python: Plus Galactic Hyperdrive. Extra Energy Unit. Docking Computers. E.C.M. System. Forward weapon upgraded to military laser. Price 215 000 ₢.&amp;quot;,&lt;br /&gt;
    shipdata_key: &amp;quot;python-player&amp;quot;,&lt;br /&gt;
    id: &amp;quot;675b6b-c60a74&amp;quot;,&lt;br /&gt;
    price: 215000,&lt;br /&gt;
    ship: {&lt;br /&gt;
      ...''[[shipdata.plist]]'' details of ship...&lt;br /&gt;
    },&lt;br /&gt;
    personality: 9807,&lt;br /&gt;
    extras: [&amp;quot;EQ_GAL_DRIVE&amp;quot;, &amp;quot;EQ_FUEL_SCOOPS&amp;quot;, &amp;quot;EQ_ENERGY_UNIT&amp;quot;, &amp;quot;EQ_FUEL_INJECTION&amp;quot;, &amp;quot;EQ_DOCK_COMP&amp;quot;, &amp;quot;EQ_ECM&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; is the amount being paid the for ship.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;tradeIn&amp;lt;/code&amp;gt; is the trade in value of the current ship.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#playerBoughtNewShip|playerBoughtNewShip]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerWillReplaceShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.89}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerWillReplaceShip&amp;lt;/code&amp;gt; handler is called just before a ship is replaced using [[Oolite JavaScript Reference: Player#replaceShip|&amp;lt;code&amp;gt;player.replaceShip()&amp;lt;/code&amp;gt;]]. 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.playerWillReplaceShip = function(dataKey)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; is the shipdata.plist &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; for the ship being purchased.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#playerReplacedShip|playerReplacedShip]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;chartHightlightModeChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.87}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;chartHighlightModeChanged&amp;lt;/code&amp;gt; handler is called whenever the highlight mode of the galactic chart is changed either manually (from player input) or programmatically (by setting the mode with &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#chartHighlightMode|player.ship.chartHightlightMode]]&amp;lt;/code&amp;gt;). The &amp;quot;newMode&amp;quot; parameter will be one of the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_SUNCOLOR&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_ECONOMY&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_GOVERNMENT&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_TECHLEVEL&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 this.chartHightlightModeChanged = function(newMode)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&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 (newday parameter) passed to the handler 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;escapePodSequenceOver&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;escapePodSequenceOver&amp;lt;/code&amp;gt; handler is called at the end of the escape pod sequence, after the &amp;lt;code&amp;gt;shipLaunchedEscapePod&amp;lt;/code&amp;gt; event and just prior to the &amp;lt;code&amp;gt;shipWillDockWithStation&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;shipDockedWithStation&amp;lt;/code&amp;gt; events. &lt;br /&gt;
&lt;br /&gt;
Use this handler if you need to override the destination for the escape pod with [[Oolite_JavaScript_Reference:_Player#setEscapePodDestination|&amp;lt;code&amp;gt;player.setEscapePodDestination()&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
 this.escapePodSequenceOver = function() &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 &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#guiScreen|guiScreen]]&amp;lt;/code&amp;gt; changes. The ''from'' parameter is the screen it is leaving and ''to'' is the screen initially being switched to. Note that the screen can have changed again in the meantime by the action of other oxps. Therefore, it is generally better to test the global &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#guiScreen|guiScreen]]&amp;lt;/code&amp;gt; to see which page is really on display instead of using the ''to'' parameter. (world script only)&lt;br /&gt;
&lt;br /&gt;
This handler will only fire when switched to/from any of the following:&lt;br /&gt;
&lt;br /&gt;
1.76: &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MAIN&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt;(F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;(F5F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;(F7), &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_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;(F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;(F3F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHORT_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LONG_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;(F8), &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_REPORT&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.77: adds &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTERFACES&amp;quot;&amp;lt;/code&amp;gt;(F4) and removes &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_CONTRACTS&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.81: adds &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKETINFO&amp;quot;&amp;lt;/code&amp;gt;(F8F8)&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 &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#guiScreen|guiScreen]]&amp;lt;/code&amp;gt; is about to change.  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 handler will only fire when switching to/from any of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;(F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;(F5F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;(F8), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;(F3F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;(F7)&lt;br /&gt;
&lt;br /&gt;
1.77: adds &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTERFACES&amp;quot;&amp;lt;/code&amp;gt;(F4), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt;(F5)&lt;br /&gt;
&lt;br /&gt;
1.81: adds &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKETINFO&amp;quot;&amp;lt;/code&amp;gt;(F8F8)&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;infoSystemChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.83}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;infoSystemChanged&amp;lt;/code&amp;gt; handler is called when the system displayed in F7 is changed, e.g. by moving the small blue cursor along the planned route in the chart.&lt;br /&gt;
&lt;br /&gt;
 this.infoSystemChanged = 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;infoSystemWillChange&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;infoSystemWChange&amp;lt;/code&amp;gt; handler is called just before the system displayed in F7 is updated, e.g. by moving the small blue cursor along the planned route in the chart.&lt;br /&gt;
&lt;br /&gt;
 this.infoSystemWillChange = 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;mfdKeyChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;mfdKeyChanged&amp;lt;/code&amp;gt; handler is called whenever the player changes the content of an MFD slot. The &amp;lt;code&amp;gt;activeMFD&amp;lt;/code&amp;gt; parameter identifies which MFD slot is being changed, and the &amp;lt;code&amp;gt;mfdKey&amp;lt;/code&amp;gt; specifies the key code now in use in this slot.&lt;br /&gt;
&lt;br /&gt;
 this.mfdKeyChanged = function(activeMFD : integer, mfdKey : string)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#setMultiFunctionDisplay|PlayerShip.setMultiFunctionDisplay()]]&amp;lt;/code&amp;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 &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; via script (either using the legacy script method resetMissionChice or using &amp;lt;code&amp;gt;mission.runScreen ({choices: null})&amp;lt;/code&amp;gt; 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 a mission screen ends. Note that another script may have put up a new mission screen 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's ship is docked. It gets fired at game startup, upon docking and after an arrival 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 from other handlers. It fires for every installed OXP/OXZ until one creates a mission screen during this handler, and then it stops. When the mission screen ends and there is no callback function that creates a new mission screen, the &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; is sent again to all installed OXPs/OXZs starting with the one that created the last mission screen. All this means is that when this handler fires, it is safe to show a mission screen and no further tests 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;selectedMFDChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;selectedMFDChanged&amp;lt;/code&amp;gt; handler is send whenever the player selects a new MFD slot (normally using the default keypress &amp;quot;;&amp;quot;). The &amp;lt;code&amp;gt;activeMFD&amp;lt;/code&amp;gt; paramater is the index of the MFD which is now active.&lt;br /&gt;
&lt;br /&gt;
 this.selectedMFDChanged = function(activeMFD : integer)&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 worldScript 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 the &amp;lt;code&amp;gt;escapePodSequenceOver&amp;lt;/code&amp;gt; event, and then 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;systemInformationChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;systemInformationChanged&amp;lt;/code&amp;gt; handler is called when system information is modified. It is passed the galaxy and system ID which were changed, and the key and new value in the SystemInfo object.&lt;br /&gt;
&lt;br /&gt;
To avoid problems with recursion, attempting to change the value of any system information property from within this handler will fail and log an error. Also note that changes which take place while Oolite is not running (from OXP planetinfo.plist files) will not cause this handler to be called when the game is reloaded.&lt;br /&gt;
&lt;br /&gt;
 this.systemInformationChanged = function(galaxy,system,key,newValue)&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;
=== System population ===&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.79 and later, functions are called to populate and repopulate the system. These functions do not have fixed names, as they depend on the system, but otherwise act like normal worldscript functions. [[Oolite System Populator|The populator page]] has more documentation on these functions.&lt;br /&gt;
&lt;br /&gt;
=== Defunct ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentDestroyed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
''Handler no longer exists in current stable version 1.80''&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, 1.77 or earlier only)  (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;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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_VisualEffect&amp;diff=76441</id>
		<title>Oolite JavaScript Reference: VisualEffect</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_VisualEffect&amp;diff=76441"/>
		<updated>2022-10-29T21:17:25Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* scannerDisplayColor1 */ uniform null format&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;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;VisualEffect&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 visible but non-solid object defined from [[effectdata.plist]]. It has all the properties and methods of an Entity, and several others.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Unless otherwise stated {{oolite-prop-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;beaconCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''beaconCode''' : String (read-write)&lt;br /&gt;
If the effect 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;
=== &amp;lt;code&amp;gt;beaconLabel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''beaconLabel''' : String (read/write)&lt;br /&gt;
A full label for the beacon. This is useful where the beacon code and the full beacon label do not begin with the same letter.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''dataKey''' : String (read-only)&lt;br /&gt;
The data key from [[effectdata.plist]] used to generate this visual effect.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hullHeatLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''hullHeatLevel''' : Float (read/write)&lt;br /&gt;
While visual effects do not have a temperature as such, this property is provided to allow easy compatibility with the default Oolite shader for ships.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;isBreakPattern&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''isBreakPattern''' : Boolean (read/write)&lt;br /&gt;
If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the VisualEffect object will remain visible while break patterns on docking, launching or witchspace are being displayed (or not displayed). Normally all objects other than the break pattern itself are hidden.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scaleX&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;scaleY&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;scaleZ&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scaleX''' : positive Float (read/write)&lt;br /&gt;
 '''scaleY''' : positive Float (read/write)&lt;br /&gt;
 '''scaleZ''' : positive Float (read/write)&lt;br /&gt;
&lt;br /&gt;
Adjust the apparent size of the visual effect along each of its main axes. Subentity visual effects will be repositioned and rescaled accordingly. Subentity flashers will be repositioned and resized to keep a roughly proportionate volume, but not rescaled (as flashers are always spherical).&lt;br /&gt;
&lt;br /&gt;
 effect.scaleX = effect.scaleY = effect.scaleZ = newsize;&lt;br /&gt;
is equivalent to&lt;br /&gt;
 effect.scale(newsize);&lt;br /&gt;
if you need to rescale the effect uniformly&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 [[effectdata.plist]].&lt;br /&gt;
&lt;br /&gt;
If both this and &amp;lt;code&amp;gt;scannerDisplayColor2&amp;lt;/code&amp;gt; are set to &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;, and no value is set for either in [[effectdata.plist]] then the effect will not appear on scanners.&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;script&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''script''' : [[Oolite JavaScript Reference: Script|Script]] (read-only)&lt;br /&gt;
The effect’s script. See the &amp;quot;Effect Scripts&amp;quot; section below for more details.&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 effect’s ''[[effectdata.plist]]'' entry, if any. This may be any [[property list]] object, but the recommended 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 explicitly 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;shader*&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''shaderFloat1''' : Number (read/write)&lt;br /&gt;
 '''shaderFloat2''' : Number (read/write)&lt;br /&gt;
 '''shaderInt1''' : Number (read/write)&lt;br /&gt;
 '''shaderInt2''' : Number (read/write)&lt;br /&gt;
 '''shaderVector1''' : Vector (read/write)&lt;br /&gt;
 '''shaderVector2''' : Vector (read/write)&lt;br /&gt;
Since visual effects have very few intrinsic properties, some arbitrary parameters which may be bound as shader uniforms are provided.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;subEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''subEntities''' : Array (read-only)&lt;br /&gt;
A list of those subentities which are also visual effects&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getMaterials&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''getMaterials'''() : Object&lt;br /&gt;
getMaterials() returns the effect's current materials dictionary, or if none present an empty dictionary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getShaders|getShaders()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getShaders&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''getShaders'''() : Object&lt;br /&gt;
getShaders() returns the effect's current shaders dictionary, or if none present an empty dictionary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setShaders|setShaders()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getMaterials|getMaterials()]]&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'''()&lt;br /&gt;
Immediately removes the effect from the universe.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;restoreSubEntities&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''restoreSubEntities'''()&lt;br /&gt;
Restores all missing subentities. Returns the number of subentities restored.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''scale'''(factor : Number)&lt;br /&gt;
Multiplies the size of the visual effect by &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt;. Subentities will be rescaled as well, and moved further from the centre of the effect as appropriate. An error will occur if &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; is less than or equal to zero.&lt;br /&gt;
&lt;br /&gt;
Note that this method resizes relative to the objects ''original'' size, not its current size. &amp;lt;code&amp;gt;scale(1)&amp;lt;/code&amp;gt; will therefore always return to the original size.&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 effect’s model. This works exactly like the &amp;lt;code&amp;gt;materials&amp;lt;/code&amp;gt; dictionary in [[effectdata.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;
 effect.setMaterials({&amp;quot;my_effect_diffuse.png&amp;quot;: { diffuse_map: &amp;quot;my_effect_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;, &amp;lt;code&amp;gt;[[#getMaterials|getMaterials()]]&amp;lt;/code&amp;gt;&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 effect’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 effect’s current material dictionary.&lt;br /&gt;
 &lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getShaders|getShaders()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effect Scripts ==&lt;br /&gt;
&lt;br /&gt;
Visual Effects may have an effect script attached to them. These work in a similar way to ship scripts, but define different handlers and properties. As with ship scripts, there will be a separate independent copy of the script for each visual effect.&lt;br /&gt;
&lt;br /&gt;
Effects scripts have one property, &amp;lt;code&amp;gt;this.visualEffect&amp;lt;/code&amp;gt;, which is a reference to the visual effect this is a script for. They have the following event handlers.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;effectRemoved&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;effectRemoved&amp;lt;/code&amp;gt; handler is called when the effect is removed from the universe, either by the [[#remove|remove]] method or automatically when the player leaves the system. This is a good place to clean up any frame callbacks or timers associated with this effect.&lt;br /&gt;
&lt;br /&gt;
 this.effectRemoved = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;effectSpawned&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;effectSpawned&amp;lt;/code&amp;gt; handler is called on the first update after the effect is added to the universe.&lt;br /&gt;
&lt;br /&gt;
 this.effectSpawned = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_SystemInfo&amp;diff=76440</id>
		<title>Oolite JavaScript Reference: SystemInfo</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_SystemInfo&amp;diff=76440"/>
		<updated>2022-10-29T21:06:49Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* routeToSystem */ uniform null format&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 star system. &amp;lt;code&amp;gt;SystemInfo&amp;lt;/code&amp;gt;s can be retrieved for any system in any galaxy as of version 1.82. In previous versions, only systems for the current galaxy could be read.&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;
Warning: in version 1.76 or earlier there is a bug in this method which may cause a crash if either the start or end of the route is in interstellar space (i.e. system ID -1). In later versions this simply returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;samplePrice&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''samplePrice'''(commodity : String) : Array&lt;br /&gt;
Return a sample main market price in decicredits for the commodity with that key in this system. As this requires reading system information, it will only work for systems in the current galaxy. There is of course no guarantee that the price returned by this method will be anywhere near the actual price when the system is next entered.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setProperty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setProperty'''(layer: Number, key : String, value: String [, manifest: String])&lt;br /&gt;
&lt;br /&gt;
This lets you set properties with more control than provided by writing directly to &amp;lt;code&amp;gt;systemInfo.property&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;layer&amp;lt;/code&amp;gt; is the layer from 0 to 3 that the change should be applied at, as in [[planetinfo.plist]]. Layer 2 is the default layer for Javascript-initiated changes, but 3 may be used for changes absolutely crucial for OXP functionality.&lt;br /&gt;
&lt;br /&gt;
It is also possible to make changes on behalf of a different OXP by passing the manifest ID of that OXP as the fourth parameter. Otherwise the OXP responsible for the current script execution context will be used.&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;
== 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;
=== &amp;lt;code&amp;gt;setInterstellarProperty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInterstellarProperty'''(galaxy : Number, fromsystem : Number, tosystem : Number, layer: Number, key : String, value: String, [, manifest: String])&lt;br /&gt;
&lt;br /&gt;
This is similar to [[#setProperty|setProperty]] but for setting properties of interstellar space regions. Changes made to the current interstellar space region will only take effect if the player leaves and returns. &lt;br /&gt;
&lt;br /&gt;
Note that the order of fromsystem (the last real system visited) and tosystem (the target of the latest jump) is significant - 0,7,55 is Lave to Leesti; 0,55,7 is Leesti to Lave. In many cases setting the same change for both directions may be necessary.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=76439</id>
		<title>Oolite JavaScript Reference: System</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_System&amp;diff=76439"/>
		<updated>2022-10-29T21:02:10Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* setPopulator */ uniform null format&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 star 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;ambientLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''ambientLevel''' : float (read/write)&lt;br /&gt;
Adjusts the level of ambient light in the current system. Values should typically be between 0.0 and 1.0 (1.0 is the default) but can be higher for a flat lit, cartoon-like effect. This is will override the &amp;quot;ambient_level&amp;quot; setting defined in [[Planetinfo.plist]]. The change is not permanent and will be reset when the system is reloaded.&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, &amp;lt;code&amp;gt;&amp;quot;Mostly Industrial&amp;quot;&amp;lt;/code&amp;gt;. 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, &amp;lt;code&amp;gt;&amp;quot;Democracy&amp;quot;&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;&amp;quot;Slimy Blue Frogs&amp;quot;&amp;lt;/code&amp;gt;.&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Planet#isMainPlanet|planet.isMainPlanet]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#isMainStation|station.isMainStation]]&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/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;populatorSettings&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''populatorSettings''' : Dictionary (read-only)&lt;br /&gt;
The current [[Oolite_System_Populator|populator settings]]. This is only useful to read while the system population is being prepared. After that point, further changes are meaningless.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#setPopulator|setPopulator]]&amp;lt;/code&amp;gt;&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;stations&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''stations''' : Array (read-only)&lt;br /&gt;
A list of the stations in the system.&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;
=== &amp;lt;code&amp;gt;wormholes&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''wormholes''' : Array (read-only)&lt;br /&gt;
A list of the [[Oolite_JavaScript_Reference:_Wormhole|wormholes]] in the system.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;waypoints&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''waypoints''' : Array (read-only)&lt;br /&gt;
A dictionary of the [[Oolite_JavaScript_Reference:_Waypoint|waypoints]] in the system by key and value.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#setWaypoint|setWaypoint()]]&amp;lt;/code&amp;gt;&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 [[Oolite_JavaScript_Reference:_Vector3D#fromCoordinateSystem|fromCoordinateSystem]] method to convert legacy type coordinates to absolute coordinates.&lt;br /&gt;
&lt;br /&gt;
If you wish to add ships of a specific shipdata key, pass the key as the &amp;quot;role&amp;quot; parameter, enclosed in square brackets.&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;&amp;quot;wp&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;pw&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;ws&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;sw&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;sp&amp;quot;&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;&amp;quot;ps&amp;quot;&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;&amp;quot;w&amp;quot;&amp;lt;/code&amp;gt; stands for the witchpoint, &amp;lt;code&amp;gt;&amp;quot;p&amp;quot;&amp;lt;/code&amp;gt; for the planet and &amp;lt;code&amp;gt;&amp;quot;s&amp;quot;&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 methods 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;locationFromCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''locationFromCode'''(code) : Vector&lt;br /&gt;
Returns a random location in the region specified by the code string. The code strings are the same as used by the  [[Oolite_System_Populator|Oolite populator]]&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;
{{QuoteText|Text=scrambledPseudoRandomNumber, was invented to generate 'random' numbers that are always the same for a given system. Useful to only add stations in certain systems and consistently over time. The salt was added to prevent all oxp's selecting the same 'random' choice for a given system. |Source=([http://oolite.aegidian.org/bb/viewtopic.php?p=193483#p193483 Eric Walch])}}&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random math.random]&amp;lt;/code&amp;gt;&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;setPopulator&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setPopulator'''(key : String, definition : Object)&lt;br /&gt;
Sets the [[Oolite_System_Populator|populator settings]] for the specified key to the given definition, or deletes them if the definition is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. Calling this outside of the system population set up is possible but useless. See the populator settings page for more information on the format of the &amp;lt;code&amp;gt;definition&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#populatorSettings|populatorSettings]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setWaypoint&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setWaypoint'''(key : String, position : VectorExpression, orientation : QuaternionExpression, parameters : Object)&lt;br /&gt;
Adds a [[Oolite_JavaScript_Reference:_Waypoint|waypoint]] to the system with the given &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;, placed at the specified &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;orientation&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;parameter&amp;lt;/code&amp;gt; is an object with the following optional keys:&lt;br /&gt;
* '''size''': the radius of the waypoint in metres&lt;br /&gt;
* '''beaconCode''': the beacon code (default &amp;quot;W&amp;quot;)&lt;br /&gt;
* '''beaconLabel''': the beacon label (default &amp;quot;Waypoint&amp;quot;)&lt;br /&gt;
Waypoints will be visible only when the player has a working Advanced Space Compass.&lt;br /&gt;
&lt;br /&gt;
 '''setWaypoint'''(key : String)&lt;br /&gt;
Removes the waypoint with the specified &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;, if it exists.&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.81, waypoints can either be oriented (the 1.80 default) or unoriented. Unoriented waypoints do not display the directional arrows. To create an unoriented waypoint, set its orientation to the zero quaternion (0,0,0,0) either on creation or later.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#waypoints|waypoints]]&amp;lt;/code&amp;gt;&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;[[#shipsWithPrimaryRole|shipsWithPrimaryRole()]]&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;
== 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;lt;code&amp;gt;&amp;quot;This is a dull planet.&amp;quot;&amp;lt;/code&amp;gt;&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;lt;code&amp;gt;&amp;quot;This is a dull planet.&amp;quot;&amp;lt;/code&amp;gt; if called from galaxy 0, and throw an exception if called from the other galaxies.&lt;br /&gt;
&lt;br /&gt;
Of particular note the spelling of the '''techlevel''' property when using the infoForSystem method to extract it. While the property of &amp;lt;code&amp;gt;system.'''techLevel'''&amp;lt;/code&amp;gt; is spelt using camelCase, &amp;lt;code&amp;gt;System.infoForSystem(0, 55).'''techlevel'''&amp;lt;/code&amp;gt; is all lowercase. This is because planetinfo.plist has always had the techlevel key spelt this way.&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 &amp;lt;code&amp;gt;&amp;quot;Inzaan&amp;quot;&amp;lt;/code&amp;gt;. &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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_PlayerShip&amp;diff=76438</id>
		<title>Oolite JavaScript Reference: PlayerShip</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_PlayerShip&amp;diff=76438"/>
		<updated>2022-10-29T20:53:46Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* currentWeapon */ uniform null format&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 PlayerShip 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;activeMissile&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.89}}&lt;br /&gt;
 '''activeMissile''' : Number (read-only integer)&lt;br /&gt;
Index in the [[Oolite_JavaScript_Reference:_Ship#missiles|&amp;lt;code&amp;gt;missiles&amp;lt;/code&amp;gt;]] array of the currently selected missile.&lt;br /&gt;
&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 in 1.80 and earlier, read/write in 1.81 and later, 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. In 1.80 and earlier always the same as &amp;lt;code&amp;gt;[[#forwardShieldRechargeRate|forwardShieldRechargeRate]]&amp;lt;/code&amp;gt;, but this is not the case from 1.81.&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;chartHighlightMode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.87}}&lt;br /&gt;
&lt;br /&gt;
 '''chartHighlightMode''' : String (read/write)&lt;br /&gt;
Gets/sets the type of highlight being shown on the galactic chart. Can be any one of the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_SUNCOLOR&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_ECONOMY&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_GOVERNMENT&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_TECHLEVEL&amp;quot;&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 in 1.84 and earlier, read/write in 1.85 and later)&lt;br /&gt;
Gets/sets the current compass mode, which can be any one of the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;COMPASS_MODE_BASIC&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;COMPASS_MODE_PLANET&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;COMPASS_MODE_STATION&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;COMPASS_MODE_SUN&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;COMPASS_MODE_TARGET&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;COMPASS_MODE_BEACONS&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;compassTarget&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''compassTarget''' : Entity(read-only in 1.84 and earlier, read/write in 1.85 and later)&lt;br /&gt;
Gets/sets the entity currently targeted by the compass. When setting this value, the entity must be valid, and have a compass beacon.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;compassType&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''compassType''' : String (read-only in 1.84 and earlier, read/write in 1.85 and later)&lt;br /&gt;
Gets/sets the current space compass type, which can be one of the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OO_COMPASSTYPE_BASIC&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OO_COMPASSTYPE_ADVANCED&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;crosshairs&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''crosshairs''' : String (read/write)&lt;br /&gt;
The name of the [[Crosshairs.plist|crosshairs.plist]] defining the ship’s weapon crosshairs. HUDs can define crosshairs separately. This value will be &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if the HUD built-in crosshairs are in use, and setting it to &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; will revert to the default HUD crosshairs.&lt;br /&gt;
&lt;br /&gt;
If the HUD is changed, the old value of this property will be discarded, and the HUD's default crosshairs will be used.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;currentWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''currentWeapon''' : EquipmentInfo (read/write)&lt;br /&gt;
A shortcut property to whichever of [[Oolite_JavaScript_Reference:_Ship#aftWeapon|aftWeapon]], [[Oolite_JavaScript_Reference:_Ship#forwardWeapon|forwardWeapon]], [[Oolite_JavaScript_Reference:_Ship#portWeapon|portWeapon]] or [[Oolite_JavaScript_Reference:_Ship#starboardWeapon|starboardWeapon]] is the currently active player weapon.&lt;br /&gt;
&lt;br /&gt;
If the player is on a screen with no active weapon (e.g. docked, or viewing the status screens) then this will always be &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; and attempting to write to it will give an error.&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;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 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;extraCargo&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''extraCargo''' : Number (read-only integer)&lt;br /&gt;
The amount the &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt; increases when a [[Cargo Bay Expansion]] is installed. The corresponding ''shipdata.plist'' key is &amp;lt;code&amp;gt;[[Shipdata.plist#extra_cargo|extra_cargo]]&amp;lt;/code&amp;gt;.  Note that although this property can be used to check non-player ships, it only contains the value for the player ship.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &lt;br /&gt;
&amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fastEquipmentA&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''fastEquipmentA''' : String (read/write)&lt;br /&gt;
Gets/sets the equipment key of primable equipment item currently assigned to the fast affinity defensive slot (default key: 0).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;fastEquipmentB&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''fastEquipmentB''' : String (read/write)&lt;br /&gt;
Gets/sets the equipment key of primable equipment item currently assigned to the fast affinity offensive slot (default key: TAB).&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 in 1.80 and earlier, read/write in 1.81 and later, 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. In 1.80 and earlier always the same as &amp;lt;code&amp;gt;[[#aftShieldRechargeRate|aftShieldRechargeRate]]&amp;lt;/code&amp;gt;, but this is no longer the case in 1.81&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;hudAllowsBigGui&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.83}}&lt;br /&gt;
&lt;br /&gt;
 '''hudAllowsBigGui''' : Boolean (read-only)&lt;br /&gt;
Whether the HUD allows a &amp;quot;big GUI&amp;quot; or not. Most useful for determining whether mission screens will have 21 or 27 lines.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;hudHidden&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, this will also be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; even if the HUD would not normally allow a big GUI.&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;hyperspaceSpinTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
 '''hyperspaceSpinTime''' : Number (read-only, read/write in 1.81)&lt;br /&gt;
The length of the ship's hyperspace countdown.&lt;br /&gt;
&lt;br /&gt;
Setting this to a negative value disables the drive entirely.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;infoSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.83}}&lt;br /&gt;
&lt;br /&gt;
 '''infoSystem''' : Number (read/write)&lt;br /&gt;
The ID of the system shown in the system (F7) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;injectorsEngaged&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
 '''injectorsEngaged''' : Boolean(read-only)&lt;br /&gt;
Is the player ship currently using [[Witch Fuel Injectors|fuel injection]].&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;
'''Example:'''&lt;br /&gt;
 // addressed as a property of playerShip&lt;br /&gt;
 player.ship.manifest.food = 5&lt;br /&gt;
 // addressed as a class of its own&lt;br /&gt;
 manifest.food = 5&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#extraCargo|extraCargo]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addCargoEntity|addCargoEntity()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeAllCargo|removeAllCargo()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;massLockable&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.85}}&lt;br /&gt;
 '''massLockable''' : Boolean (read/write)&lt;br /&gt;
Indicates whether the player ship can be mass-locked.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxAftShield&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxAftShield''' : Number (read-only in 1.80 and earlier, read/write in 1.81 and later, 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. In 1.80 and earlier always the same as &amp;lt;code&amp;gt;[[#maxForwardShield|maxForwardShield]]&amp;lt;/code&amp;gt;, but this is not necessarily true from 1.81.&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 in 1.80 and earlier, read/write in 1.81 and later, 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. In 1.80 and earlier always the same as &amp;lt;code&amp;gt;[[#maxAftShield|maxAftShield]]&amp;lt;/code&amp;gt;, but this is not necessarily true from 1.81.&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;missilesOnline&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
 '''missilesOnline''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship's targeting system is currently in missile targeting mode, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if it is currently in identification mode.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;messageGuiTextColor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
 '''messageGuiTextColor''' : [[Materials in Oolite#Colour specifiers|Color specifier]] (read/write)&lt;br /&gt;
Gets/sets the color used by the message GUI component of the HUD to display text messages.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;messageGuiTextCommsColor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
 '''messageGuiTextCommsColor''' : [[Materials in Oolite#Colour specifiers|Color specifier]] (read/write)&lt;br /&gt;
Gets/sets the color used by the message GUI component of the HUD to display comms messages.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;multiFunctionDisplayList&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
 '''multiFunctionDisplayList''' : Array (read-only, strings)&lt;br /&gt;
The IDs of the currently active multi-function displays&lt;br /&gt;
&lt;br /&gt;
e.g.&lt;br /&gt;
 [null, &amp;quot;myoxp_mfd1&amp;quot;] // My OXP MFD1 in the second display, first display blank&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;multiFunctionDisplays&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
 '''multiFunctionDisplays''' : Number (read-only, integer)&lt;br /&gt;
The number of multi-function displays available on the current HUD.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;nextSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
 '''nextSystem''' : Integer (read-only)&lt;br /&gt;
The ID of the next hyperspace system, if the player has a multi-step course plotted on the galactic chart.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#targetSystem|targetSystem]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
 '''price''' : Number (read-only, positive integer in decicredits)&lt;br /&gt;
The value the player's ship would have, including equipment, if in a perfect servicing state. The ship can be exchanged at a shipyard for 75% of this value if it really is in perfect servicing state.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;primedEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
 '''primedEquipment''' : String (read/write)&lt;br /&gt;
Gets/sets the equipment key of current primed equipment item. When setting, the change will happen silently (i.e., there will be no console message informing the player of the change).&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#setPrimedEquipment|setPrimedEquipment()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;renovationCost&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
 '''renovationCost''' : Number (read-only, positive integer in decicredits)&lt;br /&gt;
The current price in decicredits to service the ship. Depending on the [[#serviceLevel|serviceLevel]] it may not be possible to actually purchase renovation at this time.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;renovationMultiplier&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
 '''renovationMultiplier''' : Number (read-only, positive)&lt;br /&gt;
The multiplier applied to the base cost of renovation (&amp;lt;code&amp;gt;renovationCost&amp;lt;/code&amp;gt; already includes this multiplier) to allow for some ships being more difficult to maintain than others. The default is 1.0 - other values are set in [[Shipyard.plist#renovation_multiplier|shipyard.plist]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;reticleColorTarget&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
 '''reticleColorTarget''' : [[Materials in Oolite#Colour specifiers|Color specifier]] (read/write)&lt;br /&gt;
Gets/sets the color used to highlight a target on the HUD.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#reticleColorTargetSensitive|reticleColorTargetSensitive()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;reticleColorTargetSenstive&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
 '''reticleColorTargetSensitive''' : [[Materials in Oolite#Colour specifiers|Color specifier]] (read/write)&lt;br /&gt;
Gets/sets the color used to highlight a target on the HUD when it is lined up (the &amp;lt;code&amp;gt;reticleTargetSensitive&amp;lt;/code&amp;gt; property must be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#reticleColorTarget|reticleColorTarget()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#reticleTargetSenstive|reticleTargetSensitive]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;reticleColorWormhole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
 '''reticleColorWormhole''' : [[Materials in Oolite#Colour specifiers|Color specifier]] (read/write)&lt;br /&gt;
Gets/sets the color used to highlight a wormhole on the HUD.&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 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; and the [[Scanner Targeting Enhancement]] is installed, the selected target reticle will turn red when the target is in the player’s sights. This is equivalent to the &amp;lt;code&amp;gt;[[Hud.plist#reticle_target_sensitive|reticle_target_sensitive]]&amp;lt;/code&amp;gt; key in HUD plists.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;routeMode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''routeMode''' : String (read-only)&lt;br /&gt;
Gives the current mode of the [[Advanced Navigational Array]]. Three possible values&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OPTIMIZED_BY_NONE&amp;quot;&amp;lt;/code&amp;gt;: off, or not fitted&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OPTIMIZED_BY_JUMPS&amp;quot;&amp;lt;/code&amp;gt;: shortest route&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OPTIMIZED_BY_TIME&amp;quot;&amp;lt;/code&amp;gt;: quickest route&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerNonLinear&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scannerNonLinear''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the scanner is operating in non-linear mode. This property will be reset to the HUD default if the HUD is changed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerUltraZoom&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''scannerUltraZoom''' : Boolean (read/write)&lt;br /&gt;
If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the scanner has 1x, 2x, 4x, 8x and 16x zoom modes, rather than the conventional 1x, 2x, 3x, 4x and 5x. This property will be reset to the HUD default if the HUD is changed.&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 Scoops|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;serviceLevel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''serviceLevel''' : Number (read/write, positive integer in range 75-100)&lt;br /&gt;
The level of servicing the player's ship has. Renovation will be offered in shipyards at 85 or below, and malfunctions are more likely at lower values. This affects the sales price of the ship.&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;.  This will not be listed in the manifest.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#useSpecialCargo|useSpecialCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeAllCargo|removeAllCargo()]]&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, sometimes read/write in 1.77)&lt;br /&gt;
The ID of the selected hyperspace target system. In 1.77, it can be written to if the player's ship is docked. The target system is the final destination system if the player has a multi-jump course plotted on the galactic chart.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#nextSystem|nextSystem]]()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;torusEngaged&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''torusEngaged''' : Boolean(read-only)&lt;br /&gt;
Is the player ship currently using [[Torus Drive|torus drive]].&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;viewPosition*&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''viewPositionAft''' : Vector (read-only)&lt;br /&gt;
 '''viewPositionForward''' : Vector (read-only)&lt;br /&gt;
 '''viewPositionPort''' : Vector (read-only)&lt;br /&gt;
 '''viewPositionStarboard''' : Vector (read-only)&lt;br /&gt;
The ship's 4 point-of-view positions in XYZ relative to the model. The corresponding ''[[shipdata.plist]]'' keys start with &amp;lt;code&amp;gt;view_position_&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;addCargoEntity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''addCargoEntity'''(cargo : ShipEntity [, processEvents : Boolean [, processMessages : Boolean]]) : Boolean&lt;br /&gt;
Adds a cargo entity directly to the player's cargo hold. This can be performed only under the following conditions: the player's ship is in space with enough [[Oolite JavaScript Reference: Ship#cargoSpaceAvailable|free cargo capacity]], the cargo item passed to the method must be a valid ship entity and able to be [[Fuel Scoops|scooped]]. Will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the cargo item was successfully added to the player ship, otherwise &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The optional &amp;lt;code&amp;gt;processEvents&amp;lt;/code&amp;gt; parameter controls whether or not standard scooping events (&amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship script event handlers#shipWasScooped|shipWasScooped]]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: World script event handlers#shipScoopedOther|shipScoopedOther]]&amp;lt;/code&amp;gt;) will be performed when the ship is added. The default is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The optional &amp;lt;code&amp;gt;processMessages&amp;lt;/code&amp;gt; parameter controls whether or not any of the standard scooping messages (eg. &amp;quot;1t Computers&amp;quot;) will be displayed. The default is &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#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#manifest|manifest]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addParcel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''addParcel'''(name : String, start : Number, destination : Number, arrivalTime : Number, fee : Number [, advance: Number [, risk: Number]]) : Boolean&lt;br /&gt;
Add a parcel 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 already a parcel with that name or the arrival time is invalid.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;advance&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;risk&amp;lt;/code&amp;gt; parameters were added in Oolite 1.79. &amp;lt;code&amp;gt;advance&amp;lt;/code&amp;gt; is purely advisory and describes any up-front payment given for the parcel. &amp;lt;code&amp;gt;risk&amp;lt;/code&amp;gt; can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: the higher the number, the more likely that assassins will try to kill the player carrying this parcel.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#parcelCount|parcelCount]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#parcels|parcels]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeParcel|removeParcel()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&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 [, advance: Number [, risk: 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, there is already a passenger with that name 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 initial payment is made. In versions after 1.77, an optional parameter can be added to describe what the advance ''was'', without actually making it.&lt;br /&gt;
&lt;br /&gt;
The risk parameter was added in Oolite 1.79. &amp;lt;code&amp;gt;risk&amp;lt;/code&amp;gt; can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;: the higher the number, the more likely that assassins will try to kill the player carrying this passenger.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengerCapacity|passengerCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengerCount|passengerCount]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengers|passengers]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;&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 [, premium : 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;
&lt;br /&gt;
'''N.B.''' Normally to get a contract, the player will have to pay a deposit similar in value to the cargo. Using this method, no deposit payment is made. In versions after 1.77, an optional parameter can be added to describe what the deposit payment ''was'', without actually making it.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#contracts|contracts]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#removeContract|removeContract()]]&amp;lt;/code&amp;gt;&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;beginHyperspaceCountdown&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''beginHyperspaceCountdown'''( [ length : Number ] ) : Boolean&lt;br /&gt;
This method begins the witchspace sequence for the player ship. It returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the sequence is started successfully, and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise (no destination selected, insufficient fuel, out of range, etc.). Optionally, the length of the countdown can be varied. Values between 5 and 60 seconds are accepted. If this parameter is omitted the default sequence length for this class of ship will be used.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#cancelHyperspaceCountdown|cancelHyperspaceCountdown]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cancelDockingRequest&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''cancelDockingRequest'''(station : Station)&lt;br /&gt;
Tells the station to cancel a previous request for docking. If the player isn't currently waiting for clearance, or doesn't already have clearance, this method will do nothing&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requestDockingClearance|requestDockingClearance]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cancelHyperspaceCountdown&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''cancelHyperspaceCountdown'''() : Boolean&lt;br /&gt;
This method cancels the witchspace sequence for the player ship. It returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if there was an ongoing sequence to cancel, and &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;[[#beginHyperspaceCountdown|beginHyperspaceCountdown]]&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;hideHUDSelector&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''hideHUDSelector'''(selector : String)&lt;br /&gt;
Hide all dials using the specified [[Hud.plist#selector|selector]] on the HUD display. For example&lt;br /&gt;
&lt;br /&gt;
 player.ship.hideHUDSelector(&amp;quot;drawScanner:&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#showHUDSelector|showHUDSelector()]]&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 that are measured in tons (including [[#specialCargo|special cargo]]). Does not affect gold, platinum or gem stones. Can only be used while docked.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#manifest|manifest]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeContract&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''removeContract'''(commodity : String, destination : Number)&lt;br /&gt;
Remove the cargo contract matching that commodity and destination.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#contracts|contracts]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#awardContract|awardContract()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeParcel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''removeParcel'''(name : String)&lt;br /&gt;
Remove a named parcel.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#parcelCount|parcelCount]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#parcels|parcels]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addParcel|addParcel()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengerCapacity|passengerCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengerCount|passengerCount]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengers|passengers]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requestDockingClearance&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''requestDockingClearance'''(station : Station)&lt;br /&gt;
Sends the station a request to dock. If the station has already granted docking clearance, or is currently processing a previous request, this method will do nothing.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#cancelDockingRequest|cancelDockingRequest]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;resetCustomView&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''resetCustomView'''()&lt;br /&gt;
Resets the custom view back to the last-used setting defined in [[shipdata.plist]]&lt;br /&gt;
&lt;br /&gt;
This method gives an error if used when the custom view camera is not selected.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;resetScannerZoom&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''resetScannerZoom'''()&lt;br /&gt;
Resets the scanner zoom back to 1:1&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCustomView&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''setCustomView'''(Vector : position, Quaternion : orientation [,WeaponDirection weapon])&lt;br /&gt;
Set the position and orientation of the custom view camera to those specified. As with the custom views specified through [[shipdata.plist]], these are relative to the player's ship's position, and the coordinate frame defined by the ship's forward, right and up Vectors.&lt;br /&gt;
&lt;br /&gt;
The optional weapon parameter can be &amp;quot;FORWARD&amp;quot;, &amp;quot;AFT&amp;quot;, &amp;quot;PORT&amp;quot; or &amp;quot;STARBOARD&amp;quot; and sets the active weapon accordingly. If omitted, the active weapon for the previous custom view will be preserved.&lt;br /&gt;
&lt;br /&gt;
This method gives an error if used when the custom view camera is not selected. Setting the custom view does not affect the custom views defined in [[shipdata.plist]], which will be switched back to the next time 'v' is pressed, or when [[#resetCustomView|resetCustomView]] is called.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCustomHUDDial&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setCustomHUDDial'''(key : String, value : Value)&lt;br /&gt;
Sets the custom HUD dial [[hud.plist#data_source|data source]] 'key' to the specified value. Different types of custom HUD dial will expect different types of values; a value of an incorrect type will be converted if possible.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setMultiFunctionDisplay&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setMultiFunctionDisplay'''(index : Number, key : String) : Boolean&lt;br /&gt;
Sets the multi-function display with the specified number to display the given multi-function display &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; set earlier with [[#setMultiFunctionText|setMultiFunctionText()]]. Multi-function displays are numbered from 0 to [[#multiFunctionDisplays|multiFunctionDisplays]]-1. If the index given is outside this range, the first unused multi-function display will be used, or the method will return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if all are currently in use.&lt;br /&gt;
Example:&lt;br /&gt;
 // picks first unused one&lt;br /&gt;
 player.ship.setMultiFunctionDisplay(player.ship.multiFunctionDisplays, &amp;quot;myOxp_mfd&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
As the player can cycle the contents of their displays between the various active keys themselves using keyboard controls, it is advisable not to call this method to override a specific display except in emergencies, as this is likely to annoy the player.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setMultiFunctionText&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setMultiFunctionText'''(key : String [, contents : String [, reflow : Boolean]])&lt;br /&gt;
Set the text for the multi-function display with the specified &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; to be &amp;lt;code&amp;gt;contents&amp;lt;/code&amp;gt;. The limit on space for a multi-function display is ten lines of text, each 15 blocks wide. &lt;br /&gt;
&lt;br /&gt;
If you specify the optional &amp;lt;code&amp;gt;reflow&amp;lt;/code&amp;gt; parameter, then the text given will automatically be fitted into the available space, with any extra discarded. Otherwise, line-breaks will not be added automatically, so you must enter them into &amp;lt;code&amp;gt;contents&amp;lt;/code&amp;gt; yourself. If any individual line is more than 15 blocks long, the text will be compressed to fit it into the available space. This looks bad and is best avoided.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setPrimedEquipment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
 function '''setPrimedEquipment'''(equipmentKey : String [, showMessage : Boolean])&lt;br /&gt;
Sets the current primed equipment to the specified equipment key.&lt;br /&gt;
&lt;br /&gt;
Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the method was successful. If equipment key is not found, primed equipment will be set to &amp;quot;None&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
If the showMessage parameter is left out or set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, a console message will be displayed informing the player of the change in primed equipment. Setting showMessage to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; will make the change silently.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#primedEquipment|primedEquipment]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;showHUDSelector&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''showHUDSelector'''(selector : String)&lt;br /&gt;
Show all dials using the specified [[Hud.plist#selector|selector]] on the HUD display if they were previously hidden. For example&lt;br /&gt;
&lt;br /&gt;
 player.ship.showHUDSelector(&amp;quot;drawScanner:&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#hideHUDSelector|hideHUDSelector()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;takeInternalDamage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''takeInternalDamage'''() : Boolean&lt;br /&gt;
Causes the player ship to potentially take &amp;quot;internal damage&amp;quot;. Internal damage can also be caused by hits on the hull and some witchdrive malfunctions, and this method uses the same algorithm to determine the damage taken, which can be:&lt;br /&gt;
* damage to cargo&lt;br /&gt;
* damage to equipment (according to the damage_probability)&lt;br /&gt;
* reduction in [[#serviceLevel|service level]]&lt;br /&gt;
* no damage&lt;br /&gt;
The method will return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if &amp;quot;no damage&amp;quot; was selected, or &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; otherwise. The relative probabilities of the three options vary depending on the size of the player ship, its cargo capacity, cargo carried and installed equipment.&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.  Any current cargo (except for g- and kg-based cargo) will be discarded.  Use [[#removeAllCargo|removeAllCargo()]] to remove the special cargo.&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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=76437</id>
		<title>Oolite JavaScript Reference: Player</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Player&amp;diff=76437"/>
		<updated>2022-10-29T20:47:19Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* setEscapePodDestination */ cleared up wording&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;contractReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''contractReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''contractReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s cargo contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards..&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;[[Oolite JavaScript Reference: Ship#contracts|contracts]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&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, float)&lt;br /&gt;
The amount of money the player has, in credits.&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;escapePodRescueTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.89}}&lt;br /&gt;
 '''escapePodRescueTime''' : Number (read-write decimal)&lt;br /&gt;
Number of seconds that will be added to the clock when the player uses an escape pod and is rescued. Default value is 0 (zero), which will utilise the default time calculation that can add up to eight days to the clock.&lt;br /&gt;
Negative numbers will be ignored (and default calculation will apply).&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, read/write from 1.79)&lt;br /&gt;
The name of the player’s character (e.g., &amp;lt;code&amp;gt;&amp;quot;Jameson&amp;quot;&amp;lt;/code&amp;gt;). Prior to 1.79, this was also used as the filename for the savegame and so was not writable.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;parcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcelReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''parcelReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s parcel contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#decreaseParcelReputation|decreaseParcelReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseParcelReputation|increaseParcelReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#parcels|parcels]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&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;passengerReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''passengerReputation''' : Number (read-only integer)&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''passengerReputationPrecise''' : Number (read-only decimal)&lt;br /&gt;
The player’s passenger contract reputation, ranging from -7 to +7. Reputation is made up internally of three components - &amp;quot;good&amp;quot;, &amp;quot;bad&amp;quot;, and &amp;quot;unknown&amp;quot;. &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; will decay back to &amp;quot;unknown&amp;quot; slowly over time, while &amp;quot;unknown&amp;quot; may in some systems (randomised on entry) be partially treated as &amp;quot;good&amp;quot;, to represent imperfect knowledge of the player's reputation. The value reported by these properties is the final value after this randomisation is applied. The &amp;quot;Precise&amp;quot; version includes fractional reputation, used in Oolite 1.79 onwards.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#decreasePassengerReputation|decreasePassengerReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increasePassengerReputation|increasePassengerReputation()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship#passengers|passengers]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&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;roleWeights&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''roleWeights''' : Array (read-only)&lt;br /&gt;
An array of the player's current role as perceived by the game. Generally NPCs will pick a random entry from this list and treat the player as if they were an NPC of that role. The '&amp;lt;code&amp;gt;player-unknown&amp;lt;/code&amp;gt;' role is the default role. The size of the list depends on the player's current Elite ranking.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setPlayerRole|setPlayerRole()]]&amp;lt;/code&amp;gt;&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;ship&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''ship''' : [[Oolite_JavaScript_Reference:_Ship | Ship]]&lt;br /&gt;
The player’s ship&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 shown immediately after docking. Oolite puts its own stuff on the list immediately after [[Oolite JavaScript Reference: World script event handlers#shipWillDockWithStation|shipWillDockWithStation]] so this is a good moment to add the messages when you know what station will be docked.  [[Oolite JavaScript Reference: World script event handlers#shipDockedWithStation|shipDockedWithStation]] may also be used.  Messages added while in flight or during shipWillDockWithStation will be above Oolite's own arrival messages.  Those added during shipDockedWithStation will be below Oolite's own arrival messages.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#suppressArrivalReports|station.suppressArrivalReports]]&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 [, 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.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 player.commsMessage(&amp;quot;Hello, cruel universe.&amp;quot;, 6)&lt;br /&gt;
NB, this &amp;lt;code&amp;gt;commsMessage()&amp;lt;/code&amp;gt; is a method of the &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt; object.  &amp;lt;code&amp;gt;player.ship&amp;lt;/code&amp;gt; can also have a &amp;lt;code&amp;gt;[[Oolite_JavaScript_Reference:_Ship#commsMessage|commsMessage()]]&amp;lt;/code&amp;gt; method, but that belongs to the ship and has a different second parameter.&lt;br /&gt;
*[http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=10880 Formatting text msgs on a HUD] (2011)&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;
'''See also''': [http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=10880 Formatting text msgs on a HUD] (2011)&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;decreaseParcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''decreaseParcelReputation'''()&lt;br /&gt;
Give the player a negative reputation point for parcel contracts. Decreases the underlying value for parcelReputation 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;[[#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#increaseParcelReputation|increaseParcelReputation()]]&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;endScenario&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''endScenario'''(key : String) : Boolean&lt;br /&gt;
End the current game immediately and return to the start game screen. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if it succeeds (though this will shortly be irrelevant) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if it fails, which it will do if the key passed in is not the same as the [[scenarios.plist#scenario|scenario key]] in the current game scenario. If the current game scenario has no scenario key, this method will always fail.&lt;br /&gt;
&lt;br /&gt;
There is no way to find out what, if any, the current scenario key is. If you are calling this method, you should be doing so in a context where you already know what it is.&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;increaseParcelReputation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''increaseParcelReputation'''()&lt;br /&gt;
Give the player a positive reputation point for parcel contracts. Increases the underlying value for parcelReputation by 1 until a maximum of 7&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#decreaseParcelReputation|decreaseParcelReputation()]]&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 – mainly from the [[Oolite_JavaScript_Reference:_World_script_event_handlers#escapePodSequenceOver|&amp;lt;code&amp;gt;escapePodSequenceOver&amp;lt;/code&amp;gt;]] event handler. It determines where the player will end up. The &amp;lt;code&amp;gt;destination&amp;lt;/code&amp;gt; parameter may be any station/carrier, 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; (which is the default in interstellar space), the player will die of life support failure.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setPlayerRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setPlayerRole'''(role [,index])&lt;br /&gt;
Sets one of the player's perceived role entries to the specified role. If index is not specified, a random entry will be chosen.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roleWeights|roleWeights]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;replaceShip&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.77}}&lt;br /&gt;
 function '''replaceShip'''(dataKey [, personality])&lt;br /&gt;
This method can only be called while the player is docked at a station. It discards the player's current ship (including all cargo, passenger contracts, and equipment), and replaces it with the ship defined by the shipyard.plist entry &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; (obviously the key must also be defined in shipyard.plist as a valid player ship). The new ship will have all standard equipment for a ship of that type, and any equipment from the previous ship which was [[Oolite JavaScript Reference: EquipmentInfo#isPortableBetweenShips|isPortableBetweenShips]]. While this may not necessarily be a ship purchase, the [[Oolite JavaScript Reference: World script event handlers#playerBoughtNewShip|playerBoughtNewShip]] will fire to notify other scripts of the change, although this event is being deprecated in favour of [[Oolite JavaScript Reference: World script event handlers#playerReplacedShip|playerReplacedShip]], which was added in Oolite Test Release 1.89.&lt;br /&gt;
&lt;br /&gt;
If the dataKey was not defined in both shipdata.plist and shipyard.plist, or the player is in flight, this method does nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;personality&amp;lt;/code&amp;gt; is optional, and can be between 0 and 32767. The new ship is given that specific [[Oolite_JavaScript_Reference:_Ship#entityPersonality|entityPersonality]], which for some ships may affect its appearance with shaders.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=76425</id>
		<title>Oolite JavaScript Reference: Ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=76425"/>
		<updated>2022-10-29T16:45:07Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* maxSpeed */ deleted redundant link&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 an &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|Stations]]&amp;lt;/code&amp;gt; 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;accuracy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''accuracy''' : Number (read/write, read-only and irrelevant for player ship)&lt;br /&gt;
The accuracy of the ship's AI. Varies between -5 and +10 for ships, or 0 and +10 for missiles. Setting a value outside the allowed range will set the closest value within the allowed range.&lt;br /&gt;
&lt;br /&gt;
For missiles, this affects the missile tracking, with 0 being the default value.&lt;br /&gt;
&lt;br /&gt;
For NPC ships, this affects their combat AI in many ways. Values of +5 or higher enable various [[OXP_NPC_Combat_AI|special combat AIs]] for a tough fight.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;aftWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''aftWeapon''' : EquipmentType (read-only, read/write in 1.77)&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 plist-based state machine AI. If the ship is using Javascript-based AI, this will always be &amp;quot;&amp;lt;code&amp;gt;nullAI.plist&amp;lt;/code&amp;gt;&amp;quot;&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;, &amp;lt;code&amp;gt;[[#AIScript|AIScript]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIFoundTarget&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''AIFoundTarget''' : Entity (read/write, read-only for player)&lt;br /&gt;
The &amp;quot;found target&amp;quot; of the ship's AI. This is set by various AI state commands, and is often copied to the primary target with the &amp;lt;code&amp;gt;setTargetToFoundTarget&amp;lt;/code&amp;gt; AI command.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIPrimaryAggressor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''AIPrimaryAggressor''' : Entity (read/write, read-only for player)&lt;br /&gt;
The &amp;quot;primary aggressor&amp;quot; of the ship's AI. Often the last ship to attack this ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIScript&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''AIScript''' : String (read-only)&lt;br /&gt;
The name of the ship’s current Javascript-based AI. If the ship is using plist-based AI, this will always be &amp;quot;&amp;lt;code&amp;gt;oolite-nullAI.js&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AIScriptWakeTime|AIScriptWakeTime]]&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;, &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIScriptWakeTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''AIScriptWaketime''' : Number (read-write)&lt;br /&gt;
The next game time at which the ship's Javascript-based AI script will receive an &amp;lt;code&amp;gt;aiAwoken&amp;lt;/code&amp;gt; event.&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 plist 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;alertCondition&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertCondition''' : Number (read-only integer)&lt;br /&gt;
The ship's current alert condition (Docked = 0, Green = 1, Yellow = 2, Red = 3). Non-Station non-Player ships are generally only found at condition Yellow or Red.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[Oolite JavaScript Reference: Station#alertCondition|station.alertCondition]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;autoAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''autoAI''' : Boolean (read-only)&lt;br /&gt;
The value of the &amp;lt;code&amp;gt;&amp;quot;auto_ai&amp;quot;&amp;lt;/code&amp;gt; shipdata key. If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship's provider has given permission for scripts (such as the system populator) to alter the AI of this ship to better fit into scenarios or roles. If this is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the ship's provider would prefer you not to alter the AI of this ship but to use it as-is.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;autoWeapons&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''autoWeapons''' : Boolean (read-only)&lt;br /&gt;
The value of the &amp;lt;code&amp;gt;&amp;quot;auto_weapons&amp;quot;&amp;lt;/code&amp;gt; shipdata key. If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship's provider has given permission for scripts (such as the system populator) to alter the properties of this ship to better fit into scenarios or roles. If this is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the ship's provider would prefer you not to alter the properties of this ship but to use it as-is.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;beaconCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''beaconCode''' : String (read-only in 1.76, read-write from 1.77)&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;. This cannot be changed by script for either the player's ship or the main station.&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;beaconLabel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''beaconLabel''' : String (read/write, read-only for player)&lt;br /&gt;
A full label for the beacon. This is useful where the beacon code and the full beacon label do not begin with the same letter.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;boundingBox&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''boundingBox''' : Vector (read-only)&lt;br /&gt;
For ships, a vector describing the dimensions of the cuboid box containing the ship aligned to the ship axes, including all non-flasher sub-entities. For sub-entities, the dimensions of the box for the sub-entity alone.&lt;br /&gt;
&lt;br /&gt;
Vector components match the standard model order - &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is width, &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; is height, &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; is length.&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.&lt;br /&gt;
&lt;br /&gt;
In 1.77, changes to the bounty are given a reason. If you change this directly, the reason sent to [[Oolite JavaScript Reference: Ship script event handlers#shipBountyChanged|shipBountyChanged]] will be &amp;quot;scripted&amp;quot;. To set a different reason, use [[#setBounty|setBounty]] instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoList&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''cargoList''' : Array (read-only)&lt;br /&gt;
A list of the ship's current cargo, grouped by cargo type.&lt;br /&gt;
&lt;br /&gt;
An item looks like this:&lt;br /&gt;
 {&lt;br /&gt;
    unit: &amp;quot;t&amp;quot;,&lt;br /&gt;
    displayName: &amp;quot;Liquor/Wines&amp;quot;,&lt;br /&gt;
    commodity: &amp;quot;liquor_wines&amp;quot;,&lt;br /&gt;
    quantity: 3&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This property is for non-player ships.  For the player ship, use &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Manifest#list|manifest.list]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&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;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceCapacity''' : Number (read-only in 1.80, read/write in 1.81, integer)&lt;br /&gt;
The ship’s cargo capacity, in tons.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;collisionExceptions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''collisionExceptions''' : Array (read-only)&lt;br /&gt;
A list of ships this ship is currently prevented from colliding with. See [[#addCollisionException|addCollisionException]] and [[#removeCollisionException|removeCollisionException]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''commodity''' : String (read-only)&lt;br /&gt;
The commodity for cargo containers as a lowercase string. Returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-cargo ships. For scripted cargo that has no specific cargo defined, it returns the general description &amp;quot;goods&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commodityAmount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''commodityAmount''' : Number (read-only)&lt;br /&gt;
The amount of commodity in a cargo container. (not the number of containers in a ship)&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#awardContract|awardContract()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeContract|removeContract()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;&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;crew&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''crew''' : Array (read-only)&lt;br /&gt;
An array containing the ship's crew. Each crew member is represented as a dictionary:&lt;br /&gt;
  {&lt;br /&gt;
   &amp;quot;description&amp;quot;:&amp;quot;a small yellow horned humanoid from Malama&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;:&amp;quot;Masten Onlo&amp;quot;,&lt;br /&gt;
   &amp;quot;homeSystem&amp;quot;:49,&lt;br /&gt;
   &amp;quot;insuranceCredits&amp;quot;:500,&lt;br /&gt;
   &amp;quot;species&amp;quot;:&amp;quot;small yellow horned humanoid&amp;quot;,&lt;br /&gt;
   &amp;quot;legalStatus&amp;quot;:0&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Note that in current Oolite versions ships only have a single crew member defined. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setCrew|setCrew()]]&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;currentWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}} &lt;br /&gt;
 '''currentWeapon''' : EquipmentType (read/write)&lt;br /&gt;
A shortcut property to whichever of &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; or &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt; represents the ship's currently active laser mount.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''dataKey''' : String (read-only)&lt;br /&gt;
The ship data key used to define this ship (e.g. &amp;lt;code&amp;gt;&amp;quot;adder-player&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;coriolis-station&amp;quot;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;defenseTargets&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''defenseTargets''' : Array (read-only)&lt;br /&gt;
The array of defense targets that the ship has. If the ship has point defense weapons (turrets, thargoid lasers) it may fire them at these targets if it cannot hit its primary target.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addDefenseTarget|addDefenseTarget]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#clearDefenseTargets|clearDefenseTargets]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;desiredRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''desiredRange''' : Number (read/write nonnegative, read-only for player)&lt;br /&gt;
The range the AI uses in various AI routines to set a distance between the ship and another object - for example, the radius of a sphere around a destination point, or the distance to flee from a hostile ship.&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;destination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''destination''' : Vector (read/write, read-only for player)&lt;br /&gt;
The destination coordinates for the AI, used in behaviours such as &amp;lt;code&amp;gt;performFlyToRangeFromDestination&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;destinationSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''destinationSystem''' : Number (read/write)&lt;br /&gt;
The destination system ID of the ship, used by the AI for certain decisions. This defaults to the current system when a ship is spawned.&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 in 1.78 or earlier, it is the same as &amp;lt;code&amp;gt;[[#name|name]]&amp;lt;/code&amp;gt;. In 1.79 or later, it is a combination of &amp;lt;code&amp;gt;[[#shipClassName|shipClassName]]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[[#shipUniqueName|shipUniqueName]]&amp;lt;/code&amp;gt;.&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]]&lt;br /&gt;
The Station the ship is currently docked to.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''dockingInstructions''' : Object (read-only)&lt;br /&gt;
If the ship is currently attempting to dock with a station, this describes the next step on its docking procedure&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
    station: [Station &amp;quot;Coriolis Station&amp;quot; &amp;quot;Coriolis Station&amp;quot; position: (-31043.6, -94232.3, 619036) scanClass: CLASS_STATION status: STATUS_ACTIVE],&lt;br /&gt;
    match_rotation: 0,&lt;br /&gt;
    ai_message: &amp;quot;APPROACH_COORDINATES&amp;quot;,&lt;br /&gt;
    speed: 512,&lt;br /&gt;
    destination: {&lt;br /&gt;
        x: -28033.37401563089,&lt;br /&gt;
        y: -92813.76688970842,&lt;br /&gt;
        z: 622226.0625336492&lt;br /&gt;
    },&lt;br /&gt;
    range: 96&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requestDockingInstructions|requestDockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#recallDockingInstructions|recallDockingInstructions]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;energyRechargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''energyRechargeRate''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The rate at which energy is replenished in every second. The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;energy_recharge_rate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note for the player ship that this includes the boost from an extra or naval energy unit, and NPC (but not player) ships with military shield boosters also have an increase to this in lieu of actual shields.&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, read/write in 1.81 onwards)&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;
Altering this value is possible in 1.81 onwards, but requires a re-bind of the materials and shaders, and so is a relatively slow process.&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;
'''See also:''' &amp;lt;code&amp;gt;[[#maxEscorts|maxEscorts]]&amp;lt;/code&amp;gt;&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;exhaustEmissiveColor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''exhaustEmissiveColor''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The baseline colour of the ship's exhaust. Damage to the ship, and use of injectors and torus drive, apply a fixed transformation to this colour, so not all colours are effective as exhaust colours.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exhausts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''exhausts''' : Array (read-only)&lt;br /&gt;
An array of the ship's [[Oolite JavaScript Reference: ExhaustPlume|ExhaustPlume]] subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;flashers&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''flashers''' : Array (read-only)&lt;br /&gt;
An array of the ship's [[Oolite JavaScript Reference: Flasher|Flasher]] subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;forwardWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''forwardWeapon''' : EquipmentType (read-only, read/write in 1.77)&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;code&amp;gt;fuelChargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''fuelChargeRate''' : Number (read-only)&lt;br /&gt;
The cost, relative to the cost for a new Cobra III, of a unit of fuel. When buying fuel for a ship, the price in [[equipment.plist]] will be multiplied by this number.&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;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 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;
Note that in 1.80 and earlier writes to this property had no effect on the player ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;homeSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''homeSystem''' : Number (read/write)&lt;br /&gt;
The home system ID of the ship, used by the AI for certain decisions. This defaults to the current system when a ship is spawned.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hyperspaceSpinTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''hyperspaceSpinTime''' : Number (read/write)&lt;br /&gt;
The length of the ship's hyperspace countdown.&lt;br /&gt;
&lt;br /&gt;
Setting this to a negative value disables the drive entirely.&lt;br /&gt;
&lt;br /&gt;
Note that most NPC ship jumps use &amp;lt;code&amp;gt;ship.exitSystem()&amp;lt;/code&amp;gt; to make the jump, which does not have a delay. Provided this value is zero or positive, the ship will jump instantly if &amp;lt;code&amp;gt;ship.exitSystem()&amp;lt;/code&amp;gt; is called. The AI must use this property elsewhere if a delay before jumping is required.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;injectorBurnRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''injectorBurnRate''' : Number (read/write)&lt;br /&gt;
The rate at which the ship's injectors burn fuel in deci-LY per second. The default is 0.25.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;injectorSpeedFactor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''injectorSpeedFactor''' : Number (read/write)&lt;br /&gt;
The multiplier to maximum speed granted to this ship when it is using injectors. The default is 7, and values must be between 1.0 and 32.0 (the torus drive's speed)&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;lt;code&amp;gt;&amp;quot;boulder&amp;quot;&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt; 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 * [[Oolite JavaScript Reference: Entity#maxEnergy|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;isFleeing&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isFleeing''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is currently fleeing combat. This may be queried for the player ship too, though the value is somewhat of a guess in that case as it's impossible to say for certain what the player is intending by their actions.&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;, &amp;lt;code&amp;gt;[[#restoreSubEntities|restoreSubEntities()]]&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 [[Shipdata.plist#has_military_jammer|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;isMinable&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isMinable''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship will break up usefully when hit by a mining laser, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. By default this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for anything with &amp;lt;code&amp;gt;&amp;quot;asteroid&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;boulder&amp;quot;&amp;lt;/code&amp;gt; in its role list - if you need to add anything which miners shouldn't be shooting at to those roles, give it &amp;lt;code&amp;gt;&amp;quot;no_boulders&amp;quot; = yes;&amp;lt;/code&amp;gt; in its [[shipdata.plist]].&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- ships, stations and escape pods have pilots whereas cargo, rocks, missiles and buoys do not.&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: &amp;lt;code&amp;gt;&amp;quot;CLASS_ROCK&amp;quot;&amp;lt;/code&amp;gt;)&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;isTurret&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isTurret''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a plasma turret sub-entity, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&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;laserHeatLevel&amp;lt;/code&amp;gt;* ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''laserHeatLevel''' : Number (read-only, 0 to 1)&lt;br /&gt;
The temperature of the ship's currently active weapon. Thermal cut-out is active above 0.85. For non-player ships, if their forward weapon is empty, then the temperature of the forward weapon may be the temperature of a subentity forward weapon.&lt;br /&gt;
 '''laserHeatLevelAft''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelForward''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelPort''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelStarboard''' : Number (read-only, 0 to 1)&lt;br /&gt;
The temperature of specific laser mounts can also be queried.&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 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; in their ''shipdata.plist'' declarations.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedForFines&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''markedForFines''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has been marked for fines the next time it docks at this system's main station.&lt;br /&gt;
&lt;br /&gt;
'''See also''' : [[#markTargetForFines|markTargetForFines()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxEscorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxEscorts''' : Number (read/write)&lt;br /&gt;
The maximum number of escorts this ship can have. This cannot be set lower than the number of escorts it currently has, or higher than the value of the MAX_ESCORTS constant (currently 16). There may be other reasons why a ship can have fewer escorts than the value of &amp;lt;code&amp;gt;maxEscorts&amp;lt;/code&amp;gt; (for instance, ships which are escorts cannot have their own escorts)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#escortGroup|escortGroup]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxPitch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxPitch''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum pitch rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#pitch|pitch]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxRoll&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxRoll''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum roll rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roll|roll]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxSpeed''' : Number (read-only, read/write from 1.81)&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 the [[Witch Fuel Injectors]] or [[Torus Drive]] are in use.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxThrust&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxThrust''' : Number (read-only, read/write from 1.81)&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;maxYaw&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxYaw''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum yaw rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#yaw|yaw]]&amp;lt;/code&amp;gt;&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;parcelCount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcelCount''' : Number (read-only integer)&lt;br /&gt;
The ship’s current number of parcels.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addParcel|addParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeParcel|removeParcel()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;parcels&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcels''' : Array (read-only NSDictionary)&lt;br /&gt;
The ship’s parcels. (For now only available for the player). Each parcel 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.parcels[0].name&lt;br /&gt;
 player.ship.parcels[0].start&lt;br /&gt;
 player.ship.parcels[0].destination&lt;br /&gt;
 player.ship.parcels[0].startName&lt;br /&gt;
 player.ship.parcels[0].destinationName&lt;br /&gt;
 player.ship.parcels[0].eta&lt;br /&gt;
 player.ship.parcels[0].etaDescription&lt;br /&gt;
 player.ship.parcels[0].fee  // The final fee, paid out 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 parcel.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addParcel|addParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeParcel|removeParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pitch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''pitch''' : Number (read-only)&lt;br /&gt;
The rate of pitch of the ship in radians/second (positive for dive, negative for climb)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxPitch|maxPitch]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''portWeapon''' : EquipmentType (read-only, read/write in 1.77)&lt;br /&gt;
The currently equipped port weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. This is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships in 1.76.&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 &amp;lt;code&amp;gt;&amp;quot;pirate trader(0.5) escort&amp;quot;&amp;lt;/code&amp;gt; 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; are &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; are &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;
 '''roleWeights''' : 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;roll&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''roll''' : Number (read-only, read/write for stations)&lt;br /&gt;
The rate of roll of the ship in radians/second (positive for anti-clockwise, negative for clockwise)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxRoll|maxRoll]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#roll|station.roll]]&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;scanDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''scanDescription''' : String (read/write)&lt;br /&gt;
The description of the ship in the &amp;quot;legal status&amp;quot; text shown by the [[Scanner Targeting Enhancement]]. If this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; then the default text for the ship's scan class and bounty level will be shown.&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;, &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor1|scannerHostileDisplayColor1]]&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;, &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor2|scannerHostileDisplayColor2]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerHostileDisplayColor1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''scannerHostileDisplayColor1''' : [[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 the ship is specifically targeting the player with hostile intent. 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;
If hostile colours are set but normal colours aren't, then the normal colours will default to those for the ship's scan class. If normal colours are set but hostile colours aren't, the scanner blip will not change colour when the ship is hostile.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor2|scannerHostileDisplayColor2]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#scannerDisplayColor1|scannerDisplayColor1]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerHostileDisplayColor2&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''scannerHostileDisplayColor2''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The second scanner colour when the ship is specifically targeting the player with hostile intent.. If both &amp;lt;code&amp;gt;scannerHostileDisplayColor1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;scannerHostileDisplayColor2&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;[[#scannerHostileDisplayColor1|scannerHostileDisplayColor1]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#scannerDisplayColor2|scannerDisplayColor2]]&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;scriptedMisjumpRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''scriptedMisjumpRange''' : Number (read/write)&lt;br /&gt;
If this ship misjumps, this number will be consulted to determine the length of the resulting misjump relative to the normal jump range. Setting this does not in itself force a misjump - this must occur through the usual mechanisms. Values must be greater than 0.0 and less than 1.0, and the default is 0.5 for a traditional half-way misjump. This will be reset to 0.5 at the same time as &amp;lt;code&amp;gt;[[#scriptedMisjump|scriptedMisjump]]&amp;lt;/code&amp;gt; is reset to &amp;lt;code&amp;gt;false&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 ship’s ''[[shipdata.plist]]'' entry, if any. This may be any [[property list]] object, but the recommended 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 explicitly 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;shipClassName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''shipClassName''' : String (read/write)&lt;br /&gt;
The name of the ship class (e.g. &amp;lt;code&amp;gt;&amp;quot;Python&amp;quot;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipUniqueName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''shipUniqueName''' : String (read/write)&lt;br /&gt;
The name of this specific ship (e.g. &amp;lt;code&amp;gt;&amp;quot;Sunrise of Lave&amp;quot;&amp;lt;/code&amp;gt;)&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, read/write in 1.77)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. This is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships in 1.76.&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;, &amp;lt;code&amp;gt;[[#restoreSubEntities|restoreSubEntities()]]&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;subEntityRotation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''subEntityRotation''' : Quaternion (read/write)&lt;br /&gt;
The subentity rotational velocity, expressed as a quaternion. This much rotation will be applied per second. Exact 180 degree rotations should not be specified, as it is not possible to determine what route to use to make that rotation. This property is ignored when set on non-subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sunGlareFilter&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''sunGlareFilter''' : Number (read/write)&lt;br /&gt;
The strength of the sun glare filter on this ship. It must be in the range 0 to 1 (0 is no filter).&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 before 1.81)&lt;br /&gt;
The ship’s thrust, ranging from 0 to &amp;lt;code&amp;gt;[[#maxThrust|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 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, 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;weaponFacings&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''weaponFacings''' : Number (read-only, integer in range 0-15)&lt;br /&gt;
The weapon facings available for the ship. The format is the same as the equivalent property in [[shipyard.plist]] or [[shipdata.plist]] - a bitmask with the following bits:&amp;lt;br&amp;gt;&lt;br /&gt;
1 - fore&amp;lt;br&amp;gt;&lt;br /&gt;
2 - aft&amp;lt;br&amp;gt;&lt;br /&gt;
4 - port&amp;lt;br&amp;gt;&lt;br /&gt;
8 - starboard&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;weaponPosition*&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''weaponPositionAft''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionForward''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionPort''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionStarboard''' : Vector (read-only)&lt;br /&gt;
&lt;br /&gt;
{{Oolite-prop-added|1.83}}&lt;br /&gt;
 '''weaponPositionAft''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionForward''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionPort''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionStarboard''' : Array of Vectors (read-only)&lt;br /&gt;
&lt;br /&gt;
The position relative to the ship at which the appropriate laser beam will start. These properties do not imply that the ship has or can have any such weapon.&lt;br /&gt;
&lt;br /&gt;
In 1.83 this property changed syntax to become an array of vectors, as ships can now have multiple mounts per facing.&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;
=== &amp;lt;code&amp;gt;yaw&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''yaw''' : Number (read-only)&lt;br /&gt;
The rate of yaw of the ship in radians/second (positive for right, negative for left)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxYaw|maxYaw]]&amp;lt;/code&amp;gt;&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 escape pod.  It will launch all escape pods on board leaving the ship behind as a empty hulk (&amp;lt;code&amp;gt;scanClass === &amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;). This command does nothing when no escape pod is present.&amp;lt;br&amp;gt;&lt;br /&gt;
Presence of an escape pod 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;addCollisionException&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''addCollisionException'''(exception : Ship)&lt;br /&gt;
Prevented this ship and the selected ship from colliding. See [[#collisionExceptions|collisionExceptions]] and [[#removeCollisionException|removeCollisionException]].&lt;br /&gt;
&lt;br /&gt;
Prevention from collision will specifically prevent the following:&lt;br /&gt;
&lt;br /&gt;
* the ships colliding with each other and suffering collision damage and/or momentum change&lt;br /&gt;
* the ships receiving collision warning events if they come close to each other&lt;br /&gt;
* if one of the ships is a station, the other ship will not be able to dock with it even if it enters a dock&lt;br /&gt;
&lt;br /&gt;
This has no useful effect when applied to a subentity.&lt;br /&gt;
&lt;br /&gt;
Adding a collision exception which already exists has no effect but will not cause an error.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addDefenseTarget&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''addDefenseTarget'''(target : Ship)&lt;br /&gt;
Adds the target ship to this ship's list of point [[#defenseTargets|defense targets]], if it isn't already.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;adjustCargo&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''adjustCargo'''(commodity : String, amount : Number) : Boolean&lt;br /&gt;
Adjust the quantity of the specified commodity carried by the ship. Amount may be negative to remove cargo. The method will return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if the operation would fail due to insufficient free space or carried cargo and will not make a partial adjustment in this case.&lt;br /&gt;
&lt;br /&gt;
This method is for non-player ships.  For the player ship, use &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setCargoType|setCargoType()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&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;becomeCascadeExplosion&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''becomeCascadeExplosion'''()&lt;br /&gt;
This method causes the ship to explode as if it were hit by a quirium cascade.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;broadcastCascadeImminent&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''broadcastCascadeImminent'''()&lt;br /&gt;
This method causes the ship to broadcast a message to the AIs of all nearby ships warning them of an imminent cascade explosion. It is polite to call this a few seconds before calling &amp;lt;code&amp;gt;becomeCascadeExplosion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;broadcastDistressMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''broadcastDistressMessage'''()&lt;br /&gt;
This method causes the ship to broadcast a distress message to the AIs of all nearby ships (received also by the player as a comms message). Ships receiving a distress message will often intervene in the fight, depending on their own AI and the roles of the ships already involved.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;checkCourseToDestination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''checkCourseToDestination'''()&lt;br /&gt;
Checks the line between the ship's current position and its destination, and returns either &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; or an Entity (usually a planet, sun or other ship) that this ship would risk collision with if it travelled along that course.&lt;br /&gt;
&lt;br /&gt;
'''See also''': [[#getSafeCourseToDestination|getSafeCourseToDestination()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;checkScanner&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''checkScanner'''([poweredOnly : Boolean]) : Array&lt;br /&gt;
Runs a fast scanner check and returns the results. At most 32 objects within scanner range will be returned. If the &amp;lt;code&amp;gt;poweredOnly&amp;lt;/code&amp;gt; parameter is present and set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then only powered objects will be returned (i.e. ships with a scan class other than &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;CLASS_ROCK&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This method is usually considerably quicker than &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: System#filteredEntities|system.filteredEntities()]]&amp;lt;/code&amp;gt; and similar methods, with little loss of accuracy, though it is still advisable to cache the result for a while before re-scanning.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;clearDefenseTargets&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''clearDefenseTargets'''()&lt;br /&gt;
Clears the ship's list of point [[#defenseTargets|defense targets]].&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#commsMessage|player.commsMessage()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;damageAssessment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''damageAssessment'''() : Number&lt;br /&gt;
Returns a number indicating the amount of damage or supply usage by this ship. Zero means that the ship is in excellent fighting condition, while higher numbers indicate increasing amounts of damage or supply shortages.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dealEnergyDamage&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''dealEnergyDamage'''(damage : Number, idealRange : Number [, velocityBias : Number])&lt;br /&gt;
Deals damage to all ships within a sphere centred on this ship. If this ship has an owner (e.g. it is a missile or a subentity) the damage will be credited to its owner. Damage is dealt according to the following formula:&lt;br /&gt;
* Further away than MAX_SCANNER_RANGE (25.6km): deal no damage&lt;br /&gt;
* At or closer than &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt;: deal &amp;lt;code&amp;gt;damage&amp;lt;/code&amp;gt; plus (or minus, for receding objects) &amp;lt;code&amp;gt;velocityBias&amp;lt;/code&amp;gt; damage for every 0.001LM of relative closing speed, up to a maximum of 1.0LM&lt;br /&gt;
* Between &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt; and a derived maximum range: calculate the damage that would have been done at &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt;, and then divide it by the square of the ratio of &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt; and the real range (i.e inverse-square). The derived maximum range is the distance where a target with no relative closing speed would take 1 point of damage.&lt;br /&gt;
&lt;br /&gt;
As an example, the standard Oolite missile uses &amp;lt;code&amp;gt;dealEnergyDamage(170, 32.5, 0.25)&amp;lt;/code&amp;gt;, has a maximum speed of 0.75LM, and its AI tries to detonate it 25m from its target. Some worked examples (for comparision, one energy bank can absorb 64 points of damage, and a standard shield generator can absorb 128 points of damage):&lt;br /&gt;
* The missile is fired at a stationary asteroid. It detonates at 25m, within the ideal range, and the relative closing speed is 0.75LM. The asteroid takes 170 + (0.25 * 750) = 357.5 points of damage&lt;br /&gt;
* The missile is fired at a Cobra Mk III, which tries to flee from and evade the missile at its top speed of 0.35LM. The missile detonates at 25m, and the evasive manoeuvres mean that it is not heading directly at the Cobra when it detonates. The relative closing speed is 0.38LM. The Cobra takes 170 + (0.25 * 380) = 265 points of damage.&lt;br /&gt;
* An Anaconda freighter travelling at 0.2LM fires a missile at a distant Fer-de-lance. After the missile has travelled 150m away from the Anaconda, it is hit by an ECM pulse from the FDL, and detonates. The relative velocity is -0.55LM (the missile is travelling away from the Anaconda), so the damage at the ideal range would be 170 - (0.25 * 550) = 32.5. The damage is then divided by (150 / 32.5)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, so the Anaconda takes about 1.5 points of damage.&lt;br /&gt;
* A missile fired at something else detonates 500m away from a Sidewinder. The inverse-square rule divides the damage by (500 / 32.5)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, so the base damage at this range (ignoring velocityBias) is only 0.7. The Sidewinder is therefore safely outside the blast radius, and is not considered for damage. &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;
Cause a random number (at least 1 if possible) of the ship's escorts which are not already attacking a target to attack this ship's primary target, unless this method has already been called for the current target without meanwhile being called for a different target.&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'''([amount : Number, commodity: String]) : 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;
In 1.79 or later, multiple items may be scheduled for dumping by passing the number as a parameter.&lt;br /&gt;
&lt;br /&gt;
In 1.81 or later, a preferred commodity may be specified (if this is not present, a random item will be dumped as usual). This preference only applies to the first item dropped, not subsequent ones.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#ejectItem|ejectItem]]&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 &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt; of the ejected item will always be &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;.&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 &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt; of the ejected item will always be &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;.&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;enterWormhole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''enterWormhole'''([wormhole : Wormhole])&lt;br /&gt;
If the player has entered witchspace, but before the old system is removed from memory, this method may be used to add this ship to the contents of the specified outbound wormhole. If no parameter is given, add them to the player's wormhole.&lt;br /&gt;
&lt;br /&gt;
If the player is not entering witchspace, this method does nothing: the ship must fly to the wormhole in the normal way to enter it.&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]] [, multiple : Boolean]) : String or Object&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;
In 1.81 and later, if the optional &amp;lt;code&amp;gt;multiple&amp;lt;/code&amp;gt; parameter is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it will instead return an object in this format:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;EQUIPMENT_OK&amp;quot;: 3.&lt;br /&gt;
    &amp;quot;EQUIPMENT_DAMAGED&amp;quot;: 2&lt;br /&gt;
 }&lt;br /&gt;
to allow equipments which allow fitting multiple to be queried. If multiple equipments can be fitted, not setting the 'multiple' parameter will return the 'best' state of all items of that type.&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;findNearestStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''findNearestStation'''()&lt;br /&gt;
Returns the nearest Station entity to this ship. This is quicker than manually searching &amp;lt;code&amp;gt;system.stations&amp;lt;/code&amp;gt; and much quicker than using &amp;lt;code&amp;gt;system.filteredEntities()&amp;lt;/code&amp;gt;.&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;getSafeCourseToDestination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''getSafeCourseToDestination'''()&lt;br /&gt;
Returns some coordinates which can be flown to as an intermediate destination to allow travel between the ship's current position and its destination without colliding with any objects on the way. Use this if &amp;lt;code&amp;gt;checkCourseToDestination&amp;lt;/code&amp;gt; returns an object you are unable or unwilling to destroy to calculate a new route.&lt;br /&gt;
&lt;br /&gt;
'''See also''': [[#checkCourseToDestination|checkCourseToDestination()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getMaterials&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''getMaterials'''() : Object&lt;br /&gt;
getMaterials() returns the ship's current materials dictionary, or if none present an empty dictionary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getShaders|getShaders()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getShaders&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''getShaders'''() : Object&lt;br /&gt;
getShaders() returns the ship's current shaders dictionary, or if none present an empty dictionary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setShaders|setShaders()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getMaterials|getMaterials()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasEquipmentProviding&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''hasEquipmentProviding'''(key : String) : Boolean&lt;br /&gt;
This method returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has any equipment providing the &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; equipment type, and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''hasRole'''(role : String) : Boolean&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;markTargetForFines&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''markTargetForFines()'''&lt;br /&gt;
If this ship is eligible to give out fines and the primary target has a bounty, mark the current primary target for fines, which will need to be paid when the ship docks. If used on a ship other than the player, of course, the fines are not particularly meaningful.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;notifyGroupOfWormhole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''notifyGroupOfWormhole()'''&lt;br /&gt;
Tells the ship's group about a wormhole (usually the one this ship has just entered). Causes a &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship script event handlers#wormholeSuggested|wormholeSuggested]]&amp;lt;/code&amp;gt; event to occur in the scripts of other group members.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;offerToEscort&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''offerToEscort(mother : Ship)'''&lt;br /&gt;
Offer to escort the specified ship. The ship making the offer must have the same scan class as the mothership and must have one of the designated escort roles. After the mothership has made a decision this ship will receive either an &amp;lt;code&amp;gt;escortAccepted&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;escortRejected&amp;lt;/code&amp;gt; ship script event.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;perform*&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Each of these methods switches the frame-by-frame behaviour of the ship to a different mode. It may not necessarily remain in that mode, however - for example, those modes which require a target will usually fall back to idle mode if the target is lost.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performAttack&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performAttack()'''&lt;br /&gt;
Attack the current target with available weapons.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performCollect&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performCollect()'''&lt;br /&gt;
Attempt to scoop up the current target. If the current target is not scoopable, it will be lost.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performEscort&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performEscort()'''&lt;br /&gt;
Escort the group leader. If this ship is not an escort of the group leader, it will not receive escort position updates from that ship.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFaceDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFaceDestination()'''&lt;br /&gt;
Come to a stop, and turn to face the current destination coordinates.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFlee&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFlee()'''&lt;br /&gt;
Flee from the current target, using injectors if possible, until it is out of scanner range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFlyToRangeFromDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFlyToRangeFromDestination()'''&lt;br /&gt;
Fly to the current [[#destination|destination]] coordinates, stopping when the distance between the ship and those coordinates is the [[#desiredRange|desiredRange]]. If the ship is already closer to the destination coordinates than the desired range, it will move away from the coordinates.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performHold&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performHold()'''&lt;br /&gt;
Come to a stop, and continually turn to face the current target&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performIdle&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performIdle()'''&lt;br /&gt;
Cancel any current turns to return to level flight, then move forward at current speed.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performIntercept&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performIntercept()'''&lt;br /&gt;
Fly to intercept (i.e. ram) the current target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performLandOnPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performLandOnPlanet()'''&lt;br /&gt;
Land on rather than crash into the planet. This is a slow flight, so it is recommended to get close to the planet surface before activating this behaviour.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performMining&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performMining()'''&lt;br /&gt;
Attack the current target with a mining laser. This does not count as hostile behaviour, so cannot be used except on rocks.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performScriptedAI&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performScriptedAI()'''&lt;br /&gt;
Request flight instructions from a [[OXP_Scripted_AI|scripted AI]] callback each frame.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performScriptedAttackAI&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performScriptedAttackAI()'''&lt;br /&gt;
Request flight instructions, including weapons fire, from a [[OXP_Scripted_AI|scripted AI]] callback each frame.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performStop&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performStop()'''&lt;br /&gt;
Come to a complete halt&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performTumble&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performTumble()'''&lt;br /&gt;
Come to a complete halt and rotate randomly.&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;recallDockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''recallDockingInstructions'''() : Object&lt;br /&gt;
Returns the current docking instructions as an object, and sets the destination, desired range and desired speed to match the instructions. Use this if the ship may have been interrupted while docking to ensure its flight parameters are set correctly.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dockingInstructions|dockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requestDockingInstructions|requestDockingInstructions]]&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 [[Oolite JavaScript Reference: Ship script event handlers#shipRemoved|this.shipRemoved(suppressDeathEvent)]] event. By default it will also trigger a [[Oolite JavaScript Reference: Ship script event handlers#shipDied|this.shipDied()]] event, unless &amp;lt;code&amp;gt;suppressDeathEvent&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&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;removeCollisionException&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''removeCollisionException'''(exception : Ship)&lt;br /&gt;
Allow this ship and the selected ship to collide again. See [[#collisionExceptions|collisionExceptions]] and [[#addCollisionException|addCollisionException]].&lt;br /&gt;
&lt;br /&gt;
Removing a collision exception which does not exist has no effect but will not cause an error.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeDefenseTarget&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''removeDefenseTarget'''(target : Ship)&lt;br /&gt;
Ensures that the target ship is not on this ship's list of point [[#defenseTargets|defense targets]].&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 method 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;
Note that in Oolite prior to 1.76.1 there was a bug which could sometimes cause the game to crash if this method was used on pylon-mounted equipment. Therefore, if you do this in your OXP, you should set (at least) 1.76.1 as the version in requires.plist&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;requestDockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''requestDockingInstructions'''() : Object&lt;br /&gt;
Requests the next docking instructions from the station, and returns them as an object, setting the destination, desired range and desired speed to match the instructions. Use this to get the next step in the docking sequence after completing the previous one.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dockingInstructions|dockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#recallDockingInstructions|recallDockingInstructions]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requestHelpFromGroup&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''requestHelpFromGroup'''()&lt;br /&gt;
This method sends the &amp;lt;code&amp;gt;helpRequestReceived&amp;lt;/code&amp;gt; event to the other ships in this ship's group and escort group, sending the name of this ship's current target as the aggressor.&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 or removed subentities of the ship. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if any subentities were added. Whether or not any subentities were added, this will also reset all subentities to their original configuration of position, orientation and other properties.&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;[[#isFrangible|isFrangible]]&amp;lt;/code&amp;gt;&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. From 1.79 onwards AI files may either be plist-based (with a .plist extension) or Javascript-based (with a .js extension).&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;setBounty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''setBounty'''(bounty : Number, reason : String)&lt;br /&gt;
Sets the ship's bounty to the new value. &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt; will be sent to [[Oolite JavaScript Reference: Ship script event handlers#shipBountyChanged|shipBountyChanged()]].&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#bounty|bounty]]&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 &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; specified for a cargo barrel.  This cannot be used to set cargo for ships.  When more units are defined than 1 ton, the count is reduced to 1 ton.  It returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when the selected commodity is unknown. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is not specified, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; will be assumed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCargoType&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setCargoType'''(commodityType : String) : Boolean&lt;br /&gt;
Attempts to set the ship's cargo hold to contain commodities of the specified type, discarding any cargo already present. This should generally only be used immediately after a ship is spawned. Valid commodity types are:&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;SCARCE_GOODS&amp;quot;&amp;lt;/code&amp;gt;: goods which are likely to be rare in the current system, usually legal&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;PLENTIFUL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: goods which are likely to be plentiful in the current system, usually legal&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;MEDICAL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: narcotics (used for the Moray Medical Boat)&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;ILLEGAL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: various goods likely to be rare in the current system, with a strong bias towards contraband&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;PIRATE_GOODS&amp;quot;&amp;lt;/code&amp;gt;: similar to &amp;lt;code&amp;gt;&amp;quot;ILLEGAL_GOODS&amp;quot;&amp;lt;/code&amp;gt; but the total amount carried will be lower&lt;br /&gt;
This will return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if an unrecognised commodity type is used and will throw an exception if used on a cargo pod rather than a cargo carrier. Using it on a ship like an Asp without a cargo hold is valid but pointless.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCrew&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setCrew'''(Object) : Boolean&lt;br /&gt;
Sets the ship's crew to one represented by the given object (or sets the ship to uncrewed if &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; is given as a parameter). Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if this succeeds, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise (if the ship is ''always'' unpiloted). The object has the same keys as [[characters.plist]], all of which are optional and will be replaced with default values if unset. They are applied in the following order:&lt;br /&gt;
* origin system&lt;br /&gt;
* random seed&lt;br /&gt;
* role&lt;br /&gt;
* the rest&lt;br /&gt;
You can therefore set a random seed or role to get particular behaviour, and use the other keys to override it.&lt;br /&gt;
&lt;br /&gt;
At the moment this method only sets the first crew member (the pilot of the ship) in [[Oolite JavaScript Reference: Ship#crew|crew]][0] .&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;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: EquipmentInfo#canBeDamaged|EquipmentInfo.canBeDamaged]]&amp;lt;/code&amp;gt;for equipment that cannot be damaged&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;, &amp;lt;code&amp;gt;[[#getMaterials|getMaterials()]]&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;, &amp;lt;code&amp;gt;[[#getShaders|getShaders()]]&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;threatAssessment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''threatAssessment'''(full : Boolean) : Number&lt;br /&gt;
Returns a number indicating the relative strength of the ship. If the 'full' parameter is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, additional information will be considered as part of the assessment which would generally only be known by ships which know this ship or have seen it in combat. Otherwise, only data which could reasonably be expected to be common knowledge based on the class of the ship will be included.&lt;br /&gt;
&lt;br /&gt;
For example, which weapon facings are available is part of the basic assessment, but what forward laser the ship has is part of the full assessment.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;throwSpark&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''throwSpark'''()&lt;br /&gt;
Sets the ship to throw a spark as if it was seriously damaged. If this ship is already scheduled to throw a spark, this does nothing.&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;
== Static Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;keys&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''keys'''() : Array&lt;br /&gt;
Returns all dataKeys of ships defined in all [[shipdata.plist]] including installed [[OXP]]s.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var dataKeysArray = Ship.keys();&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;keysForRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''keysForRole'''(role : String) : Array&lt;br /&gt;
Returns all dataKeys of ships defined in all [[shipdata.plist]] which contains the given role.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var role = &amp;quot;trader&amp;quot;;&lt;br /&gt;
 var roleKeys = Ship.keysForRole( role );&lt;br /&gt;
 log(&amp;quot;keysForRole&amp;quot;, role + &amp;quot;: &amp;quot; + roleKeys );&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roleIsInCategory&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''roles'''(role : String, category : String) : Boolean&lt;br /&gt;
Returns whether the role given is in a particular category as defined in [[role-categories.plist]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 Ship.roleIsInCategory(&amp;quot;trader&amp;quot;,&amp;quot;oolite-pirate-victims&amp;quot;); // true&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''roles'''() : Array&lt;br /&gt;
Returns all roles of ships defined in all [[shipdata.plist]] including installed [[OXP]]s.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var roles = Ship.roles();&lt;br /&gt;
 for( var i = 0; i &amp;lt; roles.length; i++ ) {&lt;br /&gt;
  var roleKeys = Ship.keysForRole( roles[i] );&lt;br /&gt;
  log(&amp;quot;roles&amp;quot;, i + &amp;quot;. &amp;quot;+roles[i] + &amp;quot;: &amp;quot; + roleKeys );&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipDataForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''shipDataForKey'''(datakey : String) : Object&lt;br /&gt;
Returns an object containing a representation of the raw [[shipdata.plist]] entry for a given data key, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if the data key does not exist. Keys not defined in the shipdata.plist entry will not be defined in the object - they won't get their default values.&lt;br /&gt;
&lt;br /&gt;
Using the ship object properties is generally a better way to get this information, but this is useful if you want to find out what a ship might be like if you did add it.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var shipdata = Ship.shipDataForKey(&amp;quot;cobra3-trader&amp;quot;);&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;name&amp;quot;]); // &amp;quot;Cobra Mark III&amp;quot;&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;ship_class_name&amp;quot;]); // undefined&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;ship_unique_name&amp;quot;]); // undefined&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;display_name&amp;quot;]); // undefined&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;setShipDataForKey&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{Oolite-method-added|1.91}}&lt;br /&gt;
 function '''setShipDataForKey'''(datakey : String, newShipData : Object)&lt;br /&gt;
This method modifies or adds properties of a ship class specified by the datakey parameter.  The newShipData parameter can be an existing property defined in shipdata.plist or a new one.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 Ship.setShipDataForKey (&amp;quot;cobra3-trader&amp;quot;, {name: &amp;quot;Cobra trader variant&amp;quot;})&lt;br /&gt;
 var shipdata = Ship.shipDataForKey (&amp;quot;cobra3-trader&amp;quot;)&lt;br /&gt;
 log (&amp;quot;test&amp;quot;, shipdata [&amp;quot;name&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
'''See also''': [http://www.aegidian.org/bb/viewtopic.php?p=274534#p274534 bulletin board post by Tsoj]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Shipdata.plist]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=76424</id>
		<title>Oolite JavaScript Reference: Ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=76424"/>
		<updated>2022-10-29T16:42:56Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* maxSpeed */ fixed link&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 an &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|Stations]]&amp;lt;/code&amp;gt; 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;accuracy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''accuracy''' : Number (read/write, read-only and irrelevant for player ship)&lt;br /&gt;
The accuracy of the ship's AI. Varies between -5 and +10 for ships, or 0 and +10 for missiles. Setting a value outside the allowed range will set the closest value within the allowed range.&lt;br /&gt;
&lt;br /&gt;
For missiles, this affects the missile tracking, with 0 being the default value.&lt;br /&gt;
&lt;br /&gt;
For NPC ships, this affects their combat AI in many ways. Values of +5 or higher enable various [[OXP_NPC_Combat_AI|special combat AIs]] for a tough fight.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;aftWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''aftWeapon''' : EquipmentType (read-only, read/write in 1.77)&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 plist-based state machine AI. If the ship is using Javascript-based AI, this will always be &amp;quot;&amp;lt;code&amp;gt;nullAI.plist&amp;lt;/code&amp;gt;&amp;quot;&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;, &amp;lt;code&amp;gt;[[#AIScript|AIScript]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIFoundTarget&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''AIFoundTarget''' : Entity (read/write, read-only for player)&lt;br /&gt;
The &amp;quot;found target&amp;quot; of the ship's AI. This is set by various AI state commands, and is often copied to the primary target with the &amp;lt;code&amp;gt;setTargetToFoundTarget&amp;lt;/code&amp;gt; AI command.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIPrimaryAggressor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''AIPrimaryAggressor''' : Entity (read/write, read-only for player)&lt;br /&gt;
The &amp;quot;primary aggressor&amp;quot; of the ship's AI. Often the last ship to attack this ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIScript&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''AIScript''' : String (read-only)&lt;br /&gt;
The name of the ship’s current Javascript-based AI. If the ship is using plist-based AI, this will always be &amp;quot;&amp;lt;code&amp;gt;oolite-nullAI.js&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AIScriptWakeTime|AIScriptWakeTime]]&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;, &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIScriptWakeTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''AIScriptWaketime''' : Number (read-write)&lt;br /&gt;
The next game time at which the ship's Javascript-based AI script will receive an &amp;lt;code&amp;gt;aiAwoken&amp;lt;/code&amp;gt; event.&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 plist 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;alertCondition&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertCondition''' : Number (read-only integer)&lt;br /&gt;
The ship's current alert condition (Docked = 0, Green = 1, Yellow = 2, Red = 3). Non-Station non-Player ships are generally only found at condition Yellow or Red.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[Oolite JavaScript Reference: Station#alertCondition|station.alertCondition]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;autoAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''autoAI''' : Boolean (read-only)&lt;br /&gt;
The value of the &amp;lt;code&amp;gt;&amp;quot;auto_ai&amp;quot;&amp;lt;/code&amp;gt; shipdata key. If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship's provider has given permission for scripts (such as the system populator) to alter the AI of this ship to better fit into scenarios or roles. If this is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the ship's provider would prefer you not to alter the AI of this ship but to use it as-is.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;autoWeapons&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''autoWeapons''' : Boolean (read-only)&lt;br /&gt;
The value of the &amp;lt;code&amp;gt;&amp;quot;auto_weapons&amp;quot;&amp;lt;/code&amp;gt; shipdata key. If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship's provider has given permission for scripts (such as the system populator) to alter the properties of this ship to better fit into scenarios or roles. If this is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the ship's provider would prefer you not to alter the properties of this ship but to use it as-is.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;beaconCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''beaconCode''' : String (read-only in 1.76, read-write from 1.77)&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;. This cannot be changed by script for either the player's ship or the main station.&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;beaconLabel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''beaconLabel''' : String (read/write, read-only for player)&lt;br /&gt;
A full label for the beacon. This is useful where the beacon code and the full beacon label do not begin with the same letter.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;boundingBox&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''boundingBox''' : Vector (read-only)&lt;br /&gt;
For ships, a vector describing the dimensions of the cuboid box containing the ship aligned to the ship axes, including all non-flasher sub-entities. For sub-entities, the dimensions of the box for the sub-entity alone.&lt;br /&gt;
&lt;br /&gt;
Vector components match the standard model order - &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is width, &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; is height, &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; is length.&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.&lt;br /&gt;
&lt;br /&gt;
In 1.77, changes to the bounty are given a reason. If you change this directly, the reason sent to [[Oolite JavaScript Reference: Ship script event handlers#shipBountyChanged|shipBountyChanged]] will be &amp;quot;scripted&amp;quot;. To set a different reason, use [[#setBounty|setBounty]] instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoList&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''cargoList''' : Array (read-only)&lt;br /&gt;
A list of the ship's current cargo, grouped by cargo type.&lt;br /&gt;
&lt;br /&gt;
An item looks like this:&lt;br /&gt;
 {&lt;br /&gt;
    unit: &amp;quot;t&amp;quot;,&lt;br /&gt;
    displayName: &amp;quot;Liquor/Wines&amp;quot;,&lt;br /&gt;
    commodity: &amp;quot;liquor_wines&amp;quot;,&lt;br /&gt;
    quantity: 3&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This property is for non-player ships.  For the player ship, use &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Manifest#list|manifest.list]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&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;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceCapacity''' : Number (read-only in 1.80, read/write in 1.81, integer)&lt;br /&gt;
The ship’s cargo capacity, in tons.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;collisionExceptions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''collisionExceptions''' : Array (read-only)&lt;br /&gt;
A list of ships this ship is currently prevented from colliding with. See [[#addCollisionException|addCollisionException]] and [[#removeCollisionException|removeCollisionException]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''commodity''' : String (read-only)&lt;br /&gt;
The commodity for cargo containers as a lowercase string. Returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-cargo ships. For scripted cargo that has no specific cargo defined, it returns the general description &amp;quot;goods&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commodityAmount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''commodityAmount''' : Number (read-only)&lt;br /&gt;
The amount of commodity in a cargo container. (not the number of containers in a ship)&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#awardContract|awardContract()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeContract|removeContract()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;&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;crew&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''crew''' : Array (read-only)&lt;br /&gt;
An array containing the ship's crew. Each crew member is represented as a dictionary:&lt;br /&gt;
  {&lt;br /&gt;
   &amp;quot;description&amp;quot;:&amp;quot;a small yellow horned humanoid from Malama&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;:&amp;quot;Masten Onlo&amp;quot;,&lt;br /&gt;
   &amp;quot;homeSystem&amp;quot;:49,&lt;br /&gt;
   &amp;quot;insuranceCredits&amp;quot;:500,&lt;br /&gt;
   &amp;quot;species&amp;quot;:&amp;quot;small yellow horned humanoid&amp;quot;,&lt;br /&gt;
   &amp;quot;legalStatus&amp;quot;:0&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Note that in current Oolite versions ships only have a single crew member defined. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setCrew|setCrew()]]&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;currentWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}} &lt;br /&gt;
 '''currentWeapon''' : EquipmentType (read/write)&lt;br /&gt;
A shortcut property to whichever of &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; or &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt; represents the ship's currently active laser mount.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''dataKey''' : String (read-only)&lt;br /&gt;
The ship data key used to define this ship (e.g. &amp;lt;code&amp;gt;&amp;quot;adder-player&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;coriolis-station&amp;quot;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;defenseTargets&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''defenseTargets''' : Array (read-only)&lt;br /&gt;
The array of defense targets that the ship has. If the ship has point defense weapons (turrets, thargoid lasers) it may fire them at these targets if it cannot hit its primary target.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addDefenseTarget|addDefenseTarget]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#clearDefenseTargets|clearDefenseTargets]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;desiredRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''desiredRange''' : Number (read/write nonnegative, read-only for player)&lt;br /&gt;
The range the AI uses in various AI routines to set a distance between the ship and another object - for example, the radius of a sphere around a destination point, or the distance to flee from a hostile ship.&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;destination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''destination''' : Vector (read/write, read-only for player)&lt;br /&gt;
The destination coordinates for the AI, used in behaviours such as &amp;lt;code&amp;gt;performFlyToRangeFromDestination&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;destinationSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''destinationSystem''' : Number (read/write)&lt;br /&gt;
The destination system ID of the ship, used by the AI for certain decisions. This defaults to the current system when a ship is spawned.&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 in 1.78 or earlier, it is the same as &amp;lt;code&amp;gt;[[#name|name]]&amp;lt;/code&amp;gt;. In 1.79 or later, it is a combination of &amp;lt;code&amp;gt;[[#shipClassName|shipClassName]]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[[#shipUniqueName|shipUniqueName]]&amp;lt;/code&amp;gt;.&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]]&lt;br /&gt;
The Station the ship is currently docked to.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''dockingInstructions''' : Object (read-only)&lt;br /&gt;
If the ship is currently attempting to dock with a station, this describes the next step on its docking procedure&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
    station: [Station &amp;quot;Coriolis Station&amp;quot; &amp;quot;Coriolis Station&amp;quot; position: (-31043.6, -94232.3, 619036) scanClass: CLASS_STATION status: STATUS_ACTIVE],&lt;br /&gt;
    match_rotation: 0,&lt;br /&gt;
    ai_message: &amp;quot;APPROACH_COORDINATES&amp;quot;,&lt;br /&gt;
    speed: 512,&lt;br /&gt;
    destination: {&lt;br /&gt;
        x: -28033.37401563089,&lt;br /&gt;
        y: -92813.76688970842,&lt;br /&gt;
        z: 622226.0625336492&lt;br /&gt;
    },&lt;br /&gt;
    range: 96&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requestDockingInstructions|requestDockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#recallDockingInstructions|recallDockingInstructions]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;energyRechargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''energyRechargeRate''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The rate at which energy is replenished in every second. The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;energy_recharge_rate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note for the player ship that this includes the boost from an extra or naval energy unit, and NPC (but not player) ships with military shield boosters also have an increase to this in lieu of actual shields.&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, read/write in 1.81 onwards)&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;
Altering this value is possible in 1.81 onwards, but requires a re-bind of the materials and shaders, and so is a relatively slow process.&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;
'''See also:''' &amp;lt;code&amp;gt;[[#maxEscorts|maxEscorts]]&amp;lt;/code&amp;gt;&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;exhaustEmissiveColor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''exhaustEmissiveColor''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The baseline colour of the ship's exhaust. Damage to the ship, and use of injectors and torus drive, apply a fixed transformation to this colour, so not all colours are effective as exhaust colours.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exhausts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''exhausts''' : Array (read-only)&lt;br /&gt;
An array of the ship's [[Oolite JavaScript Reference: ExhaustPlume|ExhaustPlume]] subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;flashers&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''flashers''' : Array (read-only)&lt;br /&gt;
An array of the ship's [[Oolite JavaScript Reference: Flasher|Flasher]] subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;forwardWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''forwardWeapon''' : EquipmentType (read-only, read/write in 1.77)&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;code&amp;gt;fuelChargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''fuelChargeRate''' : Number (read-only)&lt;br /&gt;
The cost, relative to the cost for a new Cobra III, of a unit of fuel. When buying fuel for a ship, the price in [[equipment.plist]] will be multiplied by this number.&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;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 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;
Note that in 1.80 and earlier writes to this property had no effect on the player ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;homeSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''homeSystem''' : Number (read/write)&lt;br /&gt;
The home system ID of the ship, used by the AI for certain decisions. This defaults to the current system when a ship is spawned.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hyperspaceSpinTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''hyperspaceSpinTime''' : Number (read/write)&lt;br /&gt;
The length of the ship's hyperspace countdown.&lt;br /&gt;
&lt;br /&gt;
Setting this to a negative value disables the drive entirely.&lt;br /&gt;
&lt;br /&gt;
Note that most NPC ship jumps use &amp;lt;code&amp;gt;ship.exitSystem()&amp;lt;/code&amp;gt; to make the jump, which does not have a delay. Provided this value is zero or positive, the ship will jump instantly if &amp;lt;code&amp;gt;ship.exitSystem()&amp;lt;/code&amp;gt; is called. The AI must use this property elsewhere if a delay before jumping is required.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;injectorBurnRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''injectorBurnRate''' : Number (read/write)&lt;br /&gt;
The rate at which the ship's injectors burn fuel in deci-LY per second. The default is 0.25.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;injectorSpeedFactor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''injectorSpeedFactor''' : Number (read/write)&lt;br /&gt;
The multiplier to maximum speed granted to this ship when it is using injectors. The default is 7, and values must be between 1.0 and 32.0 (the torus drive's speed)&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;lt;code&amp;gt;&amp;quot;boulder&amp;quot;&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt; 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 * [[Oolite JavaScript Reference: Entity#maxEnergy|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;isFleeing&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isFleeing''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is currently fleeing combat. This may be queried for the player ship too, though the value is somewhat of a guess in that case as it's impossible to say for certain what the player is intending by their actions.&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;, &amp;lt;code&amp;gt;[[#restoreSubEntities|restoreSubEntities()]]&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 [[Shipdata.plist#has_military_jammer|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;isMinable&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isMinable''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship will break up usefully when hit by a mining laser, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. By default this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for anything with &amp;lt;code&amp;gt;&amp;quot;asteroid&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;boulder&amp;quot;&amp;lt;/code&amp;gt; in its role list - if you need to add anything which miners shouldn't be shooting at to those roles, give it &amp;lt;code&amp;gt;&amp;quot;no_boulders&amp;quot; = yes;&amp;lt;/code&amp;gt; in its [[shipdata.plist]].&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- ships, stations and escape pods have pilots whereas cargo, rocks, missiles and buoys do not.&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: &amp;lt;code&amp;gt;&amp;quot;CLASS_ROCK&amp;quot;&amp;lt;/code&amp;gt;)&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;isTurret&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isTurret''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a plasma turret sub-entity, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&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;laserHeatLevel&amp;lt;/code&amp;gt;* ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''laserHeatLevel''' : Number (read-only, 0 to 1)&lt;br /&gt;
The temperature of the ship's currently active weapon. Thermal cut-out is active above 0.85. For non-player ships, if their forward weapon is empty, then the temperature of the forward weapon may be the temperature of a subentity forward weapon.&lt;br /&gt;
 '''laserHeatLevelAft''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelForward''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelPort''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelStarboard''' : Number (read-only, 0 to 1)&lt;br /&gt;
The temperature of specific laser mounts can also be queried.&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 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; in their ''shipdata.plist'' declarations.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedForFines&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''markedForFines''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has been marked for fines the next time it docks at this system's main station.&lt;br /&gt;
&lt;br /&gt;
'''See also''' : [[#markTargetForFines|markTargetForFines()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxEscorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxEscorts''' : Number (read/write)&lt;br /&gt;
The maximum number of escorts this ship can have. This cannot be set lower than the number of escorts it currently has, or higher than the value of the MAX_ESCORTS constant (currently 16). There may be other reasons why a ship can have fewer escorts than the value of &amp;lt;code&amp;gt;maxEscorts&amp;lt;/code&amp;gt; (for instance, ships which are escorts cannot have their own escorts)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#escortGroup|escortGroup]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxPitch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxPitch''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum pitch rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#pitch|pitch]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxRoll&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxRoll''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum roll rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roll|roll]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxSpeed''' : Number (read-only, read/write from 1.81)&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 the [[Witch Fuel Injectors]] or [[Torus Drive]] 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, read/write from 1.81)&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;maxYaw&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxYaw''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum yaw rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#yaw|yaw]]&amp;lt;/code&amp;gt;&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;parcelCount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcelCount''' : Number (read-only integer)&lt;br /&gt;
The ship’s current number of parcels.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addParcel|addParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeParcel|removeParcel()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;parcels&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcels''' : Array (read-only NSDictionary)&lt;br /&gt;
The ship’s parcels. (For now only available for the player). Each parcel 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.parcels[0].name&lt;br /&gt;
 player.ship.parcels[0].start&lt;br /&gt;
 player.ship.parcels[0].destination&lt;br /&gt;
 player.ship.parcels[0].startName&lt;br /&gt;
 player.ship.parcels[0].destinationName&lt;br /&gt;
 player.ship.parcels[0].eta&lt;br /&gt;
 player.ship.parcels[0].etaDescription&lt;br /&gt;
 player.ship.parcels[0].fee  // The final fee, paid out 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 parcel.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addParcel|addParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeParcel|removeParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pitch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''pitch''' : Number (read-only)&lt;br /&gt;
The rate of pitch of the ship in radians/second (positive for dive, negative for climb)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxPitch|maxPitch]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''portWeapon''' : EquipmentType (read-only, read/write in 1.77)&lt;br /&gt;
The currently equipped port weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. This is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships in 1.76.&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 &amp;lt;code&amp;gt;&amp;quot;pirate trader(0.5) escort&amp;quot;&amp;lt;/code&amp;gt; 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; are &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; are &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;
 '''roleWeights''' : 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;roll&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''roll''' : Number (read-only, read/write for stations)&lt;br /&gt;
The rate of roll of the ship in radians/second (positive for anti-clockwise, negative for clockwise)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxRoll|maxRoll]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#roll|station.roll]]&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;scanDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''scanDescription''' : String (read/write)&lt;br /&gt;
The description of the ship in the &amp;quot;legal status&amp;quot; text shown by the [[Scanner Targeting Enhancement]]. If this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; then the default text for the ship's scan class and bounty level will be shown.&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;, &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor1|scannerHostileDisplayColor1]]&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;, &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor2|scannerHostileDisplayColor2]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerHostileDisplayColor1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''scannerHostileDisplayColor1''' : [[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 the ship is specifically targeting the player with hostile intent. 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;
If hostile colours are set but normal colours aren't, then the normal colours will default to those for the ship's scan class. If normal colours are set but hostile colours aren't, the scanner blip will not change colour when the ship is hostile.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor2|scannerHostileDisplayColor2]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#scannerDisplayColor1|scannerDisplayColor1]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerHostileDisplayColor2&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''scannerHostileDisplayColor2''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The second scanner colour when the ship is specifically targeting the player with hostile intent.. If both &amp;lt;code&amp;gt;scannerHostileDisplayColor1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;scannerHostileDisplayColor2&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;[[#scannerHostileDisplayColor1|scannerHostileDisplayColor1]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#scannerDisplayColor2|scannerDisplayColor2]]&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;scriptedMisjumpRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''scriptedMisjumpRange''' : Number (read/write)&lt;br /&gt;
If this ship misjumps, this number will be consulted to determine the length of the resulting misjump relative to the normal jump range. Setting this does not in itself force a misjump - this must occur through the usual mechanisms. Values must be greater than 0.0 and less than 1.0, and the default is 0.5 for a traditional half-way misjump. This will be reset to 0.5 at the same time as &amp;lt;code&amp;gt;[[#scriptedMisjump|scriptedMisjump]]&amp;lt;/code&amp;gt; is reset to &amp;lt;code&amp;gt;false&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 ship’s ''[[shipdata.plist]]'' entry, if any. This may be any [[property list]] object, but the recommended 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 explicitly 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;shipClassName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''shipClassName''' : String (read/write)&lt;br /&gt;
The name of the ship class (e.g. &amp;lt;code&amp;gt;&amp;quot;Python&amp;quot;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipUniqueName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''shipUniqueName''' : String (read/write)&lt;br /&gt;
The name of this specific ship (e.g. &amp;lt;code&amp;gt;&amp;quot;Sunrise of Lave&amp;quot;&amp;lt;/code&amp;gt;)&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, read/write in 1.77)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. This is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships in 1.76.&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;, &amp;lt;code&amp;gt;[[#restoreSubEntities|restoreSubEntities()]]&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;subEntityRotation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''subEntityRotation''' : Quaternion (read/write)&lt;br /&gt;
The subentity rotational velocity, expressed as a quaternion. This much rotation will be applied per second. Exact 180 degree rotations should not be specified, as it is not possible to determine what route to use to make that rotation. This property is ignored when set on non-subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sunGlareFilter&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''sunGlareFilter''' : Number (read/write)&lt;br /&gt;
The strength of the sun glare filter on this ship. It must be in the range 0 to 1 (0 is no filter).&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 before 1.81)&lt;br /&gt;
The ship’s thrust, ranging from 0 to &amp;lt;code&amp;gt;[[#maxThrust|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 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, 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;weaponFacings&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''weaponFacings''' : Number (read-only, integer in range 0-15)&lt;br /&gt;
The weapon facings available for the ship. The format is the same as the equivalent property in [[shipyard.plist]] or [[shipdata.plist]] - a bitmask with the following bits:&amp;lt;br&amp;gt;&lt;br /&gt;
1 - fore&amp;lt;br&amp;gt;&lt;br /&gt;
2 - aft&amp;lt;br&amp;gt;&lt;br /&gt;
4 - port&amp;lt;br&amp;gt;&lt;br /&gt;
8 - starboard&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;weaponPosition*&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''weaponPositionAft''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionForward''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionPort''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionStarboard''' : Vector (read-only)&lt;br /&gt;
&lt;br /&gt;
{{Oolite-prop-added|1.83}}&lt;br /&gt;
 '''weaponPositionAft''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionForward''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionPort''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionStarboard''' : Array of Vectors (read-only)&lt;br /&gt;
&lt;br /&gt;
The position relative to the ship at which the appropriate laser beam will start. These properties do not imply that the ship has or can have any such weapon.&lt;br /&gt;
&lt;br /&gt;
In 1.83 this property changed syntax to become an array of vectors, as ships can now have multiple mounts per facing.&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;
=== &amp;lt;code&amp;gt;yaw&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''yaw''' : Number (read-only)&lt;br /&gt;
The rate of yaw of the ship in radians/second (positive for right, negative for left)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxYaw|maxYaw]]&amp;lt;/code&amp;gt;&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 escape pod.  It will launch all escape pods on board leaving the ship behind as a empty hulk (&amp;lt;code&amp;gt;scanClass === &amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;). This command does nothing when no escape pod is present.&amp;lt;br&amp;gt;&lt;br /&gt;
Presence of an escape pod 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;addCollisionException&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''addCollisionException'''(exception : Ship)&lt;br /&gt;
Prevented this ship and the selected ship from colliding. See [[#collisionExceptions|collisionExceptions]] and [[#removeCollisionException|removeCollisionException]].&lt;br /&gt;
&lt;br /&gt;
Prevention from collision will specifically prevent the following:&lt;br /&gt;
&lt;br /&gt;
* the ships colliding with each other and suffering collision damage and/or momentum change&lt;br /&gt;
* the ships receiving collision warning events if they come close to each other&lt;br /&gt;
* if one of the ships is a station, the other ship will not be able to dock with it even if it enters a dock&lt;br /&gt;
&lt;br /&gt;
This has no useful effect when applied to a subentity.&lt;br /&gt;
&lt;br /&gt;
Adding a collision exception which already exists has no effect but will not cause an error.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addDefenseTarget&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''addDefenseTarget'''(target : Ship)&lt;br /&gt;
Adds the target ship to this ship's list of point [[#defenseTargets|defense targets]], if it isn't already.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;adjustCargo&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''adjustCargo'''(commodity : String, amount : Number) : Boolean&lt;br /&gt;
Adjust the quantity of the specified commodity carried by the ship. Amount may be negative to remove cargo. The method will return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if the operation would fail due to insufficient free space or carried cargo and will not make a partial adjustment in this case.&lt;br /&gt;
&lt;br /&gt;
This method is for non-player ships.  For the player ship, use &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setCargoType|setCargoType()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&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;becomeCascadeExplosion&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''becomeCascadeExplosion'''()&lt;br /&gt;
This method causes the ship to explode as if it were hit by a quirium cascade.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;broadcastCascadeImminent&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''broadcastCascadeImminent'''()&lt;br /&gt;
This method causes the ship to broadcast a message to the AIs of all nearby ships warning them of an imminent cascade explosion. It is polite to call this a few seconds before calling &amp;lt;code&amp;gt;becomeCascadeExplosion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;broadcastDistressMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''broadcastDistressMessage'''()&lt;br /&gt;
This method causes the ship to broadcast a distress message to the AIs of all nearby ships (received also by the player as a comms message). Ships receiving a distress message will often intervene in the fight, depending on their own AI and the roles of the ships already involved.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;checkCourseToDestination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''checkCourseToDestination'''()&lt;br /&gt;
Checks the line between the ship's current position and its destination, and returns either &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; or an Entity (usually a planet, sun or other ship) that this ship would risk collision with if it travelled along that course.&lt;br /&gt;
&lt;br /&gt;
'''See also''': [[#getSafeCourseToDestination|getSafeCourseToDestination()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;checkScanner&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''checkScanner'''([poweredOnly : Boolean]) : Array&lt;br /&gt;
Runs a fast scanner check and returns the results. At most 32 objects within scanner range will be returned. If the &amp;lt;code&amp;gt;poweredOnly&amp;lt;/code&amp;gt; parameter is present and set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then only powered objects will be returned (i.e. ships with a scan class other than &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;CLASS_ROCK&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This method is usually considerably quicker than &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: System#filteredEntities|system.filteredEntities()]]&amp;lt;/code&amp;gt; and similar methods, with little loss of accuracy, though it is still advisable to cache the result for a while before re-scanning.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;clearDefenseTargets&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''clearDefenseTargets'''()&lt;br /&gt;
Clears the ship's list of point [[#defenseTargets|defense targets]].&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#commsMessage|player.commsMessage()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;damageAssessment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''damageAssessment'''() : Number&lt;br /&gt;
Returns a number indicating the amount of damage or supply usage by this ship. Zero means that the ship is in excellent fighting condition, while higher numbers indicate increasing amounts of damage or supply shortages.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dealEnergyDamage&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''dealEnergyDamage'''(damage : Number, idealRange : Number [, velocityBias : Number])&lt;br /&gt;
Deals damage to all ships within a sphere centred on this ship. If this ship has an owner (e.g. it is a missile or a subentity) the damage will be credited to its owner. Damage is dealt according to the following formula:&lt;br /&gt;
* Further away than MAX_SCANNER_RANGE (25.6km): deal no damage&lt;br /&gt;
* At or closer than &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt;: deal &amp;lt;code&amp;gt;damage&amp;lt;/code&amp;gt; plus (or minus, for receding objects) &amp;lt;code&amp;gt;velocityBias&amp;lt;/code&amp;gt; damage for every 0.001LM of relative closing speed, up to a maximum of 1.0LM&lt;br /&gt;
* Between &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt; and a derived maximum range: calculate the damage that would have been done at &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt;, and then divide it by the square of the ratio of &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt; and the real range (i.e inverse-square). The derived maximum range is the distance where a target with no relative closing speed would take 1 point of damage.&lt;br /&gt;
&lt;br /&gt;
As an example, the standard Oolite missile uses &amp;lt;code&amp;gt;dealEnergyDamage(170, 32.5, 0.25)&amp;lt;/code&amp;gt;, has a maximum speed of 0.75LM, and its AI tries to detonate it 25m from its target. Some worked examples (for comparision, one energy bank can absorb 64 points of damage, and a standard shield generator can absorb 128 points of damage):&lt;br /&gt;
* The missile is fired at a stationary asteroid. It detonates at 25m, within the ideal range, and the relative closing speed is 0.75LM. The asteroid takes 170 + (0.25 * 750) = 357.5 points of damage&lt;br /&gt;
* The missile is fired at a Cobra Mk III, which tries to flee from and evade the missile at its top speed of 0.35LM. The missile detonates at 25m, and the evasive manoeuvres mean that it is not heading directly at the Cobra when it detonates. The relative closing speed is 0.38LM. The Cobra takes 170 + (0.25 * 380) = 265 points of damage.&lt;br /&gt;
* An Anaconda freighter travelling at 0.2LM fires a missile at a distant Fer-de-lance. After the missile has travelled 150m away from the Anaconda, it is hit by an ECM pulse from the FDL, and detonates. The relative velocity is -0.55LM (the missile is travelling away from the Anaconda), so the damage at the ideal range would be 170 - (0.25 * 550) = 32.5. The damage is then divided by (150 / 32.5)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, so the Anaconda takes about 1.5 points of damage.&lt;br /&gt;
* A missile fired at something else detonates 500m away from a Sidewinder. The inverse-square rule divides the damage by (500 / 32.5)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, so the base damage at this range (ignoring velocityBias) is only 0.7. The Sidewinder is therefore safely outside the blast radius, and is not considered for damage. &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;
Cause a random number (at least 1 if possible) of the ship's escorts which are not already attacking a target to attack this ship's primary target, unless this method has already been called for the current target without meanwhile being called for a different target.&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'''([amount : Number, commodity: String]) : 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;
In 1.79 or later, multiple items may be scheduled for dumping by passing the number as a parameter.&lt;br /&gt;
&lt;br /&gt;
In 1.81 or later, a preferred commodity may be specified (if this is not present, a random item will be dumped as usual). This preference only applies to the first item dropped, not subsequent ones.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#ejectItem|ejectItem]]&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 &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt; of the ejected item will always be &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;.&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 &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt; of the ejected item will always be &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;.&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;enterWormhole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''enterWormhole'''([wormhole : Wormhole])&lt;br /&gt;
If the player has entered witchspace, but before the old system is removed from memory, this method may be used to add this ship to the contents of the specified outbound wormhole. If no parameter is given, add them to the player's wormhole.&lt;br /&gt;
&lt;br /&gt;
If the player is not entering witchspace, this method does nothing: the ship must fly to the wormhole in the normal way to enter it.&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]] [, multiple : Boolean]) : String or Object&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;
In 1.81 and later, if the optional &amp;lt;code&amp;gt;multiple&amp;lt;/code&amp;gt; parameter is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it will instead return an object in this format:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;EQUIPMENT_OK&amp;quot;: 3.&lt;br /&gt;
    &amp;quot;EQUIPMENT_DAMAGED&amp;quot;: 2&lt;br /&gt;
 }&lt;br /&gt;
to allow equipments which allow fitting multiple to be queried. If multiple equipments can be fitted, not setting the 'multiple' parameter will return the 'best' state of all items of that type.&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;findNearestStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''findNearestStation'''()&lt;br /&gt;
Returns the nearest Station entity to this ship. This is quicker than manually searching &amp;lt;code&amp;gt;system.stations&amp;lt;/code&amp;gt; and much quicker than using &amp;lt;code&amp;gt;system.filteredEntities()&amp;lt;/code&amp;gt;.&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;getSafeCourseToDestination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''getSafeCourseToDestination'''()&lt;br /&gt;
Returns some coordinates which can be flown to as an intermediate destination to allow travel between the ship's current position and its destination without colliding with any objects on the way. Use this if &amp;lt;code&amp;gt;checkCourseToDestination&amp;lt;/code&amp;gt; returns an object you are unable or unwilling to destroy to calculate a new route.&lt;br /&gt;
&lt;br /&gt;
'''See also''': [[#checkCourseToDestination|checkCourseToDestination()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getMaterials&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''getMaterials'''() : Object&lt;br /&gt;
getMaterials() returns the ship's current materials dictionary, or if none present an empty dictionary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getShaders|getShaders()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getShaders&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''getShaders'''() : Object&lt;br /&gt;
getShaders() returns the ship's current shaders dictionary, or if none present an empty dictionary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setShaders|setShaders()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getMaterials|getMaterials()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasEquipmentProviding&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''hasEquipmentProviding'''(key : String) : Boolean&lt;br /&gt;
This method returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has any equipment providing the &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; equipment type, and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''hasRole'''(role : String) : Boolean&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;markTargetForFines&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''markTargetForFines()'''&lt;br /&gt;
If this ship is eligible to give out fines and the primary target has a bounty, mark the current primary target for fines, which will need to be paid when the ship docks. If used on a ship other than the player, of course, the fines are not particularly meaningful.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;notifyGroupOfWormhole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''notifyGroupOfWormhole()'''&lt;br /&gt;
Tells the ship's group about a wormhole (usually the one this ship has just entered). Causes a &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship script event handlers#wormholeSuggested|wormholeSuggested]]&amp;lt;/code&amp;gt; event to occur in the scripts of other group members.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;offerToEscort&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''offerToEscort(mother : Ship)'''&lt;br /&gt;
Offer to escort the specified ship. The ship making the offer must have the same scan class as the mothership and must have one of the designated escort roles. After the mothership has made a decision this ship will receive either an &amp;lt;code&amp;gt;escortAccepted&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;escortRejected&amp;lt;/code&amp;gt; ship script event.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;perform*&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Each of these methods switches the frame-by-frame behaviour of the ship to a different mode. It may not necessarily remain in that mode, however - for example, those modes which require a target will usually fall back to idle mode if the target is lost.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performAttack&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performAttack()'''&lt;br /&gt;
Attack the current target with available weapons.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performCollect&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performCollect()'''&lt;br /&gt;
Attempt to scoop up the current target. If the current target is not scoopable, it will be lost.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performEscort&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performEscort()'''&lt;br /&gt;
Escort the group leader. If this ship is not an escort of the group leader, it will not receive escort position updates from that ship.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFaceDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFaceDestination()'''&lt;br /&gt;
Come to a stop, and turn to face the current destination coordinates.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFlee&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFlee()'''&lt;br /&gt;
Flee from the current target, using injectors if possible, until it is out of scanner range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFlyToRangeFromDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFlyToRangeFromDestination()'''&lt;br /&gt;
Fly to the current [[#destination|destination]] coordinates, stopping when the distance between the ship and those coordinates is the [[#desiredRange|desiredRange]]. If the ship is already closer to the destination coordinates than the desired range, it will move away from the coordinates.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performHold&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performHold()'''&lt;br /&gt;
Come to a stop, and continually turn to face the current target&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performIdle&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performIdle()'''&lt;br /&gt;
Cancel any current turns to return to level flight, then move forward at current speed.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performIntercept&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performIntercept()'''&lt;br /&gt;
Fly to intercept (i.e. ram) the current target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performLandOnPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performLandOnPlanet()'''&lt;br /&gt;
Land on rather than crash into the planet. This is a slow flight, so it is recommended to get close to the planet surface before activating this behaviour.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performMining&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performMining()'''&lt;br /&gt;
Attack the current target with a mining laser. This does not count as hostile behaviour, so cannot be used except on rocks.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performScriptedAI&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performScriptedAI()'''&lt;br /&gt;
Request flight instructions from a [[OXP_Scripted_AI|scripted AI]] callback each frame.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performScriptedAttackAI&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performScriptedAttackAI()'''&lt;br /&gt;
Request flight instructions, including weapons fire, from a [[OXP_Scripted_AI|scripted AI]] callback each frame.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performStop&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performStop()'''&lt;br /&gt;
Come to a complete halt&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performTumble&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performTumble()'''&lt;br /&gt;
Come to a complete halt and rotate randomly.&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;recallDockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''recallDockingInstructions'''() : Object&lt;br /&gt;
Returns the current docking instructions as an object, and sets the destination, desired range and desired speed to match the instructions. Use this if the ship may have been interrupted while docking to ensure its flight parameters are set correctly.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dockingInstructions|dockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requestDockingInstructions|requestDockingInstructions]]&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 [[Oolite JavaScript Reference: Ship script event handlers#shipRemoved|this.shipRemoved(suppressDeathEvent)]] event. By default it will also trigger a [[Oolite JavaScript Reference: Ship script event handlers#shipDied|this.shipDied()]] event, unless &amp;lt;code&amp;gt;suppressDeathEvent&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&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;removeCollisionException&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''removeCollisionException'''(exception : Ship)&lt;br /&gt;
Allow this ship and the selected ship to collide again. See [[#collisionExceptions|collisionExceptions]] and [[#addCollisionException|addCollisionException]].&lt;br /&gt;
&lt;br /&gt;
Removing a collision exception which does not exist has no effect but will not cause an error.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeDefenseTarget&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''removeDefenseTarget'''(target : Ship)&lt;br /&gt;
Ensures that the target ship is not on this ship's list of point [[#defenseTargets|defense targets]].&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 method 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;
Note that in Oolite prior to 1.76.1 there was a bug which could sometimes cause the game to crash if this method was used on pylon-mounted equipment. Therefore, if you do this in your OXP, you should set (at least) 1.76.1 as the version in requires.plist&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;requestDockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''requestDockingInstructions'''() : Object&lt;br /&gt;
Requests the next docking instructions from the station, and returns them as an object, setting the destination, desired range and desired speed to match the instructions. Use this to get the next step in the docking sequence after completing the previous one.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dockingInstructions|dockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#recallDockingInstructions|recallDockingInstructions]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requestHelpFromGroup&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''requestHelpFromGroup'''()&lt;br /&gt;
This method sends the &amp;lt;code&amp;gt;helpRequestReceived&amp;lt;/code&amp;gt; event to the other ships in this ship's group and escort group, sending the name of this ship's current target as the aggressor.&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 or removed subentities of the ship. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if any subentities were added. Whether or not any subentities were added, this will also reset all subentities to their original configuration of position, orientation and other properties.&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;[[#isFrangible|isFrangible]]&amp;lt;/code&amp;gt;&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. From 1.79 onwards AI files may either be plist-based (with a .plist extension) or Javascript-based (with a .js extension).&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;setBounty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''setBounty'''(bounty : Number, reason : String)&lt;br /&gt;
Sets the ship's bounty to the new value. &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt; will be sent to [[Oolite JavaScript Reference: Ship script event handlers#shipBountyChanged|shipBountyChanged()]].&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#bounty|bounty]]&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 &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; specified for a cargo barrel.  This cannot be used to set cargo for ships.  When more units are defined than 1 ton, the count is reduced to 1 ton.  It returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when the selected commodity is unknown. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is not specified, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; will be assumed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCargoType&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setCargoType'''(commodityType : String) : Boolean&lt;br /&gt;
Attempts to set the ship's cargo hold to contain commodities of the specified type, discarding any cargo already present. This should generally only be used immediately after a ship is spawned. Valid commodity types are:&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;SCARCE_GOODS&amp;quot;&amp;lt;/code&amp;gt;: goods which are likely to be rare in the current system, usually legal&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;PLENTIFUL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: goods which are likely to be plentiful in the current system, usually legal&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;MEDICAL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: narcotics (used for the Moray Medical Boat)&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;ILLEGAL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: various goods likely to be rare in the current system, with a strong bias towards contraband&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;PIRATE_GOODS&amp;quot;&amp;lt;/code&amp;gt;: similar to &amp;lt;code&amp;gt;&amp;quot;ILLEGAL_GOODS&amp;quot;&amp;lt;/code&amp;gt; but the total amount carried will be lower&lt;br /&gt;
This will return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if an unrecognised commodity type is used and will throw an exception if used on a cargo pod rather than a cargo carrier. Using it on a ship like an Asp without a cargo hold is valid but pointless.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCrew&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setCrew'''(Object) : Boolean&lt;br /&gt;
Sets the ship's crew to one represented by the given object (or sets the ship to uncrewed if &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; is given as a parameter). Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if this succeeds, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise (if the ship is ''always'' unpiloted). The object has the same keys as [[characters.plist]], all of which are optional and will be replaced with default values if unset. They are applied in the following order:&lt;br /&gt;
* origin system&lt;br /&gt;
* random seed&lt;br /&gt;
* role&lt;br /&gt;
* the rest&lt;br /&gt;
You can therefore set a random seed or role to get particular behaviour, and use the other keys to override it.&lt;br /&gt;
&lt;br /&gt;
At the moment this method only sets the first crew member (the pilot of the ship) in [[Oolite JavaScript Reference: Ship#crew|crew]][0] .&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;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: EquipmentInfo#canBeDamaged|EquipmentInfo.canBeDamaged]]&amp;lt;/code&amp;gt;for equipment that cannot be damaged&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;, &amp;lt;code&amp;gt;[[#getMaterials|getMaterials()]]&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;, &amp;lt;code&amp;gt;[[#getShaders|getShaders()]]&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;threatAssessment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''threatAssessment'''(full : Boolean) : Number&lt;br /&gt;
Returns a number indicating the relative strength of the ship. If the 'full' parameter is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, additional information will be considered as part of the assessment which would generally only be known by ships which know this ship or have seen it in combat. Otherwise, only data which could reasonably be expected to be common knowledge based on the class of the ship will be included.&lt;br /&gt;
&lt;br /&gt;
For example, which weapon facings are available is part of the basic assessment, but what forward laser the ship has is part of the full assessment.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;throwSpark&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''throwSpark'''()&lt;br /&gt;
Sets the ship to throw a spark as if it was seriously damaged. If this ship is already scheduled to throw a spark, this does nothing.&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;
== Static Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;keys&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''keys'''() : Array&lt;br /&gt;
Returns all dataKeys of ships defined in all [[shipdata.plist]] including installed [[OXP]]s.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var dataKeysArray = Ship.keys();&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;keysForRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''keysForRole'''(role : String) : Array&lt;br /&gt;
Returns all dataKeys of ships defined in all [[shipdata.plist]] which contains the given role.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var role = &amp;quot;trader&amp;quot;;&lt;br /&gt;
 var roleKeys = Ship.keysForRole( role );&lt;br /&gt;
 log(&amp;quot;keysForRole&amp;quot;, role + &amp;quot;: &amp;quot; + roleKeys );&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roleIsInCategory&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''roles'''(role : String, category : String) : Boolean&lt;br /&gt;
Returns whether the role given is in a particular category as defined in [[role-categories.plist]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 Ship.roleIsInCategory(&amp;quot;trader&amp;quot;,&amp;quot;oolite-pirate-victims&amp;quot;); // true&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''roles'''() : Array&lt;br /&gt;
Returns all roles of ships defined in all [[shipdata.plist]] including installed [[OXP]]s.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var roles = Ship.roles();&lt;br /&gt;
 for( var i = 0; i &amp;lt; roles.length; i++ ) {&lt;br /&gt;
  var roleKeys = Ship.keysForRole( roles[i] );&lt;br /&gt;
  log(&amp;quot;roles&amp;quot;, i + &amp;quot;. &amp;quot;+roles[i] + &amp;quot;: &amp;quot; + roleKeys );&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipDataForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''shipDataForKey'''(datakey : String) : Object&lt;br /&gt;
Returns an object containing a representation of the raw [[shipdata.plist]] entry for a given data key, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if the data key does not exist. Keys not defined in the shipdata.plist entry will not be defined in the object - they won't get their default values.&lt;br /&gt;
&lt;br /&gt;
Using the ship object properties is generally a better way to get this information, but this is useful if you want to find out what a ship might be like if you did add it.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var shipdata = Ship.shipDataForKey(&amp;quot;cobra3-trader&amp;quot;);&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;name&amp;quot;]); // &amp;quot;Cobra Mark III&amp;quot;&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;ship_class_name&amp;quot;]); // undefined&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;ship_unique_name&amp;quot;]); // undefined&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;display_name&amp;quot;]); // undefined&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;setShipDataForKey&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{Oolite-method-added|1.91}}&lt;br /&gt;
 function '''setShipDataForKey'''(datakey : String, newShipData : Object)&lt;br /&gt;
This method modifies or adds properties of a ship class specified by the datakey parameter.  The newShipData parameter can be an existing property defined in shipdata.plist or a new one.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 Ship.setShipDataForKey (&amp;quot;cobra3-trader&amp;quot;, {name: &amp;quot;Cobra trader variant&amp;quot;})&lt;br /&gt;
 var shipdata = Ship.shipDataForKey (&amp;quot;cobra3-trader&amp;quot;)&lt;br /&gt;
 log (&amp;quot;test&amp;quot;, shipdata [&amp;quot;name&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
'''See also''': [http://www.aegidian.org/bb/viewtopic.php?p=274534#p274534 bulletin board post by Tsoj]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Shipdata.plist]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Ship_script_event_handlers&amp;diff=76423</id>
		<title>Oolite JavaScript Reference: Ship script event handlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Ship_script_event_handlers&amp;diff=76423"/>
		<updated>2022-10-29T16:20:35Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* willOpenDockingPortFor */ replaced &amp;quot;function&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a list of event handlers which can be implemented by [[Scripting Oolite with JavaScript|JavaScript scripts for Oolite]].&lt;br /&gt;
&lt;br /&gt;
Ship scripts are linked to Oolite either using the appropriate [[shipdata.plist#script|shipdata.plist]] setting or via javascript using [[Oolite JavaScript Reference: Ship#setScript|ship.setScript]] and are only active when the ship is present. More than one ship can be assigned the same ship script. Each ship will create its own separate copy of the script, each one independent from the others.&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;
Note that a ship script event which affects the player ship (therefore not those marked NPC only, station only, etc.) will also appear as a [[Oolite JavaScript Reference: World script event handlers|world script event]].&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.79 onwards, each ship has two scripts: the &amp;quot;ship script&amp;quot; as in previous versions (&amp;lt;code&amp;gt;ship.script&amp;lt;/code&amp;gt;) and an AI script (&amp;lt;code&amp;gt;ship.AIScript&amp;lt;/code&amp;gt;) which manages [[Oolite Javascript Reference: PriorityAI Documentation|Javascript-based AI]]. The former is intended for constant events related to the ship itself, and the latter is intended for event handling which varies based on what the ship is currently doing. Both scripts receive all events which do not expect a return value. Events expecting a return value are sent to the ship script ''only''.&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 == nil&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.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;
This handler was added for npc ships with test release 1.75, before it was a worldScript only handler.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillLaunchFromStation&amp;lt;/code&amp;gt; handler is called for ship scripts on ship creation, before the shipSpawned event. &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;
&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 tract, when the ship has clearly left the station and AI updating begins.&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;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;stationWithdrewDockingClearance&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;stationWithdrewDockingClearance&amp;lt;/code&amp;gt; handler is received when the station the ship is trying to dock with unexpectedly withdraws clearance (e.g. if &amp;lt;code&amp;gt;station.abortAllDockings&amp;lt;/code&amp;gt; is called).&lt;br /&gt;
&lt;br /&gt;
 this.stationWithdrewDockingClearance = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Witchspace Jumps ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerWillEnterWitchspace&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerWillEnterWitchspace&amp;lt;/code&amp;gt; handler is called just before a witchspace jump starts and after the &amp;lt;code&amp;gt;shipWillEnterWitchspace&amp;lt;/code&amp;gt; handler fires. It is send to all ships in the system to signal that the player is about to leave the system. (By jump or by wormhole)&lt;br /&gt;
&lt;br /&gt;
 this.playerWillEnterWitchspace = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipExitedWormhole&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipExitedWormhole&amp;lt;/code&amp;gt; handler is called when a ship exits a wormhole.&lt;br /&gt;
&lt;br /&gt;
 this.shipExitedWormhole = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWillEnterWormhole&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWillEnterWormhole&amp;lt;/code&amp;gt; handler is called when a ship enters a wormhole. only&lt;br /&gt;
&lt;br /&gt;
 this.shipWillEnterWormhole = 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;shipWitchspaceBlocked&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWitchspaceBlocked&amp;lt;/code&amp;gt; handler is called when a ship is prevented from entering witchspace by the presence of a nearby large mass. The blocking object is passed as a parameter&lt;br /&gt;
&lt;br /&gt;
 this.shipWitchspaceBlocked = function(blocker)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;wormholeSuggested&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;wormholeSuggested&amp;lt;/code&amp;gt; handler is called when another ship enters witchspace and suggests that this ship follows. The wormhole used is passed as a parameter. This is most commonly called when a group leader enters witchspace and wishes to take its escorts with it.&lt;br /&gt;
&lt;br /&gt;
 this.wormholeSuggested = function(wormhole)&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;cascadeWeaponDetected&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;cascadeWeaponDetected&amp;lt;/code&amp;gt; handler fires when a Q-bomb (or equivalent device) detonates within scanner range of the player. The stock Q-mine (and potentially OXP equivalents) will also send this handler at the start of the countdown, giving ships more time to react. The weapon entity will be passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
 this.cascadeWeaponDetected = function(weapon)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;defenseTargetDestroyed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;defenseTargetDestroyed&amp;lt;/code&amp;gt; handler is sent when a defense (i.e. secondary) target is destroyed. A reference to the destroyed ship (which will become invalid shortly) is passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
 this.defenseTargetDestroyed = 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;escortAttack&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;escortAttack&amp;lt;/code&amp;gt; handler is sent to all escorts of a mothership that are deployed. The mother first changes the escorts AI to interceptAI.plist and also sets the escort target to his own target before sending this handler to the escorts.&lt;br /&gt;
&lt;br /&gt;
 this.escortAttack = 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;helpRequestReceived&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helpRequestReceived&amp;lt;/code&amp;gt; handler is sent when an ally of this ship is being attacked and requires help. There are two parameters, the ally and the enemy.&lt;br /&gt;
&lt;br /&gt;
 this.helpRequestReceived = function(ally, enemy)&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;
{{oolite-method-added|1.74.2}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipAttackedOther&amp;lt;/code&amp;gt; handler is called when this ship 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;shipAttackerDistracted&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipAttackerDistracted&amp;lt;/code&amp;gt; handler is called when the ship's current attacker is distracted by another ship. &amp;lt;code&amp;gt;whom&amp;lt;/code&amp;gt; contains the ship which is doing the distracting.&lt;br /&gt;
&lt;br /&gt;
 this.shipAttackerDistracted = 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;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. There is no parameter provided to identify the cloaked ship.&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;shipBeingAttackedUnsuccessfully&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;shipBeingAttackedUnsuccessfully&amp;lt;/code&amp;gt; handler is called when a laser shot narrowly misses the ship, when fired by an uncloaked ship intending to hit. &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.shipBeingAttackedUnsuccessfully = 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;shipCloakActivated&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.74}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipCloakActivated&amp;lt;/code&amp;gt; handler is called whenever the script's target ship activates its cloaking device. No parameters are required for this handler.&lt;br /&gt;
&lt;br /&gt;
  this.shipCloakActivated = function()&lt;br /&gt;
  {&lt;br /&gt;
     // Your code here&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipCloakDeactivated&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.74}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipCloakDeactivated&amp;lt;/code&amp;gt; handler is called whenever the script's target ship deactivates its cloaking device. No parameters are required for this handler.&lt;br /&gt;
&lt;br /&gt;
  this.shipCloakDeactivated = function()&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 by this ship. &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.&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;
==== &amp;lt;code&amp;gt;shipEnergyBecameFull &amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipEnergyBecameFull &amp;lt;/code&amp;gt; handler is called when the energy level reaches its maximum value again. &lt;br /&gt;
&lt;br /&gt;
 this.shipEnergyBecameFull = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipEnergyIsLow&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipEnergyIsLow&amp;lt;/code&amp;gt; handler is called every time when a ship gets energy damage while the energy level lies below 25% of its maximum value.&lt;br /&gt;
&lt;br /&gt;
 this.shipEnergyIsLow = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipHitByECM&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.71}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipHitByECM&amp;lt;/code&amp;gt; handler is called when a ship receives a ECM pulse. &amp;lt;code&amp;gt;pulsesRemaining&amp;lt;/code&amp;gt; contains the number of pulses that still have to be send by the sending ship. When a ship activates his ecm, he will send 4 pulses with 0.5 seconds interval and increasing range.: 6400 --&amp;gt; 12800 --&amp;gt; 19200 --&amp;gt; 25600.&lt;br /&gt;
&lt;br /&gt;
 this.shipHitByECM = function(pulsesRemaining)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipFiredMissile&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.74}}&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;shipKilledOther&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.75}}&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.&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;shipReleasedEquipment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipReleasedEquipment&amp;lt;/code&amp;gt; handler is called when a ship launches a mine (a pylon-mounted equipment item whose key ends with &amp;quot;_MINE&amp;quot;). &amp;lt;code&amp;gt;mine&amp;lt;/code&amp;gt; contains the launched mine entity.&lt;br /&gt;
&lt;br /&gt;
 this.shipReleasedEquipment = function(mine)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipTargetAcquired&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.74}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipTargetAcquired&amp;lt;/code&amp;gt; handler is called whenever a new target is selected.&lt;br /&gt;
&lt;br /&gt;
 this.shipTargetAcquired = 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;
==== &amp;lt;code&amp;gt;shipTargetLost&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.74}}&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.&amp;lt;br&amp;gt;(Handler introduced in 1.74 as replacement with consistent name for the old handler: 'shipLostTarget'.)&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;shipTakingDamage&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.75}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipTakingDamage&amp;lt;/code&amp;gt; handler is called when a ship sustains damage.&amp;lt;br&amp;gt;&lt;br /&gt;
It transfers the &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; of damage, &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; caused the damage and a string indicating the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; of damage:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;scrape damage&amp;quot; (collisions with other entities, &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; will be other entity involved)&lt;br /&gt;
* &amp;quot;heat damage&amp;quot; (see [[Shipdata.plist#heat_insulation]] for more information about this, &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; will be nil in this case)&lt;br /&gt;
* &amp;quot;energy damage&amp;quot; (default / catch-all including weapons damage and missile detonations, &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; will be nil if the entity causing the damage is cloaked, and if the damage is caused by a missile then &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; will be the entity that launched the missile, if it is damage from a direct laser or from a sub-entity weapon, &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; will be the ship or station mounting the weapon, etc.)&lt;br /&gt;
* &amp;quot;cascade weapon&amp;quot; (caught in Quirium Cascade Mine effect, &amp;lt;code&amp;gt;who&amp;lt;/code&amp;gt; will be the entity that launched the weapon)&lt;br /&gt;
* &amp;quot;hit a planet&amp;quot;&lt;br /&gt;
* &amp;quot;hit a sun&amp;quot;&lt;br /&gt;
* &amp;quot;removed&amp;quot; (corresponds to the &amp;lt;code&amp;gt;Ship.remove()&amp;lt;/code&amp;gt; method, regardless of the suppressDeathEvent parameter)&lt;br /&gt;
&lt;br /&gt;
For the player ship, only damage not absorbed by the shields will appear in &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;, but the handler will be called anyway with zero as the amount if the shields absorb all the damage.&lt;br /&gt;
&lt;br /&gt;
 this.shipTakingDamage = function(amount, whom, type)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;cargoDumpedNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;cargoDumpedNearby&amp;lt;/code&amp;gt; handler is sent when a nearby ship - not this ship - dumps a cargo pod.&lt;br /&gt;
&lt;br /&gt;
 this.cargoDumpedNearby = function(cargo: ship, releasedBy: ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;commsMessageReceived&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.75}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;commsMessageReceived&amp;lt;/code&amp;gt; handler is sent when receiving a message from other ships.&lt;br /&gt;
&lt;br /&gt;
 this.commsMessageReceived = function(message: string, sender: ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;distressMessageReceived&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.75}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;distressMessageReceived&amp;lt;/code&amp;gt; handler is sent when receiving a distress message from other ships.&lt;br /&gt;
&lt;br /&gt;
 this.distressMessageReceived = function(aggressor: ship, sender: ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentAdded&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentAdded&amp;lt;/code&amp;gt; handler is called whenever a ship gains an item of equipment. This includes &amp;quot;gaining&amp;quot; of &amp;lt;code&amp;gt;EQ_SOMETHING_DAMAGED&amp;lt;/code&amp;gt; when an &amp;lt;code&amp;gt;EQ_SOMETHING&amp;lt;/code&amp;gt; is damaged. This event will fire regardless of the reason for the equipment being added to the ship.&lt;br /&gt;
&lt;br /&gt;
 this.equipmentAdded = function(equipmentKey)&lt;br /&gt;
 {&lt;br /&gt;
       // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentRemoved&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentRemoved&amp;lt;/code&amp;gt; handler is called whenever a ship loses an item of equipment. This includes &amp;quot;losing&amp;quot; of &amp;lt;code&amp;gt;EQ_SOMETHING_DAMAGED&amp;lt;/code&amp;gt; when an &amp;lt;code&amp;gt;EQ_SOMETHING&amp;lt;/code&amp;gt; is repaired This event will fire regardless of the reason for the equipment being removed from the ship.&lt;br /&gt;
&lt;br /&gt;
 this.equipmentAdded = function(equipmentKey)&lt;br /&gt;
 {&lt;br /&gt;
       // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipAchievedDesiredRange&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipAchievedDesiredRange&amp;lt;/code&amp;gt; handler is called when the ship reaches the desired range from its destination during certain flight behaviours.&lt;br /&gt;
&lt;br /&gt;
 this.shipAchievedDesiredRange = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipAIFrustrated&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipAIFrustrated&amp;lt;/code&amp;gt; handler is called when the ship's low-level behaviour is unable to achieve the desired result (e.g. a &amp;lt;code&amp;gt;performFlee&amp;lt;/code&amp;gt; request is not getting further from the target). A short string describing the context of the frustration is passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
 this.shipAIFrustrated = function(context)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipBountyChanged&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;shipBountyChanged&amp;lt;/code&amp;gt; handler is sent when an event tries to change the bounty level of the ship. &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt; may be zero, positive or negative. &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt; is a string that may either contain a standard value or a custom value set by an OXP. The standard values are:&lt;br /&gt;
* '''setup actions''': Bounty level settings in the system populator or as a side effect of launching a ship from a station with a particular role.&lt;br /&gt;
* '''scripted''': OXP scripted changes to bounties, with no specified cause.&lt;br /&gt;
* '''attacked police''': The ship attacked a police ship&lt;br /&gt;
* '''attacked main station''': The ship attacked the main station&lt;br /&gt;
* '''attacked innocent''': The ship attacked a Clean ship and was seen doing so&lt;br /&gt;
* '''seen by police''': The ship was seen by police committing a crime&lt;br /&gt;
* '''distress call''': A police ship responded to a distress call from a ship that this ship is attacking&lt;br /&gt;
* '''illegal exports''': The ship launched from a main station while carrying illegal goods (player only)&lt;br /&gt;
* '''assisting offenders''': The bounty adjustment applied when a clean ship escorts an offender, or vice versa (NPC only)&lt;br /&gt;
* '''new galaxy''': The ship entered a new galaxy (player only)&lt;br /&gt;
* '''new system''': The ship entered a new system&lt;br /&gt;
* '''paid fine''': The ship was marked for fines by police, and then paid them on docking (player only)&lt;br /&gt;
* '''escape pod''': The ship is a replacement ship from escape pod insurance (player only)&lt;br /&gt;
* '''assisting police''': The ship helped out a police ship in combat&lt;br /&gt;
* '''unknown''': The bounty changed for an unknown reason. This should not occur.&lt;br /&gt;
&lt;br /&gt;
 this.shipBountyChanged = function(delta,reason)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipCloseContact&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipCloseContact&amp;lt;/code&amp;gt; handler is sent when approaching otherShip and when &amp;quot;track_contacts&amp;quot; in shipData is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 this.shipCloseContact = 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;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 sent 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;shipDumpedCargo&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.83}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipDumpedCargo&amp;lt;/code&amp;gt; handler is sent when this ship dumps a cargo pod.&lt;br /&gt;
&lt;br /&gt;
 this.shipDumpedCargo = function(cargo: ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipNowFacingDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipNowFacingDestination&amp;lt;/code&amp;gt; handler is called when the ship is facing its destination during certain flight behaviours.&lt;br /&gt;
&lt;br /&gt;
 this.shipNowFacingDestination = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipReachedEndPoint&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipReachedEndPoint&amp;lt;/code&amp;gt; handler is sent after reaching the last navigation point when in mode &amp;lt;code&amp;gt;performFlyRacepoints&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 shipReachedEndPoint = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipReachedNavPoint&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipReachedNavPoint&amp;lt;/code&amp;gt; handler is sent after reaching a navigation point when in mode &amp;lt;code&amp;gt;performFlyRacepoints&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 this.shipReachedNavPoint = 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 scripted_cargo. (&amp;quot;cargo_type&amp;quot; = CARGO_SCRIPTED_ITEM) Other cargo, even scooping escapepods, doesn't trigger a handler.&amp;lt;br&amp;gt;The scooped item is transferred as argument. The scooped cargo itselfs gets the handler: &amp;lt;code&amp;gt;shipWasScooped&amp;lt;/code&amp;gt; with the scooper as argument. Starting with Oolite 1.77 this handler will fire on every scooped object.&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;
==== &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 pilot 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 when it is the player that is ejecting.&lt;br /&gt;
&lt;br /&gt;
 this.shipLaunchedEscapePod = function(escapepod, passengers)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;escapepod&amp;lt;/code&amp;gt; contains the main pod with the pilot. &amp;lt;code&amp;gt;passengers&amp;lt;/code&amp;gt; will be added with Oolite 1.77 and is an array with passenger pods for those ships that have more than one escape-capsule defined.&lt;br /&gt;
&lt;br /&gt;
=== NPC only ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;aiAwoken&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
This is sent to the ship periodically when &amp;lt;code&amp;gt;ship.AIScriptWakeTime&amp;lt;/code&amp;gt; passes. One of the actions of this handler should be to cause a new wake time to be set. It is received by both the ship script and the AI script but usually only of interest to the latter.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;aiStarted&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
This is sent to the ship when a new Javascript-based AI is loaded. The AI Script should then use it to do initialisation. The ship script can usually ignore it.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;coordinatesForEscortPosition&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;coordinatesForEscortPosition&amp;lt;/code&amp;gt; handler fires whenever the game engine wishes to know the positions of escorts relative to their group leader, and fires in the group leader's ship script at that time. It is given two parameters: the number of the escort, and the maximum number of escorts the group leader might have (which is not necessarily the number of escorts it currently has, of course). Unlike most ship script handlers, which return void, ''this handler is required to return a Vector'' (or a value equivalent to a Vector) describing the relative position of the escort to the mothership.&lt;br /&gt;
&lt;br /&gt;
 coordinatesForEscortPosition = function(num,max)&lt;br /&gt;
 {&lt;br /&gt;
    // Your code here&lt;br /&gt;
    return escort_position;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The escort position is relative to the mothership, and in the mothership's coordinate system. For example, to place an escort 500m to the right of the mothership, return &amp;lt;code&amp;gt;new Vector(500, 0, 0);&amp;lt;/code&amp;gt;. You are responsible for ensuring that there is sufficient space between the escorts and the mothership, and between any pair of escorts, or they will spend most of their time trying to avoid collisions with each other. If you intend to use the same ship script on several ships of varying sizes, you may wish to include the mothership's [[Oolite_JavaScript_Reference:_Entity#collisionRadius|collisionRadius]] in the calculations.&lt;br /&gt;
&lt;br /&gt;
Placing escorts directly ahead of the mothership (e.g. &amp;lt;code&amp;gt;new Vector(0, 0, 500);&amp;lt;/code&amp;gt;) or too close to the mothership will trigger collision warnings for the mothership, making it difficult to maintain level flight for any significant time.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;entityDestroyed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.75.1}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;entityDestroyed&amp;lt;/code&amp;gt; handler fires immediately ''after'' the ship becomes invalid, regardless of the reason, except when the game restarts. This is the best place for all kind of 'clean-up' code, for example stopping [[Oolite_JavaScript_Reference:_Timer|Timers]] associated with the ship script.&lt;br /&gt;
&lt;br /&gt;
 entityDestroyed = 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;escortAccepted&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;escortAccepted&amp;lt;/code&amp;gt; handler is called when a mother ship accepts this ship as an escort. The mothership simultaneously gets a &amp;lt;code&amp;gt;shipAcceptedEscort&amp;lt;/code&amp;gt; event.&lt;br /&gt;
&lt;br /&gt;
 this.escortAccepted = function(mothership)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;escortDock&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;escortDock&amp;lt;/code&amp;gt; handler is called by a mother ships that uses the AI command: &amp;lt;code&amp;gt;dockEscorts&amp;lt;/code&amp;gt;.  Escorts are instructed to change AI into dockingAI.plist and enter the ABORT state of this AI after a certain delay. Than this event is send to all his escorts, each with a different delay with 3 seconds spacing.&lt;br /&gt;
&lt;br /&gt;
 this.escortDock = function(delay)&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;escortRejected&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;escortRejected&amp;lt;/code&amp;gt; handler is called when a mother ship rejects this ship as an escort.&lt;br /&gt;
&lt;br /&gt;
 this.escortRejected = function(mothership)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;offenceCommittedNearby&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;offenceCommittedNearby&amp;lt;/code&amp;gt; handler is only send to police ships in scanner range of a hostile action. It transfers the attacker and the victim to the police vessel.&lt;br /&gt;
&lt;br /&gt;
 this.offenceCommittedNearby = function(attacker, victim)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;scriptedAI&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;scriptedAI&amp;lt;/code&amp;gt; handler is called each frame while the ship's AI is in &amp;quot;performScriptedAI&amp;quot; or &amp;quot;performScriptedAttackAI&amp;quot; mode. It must return an object defining the ship's flight parameters. The &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt; parameter is the length of the current frame in seconds. [[OXP_Scripted_AI|More information on using this functionality]]&lt;br /&gt;
&lt;br /&gt;
 this.scriptedAI = function(delta)&lt;br /&gt;
 {&lt;br /&gt;
   // Your code here&lt;br /&gt;
   return flightParameters;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipAcceptedEscort&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipAcceptedEscort&amp;lt;/code&amp;gt; handler is called when this ship accepts a new ship as an escort. The escort simultaneously gets a &amp;lt;code&amp;gt;escortAccepted&amp;lt;/code&amp;gt; event. &lt;br /&gt;
&lt;br /&gt;
 this.shipAcceptedEscort = function(newEscort)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipLandedOnPlanet&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;shipLandedOnPlanet&amp;lt;/code&amp;gt; handler is called for ships landing on a planet. It transfers the &amp;lt;code&amp;gt;planet&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
 shipLandedOnPlanet = 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;shipRemoved&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipRemoved&amp;lt;/code&amp;gt; handler is called for ships removed by script. It transfers the &amp;lt;code&amp;gt;suppressDeathEvent&amp;lt;/code&amp;gt; parameter so the script knows if there will also follow a shipDied() event.&lt;br /&gt;
&lt;br /&gt;
 shipRemoved = function(suppressDeathEvent)&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 for newly added ships. It does not trigger on adding but on the first update after adding. On a witchspace jump it means that first all ships are added to the system, then afterwards all the shipSpawned() events are triggered. Note that this is not called for subentities - if subentities need specific set up running, this must be called from the main ship's handler.&lt;br /&gt;
&lt;br /&gt;
 this.shipSpawned = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;spawnedAsEscort&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;spawnedAsEscort&amp;lt;/code&amp;gt; handler is called for newly added escort ships. It does trigger on adding the ship and before the shipSpawned() handlers is activated. It has the mothership as argument. &lt;br /&gt;
&lt;br /&gt;
 this.spawnedAsEscort = function(mother)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWasDumped&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWasDumped&amp;lt;/code&amp;gt; handler is sent to the cargopod when a ship jettisons it. The dumping ship is transferred as the argument. &lt;br /&gt;
&lt;br /&gt;
 this.shipWasDumped = function(dumper)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipWasScooped&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipWasScooped&amp;lt;/code&amp;gt; handler is send to the cargopod when a ship scoops scripted_cargo. (&amp;quot;cargo_type&amp;quot; = CARGO_SCRIPTED_ITEM) The scooper is transferred as argument. The scooper itself gets a trigger on  the handler &amp;lt;code&amp;gt;shipScoopedOther&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 this.shipWasScooped = function(scooper)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Stations only ===&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 a station's alert status ([[Oolite JavaScript Reference: Station#alertCondition|Station.alertCondition]]) changes. Only the player and stations have an alert condition. The equivalent player event is handled inside [[Oolite JavaScript Reference: World script event handlers|world 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;otherShipDocked&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;otherShipDocked&amp;lt;/code&amp;gt; handler is called with a station script only, when an ship docks. It has the docked ship as argument.&lt;br /&gt;
&lt;br /&gt;
 this.otherShipDocked = 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;stationDockingQueuesAreEmpty&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;stationDockingQueuesAreEmpty&amp;lt;/code&amp;gt; handler is called when the last ship in the queues docks with the station (or gives up docking and leaves).&lt;br /&gt;
&lt;br /&gt;
 this.stationDockingQueuesAreEmpty = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;stationLaunchedShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;stationLaunchedShip&amp;lt;/code&amp;gt; handler is called with a station script only, when a ship launches. It has the launched ship as argument.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 this.stationLaunchedShip = 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;stationAcceptedDockingRequest&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;stationAcceptedDockingRequest&amp;lt;/code&amp;gt; handler is called when a ship has requested docking clearance and has been allocated a dock. Due to the way in which docking clearance works, this is likely to be called several times for the same ship as it moves through the docking sequence.&lt;br /&gt;
&lt;br /&gt;
 this.stationAcceptedDockingRequest = 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;stationReceivedDockingRequest&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;stationReceivedDockingRequest&amp;lt;/code&amp;gt; handler is called when a ship requests docking clearance. The ship requesting is passed as a parameter. This is often necessary for carriers which will need to come to a stop before ships can dock with them. Due to the way in which docking clearance works, this is likely to be called several times for the same ship as it moves through the docking sequence.&lt;br /&gt;
&lt;br /&gt;
 this.stationReceivedDockingRequest = function(whom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
(note: a handler by this name was present in 1.79 and 1.80, but was called at the wrong time and should not be used. Set a minimum version of 1.81 if you use this event handler)&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;willOpenDockingPortFor&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;willOpenDockingPortFor&amp;lt;/code&amp;gt; handler is called with a station script only, when a ship requests docking, in cases where a dock is set to generally disallow docking (i.e. [[Oolite_JavaScript_Reference:_Dock#allowsDocking|allowsDocking]] is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;). It returns a boolean:&lt;br /&gt;
* if it returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; (or this handler isn't defined), this dock will not be opened later for the requesting ship, and it should not try again.&lt;br /&gt;
* if it returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, this dock will be opened later for the requesting ship, and it should try again later if it cannot find another suitable dock on this station.&lt;br /&gt;
The handler is passed the identity of the dock and the requesting ship&lt;br /&gt;
&lt;br /&gt;
 this.willOpenDockingPortFor = function(dock, ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
      return allow;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Docks Only ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
==== acceptDockingRequestFrom ====&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;acceptDockingRequestFrom&amp;lt;/code&amp;gt; handler is called when a ship is looking for docking clearance from the station, and is considering this dock. To get as far as calling this handler, the dock must have &amp;lt;code&amp;gt;[[Oolite_JavaScript_Reference:_Dock#allowsDocking|allowsDocking]] = true&amp;lt;/code&amp;gt; and be large enough to physically fit the ship.&lt;br /&gt;
&lt;br /&gt;
It returns a boolean: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to accept the request (which, depending on docking queue lengths will not necessarily mean that this dock is the one that the ship heads for) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to reject the request.  &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; is assumed if this handler is not defined.&lt;br /&gt;
&lt;br /&gt;
This handler may be called multiple times for the same ship if the ship is having difficulty finding a suitable docking queue.&lt;br /&gt;
&lt;br /&gt;
 this.acceptDockingRequestFrom = function(ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
      return allow;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== acceptLaunchingRequestFrom ====&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;acceptLaunchingRequestFrom&amp;lt;/code&amp;gt; handler is called when a ship is looking for launching clearance from the station, and is considering this dock. To get as far as calling this handler, the dock must have &amp;lt;code&amp;gt;[[Oolite_JavaScript_Reference:_Dock#allowsLaunching|allowsLaunching]] = true&amp;lt;/code&amp;gt; and be large enough to physically fit the ship (unless the ship is the player).&lt;br /&gt;
&lt;br /&gt;
It returns a boolean: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to accept the request (which, depending on launching queue lengths will not necessarily mean that this dock is the one that the ship uses) or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to reject the request.  &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; is assumed if this handler is not defined.&lt;br /&gt;
&lt;br /&gt;
 this.acceptLaunchingRequestFrom = function(ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
      return allow;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Missing Events ===&lt;br /&gt;
&lt;br /&gt;
All initially planned events have a corresponding event handler in v1.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: World script event handlers|world script event handlers]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Links ==&lt;br /&gt;
*[http://www.aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=3865 distant effects of a ship's mass or energy?] - analysis of '''collisions''' at vast distance back in 2007.&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_World_script_event_handlers&amp;diff=76422</id>
		<title>Oolite JavaScript Reference: World script event handlers</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_World_script_event_handlers&amp;diff=76422"/>
		<updated>2022-10-29T16:10:12Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: replaced &amp;quot;function&amp;quot; / reworded (x7)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a list of event handlers which can be implemented inside world scripts [[Scripting Oolite with JavaScript|JavaScript scripts for Oolite]]. Additionally, ship script handlers called on the player's ship will cause an equivalent world script event.&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 (which will never start with '_' or '$').&lt;br /&gt;
&lt;br /&gt;
=== Game State ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;gamePaused&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
This event is called when the game is paused. This is mainly useful for pausing sound playback which should not continue while the game is paused.&lt;br /&gt;
&lt;br /&gt;
 this.gamePaused = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;gameResumed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
This event is called when the game is resumed from pause. This is mainly useful for resuming sound playback paused in a &amp;lt;code&amp;gt;gamePaused&amp;lt;/code&amp;gt; handler.&lt;br /&gt;
&lt;br /&gt;
 this.gameResumed = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&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, therefore 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;
==== &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. This also means that it is called every time the player loads a game, begins a new game or presses space after dying. It can be used to do one-off initialisation such as copying mission variables into &amp;lt;code&amp;gt;this.*&amp;lt;/code&amp;gt; properties for efficiency or setting up data arrays to be used by the script in other handlers. (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;
Note that from Oolite 1.79 onwards the player is in the main station while this handler runs but may be moved to another station soon after.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;startUpComplete&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;startUpComplete&amp;lt;/code&amp;gt; handler is run at game startup after the initial population of the system has been complete, and after the player has been moved to the station recorded in their save game. The order of world events at game start is therefore:&lt;br /&gt;
* &amp;lt;code&amp;gt;startUp&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;systemWillPopulate&amp;lt;/code&amp;gt; (or an alternative handler specified by the system info)&lt;br /&gt;
* &amp;lt;code&amp;gt;startUpComplete&amp;lt;/code&amp;gt;&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;lt;code&amp;gt;ship.dockedStation == null&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.docked == true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.status == &amp;quot;STATUS_DOCKING&amp;quot;&amp;lt;/code&amp;gt;&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;lt;code&amp;gt;ship.dockedStation == station&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.docked == true&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.status == &amp;quot;STATUS_DOCKED&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;guiScreen&amp;lt;/code&amp;gt; is either &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_REPORT&amp;quot;&amp;lt;/code&amp;gt;. 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;
==== &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;lt;code&amp;gt;ship.dockedStation == station&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.docked == false&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.status == &amp;quot;STATUS_LAUNCHING&amp;quot;&amp;lt;/code&amp;gt;.&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. The handler's argument is the station which launched the ship.&lt;br /&gt;
&lt;br /&gt;
 this.shipLaunchedFromStation = function(stationLaunchedFrom)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
At this moment &amp;lt;code&amp;gt;ship.dockedStation == null&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.docked == false&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ship.status == &amp;quot;STATUS_IN_FLIGHT&amp;quot;&amp;lt;/code&amp;gt;.&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. The handler is called with an argument containing the station entity that is the docking target.&lt;br /&gt;
&lt;br /&gt;
 this.playerStartedAutoPilot = function(stationForDocking)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&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;
==== &amp;lt;code&amp;gt;playerDockingClearanceCancelled&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerDockingClearanceCancelled&amp;lt;/code&amp;gt; handler is called when the player withdraws their request to dock at a station. &lt;br /&gt;
&lt;br /&gt;
 this.playerDockingClearanceCancelled = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerDockingClearanceExpired&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.83}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerDockingClearanceExpired&amp;lt;/code&amp;gt; handler is called when the player exceeds the two minute window without requesting an extension&lt;br /&gt;
&lt;br /&gt;
 this.playerDockingClearanceExpired = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerDockingClearanceGranted&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerDockingClearanceGranted&amp;lt;/code&amp;gt; handler is called when the player is given permission to dock at a station. If the player is given immediate clearance to dock, this event will be called immediately after the &amp;lt;code&amp;gt;playerRequestedDockingClearance&amp;lt;/code&amp;gt; event. If, however, the station is unable to give immediate clearance, then there will be some delay between the request to dock and permission being granted. This event will be called when the station actually gives docking clearance.&lt;br /&gt;
&lt;br /&gt;
 this.playerDockingClearanceGranted = function()&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&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;
==== &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;
==== &amp;lt;code&amp;gt;playerRescuedEscapePod&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerRescuedEscapePod&amp;lt;/code&amp;gt; handler is called when the player rescues an escape pod which does not have scripted content (all consequences of scripted content escape pods are assumed to be dealt with by the specified script instead). It has three parameters:&lt;br /&gt;
# the rescue fee, in decicredits&lt;br /&gt;
# the fee reason, which can be &amp;quot;insurance&amp;quot;, &amp;quot;bounty&amp;quot; or &amp;quot;slave&amp;quot; (in the latter case, the fee will always be zero)&lt;br /&gt;
# a dictionary like those in the &amp;lt;code&amp;gt;ship.crew&amp;lt;/code&amp;gt; property describing the pod occupant&lt;br /&gt;
&lt;br /&gt;
 this.playerRescuedEscapePod = function(fee, reason, occupant)&lt;br /&gt;
 {&lt;br /&gt;
     // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This method is called after the escape pod has been processed, but slightly before the arrival report screen giving the results of the processing is displayed to the player.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerCompletedContract&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerCompletedContract&amp;lt;/code&amp;gt; handler is called when a passenger, parcel or cargo contract ends, either successfully or by defaulting on it. It is not called when all contracts are cancelled on a galactic jump. It has four parameters:&lt;br /&gt;
# The type of contract, which can be &amp;quot;cargo&amp;quot;, &amp;quot;parcel&amp;quot; or &amp;quot;passenger&amp;quot;&lt;br /&gt;
# The result of the contract, which can be &amp;quot;success&amp;quot;, &amp;quot;late&amp;quot;, &amp;quot;failed&amp;quot;, or for cargo contracts only &amp;quot;short&amp;quot;&lt;br /&gt;
# The fee paid for the contract in decicredits&lt;br /&gt;
# The contract information dictionary&lt;br /&gt;
Note that the fee actually paid for the contract will often ''not'' match the originally agreed fee in the contract information dictionary, as penalties for late delivery or bonuses for good service are included in the fee parameter.&lt;br /&gt;
&lt;br /&gt;
 this.playerCompletedContract = function(type, result, fee, contract)&lt;br /&gt;
 {&lt;br /&gt;
     // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This method is called after the contract has been processed, but slightly before the arrival report screen giving the results of the processing is displayed to the player.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerEnteredContract&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerEnteredContract&amp;lt;/code&amp;gt; handler is called when a passenger, parcel or cargo contract starts, just after the items have been transferred to the player ship. It has two parameters:&lt;br /&gt;
# The type of contract, which can be &amp;quot;cargo&amp;quot;, &amp;quot;parcel&amp;quot; or &amp;quot;passenger&amp;quot;&lt;br /&gt;
# The contract information dictionary&lt;br /&gt;
&lt;br /&gt;
 this.playerEnteredContract = function(type, contract)&lt;br /&gt;
 {&lt;br /&gt;
     // Your code here&lt;br /&gt;
 }&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;
 // 1.80 or earlier&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;
In 1.81 or later the handler gains a second parameter, describing the jump destination. For standard and wormhole jumps, this will be the system ID of the destination system. For galactic jumps, this will be the galaxy ID of the destination galaxy. (As [[Oolite JavaScript Reference: PlayerShip#galacticHyperspaceBehaviour|player.ship.galacticHyperspaceBehaviour]] may be changed during &amp;lt;code&amp;gt;shipWillEnterWitchspace&amp;lt;/code&amp;gt;, it is not possible to predict in advance of a galactic jump being made what the resulting system ID in the destination galaxy will be)&lt;br /&gt;
&lt;br /&gt;
 // 1.81 or later&lt;br /&gt;
 this.shipWillEnterWitchspace = function(cause, destination)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&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 &amp;quot;T&amp;quot; (shift-t).&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;
{{oolite-method-added|1.75}}&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.&lt;br /&gt;
&lt;br /&gt;
 this.shipKilledOther = function(whom : ship, damageType : string)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;shipReleasedEquipment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;shipReleasedEquipment&amp;lt;/code&amp;gt; handler is called when a ship launches a mine (a pylon-mounted equipment item whose key ends with &amp;quot;_MINE&amp;quot;). &amp;lt;code&amp;gt;mine&amp;lt;/code&amp;gt; contains the launched mine entity.&lt;br /&gt;
&lt;br /&gt;
 this.shipReleasedEquipment = function(mine)&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 by the player. &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;
==== &amp;lt;code&amp;gt;weaponsSystemsToggled&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;weaponsSystemsToggled&amp;lt;/code&amp;gt; handler is called whenever the player toggles their weapons systems on or off. The &amp;lt;code&amp;gt;state&amp;lt;/code&amp;gt; parameter contains the new state of the weapons systems&lt;br /&gt;
&lt;br /&gt;
 this.weaponsSystemsToggled = function(state : boolean)&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;equipmentAdded&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentAdded&amp;lt;/code&amp;gt; handler is called whenever the player ship gains an item of equipment. This includes &amp;quot;gaining&amp;quot; of &amp;lt;code&amp;gt;EQ_SOMETHING_DAMAGED&amp;lt;/code&amp;gt; when an &amp;lt;code&amp;gt;EQ_SOMETHING&amp;lt;/code&amp;gt; is damaged. This event will fire regardless of the reason for the equipment being added to the ship.&lt;br /&gt;
&lt;br /&gt;
 this.equipmentAdded = function(equipmentKey)&lt;br /&gt;
 {&lt;br /&gt;
       // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This is often more convenient than monitoring both &amp;lt;code&amp;gt;equipmentRepaired&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;playerBoughtEquipment&amp;lt;/code&amp;gt;, and will also detect equipment addition by script.&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(equipmentKey)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentRemoved&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;equipmentRemoved&amp;lt;/code&amp;gt; handler is called whenever the player ship loses an item of equipment. This includes &amp;quot;losing&amp;quot; of &amp;lt;code&amp;gt;EQ_SOMETHING_DAMAGED&amp;lt;/code&amp;gt; when an &amp;lt;code&amp;gt;EQ_SOMETHING&amp;lt;/code&amp;gt; is repaired. This event will fire regardless of the reason for the equipment being removed from the ship.&lt;br /&gt;
&lt;br /&gt;
 this.equipmentRemoved = function(equipmentKey)&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(equipmentKey)&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, paid)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The 'paid' parameter is added from 1.89 onwards. This is the amount of credits the player paid for the equipment, including any refunds that might have been applied during the purchase (eg when purchasing a laser and installing it in a position where a laser is already fitted, the cost of the current laser will be refunded to the player during the purchase).&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, price)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The 'price' parameter is added from 1.81 onwards. It is the cost of the ship (not counting any trade-in value of the player's old ship) in credits, or zero for changes using [[Oolite JavaScript Reference: Player#replaceShip|&amp;lt;code&amp;gt;player.replaceShip()&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
'''Note:''' In a future release of Oolite, &amp;lt;code&amp;gt;playerBoughtNewShip&amp;lt;/code&amp;gt; will no longer be fired when the ship is replaced using [[Oolite JavaScript Reference: Player#replaceShip|&amp;lt;code&amp;gt;player.replaceShip()&amp;lt;/code&amp;gt;]]. Instead, the &amp;lt;code&amp;gt;[[#playerReplacedShip|playerReplacedShip]]&amp;lt;/code&amp;gt; event should be used. At the moment, both events (&amp;lt;code&amp;gt;playerBoughtNewShip&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;playerReplacedShip&amp;lt;/code&amp;gt;) will fire.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#playerWillBuyNewShip|playerWillBuyNewShip]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerChangedPrimedEquipment&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerChangedPrimedEquipment&amp;lt;/code&amp;gt; handler is called whenever the player changes the currently primed equipment (either with shift-n or ctrl-shift-n). The equipment key of the newly primed equipment will be passed as an argument.&lt;br /&gt;
&lt;br /&gt;
 this.playerChangedPrimedEquipment = function(equipmentKey)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerReplacedShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.89}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerReplacedShip&amp;lt;/code&amp;gt; handler is called when the player ship is replaced via the JS method [[Oolite JavaScript Reference: Player#replaceShip|&amp;lt;code&amp;gt;player.replaceShip&amp;lt;/code&amp;gt;]]. May be needed to re-evaluate the old equipment as replacing a ship does not trigger equipment removal.&lt;br /&gt;
&lt;br /&gt;
 this.playerReplacedShip = function(ship)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#playerWillReplaceShip|playerWillReplaceShip]]&amp;lt;/code&amp;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;
==== &amp;lt;code&amp;gt;playerWillBuyNewShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.89}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerWillBuyNewShip&amp;lt;/code&amp;gt; handler is called just before 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.playerWillBuyNewShip = function(dataKey, shipyard, price, tradeIn)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; is the shipdata.plist &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; for the ship being purchased.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;shipyard&amp;lt;/code&amp;gt; is a dictionary object containing details about the ship being purchased, with information similar to the following:&lt;br /&gt;
 {&lt;br /&gt;
    short_description: &amp;quot;Python: Plus Galactic Hyperdrive. Extra Energy Unit. Docking Computers. E.C.M. System. Forward weapon upgraded to military laser. Price 215 000 ₢.&amp;quot;,&lt;br /&gt;
    shipdata_key: &amp;quot;python-player&amp;quot;,&lt;br /&gt;
    id: &amp;quot;675b6b-c60a74&amp;quot;,&lt;br /&gt;
    price: 215000,&lt;br /&gt;
    ship: {&lt;br /&gt;
      ...''[[shipdata.plist]]'' details of ship...&lt;br /&gt;
    },&lt;br /&gt;
    personality: 9807,&lt;br /&gt;
    extras: [&amp;quot;EQ_GAL_DRIVE&amp;quot;, &amp;quot;EQ_FUEL_SCOOPS&amp;quot;, &amp;quot;EQ_ENERGY_UNIT&amp;quot;, &amp;quot;EQ_FUEL_INJECTION&amp;quot;, &amp;quot;EQ_DOCK_COMP&amp;quot;, &amp;quot;EQ_ECM&amp;quot;]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; is the amount being paid the for ship.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;tradeIn&amp;lt;/code&amp;gt; is the trade in value of the current ship.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#playerBoughtNewShip|playerBoughtNewShip]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;playerWillReplaceShip&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{Oolite-method-added|1.89}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;playerWillReplaceShip&amp;lt;/code&amp;gt; handler is called just before a ship is replaced using [[Oolite JavaScript Reference: Player#replaceShip|&amp;lt;code&amp;gt;player.replaceShip()&amp;lt;/code&amp;gt;]]. 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.playerWillReplaceShip = function(dataKey)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; is the shipdata.plist &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; for the ship being purchased.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#playerReplacedShip|playerReplacedShip]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;chartHightlightModeChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.87}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;chartHighlightModeChanged&amp;lt;/code&amp;gt; handler is called whenever the highlight mode of the galactic chart is changed either manually (from player input) or programmatically (by setting the mode with &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#chartHighlightMode|player.ship.chartHightlightMode]]&amp;lt;/code&amp;gt;). The &amp;quot;newMode&amp;quot; parameter will be one of the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_SUNCOLOR&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_ECONOMY&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_GOVERNMENT&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;quot;OOLRC_MODE_TECHLEVEL&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 this.chartHightlightModeChanged = function(newMode)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&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 (newday parameter) passed to the handler 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;escapePodSequenceOver&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;escapePodSequenceOver&amp;lt;/code&amp;gt; handler is called at the end of the escape pod sequence, after the &amp;lt;code&amp;gt;shipLaunchedEscapePod&amp;lt;/code&amp;gt; event and just prior to the &amp;lt;code&amp;gt;shipWillDockWithStation&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;shipDockedWithStation&amp;lt;/code&amp;gt; events. &lt;br /&gt;
&lt;br /&gt;
Use this handler if you need to override the destination for the escape pod with [[Oolite_JavaScript_Reference:_Player#setEscapePodDestination|&amp;lt;code&amp;gt;player.setEscapePodDestination()&amp;lt;/code&amp;gt;]].&lt;br /&gt;
&lt;br /&gt;
 this.escapePodSequenceOver = function() &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 &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#guiScreen|guiScreen]]&amp;lt;/code&amp;gt; changes. The ''from'' parameter is the screen it is leaving and ''to'' is the screen initially being switched to. Note that the screen can have changed again in the meantime by the action of other oxps. Therefore, it is generally better to test the global &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#guiScreen|guiScreen]]&amp;lt;/code&amp;gt; to see which page is really on display instead of using the ''to'' parameter. (world script only)&lt;br /&gt;
&lt;br /&gt;
This handler will only fire when switched to/from any of the following:&lt;br /&gt;
&lt;br /&gt;
1.76: &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MAIN&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt;(F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;(F5F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;(F7), &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_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;(F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;(F3F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHORT_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_LONG_RANGE_CHART&amp;quot;&amp;lt;/code&amp;gt;(F6F6), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;(F8), &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_REPORT&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.77: adds &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTERFACES&amp;quot;&amp;lt;/code&amp;gt;(F4) and removes &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_CONTRACTS&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.81: adds &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKETINFO&amp;quot;&amp;lt;/code&amp;gt;(F8F8)&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 &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#guiScreen|guiScreen]]&amp;lt;/code&amp;gt; is about to change.  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 handler will only fire when switching to/from any of the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_EQUIP_SHIP&amp;quot;&amp;lt;/code&amp;gt;(F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MANIFEST&amp;quot;&amp;lt;/code&amp;gt;(F5F5), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKET&amp;quot;&amp;lt;/code&amp;gt;(F8), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SHIPYARD&amp;quot;&amp;lt;/code&amp;gt;(F3F3), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_SYSTEM_DATA&amp;quot;&amp;lt;/code&amp;gt;(F7)&lt;br /&gt;
&lt;br /&gt;
1.77: adds &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_INTERFACES&amp;quot;&amp;lt;/code&amp;gt;(F4), &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_STATUS&amp;quot;&amp;lt;/code&amp;gt;(F5)&lt;br /&gt;
&lt;br /&gt;
1.81: adds &amp;lt;code&amp;gt;&amp;quot;GUI_SCREEN_MARKETINFO&amp;quot;&amp;lt;/code&amp;gt;(F8F8)&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;infoSystemChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.83}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;infoSystemChanged&amp;lt;/code&amp;gt; handler is called when the system displayed in F7 is changed, e.g. by moving the small blue cursor along the planned route in the chart.&lt;br /&gt;
&lt;br /&gt;
 this.infoSystemChanged = 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;infoSystemWillChange&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;infoSystemWChange&amp;lt;/code&amp;gt; handler is called just before the system displayed in F7 is updated, e.g. by moving the small blue cursor along the planned route in the chart.&lt;br /&gt;
&lt;br /&gt;
 this.infoSystemWillChange = 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;mfdKeyChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;mfdKeyChanged&amp;lt;/code&amp;gt; handler is called whenever the player changes the content of an MFD slot. The &amp;lt;code&amp;gt;activeMFD&amp;lt;/code&amp;gt; parameter identifies which MFD slot is being changed, and the &amp;lt;code&amp;gt;mfdKey&amp;lt;/code&amp;gt; specifies the key code now in use in this slot.&lt;br /&gt;
&lt;br /&gt;
 this.mfdKeyChanged = function(activeMFD : integer, mfdKey : string)&lt;br /&gt;
 {&lt;br /&gt;
      // Your code here&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#setMultiFunctionDisplay|PlayerShip.setMultiFunctionDisplay()]]&amp;lt;/code&amp;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 a mission screen ends. Note that another script may have put up a new mission screen 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's ship is docked. It gets fired at game startup, upon docking and after an arrival 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 from other handlers. It fires for every installed OXP/OXZ until one creates a mission screen during this handler, and then it stops. When the mission screen ends and there is no callback function that creates a new mission screen, the &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; is sent again to all installed OXPs/OXZs starting with the one that created the last mission screen. All this means is that when this handler fires, it is safe to show a mission screen and no further tests 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;selectedMFDChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.85}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;selectedMFDChanged&amp;lt;/code&amp;gt; handler is send whenever the player selects a new MFD slot (normally using the default keypress &amp;quot;;&amp;quot;). The &amp;lt;code&amp;gt;activeMFD&amp;lt;/code&amp;gt; paramater is the index of the MFD which is now active.&lt;br /&gt;
&lt;br /&gt;
 this.selectedMFDChanged = function(activeMFD : integer)&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 worldScript 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 the &amp;lt;code&amp;gt;escapePodSequenceOver&amp;lt;/code&amp;gt; event, and then 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;systemInformationChanged&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;systemInformationChanged&amp;lt;/code&amp;gt; handler is called when system information is modified. It is passed the galaxy and system ID which were changed, and the key and new value in the SystemInfo object.&lt;br /&gt;
&lt;br /&gt;
To avoid problems with recursion, attempting to change the value of any system information property from within this handler will fail and log an error. Also note that changes which take place while Oolite is not running (from OXP planetinfo.plist files) will not cause this handler to be called when the game is reloaded.&lt;br /&gt;
&lt;br /&gt;
 this.systemInformationChanged = function(galaxy,system,key,newValue)&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;
=== System population ===&lt;br /&gt;
&lt;br /&gt;
In Oolite 1.79 and later, functions are called to populate and repopulate the system. These functions do not have fixed names, as they depend on the system, but otherwise act like normal worldscript functions. [[Oolite System Populator|The populator page]] has more documentation on these functions.&lt;br /&gt;
&lt;br /&gt;
=== Defunct ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;equipmentDestroyed&amp;lt;/code&amp;gt; ====&lt;br /&gt;
''Handler no longer exists in current stable version 1.80''&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, 1.77 or earlier only)  (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;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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=76421</id>
		<title>Oolite JavaScript Reference: Market Scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=76421"/>
		<updated>2022-10-29T15:04:53Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* updateLocalCommodityDefinition */ replaced &amp;quot;function&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Note: this page describes functionality currently only in the 1.81 development code. It may change further before being part of a stable release.'''&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.81 it is possible for Javascript to be used to modify station, system and trade good prices. It is possible that a single trade good price/quantity calculation may be affected by more than one script. The order of events in the calculation is as follows:&lt;br /&gt;
&lt;br /&gt;
# Firstly, the primary system market is calculated&lt;br /&gt;
## The trade good price and quantity are generated from the values in [[trade-goods.plist]]&lt;br /&gt;
## The &amp;lt;code&amp;gt;updateGeneralCommodityDefinition&amp;lt;/code&amp;gt; handler of the commodity's [[Trade-goods.plist#market_script|market_script]] will be called to set primary market data for the trade good&lt;br /&gt;
## The &amp;lt;code&amp;gt;updateLocalCommodityDefinition&amp;lt;/code&amp;gt; handler of the system's [[Planetinfo.plist#market_script|market_script]] will be called to modify primary market data for the trade good.&lt;br /&gt;
# Secondary markets are then calculated for each non-main station&lt;br /&gt;
## The primary system market is copied into the secondary market, and then quantities are scaled to the station's market capacity&lt;br /&gt;
## If the station does not have a market script, the rules in its [[shipdata.plist#market_definition|market_definition]] are applied.&lt;br /&gt;
## The &amp;lt;code&amp;gt;updateGeneralCommodityDefinition&amp;lt;/code&amp;gt; handler of the commodity's [[Trade-goods.plist#market_script|market_script]] will be called again to set secondary market data for the trade good.&lt;br /&gt;
## The &amp;lt;code&amp;gt;updateLocalCommodityDefinition&amp;lt;/code&amp;gt; handler of the station's [[shipdata.plist#market_script|market_script]] will be called to modify secondary market data for the trade good.&lt;br /&gt;
&lt;br /&gt;
== Handlers ==&lt;br /&gt;
&lt;br /&gt;
=== updateGeneralCommodityDefinition ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function updateGeneralCommodityDefinition (goodDefinition : Object, station : [[Oolite_JavaScript_Reference:_Station|Station]], system : Int) : Object&lt;br /&gt;
This method takes an object containing the current good definition (keys as in [[trade-goods.plist]], with an additional &amp;quot;price&amp;quot; key for the current price, &amp;quot;quantity&amp;quot; for the current quantity, and &amp;quot;key&amp;quot; for the identifier of the trade good in the plist), carries out modifications to it based on the station and system, and returns the object in the same format.&lt;br /&gt;
&lt;br /&gt;
In general this method should only modify the &amp;quot;price&amp;quot;, &amp;quot;quantity&amp;quot;, &amp;quot;capacity&amp;quot;, &amp;quot;legality_export&amp;quot; and &amp;quot;legality_import&amp;quot; keys of the goodDefinition object. Modifying other keys is possible but significant caution should be used when doing so.&lt;br /&gt;
&lt;br /&gt;
This method is called for scripts defined for the trade good, and is applied once for each market that good appears at. It may be called twice for the same good - once with station = &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to set the primary market, and once with station = (Station) for each secondary market. In general distinguishing between these two cases and performing different modifications will be necessary.&lt;br /&gt;
&lt;br /&gt;
=== updateLocalCommodityDefinition ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function updateLocalCommodityDefinition (goodDefinition : Object, station : [[Oolite_JavaScript_Reference:_Station|Station]], system : Int) : Object&lt;br /&gt;
This method takes an object containing the current good definition (keys as in [[trade-goods.plist]], with an additional &amp;quot;price&amp;quot; key for the current price, &amp;quot;quantity&amp;quot; for the current quantity, and &amp;quot;key&amp;quot; for the identifier of the trade good in the plist), carries out modifications to it based on the station and system, and returns the object in the same format.&lt;br /&gt;
&lt;br /&gt;
In general this method should only modify the &amp;quot;price&amp;quot;, &amp;quot;quantity&amp;quot;, &amp;quot;capacity&amp;quot;, &amp;quot;legality_export&amp;quot; and &amp;quot;legality_import&amp;quot; keys of the goodDefinition object. Modifying other keys is possible but significant caution should be used when doing so.&lt;br /&gt;
&lt;br /&gt;
This method is called for scripts defined for the system or station, and is called once for each good in that market. To allow the same script to be applied to multiple systems or stations, the station and system parameters will give the current context.&lt;br /&gt;
&lt;br /&gt;
[http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=17621#p239979 Here is an example] of how to use this method.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
*[[Trade-goods.plist]] which combined the following two .plists:&lt;br /&gt;
:*Legacy script: [[Commodities.plist]]&lt;br /&gt;
:*Legacy script: [[Misc_plists#illegal_goods.plist|illegal goods.plist]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Condition_scripts&amp;diff=76420</id>
		<title>Oolite JavaScript Reference: Condition scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Condition_scripts&amp;diff=76420"/>
		<updated>2022-10-29T14:59:24Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: replaced &amp;quot;function&amp;quot; (x7)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Condition scripts ==&lt;br /&gt;
Condition scripts are used to set conditions on the appearance of ships and equipment beyond the basics possible in [[shipdata.plist]], [[shipyard.plist]], [[shiplibrary.plist]] and [[equipment.plist]]. They have a similar purpose to the &amp;quot;conditions&amp;quot; parameters in those plists, which use the legacy scripting engine, but have the full flexibility of the Javascript scripting engine. If both &amp;quot;conditions&amp;quot; and a condition script are specified for the same item, they will both be tested (but you should never need to do this).&lt;br /&gt;
&lt;br /&gt;
Conditions scripts may define any or all of the following methods. There is a single instance of each condition script regardless of how many ships and equipment items use it, so variables may be shared between calls in &amp;lt;code&amp;gt;this._property&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In 1.81 the scripts are extended slightly to modify ''how'' things may appear as well as whether they may appear.&lt;br /&gt;
&lt;br /&gt;
=== allowAwardEquipment ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
In order for this method to be called, the &amp;lt;code&amp;gt;condition_script&amp;lt;/code&amp;gt; property of an equipment item (as declared in the [[Equipment.plist]] file) must be specified, it must declare the name of the Javascript file where the method exists, and the method must exist in the referenced JavaScript file. The method will only be called for the equipment items which reference the condition script.&lt;br /&gt;
&lt;br /&gt;
This method is called when the game engine needs to know whether a particular ship can have equipment fitted. In other words, it is asking whether to allow equipment to be awarded to a ship. This may be because the player is looking at possible upgrades at a station (on the F3 Equip Ship screen), or from a call to [[Oolite_JavaScript_Reference:_Ship#canAwardEquipment|ship.canAwardEquipment]] or [[Oolite_JavaScript_Reference:_Ship#canAwardEquipment|ship.awardEquipment]], or for other similar reasons. The equipment key and a reference to the ship entity are passed as parameters. You would use this method to control if, and under what conditions, a piece of equipment is offered for purchase and installation. Returning a value of &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; would indicate that the equipment can be installed; returning a value of &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; indicates the equipment can't be installed and so it won't appear on the F3 Equip Ship screen, and any of the JavaScript methods to add the equipment item would fail. If the method does not exist, or returns a value other than &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, then a value of &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; is assumed and the equipment may be added or offered for sale (subject to other conditions, of course, like TL constraints)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;context&amp;lt;/code&amp;gt; will be one of:&lt;br /&gt;
* &amp;quot;newShip&amp;quot; - equipment for a ship in a station shipyard (F3 F3)&lt;br /&gt;
* &amp;quot;npc&amp;quot; - awarding equipment to NPC on ship setup&lt;br /&gt;
* &amp;quot;purchase&amp;quot; - equipment for purchase on the F3 screen&lt;br /&gt;
* &amp;quot;scripted&amp;quot; - equipment added by JS or legacy scripts&lt;br /&gt;
(Context can in theory also be &amp;quot;loading&amp;quot;, &amp;quot;damage&amp;quot; or &amp;quot;portable&amp;quot;, but if you see one of these, it's a bug)&lt;br /&gt;
&lt;br /&gt;
 this.allowAwardEquipment = function(eqKey, ship, context)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return bool;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The standard condition script for the core game equipment allows equipment to be barred using the &amp;quot;&amp;lt;code&amp;gt;oolite-barred-equipment&amp;lt;/code&amp;gt;&amp;quot; key in &amp;lt;code&amp;gt;script_info&amp;lt;/code&amp;gt;. If this key contains an array of equipment keys, then those items of equipment will not be sold at this station. In 1.79 and later, this &amp;lt;code&amp;gt;script_info&amp;lt;/code&amp;gt; key may be applied to any ship, preventing those items being installed onto the ship. For example:&lt;br /&gt;
&lt;br /&gt;
 script_info = {&lt;br /&gt;
   &amp;quot;oolite-barred-equipment&amp;quot; = (&amp;quot;EQ_WEAPON_MILITARY_LASER&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
On a station, this would prevent it selling military lasers. On a ship in 1.79 or later, this would also stop the ship fitting military lasers.&lt;br /&gt;
&lt;br /&gt;
=== allowOfferShip ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
This method is called when the game engine is considering adding a ship managed by this condition script to a shipyard. If the method does not exist, or returns a value other than &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, then the ship may appear for sale (or it may not, for a variety of other reasons). The ship key from shipyard.plist is passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
 this.allowOfferShip = function(shipKey)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return bool;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== allowShowLibraryShip ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
This method is called when the ship library is being shown in-game (rather than on the start screen) and determines whether the ship appears on the list for the player to view. If the method does not exist or returns a value which cannot be interpreted as a boolean, it will be assumed to have returned &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 this.allowShowLibraryShip = function(shipKey)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return bool;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== allowSpawnShip ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
&lt;br /&gt;
This method is called when the game engine is considering spawning a ship managed by this condition script. If the method does not exist, or returns a value other than &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, then the ship may be spawned (or it may not, if another ship with the appropriate role is selected instead). The ship key from shipdata.plist is passed as a parameter.&lt;br /&gt;
&lt;br /&gt;
 this.allowSpawnShip = function(shipKey)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return bool;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== updateEquipmentPrice ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
&lt;br /&gt;
This method is called when the game engine needs to know the price of fitting equipment covered by this condition script. The method takes an equipment key and the current price as parameters, and must return a non-negative number for the actual price of the equipment.&lt;br /&gt;
&lt;br /&gt;
 this.updateEquipmentPrice = function(equipmentKey, currentPrice)&lt;br /&gt;
 {&lt;br /&gt;
   // your code here&lt;br /&gt;
   return newPrice;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This method is called before [[Shipdata.plist#equipment_price_factor|equipment_price_factor]] is considered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
There is an extended bulletin board discussion with a couple of examples [http://www.aegidian.org/bb/viewtopic.php?p=286037#p286037 here] (2022).&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76412</id>
		<title>Oolite JavaScript Reference: Mission</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Mission&amp;diff=76412"/>
		<updated>2022-10-28T20:43:02Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* unmarkSystem */ added wbr tags, replaced &amp;quot;function&amp;quot;&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]]. Uses role to identify ship, so be sure to use a unique role if you want a specific ship to be showed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exitScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''exitScreen''' : [[Oolite JavaScript Reference: Global#guiScreen|guiScreen]] (read/write)&lt;br /&gt;
&lt;br /&gt;
This can be used to set a new exit screen for the current mission screen. Outside of a callback function, the value of this is meaningless, and setting it has no useful effect.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedSystems&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''markedSystems''' : Array (read-only)&lt;br /&gt;
&lt;br /&gt;
An array of the objects currently being used to mark systems. The objects will have the same properties as those used by &amp;lt;code&amp;gt;markSystem&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;unmarkSystem&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;screenID&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''screenID''' : String (read-only)&lt;br /&gt;
&lt;br /&gt;
If there is currently a mission screen running, and it defined a screenID, then that screenID. Otherwise, this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;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. Can also be used to add text to other screens like the system data (F7) screen.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addMessageTextKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''addMessageTextKey'''(messageKey : String)&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;[[#addMessageText|addMessageText()]]&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;
=== &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;. In 1.76 and earlier a system cannot be marked twice, so:&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.markSystem(7);&lt;br /&gt;
 mission.unmarkSystem(7);&lt;br /&gt;
will leave the system unmarked.&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, the parameters may be objects instead of numbers. This allows control over the marker's appearance, and allows multiple markers to be placed on the same system. The object takes the following parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt; : The system ID. This is the only required parameter.&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; : A string identifying the group this marker belongs to (which may be the script's name, or something more specific). If omitted, which is not recommended, this defaults to &amp;quot;__oolite_legacy_destinations&amp;quot; which is also used for marking with numbers and marking carried out by legacy scripts.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerColor&amp;lt;/code&amp;gt; : A string specifying a colour. e.g. &amp;quot;redColor&amp;quot; or &amp;quot;1.0 0.5 0.0&amp;quot;. If omitted, &amp;quot;redColor&amp;quot; will be used.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerScale&amp;lt;/code&amp;gt; : A number between 0.5 and 2.0 specifying the relative size of the marker. Defaults to 1.0.&lt;br /&gt;
* &amp;lt;code&amp;gt;markerShape&amp;lt;/code&amp;gt; : A string describing the shape of the marker. Valid values are MARKER_X, MARKER_PLUS, MARKER_SQUARE and MARKER_DIAMOND. If this value is invalid or omitted, MARKER_X will be used.&lt;br /&gt;
&lt;br /&gt;
Multiple markers may be placed on the same system, provided that they have different names. If a marker with the same system and name already exists, it will be replaced.&lt;br /&gt;
&lt;br /&gt;
 mission.markSystem({&lt;br /&gt;
    system: 55,&lt;br /&gt;
    name: &amp;quot;my_oxp&amp;quot;,&lt;br /&gt;
    markerColor: &amp;quot;cyanColor&amp;quot;,&lt;br /&gt;
    markerScale: 1.5,&lt;br /&gt;
    markerShape: &amp;quot;MARKER_DIAMOND&amp;quot;&lt;br /&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;runShipLibrary&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''runShipLibrary'''()&lt;br /&gt;
Display the ship library based on [[shiplibrary.plist]], including processing of condition scripts.&lt;br /&gt;
&lt;br /&gt;
This is mainly useful for scenarios which override the standard scripts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;runScreen&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''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;backgroundSpecial: String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, special background layer)&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;modelPersonality : Int&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the entityPersonality assigned to the &amp;lt;code&amp;gt;model&amp;lt;/code&amp;gt;. If unspecified, or in 1.76 or earlier, a random personality is used)&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;choices: Object&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, Object describing [[Oolite_JavaScript_Reference:_Mission#Advanced_choices_.281.77_or_later_only.29|advanced choices]])&lt;br /&gt;
* &amp;lt;code&amp;gt;choicesKey : String&amp;lt;/code&amp;gt; (Key in [[missiontext.plist]])&lt;br /&gt;
* &amp;lt;code&amp;gt;initialChoicesKey : String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, the key from &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt; which is initially selected)&lt;br /&gt;
* &amp;lt;code&amp;gt;allowInterrupt : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}. If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; (default: &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;), the mission screen can be interrupted with function keys, which does not call the callback function. Mainly intended for interfaces.)&lt;br /&gt;
* &amp;lt;code&amp;gt;exitScreen : ''guiScreen''&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, a GUI screen to exit on. If omitted, an invalid value is given, or the player is not docked, this will revert to &amp;quot;GUI_SCREEN_STATUS&amp;quot;. Not all GUI screens are selectable for this: only those reachable with function keys F3 to F8)&lt;br /&gt;
* &amp;lt;code&amp;gt;screenID : String&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.77}}, an optional string which can be read later from &amp;lt;code&amp;gt;[[#screenID|mission.screenID]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;textEntry : Boolean&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.79}}, if it's &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then you get the text prompt and 'choices' and 'choicesKey' are ignored. Whatever's typed there gets passed as the parameter to the callback function. The [https://github.com/OoliteProject/oolite/blob/master/Resources/Scripts/oolite-registership.js ship registry code] has a simple example.)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartZoom : decimal&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, zoom level of the 'CUSTOM_CHART' backgroundSpecial map)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentre: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, using the internal coordinate system. The z component is always zero. Discouraged in favour of customChartCentreInLY)&lt;br /&gt;
* &amp;lt;code&amp;gt;customChartCentreLY: Vector3D&amp;lt;/code&amp;gt; ({{oolite-prop-added|1.87}}, centre position of the 'CUSTOM_CHART' backgroundSpecial map, in LY. e.g. for Lave: (8, 34.6, 0). The z component is always zero.)&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;
There are 21 lines available for display of the message and choices combined. (In 1.77, this is extended to 27 lines if the player's HUD is hidden)&lt;br /&gt;
&lt;br /&gt;
==== runScreen callbacks ====&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. The optional &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; parameter will be used as the &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt; property of the mission screen callback. It is usually unnecessary to specify this, but if you intend the function which calls runScreen to be called from a different script, and the callback references &amp;lt;code&amp;gt;this&amp;lt;/code&amp;gt;, you will need to use it.&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;
In 1.77, if &amp;lt;code&amp;gt;allowInterrupt&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it is possible that the callback function will not be called. It should therefore only be set for mission screens which can safely be interrupted without the callback. Regardless of this setting, all mission screens may be interrupted by the player launching from the station, and this possibility should be considered (in such case callback function will be called with &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; argument).&lt;br /&gt;
&lt;br /&gt;
==== runScreen special backgrounds (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, 'backgroundSpecial' may be given the following special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the short range chart (as if the player had pressed F6). The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART&amp;lt;/code&amp;gt;: Uses the current long range chart (as if the player had pressed F6 twice). The first 16 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;LONG_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As LONG_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
In 1.87 or later, 'backgroundSpecial' has these additional special string values:&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_SHORTEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;SHORT_RANGE_CHART_QUICKEST&amp;lt;/code&amp;gt;: As SHORT_RANGE_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART&amp;lt;/code&amp;gt;: Displays a chart where zoom and centre position can be customised using the 'customChartZoom' and 'customChartCentreInLY' properties. The first 18 lines of the mission text will overlap the chart if used.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_SHORTEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the shortest (fewest jumps, not necessarily shortest distance) route to their current destination system will be displayed.&lt;br /&gt;
* &amp;lt;code&amp;gt;CUSTOM_CHART_QUICKEST&amp;lt;/code&amp;gt;: As CUSTOM_CHART, but if the player has a working [[Advanced Navigational Array]] then the quickest route to their current destination system will be displayed.&lt;br /&gt;
&lt;br /&gt;
With all special chart backgrounds, changes made to destination system, or to markers, will be updated immediately.&amp;lt;br/&amp;gt;&lt;br /&gt;
These backgrounds will be displayed above the '&amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt;' (if any) but below everything else.&lt;br /&gt;
&lt;br /&gt;
==== Advanced choices (1.77 or later only) ====&lt;br /&gt;
&lt;br /&gt;
In 1.77 or later, choices may be set either with the 'choicesKey' parameter from missiontext.plist as before, or with the 'choices' parameter. (If both are set, 'choicesKey' will be ignored)&lt;br /&gt;
'''Example'''&amp;lt;br&amp;gt;&lt;br /&gt;
 var options = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; : &amp;quot;Take the job&amp;quot;,&lt;br /&gt;
    &amp;quot;02_DECLINE&amp;quot; : &amp;quot;Politely decline&amp;quot;&lt;br /&gt;
 };&lt;br /&gt;
 if (player.bounty == 0) // only clean players have this option&lt;br /&gt;
 {&lt;br /&gt;
    options[&amp;quot;03_REPORT&amp;quot;] = &amp;quot;Call the police&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 mission.runScreen({&lt;br /&gt;
    // title, message, etc.&lt;br /&gt;
    choices: options&lt;br /&gt;
 },function(choice) {&lt;br /&gt;
    // choice handling&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
This is useful where the options available (perhaps depending on the player's ship or equipment, or on previous events in the mission) may vary in a complex fashion, to avoid the need to have a separate missiontext.plist entry for every possibility.&lt;br /&gt;
&lt;br /&gt;
The value (either in &amp;lt;code&amp;gt;choicesKey&amp;lt;/code&amp;gt;'s missiontext entry or &amp;lt;code&amp;gt;choices&amp;lt;/code&amp;gt;) may either be a text string as in previous versions, or an object itself. If it is an object, it can take four parameters: &lt;br /&gt;
* 'text' is the displayed text for this key. &lt;br /&gt;
* 'alignment' can be 'LEFT', 'RIGHT' or 'CENTER' (the default). &lt;br /&gt;
* 'unselectable' can be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; (the default for non-blank text). Unselectable rows are printed, but are skipped when moving through the options. This can be useful for keeping a consistent interface.&lt;br /&gt;
* 'color' can be any color specification (e.g. &amp;quot;orangeColor&amp;quot;). The default is &amp;quot;yellowColor&amp;quot;, or &amp;quot;darkGrayColor&amp;quot; for unselectable rows.&lt;br /&gt;
For example (missiontext.plist):&lt;br /&gt;
 &amp;quot;my_choice_1&amp;quot; = {&lt;br /&gt;
    &amp;quot;01_AGREE&amp;quot; = {&lt;br /&gt;
       text = &amp;quot;Take the job&amp;quot;;&lt;br /&gt;
       alignment = &amp;quot;LEFT&amp;quot;;&lt;br /&gt;
       unselectable = false;&lt;br /&gt;
       color = &amp;quot;greenColor&amp;quot;;&lt;br /&gt;
    };&lt;br /&gt;
    // more options&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
In 1.77, the behaviour for choices which have no text is slightly changed. These will now leave a blank and unselectable line in the option list.&lt;br /&gt;
&lt;br /&gt;
==== Safe usage of runScreen ====&lt;br /&gt;
&lt;br /&gt;
One warning: &amp;lt;code&amp;gt;runScreen()&amp;lt;/code&amp;gt; will overwrite any existing missionscreen or GUI screen. The only safe place is using it inside a &amp;lt;code&amp;gt;missionScreenOpportunity&amp;lt;/code&amp;gt; handler or the callback function from a previous mission screen (or in 1.77 onwards, inside an interface callback function), 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;
==== Known issues ====&lt;br /&gt;
&lt;br /&gt;
From Oolite 1.79, only the A-Z, a-z, 0-9 and (space) characters may be reliably entered in the 'textEntry' field. A wider selection, for boring internal reasons, is available on the Mac, and is hoped to also be available on other platforms in later releases.&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;
Note: the &amp;quot;\n&amp;quot; token does not provide a line break (verified in v1.9).&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;
In Oolite 1.81 onwards, the following variant is available&lt;br /&gt;
&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''setInstructions'''(instructions : Array, [worldScriptName : String])&lt;br /&gt;
&lt;br /&gt;
If this version is used, the first array element will be a heading on the Manifest screen, and the remaining elements will be entered underneath it, rather than being entered under the &amp;quot;Missions&amp;quot; heading.&lt;br /&gt;
&lt;br /&gt;
'''Example''':&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship Companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...]);&lt;br /&gt;
This will display Ship Companion: in yellow text on the F5F5 screen, and beneath it will show the [[String expansion|expanded]] value of the key &amp;quot;myoxp_currentpet&amp;quot; from the [[missiontext.plist]] associated with the calling world script. If not called from a world script, the worldScriptName (this.name from the script) must be provided also:&lt;br /&gt;
 mission.setInstructions([&amp;quot;Ship companion:&amp;quot;, expandMissionText (&amp;quot;myoxp_currentpet&amp;quot;),...], &amp;quot;myoxp's script name&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Note that because the first parameter is now an array, the line(s) to be added must be enclosed in brackets and comma separated. Also note the optional use of &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Global#expandMissionText|expandMissionText()]]&amp;lt;/code&amp;gt; to retrieve text from [[missiontext.plist]]. It is also possible to construct the array before calling setInstructions, for example:&amp;lt;pre&amp;gt;&lt;br /&gt;
if(myoxp_petslist.length == 0) {&lt;br /&gt;
  mission.setInstructions(null); // clear any text previously displayed by this world script on the F5F5 screen&lt;br /&gt;
} else {&lt;br /&gt;
  var textArray = [];&lt;br /&gt;
  textArray.push(&amp;quot;Ship Companion&amp;quot; + (myoxp_petslist.length &amp;gt; 1 ? &amp;quot;s:&amp;quot; : &amp;quot;:&amp;quot;)); // &amp;quot;Ship Companion:&amp;quot; or &amp;quot;Ship Companions:&amp;quot; if more than one&lt;br /&gt;
  var i = myoxp_petslist.length - 1; // pointer to last entry in myoxp_petslist&lt;br /&gt;
  while(i--) { // for each pet in the list, starting from the bottom (probably newest to oldest)&lt;br /&gt;
    textArray.push(myoxp_petslist[i].name); // add the name of the pet to the text we will show on the F5F5 screen&lt;br /&gt;
  }&lt;br /&gt;
  mission.setInstructions(textArray); // our pets list will now be visible on the F5F5 screen until further notice (the next time we call setInstructions or one of its variants, it will replace this)&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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;
In 1.76 and earlier versions, any script can unmark a system, regardless of which script marked it or how many times it was previously marked. &lt;br /&gt;
&lt;br /&gt;
In 1.77, each marker has a name, and if a system has multiple markers each marker must be removed separately. Parameters in 1.77 may be numbers or objects. Numbers remove the &amp;quot;__oolite_&amp;lt;wbr&amp;gt;legacy_&amp;lt;wbr&amp;gt;destinations&amp;quot; markers. Objects are the same format as in &amp;lt;code&amp;gt;markSystem&amp;lt;/code&amp;gt; and remove the marker of the corresponding name (the marker style options are ignored when unmarking). In 1.77, this method will return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if all requested markers existed and were removed, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if any of the requested markers did not exist.&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>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=76411</id>
		<title>Oolite JavaScript Reference: Ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Ship&amp;diff=76411"/>
		<updated>2022-10-28T20:16:40Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Methods */ replaced &amp;quot;function&amp;quot; (x6)&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 an &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|Stations]]&amp;lt;/code&amp;gt; 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;accuracy&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''accuracy''' : Number (read/write, read-only and irrelevant for player ship)&lt;br /&gt;
The accuracy of the ship's AI. Varies between -5 and +10 for ships, or 0 and +10 for missiles. Setting a value outside the allowed range will set the closest value within the allowed range.&lt;br /&gt;
&lt;br /&gt;
For missiles, this affects the missile tracking, with 0 being the default value.&lt;br /&gt;
&lt;br /&gt;
For NPC ships, this affects their combat AI in many ways. Values of +5 or higher enable various [[OXP_NPC_Combat_AI|special combat AIs]] for a tough fight.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;aftWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''aftWeapon''' : EquipmentType (read-only, read/write in 1.77)&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 plist-based state machine AI. If the ship is using Javascript-based AI, this will always be &amp;quot;&amp;lt;code&amp;gt;nullAI.plist&amp;lt;/code&amp;gt;&amp;quot;&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;, &amp;lt;code&amp;gt;[[#AIScript|AIScript]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIFoundTarget&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''AIFoundTarget''' : Entity (read/write, read-only for player)&lt;br /&gt;
The &amp;quot;found target&amp;quot; of the ship's AI. This is set by various AI state commands, and is often copied to the primary target with the &amp;lt;code&amp;gt;setTargetToFoundTarget&amp;lt;/code&amp;gt; AI command.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIPrimaryAggressor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''AIPrimaryAggressor''' : Entity (read/write, read-only for player)&lt;br /&gt;
The &amp;quot;primary aggressor&amp;quot; of the ship's AI. Often the last ship to attack this ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIScript&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''AIScript''' : String (read-only)&lt;br /&gt;
The name of the ship’s current Javascript-based AI. If the ship is using plist-based AI, this will always be &amp;quot;&amp;lt;code&amp;gt;oolite-nullAI.js&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#AIScriptWakeTime|AIScriptWakeTime]]&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;, &amp;lt;code&amp;gt;[[#AI|AI]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;AIScriptWakeTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''AIScriptWaketime''' : Number (read-write)&lt;br /&gt;
The next game time at which the ship's Javascript-based AI script will receive an &amp;lt;code&amp;gt;aiAwoken&amp;lt;/code&amp;gt; event.&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 plist 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;alertCondition&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''alertCondition''' : Number (read-only integer)&lt;br /&gt;
The ship's current alert condition (Docked = 0, Green = 1, Yellow = 2, Red = 3). Non-Station non-Player ships are generally only found at condition Yellow or Red.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' [[Oolite JavaScript Reference: Station#alertCondition|station.alertCondition]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;autoAI&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''autoAI''' : Boolean (read-only)&lt;br /&gt;
The value of the &amp;lt;code&amp;gt;&amp;quot;auto_ai&amp;quot;&amp;lt;/code&amp;gt; shipdata key. If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship's provider has given permission for scripts (such as the system populator) to alter the AI of this ship to better fit into scenarios or roles. If this is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the ship's provider would prefer you not to alter the AI of this ship but to use it as-is.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;autoWeapons&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''autoWeapons''' : Boolean (read-only)&lt;br /&gt;
The value of the &amp;lt;code&amp;gt;&amp;quot;auto_weapons&amp;quot;&amp;lt;/code&amp;gt; shipdata key. If this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the ship's provider has given permission for scripts (such as the system populator) to alter the properties of this ship to better fit into scenarios or roles. If this is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the ship's provider would prefer you not to alter the properties of this ship but to use it as-is.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;beaconCode&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''beaconCode''' : String (read-only in 1.76, read-write from 1.77)&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;. This cannot be changed by script for either the player's ship or the main station.&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;beaconLabel&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''beaconLabel''' : String (read/write, read-only for player)&lt;br /&gt;
A full label for the beacon. This is useful where the beacon code and the full beacon label do not begin with the same letter.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;boundingBox&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''boundingBox''' : Vector (read-only)&lt;br /&gt;
For ships, a vector describing the dimensions of the cuboid box containing the ship aligned to the ship axes, including all non-flasher sub-entities. For sub-entities, the dimensions of the box for the sub-entity alone.&lt;br /&gt;
&lt;br /&gt;
Vector components match the standard model order - &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; is width, &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; is height, &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; is length.&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.&lt;br /&gt;
&lt;br /&gt;
In 1.77, changes to the bounty are given a reason. If you change this directly, the reason sent to [[Oolite JavaScript Reference: Ship script event handlers#shipBountyChanged|shipBountyChanged]] will be &amp;quot;scripted&amp;quot;. To set a different reason, use [[#setBounty|setBounty]] instead.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoList&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''cargoList''' : Array (read-only)&lt;br /&gt;
A list of the ship's current cargo, grouped by cargo type.&lt;br /&gt;
&lt;br /&gt;
An item looks like this:&lt;br /&gt;
 {&lt;br /&gt;
    unit: &amp;quot;t&amp;quot;,&lt;br /&gt;
    displayName: &amp;quot;Liquor/Wines&amp;quot;,&lt;br /&gt;
    commodity: &amp;quot;liquor_wines&amp;quot;,&lt;br /&gt;
    quantity: 3&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This property is for non-player ships.  For the player ship, use &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Manifest#list|manifest.list]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&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;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;cargoSpaceCapacity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''cargoSpaceCapacity''' : Number (read-only in 1.80, read/write in 1.81, integer)&lt;br /&gt;
The ship’s cargo capacity, in tons.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt; (for the player ship), &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt; (for non-player ships), &amp;lt;code&amp;gt;[[#adjustCargo|adjustCargo()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;collisionExceptions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''collisionExceptions''' : Array (read-only)&lt;br /&gt;
A list of ships this ship is currently prevented from colliding with. See [[#addCollisionException|addCollisionException]] and [[#removeCollisionException|removeCollisionException]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''commodity''' : String (read-only)&lt;br /&gt;
The commodity for cargo containers as a lowercase string. Returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-cargo ships. For scripted cargo that has no specific cargo defined, it returns the general description &amp;quot;goods&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;commodityAmount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''commodityAmount''' : Number (read-only)&lt;br /&gt;
The amount of commodity in a cargo container. (not the number of containers in a ship)&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#awardContract|awardContract()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeContract|removeContract()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#contractReputation|contractReputation]]&amp;lt;/code&amp;gt;&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;crew&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''crew''' : Array (read-only)&lt;br /&gt;
An array containing the ship's crew. Each crew member is represented as a dictionary:&lt;br /&gt;
  {&lt;br /&gt;
   &amp;quot;description&amp;quot;:&amp;quot;a small yellow horned humanoid from Malama&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;:&amp;quot;Masten Onlo&amp;quot;,&lt;br /&gt;
   &amp;quot;homeSystem&amp;quot;:49,&lt;br /&gt;
   &amp;quot;insuranceCredits&amp;quot;:500,&lt;br /&gt;
   &amp;quot;species&amp;quot;:&amp;quot;small yellow horned humanoid&amp;quot;,&lt;br /&gt;
   &amp;quot;legalStatus&amp;quot;:0&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Note that in current Oolite versions ships only have a single crew member defined. &lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setCrew|setCrew()]]&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;currentWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}} &lt;br /&gt;
 '''currentWeapon''' : EquipmentType (read/write)&lt;br /&gt;
A shortcut property to whichever of &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; or &amp;lt;code&amp;gt;[[#starboardWeapon|starboardWeapon]]&amp;lt;/code&amp;gt; represents the ship's currently active laser mount.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dataKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''dataKey''' : String (read-only)&lt;br /&gt;
The ship data key used to define this ship (e.g. &amp;lt;code&amp;gt;&amp;quot;adder-player&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;coriolis-station&amp;quot;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;defenseTargets&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''defenseTargets''' : Array (read-only)&lt;br /&gt;
The array of defense targets that the ship has. If the ship has point defense weapons (turrets, thargoid lasers) it may fire them at these targets if it cannot hit its primary target.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#addDefenseTarget|addDefenseTarget]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#clearDefenseTargets|clearDefenseTargets]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;desiredRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''desiredRange''' : Number (read/write nonnegative, read-only for player)&lt;br /&gt;
The range the AI uses in various AI routines to set a distance between the ship and another object - for example, the radius of a sphere around a destination point, or the distance to flee from a hostile ship.&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;destination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''destination''' : Vector (read/write, read-only for player)&lt;br /&gt;
The destination coordinates for the AI, used in behaviours such as &amp;lt;code&amp;gt;performFlyToRangeFromDestination&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;destinationSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''destinationSystem''' : Number (read/write)&lt;br /&gt;
The destination system ID of the ship, used by the AI for certain decisions. This defaults to the current system when a ship is spawned.&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 in 1.78 or earlier, it is the same as &amp;lt;code&amp;gt;[[#name|name]]&amp;lt;/code&amp;gt;. In 1.79 or later, it is a combination of &amp;lt;code&amp;gt;[[#shipClassName|shipClassName]]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[[#shipUniqueName|shipUniqueName]]&amp;lt;/code&amp;gt;.&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]]&lt;br /&gt;
The Station the ship is currently docked to.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''dockingInstructions''' : Object (read-only)&lt;br /&gt;
If the ship is currently attempting to dock with a station, this describes the next step on its docking procedure&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
    station: [Station &amp;quot;Coriolis Station&amp;quot; &amp;quot;Coriolis Station&amp;quot; position: (-31043.6, -94232.3, 619036) scanClass: CLASS_STATION status: STATUS_ACTIVE],&lt;br /&gt;
    match_rotation: 0,&lt;br /&gt;
    ai_message: &amp;quot;APPROACH_COORDINATES&amp;quot;,&lt;br /&gt;
    speed: 512,&lt;br /&gt;
    destination: {&lt;br /&gt;
        x: -28033.37401563089,&lt;br /&gt;
        y: -92813.76688970842,&lt;br /&gt;
        z: 622226.0625336492&lt;br /&gt;
    },&lt;br /&gt;
    range: 96&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#requestDockingInstructions|requestDockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#recallDockingInstructions|recallDockingInstructions]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;energyRechargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''energyRechargeRate''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The rate at which energy is replenished in every second. The corresponding ''[[shipdata.plist]]'' key is &amp;lt;code&amp;gt;energy_recharge_rate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note for the player ship that this includes the boost from an extra or naval energy unit, and NPC (but not player) ships with military shield boosters also have an increase to this in lieu of actual shields.&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, read/write in 1.81 onwards)&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;
Altering this value is possible in 1.81 onwards, but requires a re-bind of the materials and shaders, and so is a relatively slow process.&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;
'''See also:''' &amp;lt;code&amp;gt;[[#maxEscorts|maxEscorts]]&amp;lt;/code&amp;gt;&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;exhaustEmissiveColor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''exhaustEmissiveColor''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The baseline colour of the ship's exhaust. Damage to the ship, and use of injectors and torus drive, apply a fixed transformation to this colour, so not all colours are effective as exhaust colours.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;exhausts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''exhausts''' : Array (read-only)&lt;br /&gt;
An array of the ship's [[Oolite JavaScript Reference: ExhaustPlume|ExhaustPlume]] subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;flashers&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''flashers''' : Array (read-only)&lt;br /&gt;
An array of the ship's [[Oolite JavaScript Reference: Flasher|Flasher]] subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;forwardWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''forwardWeapon''' : EquipmentType (read-only, read/write in 1.77)&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;code&amp;gt;fuelChargeRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''fuelChargeRate''' : Number (read-only)&lt;br /&gt;
The cost, relative to the cost for a new Cobra III, of a unit of fuel. When buying fuel for a ship, the price in [[equipment.plist]] will be multiplied by this number.&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;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 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;
Note that in 1.80 and earlier writes to this property had no effect on the player ship.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;homeSystem&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.79}}&lt;br /&gt;
 '''homeSystem''' : Number (read/write)&lt;br /&gt;
The home system ID of the ship, used by the AI for certain decisions. This defaults to the current system when a ship is spawned.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hyperspaceSpinTime&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''hyperspaceSpinTime''' : Number (read/write)&lt;br /&gt;
The length of the ship's hyperspace countdown.&lt;br /&gt;
&lt;br /&gt;
Setting this to a negative value disables the drive entirely.&lt;br /&gt;
&lt;br /&gt;
Note that most NPC ship jumps use &amp;lt;code&amp;gt;ship.exitSystem()&amp;lt;/code&amp;gt; to make the jump, which does not have a delay. Provided this value is zero or positive, the ship will jump instantly if &amp;lt;code&amp;gt;ship.exitSystem()&amp;lt;/code&amp;gt; is called. The AI must use this property elsewhere if a delay before jumping is required.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;injectorBurnRate&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''injectorBurnRate''' : Number (read/write)&lt;br /&gt;
The rate at which the ship's injectors burn fuel in deci-LY per second. The default is 0.25.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;injectorSpeedFactor&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''injectorSpeedFactor''' : Number (read/write)&lt;br /&gt;
The multiplier to maximum speed granted to this ship when it is using injectors. The default is 7, and values must be between 1.0 and 32.0 (the torus drive's speed)&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;lt;code&amp;gt;&amp;quot;boulder&amp;quot;&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt; 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 * [[Oolite JavaScript Reference: Entity#maxEnergy|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;isFleeing&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isFleeing''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is currently fleeing combat. This may be queried for the player ship too, though the value is somewhat of a guess in that case as it's impossible to say for certain what the player is intending by their actions.&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;, &amp;lt;code&amp;gt;[[#restoreSubEntities|restoreSubEntities()]]&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 [[Shipdata.plist#has_military_jammer|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;isMinable&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isMinable''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship will break up usefully when hit by a mining laser, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise. By default this is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for anything with &amp;lt;code&amp;gt;&amp;quot;asteroid&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;boulder&amp;quot;&amp;lt;/code&amp;gt; in its role list - if you need to add anything which miners shouldn't be shooting at to those roles, give it &amp;lt;code&amp;gt;&amp;quot;no_boulders&amp;quot; = yes;&amp;lt;/code&amp;gt; in its [[shipdata.plist]].&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- ships, stations and escape pods have pilots whereas cargo, rocks, missiles and buoys do not.&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: &amp;lt;code&amp;gt;&amp;quot;CLASS_ROCK&amp;quot;&amp;lt;/code&amp;gt;)&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;isTurret&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''isTurret''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship is a plasma turret sub-entity, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&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;laserHeatLevel&amp;lt;/code&amp;gt;* ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''laserHeatLevel''' : Number (read-only, 0 to 1)&lt;br /&gt;
The temperature of the ship's currently active weapon. Thermal cut-out is active above 0.85. For non-player ships, if their forward weapon is empty, then the temperature of the forward weapon may be the temperature of a subentity forward weapon.&lt;br /&gt;
 '''laserHeatLevelAft''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelForward''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelPort''' : Number (read-only, 0 to 1)&lt;br /&gt;
 '''laserHeatLevelStarboard''' : Number (read-only, 0 to 1)&lt;br /&gt;
The temperature of specific laser mounts can also be queried.&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 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; in their ''shipdata.plist'' declarations.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;markedForFines&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''markedForFines''' : Boolean (read-only)&lt;br /&gt;
&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has been marked for fines the next time it docks at this system's main station.&lt;br /&gt;
&lt;br /&gt;
'''See also''' : [[#markTargetForFines|markTargetForFines()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxEscorts&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxEscorts''' : Number (read/write)&lt;br /&gt;
The maximum number of escorts this ship can have. This cannot be set lower than the number of escorts it currently has, or higher than the value of the MAX_ESCORTS constant (currently 16). There may be other reasons why a ship can have fewer escorts than the value of &amp;lt;code&amp;gt;maxEscorts&amp;lt;/code&amp;gt; (for instance, ships which are escorts cannot have their own escorts)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#escortGroup|escortGroup]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxPitch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxPitch''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum pitch rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#pitch|pitch]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxRoll&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxRoll''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum roll rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#roll|roll]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;maxSpeed&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''maxSpeed''' : Number (read-only, read/write from 1.81)&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, read/write from 1.81)&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;maxYaw&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''maxYaw''' : Number (read-only, read/write from 1.81)&lt;br /&gt;
The maximum yaw rate of the ship, in radians per second.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#yaw|yaw]]&amp;lt;/code&amp;gt;&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;parcelCount&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcelCount''' : Number (read-only integer)&lt;br /&gt;
The ship’s current number of parcels.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addParcel|addParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeParcel|removeParcel()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;parcels&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''parcels''' : Array (read-only NSDictionary)&lt;br /&gt;
The ship’s parcels. (For now only available for the player). Each parcel 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.parcels[0].name&lt;br /&gt;
 player.ship.parcels[0].start&lt;br /&gt;
 player.ship.parcels[0].destination&lt;br /&gt;
 player.ship.parcels[0].startName&lt;br /&gt;
 player.ship.parcels[0].destinationName&lt;br /&gt;
 player.ship.parcels[0].eta&lt;br /&gt;
 player.ship.parcels[0].etaDescription&lt;br /&gt;
 player.ship.parcels[0].fee  // The final fee, paid out 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 parcel.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addParcel|addParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removeParcel|removeParcel()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#parcelReputation|parcelReputation]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;&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;
'''See also''': &amp;lt;code&amp;gt;[[Passenger Berth]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#addPassenger|addPassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#removePassenger|removePassenger()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#passengerReputation|passengerReputation]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;pitch&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''pitch''' : Number (read-only)&lt;br /&gt;
The rate of pitch of the ship in radians/second (positive for dive, negative for climb)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxPitch|maxPitch]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;portWeapon&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 '''portWeapon''' : EquipmentType (read-only, read/write in 1.77)&lt;br /&gt;
The currently equipped port weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. This is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships in 1.76.&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 &amp;lt;code&amp;gt;&amp;quot;pirate trader(0.5) escort&amp;quot;&amp;lt;/code&amp;gt; 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; are &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; are &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;
 '''roleWeights''' : 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;roll&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''roll''' : Number (read-only, read/write for stations)&lt;br /&gt;
The rate of roll of the ship in radians/second (positive for anti-clockwise, negative for clockwise)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxRoll|maxRoll]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Station#roll|station.roll]]&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;scanDescription&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.81}}&lt;br /&gt;
 '''scanDescription''' : String (read/write)&lt;br /&gt;
The description of the ship in the &amp;quot;legal status&amp;quot; text shown by the [[Scanner Targeting Enhancement]]. If this is &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; then the default text for the ship's scan class and bounty level will be shown.&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;, &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor1|scannerHostileDisplayColor1]]&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;, &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor2|scannerHostileDisplayColor2]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerHostileDisplayColor1&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''scannerHostileDisplayColor1''' : [[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 the ship is specifically targeting the player with hostile intent. 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;
If hostile colours are set but normal colours aren't, then the normal colours will default to those for the ship's scan class. If normal colours are set but hostile colours aren't, the scanner blip will not change colour when the ship is hostile.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#scannerHostileDisplayColor2|scannerHostileDisplayColor2]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#scannerDisplayColor1|scannerDisplayColor1]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;scannerHostileDisplayColor2&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''scannerHostileDisplayColor2''' : [[Materials in Oolite#Colour specifiers|Colour specifier]] (read/write)&lt;br /&gt;
The second scanner colour when the ship is specifically targeting the player with hostile intent.. If both &amp;lt;code&amp;gt;scannerHostileDisplayColor1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;scannerHostileDisplayColor2&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;[[#scannerHostileDisplayColor1|scannerHostileDisplayColor1]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#scannerDisplayColor2|scannerDisplayColor2]]&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;scriptedMisjumpRange&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.77}}&lt;br /&gt;
 '''scriptedMisjumpRange''' : Number (read/write)&lt;br /&gt;
If this ship misjumps, this number will be consulted to determine the length of the resulting misjump relative to the normal jump range. Setting this does not in itself force a misjump - this must occur through the usual mechanisms. Values must be greater than 0.0 and less than 1.0, and the default is 0.5 for a traditional half-way misjump. This will be reset to 0.5 at the same time as &amp;lt;code&amp;gt;[[#scriptedMisjump|scriptedMisjump]]&amp;lt;/code&amp;gt; is reset to &amp;lt;code&amp;gt;false&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 ship’s ''[[shipdata.plist]]'' entry, if any. This may be any [[property list]] object, but the recommended 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 explicitly 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;shipClassName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''shipClassName''' : String (read/write)&lt;br /&gt;
The name of the ship class (e.g. &amp;lt;code&amp;gt;&amp;quot;Python&amp;quot;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipUniqueName&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''shipUniqueName''' : String (read/write)&lt;br /&gt;
The name of this specific ship (e.g. &amp;lt;code&amp;gt;&amp;quot;Sunrise of Lave&amp;quot;&amp;lt;/code&amp;gt;)&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, read/write in 1.77)&lt;br /&gt;
The currently equipped forward weapon, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;. This is always &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; for non-player ships in 1.76.&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;, &amp;lt;code&amp;gt;[[#restoreSubEntities|restoreSubEntities()]]&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;subEntityRotation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.81}}&lt;br /&gt;
 '''subEntityRotation''' : Quaternion (read/write)&lt;br /&gt;
The subentity rotational velocity, expressed as a quaternion. This much rotation will be applied per second. Exact 180 degree rotations should not be specified, as it is not possible to determine what route to use to make that rotation. This property is ignored when set on non-subentities.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;sunGlareFilter&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-prop-added|1.79}}&lt;br /&gt;
 '''sunGlareFilter''' : Number (read/write)&lt;br /&gt;
The strength of the sun glare filter on this ship. It must be in the range 0 to 1 (0 is no filter).&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 before 1.81)&lt;br /&gt;
The ship’s thrust, ranging from 0 to &amp;lt;code&amp;gt;[[#maxThrust|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 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, 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;weaponFacings&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''weaponFacings''' : Number (read-only, integer in range 0-15)&lt;br /&gt;
The weapon facings available for the ship. The format is the same as the equivalent property in [[shipyard.plist]] or [[shipdata.plist]] - a bitmask with the following bits:&amp;lt;br&amp;gt;&lt;br /&gt;
1 - fore&amp;lt;br&amp;gt;&lt;br /&gt;
2 - aft&amp;lt;br&amp;gt;&lt;br /&gt;
4 - port&amp;lt;br&amp;gt;&lt;br /&gt;
8 - starboard&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;weaponPosition*&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''weaponPositionAft''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionForward''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionPort''' : Vector (read-only)&lt;br /&gt;
 '''weaponPositionStarboard''' : Vector (read-only)&lt;br /&gt;
&lt;br /&gt;
{{Oolite-prop-added|1.83}}&lt;br /&gt;
 '''weaponPositionAft''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionForward''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionPort''' : Array of Vectors (read-only)&lt;br /&gt;
 '''weaponPositionStarboard''' : Array of Vectors (read-only)&lt;br /&gt;
&lt;br /&gt;
The position relative to the ship at which the appropriate laser beam will start. These properties do not imply that the ship has or can have any such weapon.&lt;br /&gt;
&lt;br /&gt;
In 1.83 this property changed syntax to become an array of vectors, as ships can now have multiple mounts per facing.&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;
=== &amp;lt;code&amp;gt;yaw&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-prop-added|1.77}}&lt;br /&gt;
 '''yaw''' : Number (read-only)&lt;br /&gt;
The rate of yaw of the ship in radians/second (positive for right, negative for left)&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#maxYaw|maxYaw]]&amp;lt;/code&amp;gt;&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 escape pod.  It will launch all escape pods on board leaving the ship behind as a empty hulk (&amp;lt;code&amp;gt;scanClass === &amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;). This command does nothing when no escape pod is present.&amp;lt;br&amp;gt;&lt;br /&gt;
Presence of an escape pod 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;addCollisionException&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''addCollisionException'''(exception : Ship)&lt;br /&gt;
Prevented this ship and the selected ship from colliding. See [[#collisionExceptions|collisionExceptions]] and [[#removeCollisionException|removeCollisionException]].&lt;br /&gt;
&lt;br /&gt;
Prevention from collision will specifically prevent the following:&lt;br /&gt;
&lt;br /&gt;
* the ships colliding with each other and suffering collision damage and/or momentum change&lt;br /&gt;
* the ships receiving collision warning events if they come close to each other&lt;br /&gt;
* if one of the ships is a station, the other ship will not be able to dock with it even if it enters a dock&lt;br /&gt;
&lt;br /&gt;
This has no useful effect when applied to a subentity.&lt;br /&gt;
&lt;br /&gt;
Adding a collision exception which already exists has no effect but will not cause an error.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;addDefenseTarget&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''addDefenseTarget'''(target : Ship)&lt;br /&gt;
Adds the target ship to this ship's list of point [[#defenseTargets|defense targets]], if it isn't already.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;adjustCargo&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''adjustCargo'''(commodity : String, amount : Number) : Boolean&lt;br /&gt;
Adjust the quantity of the specified commodity carried by the ship. Amount may be negative to remove cargo. The method will return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if the operation would fail due to insufficient free space or carried cargo and will not make a partial adjustment in this case.&lt;br /&gt;
&lt;br /&gt;
This method is for non-player ships.  For the player ship, use &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: PlayerShip#manifest|manifest]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See also''': &amp;lt;code&amp;gt;[[#cargoSpaceCapacity|cargoSpaceCapacity]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceUsed|cargoSpaceUsed]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoSpaceAvailable|cargoSpaceAvailable]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#cargoList|cargoList]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#setCargoType|setCargoType()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#dumpCargo|dumpCargo()]]&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;becomeCascadeExplosion&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''becomeCascadeExplosion'''()&lt;br /&gt;
This method causes the ship to explode as if it were hit by a quirium cascade.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;broadcastCascadeImminent&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''broadcastCascadeImminent'''()&lt;br /&gt;
This method causes the ship to broadcast a message to the AIs of all nearby ships warning them of an imminent cascade explosion. It is polite to call this a few seconds before calling &amp;lt;code&amp;gt;becomeCascadeExplosion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;broadcastDistressMessage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''broadcastDistressMessage'''()&lt;br /&gt;
This method causes the ship to broadcast a distress message to the AIs of all nearby ships (received also by the player as a comms message). Ships receiving a distress message will often intervene in the fight, depending on their own AI and the roles of the ships already involved.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;checkCourseToDestination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''checkCourseToDestination'''()&lt;br /&gt;
Checks the line between the ship's current position and its destination, and returns either &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; or an Entity (usually a planet, sun or other ship) that this ship would risk collision with if it travelled along that course.&lt;br /&gt;
&lt;br /&gt;
'''See also''': [[#getSafeCourseToDestination|getSafeCourseToDestination()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;checkScanner&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''checkScanner'''([poweredOnly : Boolean]) : Array&lt;br /&gt;
Runs a fast scanner check and returns the results. At most 32 objects within scanner range will be returned. If the &amp;lt;code&amp;gt;poweredOnly&amp;lt;/code&amp;gt; parameter is present and set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then only powered objects will be returned (i.e. ships with a scan class other than &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;CLASS_ROCK&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This method is usually considerably quicker than &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: System#filteredEntities|system.filteredEntities()]]&amp;lt;/code&amp;gt; and similar methods, with little loss of accuracy, though it is still advisable to cache the result for a while before re-scanning.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;clearDefenseTargets&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''clearDefenseTargets'''()&lt;br /&gt;
Clears the ship's list of point [[#defenseTargets|defense targets]].&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;
'''See also''': &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Player#commsMessage|player.commsMessage()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;damageAssessment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''damageAssessment'''() : Number&lt;br /&gt;
Returns a number indicating the amount of damage or supply usage by this ship. Zero means that the ship is in excellent fighting condition, while higher numbers indicate increasing amounts of damage or supply shortages.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;dealEnergyDamage&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''dealEnergyDamage'''(damage : Number, idealRange : Number [, velocityBias : Number])&lt;br /&gt;
Deals damage to all ships within a sphere centred on this ship. If this ship has an owner (e.g. it is a missile or a subentity) the damage will be credited to its owner. Damage is dealt according to the following formula:&lt;br /&gt;
* Further away than MAX_SCANNER_RANGE (25.6km): deal no damage&lt;br /&gt;
* At or closer than &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt;: deal &amp;lt;code&amp;gt;damage&amp;lt;/code&amp;gt; plus (or minus, for receding objects) &amp;lt;code&amp;gt;velocityBias&amp;lt;/code&amp;gt; damage for every 0.001LM of relative closing speed, up to a maximum of 1.0LM&lt;br /&gt;
* Between &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt; and a derived maximum range: calculate the damage that would have been done at &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt;, and then divide it by the square of the ratio of &amp;lt;code&amp;gt;idealRange&amp;lt;/code&amp;gt; and the real range (i.e inverse-square). The derived maximum range is the distance where a target with no relative closing speed would take 1 point of damage.&lt;br /&gt;
&lt;br /&gt;
As an example, the standard Oolite missile uses &amp;lt;code&amp;gt;dealEnergyDamage(170, 32.5, 0.25)&amp;lt;/code&amp;gt;, has a maximum speed of 0.75LM, and its AI tries to detonate it 25m from its target. Some worked examples (for comparision, one energy bank can absorb 64 points of damage, and a standard shield generator can absorb 128 points of damage):&lt;br /&gt;
* The missile is fired at a stationary asteroid. It detonates at 25m, within the ideal range, and the relative closing speed is 0.75LM. The asteroid takes 170 + (0.25 * 750) = 357.5 points of damage&lt;br /&gt;
* The missile is fired at a Cobra Mk III, which tries to flee from and evade the missile at its top speed of 0.35LM. The missile detonates at 25m, and the evasive manoeuvres mean that it is not heading directly at the Cobra when it detonates. The relative closing speed is 0.38LM. The Cobra takes 170 + (0.25 * 380) = 265 points of damage.&lt;br /&gt;
* An Anaconda freighter travelling at 0.2LM fires a missile at a distant Fer-de-lance. After the missile has travelled 150m away from the Anaconda, it is hit by an ECM pulse from the FDL, and detonates. The relative velocity is -0.55LM (the missile is travelling away from the Anaconda), so the damage at the ideal range would be 170 - (0.25 * 550) = 32.5. The damage is then divided by (150 / 32.5)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, so the Anaconda takes about 1.5 points of damage.&lt;br /&gt;
* A missile fired at something else detonates 500m away from a Sidewinder. The inverse-square rule divides the damage by (500 / 32.5)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, so the base damage at this range (ignoring velocityBias) is only 0.7. The Sidewinder is therefore safely outside the blast radius, and is not considered for damage. &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;
Cause a random number (at least 1 if possible) of the ship's escorts which are not already attacking a target to attack this ship's primary target, unless this method has already been called for the current target without meanwhile being called for a different target.&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'''([amount : Number, commodity: String]) : 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;
In 1.79 or later, multiple items may be scheduled for dumping by passing the number as a parameter.&lt;br /&gt;
&lt;br /&gt;
In 1.81 or later, a preferred commodity may be specified (if this is not present, a random item will be dumped as usual). This preference only applies to the first item dropped, not subsequent ones.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#ejectItem|ejectItem]]&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 &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt; of the ejected item will always be &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;.&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 &amp;lt;code&amp;gt;scanClass&amp;lt;/code&amp;gt; of the ejected item will always be &amp;lt;code&amp;gt;&amp;quot;CLASS_CARGO&amp;quot;&amp;lt;/code&amp;gt;.&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;enterWormhole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''enterWormhole'''([wormhole : Wormhole])&lt;br /&gt;
If the player has entered witchspace, but before the old system is removed from memory, this method may be used to add this ship to the contents of the specified outbound wormhole. If no parameter is given, add them to the player's wormhole.&lt;br /&gt;
&lt;br /&gt;
If the player is not entering witchspace, this method does nothing: the ship must fly to the wormhole in the normal way to enter it.&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]] [, multiple : Boolean]) : String or Object&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;
In 1.81 and later, if the optional &amp;lt;code&amp;gt;multiple&amp;lt;/code&amp;gt; parameter is set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, it will instead return an object in this format:&lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;EQUIPMENT_OK&amp;quot;: 3.&lt;br /&gt;
    &amp;quot;EQUIPMENT_DAMAGED&amp;quot;: 2&lt;br /&gt;
 }&lt;br /&gt;
to allow equipments which allow fitting multiple to be queried. If multiple equipments can be fitted, not setting the 'multiple' parameter will return the 'best' state of all items of that type.&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;findNearestStation&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''findNearestStation'''()&lt;br /&gt;
Returns the nearest Station entity to this ship. This is quicker than manually searching &amp;lt;code&amp;gt;system.stations&amp;lt;/code&amp;gt; and much quicker than using &amp;lt;code&amp;gt;system.filteredEntities()&amp;lt;/code&amp;gt;.&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;getSafeCourseToDestination&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''getSafeCourseToDestination'''()&lt;br /&gt;
Returns some coordinates which can be flown to as an intermediate destination to allow travel between the ship's current position and its destination without colliding with any objects on the way. Use this if &amp;lt;code&amp;gt;checkCourseToDestination&amp;lt;/code&amp;gt; returns an object you are unable or unwilling to destroy to calculate a new route.&lt;br /&gt;
&lt;br /&gt;
'''See also''': [[#checkCourseToDestination|checkCourseToDestination()]]&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getMaterials&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''getMaterials'''() : Object&lt;br /&gt;
getMaterials() returns the ship's current materials dictionary, or if none present an empty dictionary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setMaterials|setMaterials()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getShaders|getShaders()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;getShaders&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''getShaders'''() : Object&lt;br /&gt;
getShaders() returns the ship's current shaders dictionary, or if none present an empty dictionary.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#setShaders|setShaders()]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#getMaterials|getMaterials()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasEquipmentProviding&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''hasEquipmentProviding'''(key : String) : Boolean&lt;br /&gt;
This method returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the ship has any equipment providing the &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; equipment type, and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;hasRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 function '''hasRole'''(role : String) : Boolean&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;markTargetForFines&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''markTargetForFines()'''&lt;br /&gt;
If this ship is eligible to give out fines and the primary target has a bounty, mark the current primary target for fines, which will need to be paid when the ship docks. If used on a ship other than the player, of course, the fines are not particularly meaningful.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;notifyGroupOfWormhole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''notifyGroupOfWormhole()'''&lt;br /&gt;
Tells the ship's group about a wormhole (usually the one this ship has just entered). Causes a &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: Ship script event handlers#wormholeSuggested|wormholeSuggested]]&amp;lt;/code&amp;gt; event to occur in the scripts of other group members.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;offerToEscort&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''offerToEscort(mother : Ship)'''&lt;br /&gt;
Offer to escort the specified ship. The ship making the offer must have the same scan class as the mothership and must have one of the designated escort roles. After the mothership has made a decision this ship will receive either an &amp;lt;code&amp;gt;escortAccepted&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;escortRejected&amp;lt;/code&amp;gt; ship script event.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;perform*&amp;lt;/code&amp;gt; ===&lt;br /&gt;
Each of these methods switches the frame-by-frame behaviour of the ship to a different mode. It may not necessarily remain in that mode, however - for example, those modes which require a target will usually fall back to idle mode if the target is lost.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performAttack&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performAttack()'''&lt;br /&gt;
Attack the current target with available weapons.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performCollect&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performCollect()'''&lt;br /&gt;
Attempt to scoop up the current target. If the current target is not scoopable, it will be lost.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performEscort&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performEscort()'''&lt;br /&gt;
Escort the group leader. If this ship is not an escort of the group leader, it will not receive escort position updates from that ship.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFaceDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFaceDestination()'''&lt;br /&gt;
Come to a stop, and turn to face the current destination coordinates.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFlee&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFlee()'''&lt;br /&gt;
Flee from the current target, using injectors if possible, until it is out of scanner range.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performFlyToRangeFromDestination&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performFlyToRangeFromDestination()'''&lt;br /&gt;
Fly to the current [[#destination|destination]] coordinates, stopping when the distance between the ship and those coordinates is the [[#desiredRange|desiredRange]]. If the ship is already closer to the destination coordinates than the desired range, it will move away from the coordinates.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performHold&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performHold()'''&lt;br /&gt;
Come to a stop, and continually turn to face the current target&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performIdle&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performIdle()'''&lt;br /&gt;
Cancel any current turns to return to level flight, then move forward at current speed.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performIntercept&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performIntercept()'''&lt;br /&gt;
Fly to intercept (i.e. ram) the current target.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performLandOnPlanet&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performLandOnPlanet()'''&lt;br /&gt;
Land on rather than crash into the planet. This is a slow flight, so it is recommended to get close to the planet surface before activating this behaviour.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performMining&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performMining()'''&lt;br /&gt;
Attack the current target with a mining laser. This does not count as hostile behaviour, so cannot be used except on rocks.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performScriptedAI&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performScriptedAI()'''&lt;br /&gt;
Request flight instructions from a [[OXP_Scripted_AI|scripted AI]] callback each frame.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performScriptedAttackAI&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performScriptedAttackAI()'''&lt;br /&gt;
Request flight instructions, including weapons fire, from a [[OXP_Scripted_AI|scripted AI]] callback each frame.&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performStop&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performStop()'''&lt;br /&gt;
Come to a complete halt&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;performTumble&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''performTumble()'''&lt;br /&gt;
Come to a complete halt and rotate randomly.&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;recallDockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''recallDockingInstructions'''() : Object&lt;br /&gt;
Returns the current docking instructions as an object, and sets the destination, desired range and desired speed to match the instructions. Use this if the ship may have been interrupted while docking to ensure its flight parameters are set correctly.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dockingInstructions|dockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#requestDockingInstructions|requestDockingInstructions]]&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 [[Oolite JavaScript Reference: Ship script event handlers#shipRemoved|this.shipRemoved(suppressDeathEvent)]] event. By default it will also trigger a [[Oolite JavaScript Reference: Ship script event handlers#shipDied|this.shipDied()]] event, unless &amp;lt;code&amp;gt;suppressDeathEvent&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&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;removeCollisionException&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.81}}&lt;br /&gt;
 function '''removeCollisionException'''(exception : Ship)&lt;br /&gt;
Allow this ship and the selected ship to collide again. See [[#collisionExceptions|collisionExceptions]] and [[#addCollisionException|addCollisionException]].&lt;br /&gt;
&lt;br /&gt;
Removing a collision exception which does not exist has no effect but will not cause an error.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;removeDefenseTarget&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''removeDefenseTarget'''(target : Ship)&lt;br /&gt;
Ensures that the target ship is not on this ship's list of point [[#defenseTargets|defense targets]].&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 method 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;
Note that in Oolite prior to 1.76.1 there was a bug which could sometimes cause the game to crash if this method was used on pylon-mounted equipment. Therefore, if you do this in your OXP, you should set (at least) 1.76.1 as the version in requires.plist&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;requestDockingInstructions&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''requestDockingInstructions'''() : Object&lt;br /&gt;
Requests the next docking instructions from the station, and returns them as an object, setting the destination, desired range and desired speed to match the instructions. Use this to get the next step in the docking sequence after completing the previous one.&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#dockingInstructions|dockingInstructions]]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[[#recallDockingInstructions|recallDockingInstructions]]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;requestHelpFromGroup&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''requestHelpFromGroup'''()&lt;br /&gt;
This method sends the &amp;lt;code&amp;gt;helpRequestReceived&amp;lt;/code&amp;gt; event to the other ships in this ship's group and escort group, sending the name of this ship's current target as the aggressor.&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 or removed subentities of the ship. Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if any subentities were added. Whether or not any subentities were added, this will also reset all subentities to their original configuration of position, orientation and other properties.&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;[[#isFrangible|isFrangible]]&amp;lt;/code&amp;gt;&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. From 1.79 onwards AI files may either be plist-based (with a .plist extension) or Javascript-based (with a .js extension).&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;setBounty&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.77}}&lt;br /&gt;
 function '''setBounty'''(bounty : Number, reason : String)&lt;br /&gt;
Sets the ship's bounty to the new value. &amp;lt;code&amp;gt;reason&amp;lt;/code&amp;gt; will be sent to [[Oolite JavaScript Reference: Ship script event handlers#shipBountyChanged|shipBountyChanged()]].&lt;br /&gt;
&lt;br /&gt;
'''See also:''' &amp;lt;code&amp;gt;[[#bounty|bounty]]&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 &amp;lt;code&amp;gt;commodity&amp;lt;/code&amp;gt; specified for a cargo barrel.  This cannot be used to set cargo for ships.  When more units are defined than 1 ton, the count is reduced to 1 ton.  It returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when the selected commodity is unknown. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is not specified, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; will be assumed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCargoType&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setCargoType'''(commodityType : String) : Boolean&lt;br /&gt;
Attempts to set the ship's cargo hold to contain commodities of the specified type, discarding any cargo already present. This should generally only be used immediately after a ship is spawned. Valid commodity types are:&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;SCARCE_GOODS&amp;quot;&amp;lt;/code&amp;gt;: goods which are likely to be rare in the current system, usually legal&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;PLENTIFUL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: goods which are likely to be plentiful in the current system, usually legal&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;MEDICAL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: narcotics (used for the Moray Medical Boat)&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;ILLEGAL_GOODS&amp;quot;&amp;lt;/code&amp;gt;: various goods likely to be rare in the current system, with a strong bias towards contraband&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;quot;PIRATE_GOODS&amp;quot;&amp;lt;/code&amp;gt;: similar to &amp;lt;code&amp;gt;&amp;quot;ILLEGAL_GOODS&amp;quot;&amp;lt;/code&amp;gt; but the total amount carried will be lower&lt;br /&gt;
This will return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if an unrecognised commodity type is used and will throw an exception if used on a cargo pod rather than a cargo carrier. Using it on a ship like an Asp without a cargo hold is valid but pointless.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;setCrew&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''setCrew'''(Object) : Boolean&lt;br /&gt;
Sets the ship's crew to one represented by the given object (or sets the ship to uncrewed if &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; is given as a parameter). Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if this succeeds, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise (if the ship is ''always'' unpiloted). The object has the same keys as [[characters.plist]], all of which are optional and will be replaced with default values if unset. They are applied in the following order:&lt;br /&gt;
* origin system&lt;br /&gt;
* random seed&lt;br /&gt;
* role&lt;br /&gt;
* the rest&lt;br /&gt;
You can therefore set a random seed or role to get particular behaviour, and use the other keys to override it.&lt;br /&gt;
&lt;br /&gt;
At the moment this method only sets the first crew member (the pilot of the ship) in [[Oolite JavaScript Reference: Ship#crew|crew]][0] .&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;, &amp;lt;code&amp;gt;[[Oolite JavaScript Reference: EquipmentInfo#canBeDamaged|EquipmentInfo.canBeDamaged]]&amp;lt;/code&amp;gt;for equipment that cannot be damaged&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;, &amp;lt;code&amp;gt;[[#getMaterials|getMaterials()]]&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;, &amp;lt;code&amp;gt;[[#getShaders|getShaders()]]&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;threatAssessment&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''threatAssessment'''(full : Boolean) : Number&lt;br /&gt;
Returns a number indicating the relative strength of the ship. If the 'full' parameter is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, additional information will be considered as part of the assessment which would generally only be known by ships which know this ship or have seen it in combat. Otherwise, only data which could reasonably be expected to be common knowledge based on the class of the ship will be included.&lt;br /&gt;
&lt;br /&gt;
For example, which weapon facings are available is part of the basic assessment, but what forward laser the ship has is part of the full assessment.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;throwSpark&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{oolite-method-added|1.79}}&lt;br /&gt;
 function '''throwSpark'''()&lt;br /&gt;
Sets the ship to throw a spark as if it was seriously damaged. If this ship is already scheduled to throw a spark, this does nothing.&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;
== Static Methods ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;keys&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''keys'''() : Array&lt;br /&gt;
Returns all dataKeys of ships defined in all [[shipdata.plist]] including installed [[OXP]]s.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var dataKeysArray = Ship.keys();&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;keysForRole&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''keysForRole'''(role : String) : Array&lt;br /&gt;
Returns all dataKeys of ships defined in all [[shipdata.plist]] which contains the given role.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var role = &amp;quot;trader&amp;quot;;&lt;br /&gt;
 var roleKeys = Ship.keysForRole( role );&lt;br /&gt;
 log(&amp;quot;keysForRole&amp;quot;, role + &amp;quot;: &amp;quot; + roleKeys );&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roleIsInCategory&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''roles'''(role : String, category : String) : Boolean&lt;br /&gt;
Returns whether the role given is in a particular category as defined in [[role-categories.plist]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 Ship.roleIsInCategory(&amp;quot;trader&amp;quot;,&amp;quot;oolite-pirate-victims&amp;quot;); // true&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;roles&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''roles'''() : Array&lt;br /&gt;
Returns all roles of ships defined in all [[shipdata.plist]] including installed [[OXP]]s.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var roles = Ship.roles();&lt;br /&gt;
 for( var i = 0; i &amp;lt; roles.length; i++ ) {&lt;br /&gt;
  var roleKeys = Ship.keysForRole( roles[i] );&lt;br /&gt;
  log(&amp;quot;roles&amp;quot;, i + &amp;quot;. &amp;quot;+roles[i] + &amp;quot;: &amp;quot; + roleKeys );&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;shipDataForKey&amp;lt;/code&amp;gt; ===&lt;br /&gt;
{{Oolite-method-added|1.79}}&lt;br /&gt;
 function '''shipDataForKey'''(datakey : String) : Object&lt;br /&gt;
Returns an object containing a representation of the raw [[shipdata.plist]] entry for a given data key, or &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if the data key does not exist. Keys not defined in the shipdata.plist entry will not be defined in the object - they won't get their default values.&lt;br /&gt;
&lt;br /&gt;
Using the ship object properties is generally a better way to get this information, but this is useful if you want to find out what a ship might be like if you did add it.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 var shipdata = Ship.shipDataForKey(&amp;quot;cobra3-trader&amp;quot;);&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;name&amp;quot;]); // &amp;quot;Cobra Mark III&amp;quot;&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;ship_class_name&amp;quot;]); // undefined&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;ship_unique_name&amp;quot;]); // undefined&lt;br /&gt;
 log(&amp;quot;test&amp;quot;,shipdata[&amp;quot;display_name&amp;quot;]); // undefined&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;setShipDataForKey&amp;lt;/code&amp;gt;===&lt;br /&gt;
{{Oolite-method-added|1.91}}&lt;br /&gt;
 function '''setShipDataForKey'''(datakey : String, newShipData : Object)&lt;br /&gt;
This method modifies or adds properties of a ship class specified by the datakey parameter.  The newShipData parameter can be an existing property defined in shipdata.plist or a new one.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 Ship.setShipDataForKey (&amp;quot;cobra3-trader&amp;quot;, {name: &amp;quot;Cobra trader variant&amp;quot;})&lt;br /&gt;
 var shipdata = Ship.shipDataForKey (&amp;quot;cobra3-trader&amp;quot;)&lt;br /&gt;
 log (&amp;quot;test&amp;quot;, shipdata [&amp;quot;name&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
'''See also''': [http://www.aegidian.org/bb/viewtopic.php?p=274534#p274534 bulletin board post by Tsoj]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Shipdata.plist]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Massively Locked</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Vector3D&amp;diff=76410</id>
		<title>Oolite JavaScript Reference: Vector3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.alioth.net/index.php?title=Oolite_JavaScript_Reference:_Vector3D&amp;diff=76410"/>
		<updated>2022-10-28T19:49:27Z</updated>

		<summary type="html">&lt;p&gt;Massively Locked: /* Methods */ replaced &amp;quot;function&amp;quot; (x2), added code tags&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 source vector and &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; is not a vector, then if it is an [[Oolite JavaScript Reference: Entity|Entity]] its position will be used; and if it is an array of three values (for example, &amp;lt;code&amp;gt;[x, y, z]&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[1, 2, 3]&amp;lt;/code&amp;gt;), it will be treated as a vector with those coordinates.&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;
'''CAUTION:''' If passed an invalid &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;, the method will return zero, not log an error.  It is also incorrect to call &amp;lt;code&amp;gt;distanceTo&amp;lt;/code&amp;gt; on something that is not a vector.  For example: &amp;lt;code&amp;gt;this.ship.distanceTo(v)&amp;lt;/code&amp;gt; is missing &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; and needs to be written as &amp;lt;code&amp;gt;this.ship.position.distanceTo(v)&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 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 source vector and vector &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt; is not a vector, then if it is an [[Oolite JavaScript Reference: Entity|Entity]] its position will be used; and if it is an array of three values (for example, &amp;lt;code&amp;gt;[x, y, z]&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[1, 2, 3]&amp;lt;/code&amp;gt;), it will be treated as a vector with those coordinates.&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;
'''CAUTION:''' If passed an invalid &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;, the method will return zero, not log an error.  It is also incorrect to call &amp;lt;code&amp;gt;squaredDistanceTo&amp;lt;/code&amp;gt; on something that is not a vector.  For example: &amp;lt;code&amp;gt;this.ship.squaredDistanceTo(v)&amp;lt;/code&amp;gt; is missing &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; and needs to be written as &amp;lt;code&amp;gt;this.ship.position.squaredDistanceTo(v)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''See Also:''' &amp;lt;code&amp;gt;[[#distanceTo|distanceTo]]()&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>Massively Locked</name></author>
		
	</entry>
</feed>