<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://backup.witchspacewiki.org/index.php?action=history&amp;feed=atom&amp;title=Oolite_JavaScript_Reference%3A_Market_Scripts</id>
	<title>Oolite JavaScript Reference: Market Scripts - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://backup.witchspacewiki.org/index.php?action=history&amp;feed=atom&amp;title=Oolite_JavaScript_Reference%3A_Market_Scripts"/>
	<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;action=history"/>
	<updated>2026-04-12T19:13:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=50263&amp;oldid=prev</id>
		<title>Debresser: moved Oolite Javascript Reference: Market Scripts to Oolite JavaScript Reference: Market Scripts: Use capital like all other articles.</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=50263&amp;oldid=prev"/>
		<updated>2016-01-16T19:59:48Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php/Oolite_Javascript_Reference:_Market_Scripts&quot; title=&quot;Oolite Javascript Reference: Market Scripts&quot;&gt;Oolite Javascript Reference: Market Scripts&lt;/a&gt; to &lt;a href=&quot;/index.php/Oolite_JavaScript_Reference:_Market_Scripts&quot; title=&quot;Oolite JavaScript Reference: Market Scripts&quot;&gt;Oolite JavaScript Reference: Market Scripts&lt;/a&gt;: Use capital like all other articles.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 19:59, 16 January 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Debresser</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=49933&amp;oldid=prev</id>
		<title>Norby: updateLocalCommodityDefinition example link</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=49933&amp;oldid=prev"/>
		<updated>2015-12-04T01:18:10Z</updated>

		<summary type="html">&lt;p&gt;updateLocalCommodityDefinition example link&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 01:18, 4 December 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&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;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&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;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;+&lt;/td&gt;
  &lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;+&lt;/td&gt;
  &lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[http://aegidian.org/bb/viewtopic.php?f=4&amp;amp;t=17621#p239979 Here is an example] how to use this function.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Norby</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=41632&amp;oldid=prev</id>
		<title>Cim: /* updateGeneralCommodityDefinition */ not null</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=41632&amp;oldid=prev"/>
		<updated>2014-12-05T22:51:17Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;updateGeneralCommodityDefinition: &lt;/span&gt; not null&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 22:51, 5 December 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In general this method should only modify the &quot;price&quot;, &quot;quantity&quot;, &quot;capacity&quot;, &quot;legality_export&quot; and &quot;legality_import&quot; keys of the goodDefinition object. Modifying other keys is possible but significant caution should be used when doing so.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In general this method should only modify the &quot;price&quot;, &quot;quantity&quot;, &quot;capacity&quot;, &quot;legality_export&quot; and &quot;legality_import&quot; keys of the goodDefinition object. Modifying other keys is possible but significant caution should be used when doing so.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;−&lt;/td&gt;
  &lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&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 = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;null&lt;/del&gt; to set the primary market, and once with station &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;!&lt;/del&gt;= &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;null&lt;/del&gt; for each secondary market. In general distinguishing between these two cases and performing different modifications will be necessary.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;+&lt;/td&gt;
  &lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&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 = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;false&lt;/ins&gt; to set the primary market, and once with station = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(Station)&lt;/ins&gt; for each secondary market. In general distinguishing between these two cases and performing different modifications will be necessary.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== updateLocalCommodityDefinition ===&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== updateLocalCommodityDefinition ===&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cim</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=40971&amp;oldid=prev</id>
		<title>Cim: moved Oolite Javascript Reference: Oolite Market Scripts to Oolite Javascript Reference: Market Scripts</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=40971&amp;oldid=prev"/>
		<updated>2014-09-13T15:19:29Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php/Oolite_Javascript_Reference:_Oolite_Market_Scripts&quot; title=&quot;Oolite Javascript Reference: Oolite Market Scripts&quot;&gt;Oolite Javascript Reference: Oolite Market Scripts&lt;/a&gt; to &lt;a href=&quot;/index.php/Oolite_Javascript_Reference:_Market_Scripts&quot; title=&quot;Oolite Javascript Reference: Market Scripts&quot;&gt;Oolite Javascript Reference: Market Scripts&lt;/a&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 15:19, 13 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Cim</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=40969&amp;oldid=prev</id>
		<title>Cim: moved Oolite Market Scripts to Oolite Javascript Reference: Oolite Market Scripts: Consistent name</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=40969&amp;oldid=prev"/>
		<updated>2014-09-13T15:18:53Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php/Oolite_Market_Scripts&quot; class=&quot;mw-redirect&quot; title=&quot;Oolite Market Scripts&quot;&gt;Oolite Market Scripts&lt;/a&gt; to &lt;a href=&quot;/index.php/Oolite_Javascript_Reference:_Oolite_Market_Scripts&quot; title=&quot;Oolite Javascript Reference: Oolite Market Scripts&quot;&gt;Oolite Javascript Reference: Oolite Market Scripts&lt;/a&gt;: Consistent name&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 15:18, 13 September 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Cim</name></author>
		
	</entry>
	<entry>
		<id>http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=40968&amp;oldid=prev</id>
		<title>Cim: Market scripts for 1.81</title>
		<link rel="alternate" type="text/html" href="http://backup.witchspacewiki.org/index.php?title=Oolite_JavaScript_Reference:_Market_Scripts&amp;diff=40968&amp;oldid=prev"/>
		<updated>2014-09-13T15:18:34Z</updated>

		<summary type="html">&lt;p&gt;Market scripts for 1.81&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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 = null to set the primary market, and once with station != null 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;
&lt;br /&gt;
[[Category:Oolite JavaScript Reference]]&lt;/div&gt;</summary>
		<author><name>Cim</name></author>
		
	</entry>
</feed>