Doc: Add element IDs/link anchors to NewGRF additions

pull/259/head
Jonathan G Rennison 3 years ago
parent 0deb1d852d
commit 743c9023c6

@ -26,23 +26,23 @@
<h3 id="feature-test">Action 14 - Feature Tests</h3>
<p>See <a href="https://newgrf-specs.tt-wiki.net/wiki/Action14">Action 14 Specification</a> for background information.</p>
<h4>Feature Test: C "FTST"</h4>
<h4 id="FTST">Feature Test: C "FTST"</h4>
<p>Each FTST chunk (type C) describes an individual feature test.<br />
Sub-chunks within each FTST chunk may appear in any order, however each sub-chunk SHOULD only appear ONCE within an individual FTST chunk.</p>
<p>Feature tests can be safely used on implementations which do not implement the described feature test mechanism because unknown Action 14 blocks are ignored,
and the observable result (in global variable 0x9D) is equivalent to the case where all feature tests have failed, indicating that the feature is not present.</p>
<h4>Feature Name: C "FTST" -> T "NAME"</h4>
<h4 id="FTST-NAME">Feature Name: C "FTST" -> T "NAME"</h4>
<p>Within an FTST chunk, the NAME text (type T) field contains the name of the feature to test for. The value of the language ID byte is ignored.<br />
If the named feature is not present, or if this field is omitted, the version is 0.<br />
If the named feature is present, the version number will be at least 1.</p>
<p>The feature testing mechanism itself has the feature name: <font face="monospace">feature_test</font>, this document describes version 1.</p>
<h4>Feature Minimum Version: C "FTST" -> B "MINV"</h4>
<h4 id="FTST-MINV">Feature Minimum Version: C "FTST" -> B "MINV"</h4>
<p>Within an FTST chunk, the MINV binary (type B) field contains the minimum (inclusive) (&ge;) version to accept. This is a Word (2 bytes).<br />
The default value is 1.</p>
<h4>Feature Maximum Version: C "FTST" -> B "MAXV"</h4>
<h4 id="FTST-MAXV">Feature Maximum Version: C "FTST" -> B "MAXV"</h4>
<p>Within an FTST chunk, the MAXV binary (type B) field contains the maximum (inclusive) (&le;) version to accept. This is a Word (2 bytes).<br />
The default value is 0xFFFF (no maximum).</p>
<h4>Feature Set Global Variable 0x9D Bit: C "FTST" -> B "SETP"</h4>
<h4 id="FTST-SETP">Feature Set Global Variable 0x9D Bit: C "FTST" -> B "SETP"</h4>
<p>Within an FTST chunk, the SETP binary (type B) field contains the bit number to set/clear in
<a href="https://newgrf-specs.tt-wiki.net/wiki/GlobalVariables">global variable</a> 0x9D (TTD Platform) to store the result of the test. This is 1 byte.<br />
If the test is successful, the bit is set (to 1), otherwise the bit is cleared (to 0).<br />
@ -51,7 +51,7 @@
If this field is omitted, no bit is set or cleared, and the test is not observable.
</p>
<br />
<h4>Example NFO:</h4>
<h4 id="FTST-example">Example NFO:</h4>
<pre>
// Set bit 4 of global variable 0x9D if sample_feature_1 is present with a version of at least 4
// Set bit 5 of global variable 0x9D if sample_feature_2 is present with a version of at least 5 and at most 6
@ -77,7 +77,7 @@
<p>See <a href="https://newgrf-specs.tt-wiki.net/wiki/Action14">Action 14 Specification</a> and <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0">Action 0 Specification</a> for background information.</p>
<p>The property mapping mechanism has the feature name: <font face="monospace">property_mapping</font>, this document describes version 1.</p>
<p>Users of this mechanism SHOULD at minimum test for the presence of the feature above or test variable 8D, below.</p>
<h4>Property Mapping: C "A0PM"</h4>
<h4 id="A0PM">Property Mapping: C "A0PM"</h4>
<p>Each A0PM chunk (type C) describes an individual property mapping.<br />
Sub-chunks within each A0PM chunk may appear in any order, however except where otherwise noted each sub-chunk SHOULD only appear ONCE within an individual A0PM chunk.</p>
<p>Property mapping can be safely used on implementations which do not implement the property mapping mechanism if Action 0 sprites which use mapped property IDs are skipped if one or more of:
@ -86,14 +86,14 @@
<li>The feature name <font face="monospace">property_mapping</font> is checked for.</li>
</ul>
Unknown Action 14 blocks are ignored, and do not need to be skipped.</p>
<h4>Property Name: C "A0PM" -> T "NAME"</h4>
<h4 id="A0PM-NAME">Property Name: C "A0PM" -> T "NAME"</h4>
<p>Within an A0PM chunk, the NAME text (type T) field contains the name of the property to map. The value of the language ID byte is ignored.</p>
<h4>Action 0 Feature ID: C "A0PM" -> B "FEAT"</h4>
<h4 id="A0PM-FEAT">Action 0 Feature ID: C "A0PM" -> B "FEAT"</h4>
<p>Within an A0PM chunk, the FEAT binary (type B) field contains the <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0#Feature">Action 0 feature ID</a>. This is 1 byte.</p>
<h4>Property ID: C "A0PM" -> B "PROP"</h4>
<h4 id="A0PM-PROP">Property ID: C "A0PM" -> B "PROP"</h4>
<p>Within an A0PM chunk, the PROP binary (type B) field contains the property ID to allocate to the named property, this value can used in Action 0 sprites. This is 1 byte.<br />
It is possible to override existing properties, however this use is not recommended.</p>
<h4 id="SETT">Success Indicator Global Variable 0x8D Bit: C "A0PM" -> B "SETT"</h4>
<h4 id="A0PM-SETT">Success Indicator Global Variable 0x8D Bit: C "A0PM" -> B "SETT"</h4>
<p>Within an A0PM chunk, the SETT binary (type B) field contains the bit number to set/clear in
<a href="https://newgrf-specs.tt-wiki.net/wiki/GlobalVariables">global variable</a> 0x8D (TTD version) to store whether the mapping operation was successful. This is 1 byte.<br />
If the operation is successful, the bit is set (to 1), otherwise the bit is cleared (to 0).<br />
@ -101,7 +101,7 @@
Global variable 0x8D can then be tested by using a standard <a href="https://newgrf-specs.tt-wiki.net/wiki/Action7">Action 7 or 9</a>, or a standard <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2">Variational Action 2</a>.<br />
If this field is omitted, no bit is set or cleared.
</p>
<h4 id="FLBK">Fallback Mode: C "A0PM" -> B "FLBK"</h4>
<h4 id="A0PM-FLBK">Fallback Mode: C "A0PM" -> B "FLBK"</h4>
<p>Within an A0PM chunk, the FLBK binary (type B) field contains the fallback mode. This is 1 byte.<br />
The fallback mode may take the following values:
<table>
@ -114,7 +114,7 @@
This chunk MAY be specified more than once, in which case the last specified valid value is used.<br />
Note that even when using fallback mode 0, above, if the property mapping feature is not present, then use of the mapped property ID in an Action 0 is an error.
</p>
<h4>Format of remapped properties</h4>
<h4 id="A0PM-format">Format of remapped properties</h4>
All properties which are mapped by this mechanism have the format:
<table>
<tr><th>Size</th><th>Name</th><th>Meaning</th></tr>
@ -124,7 +124,7 @@
Note that num is an extended byte, see <a href="https://newgrf-specs.tt-wiki.net/wiki/GRFActionsDetailed">GRFActionsDetailed</a>.<br />
If the size of the data provided is not valid for the given property, the attempt to set the property MAY be ignored or partially applied.<br />
Note that each use of the mapped property ID is followed by Num-info iterations of the size and data pair above. See: <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0">Action 0 Specification</a>.
<h4>Example NFO:</h4>
<h4 id="A0PM-example">Example NFO:</h4>
<pre>
// Map station property "sample_station_property" to property id 0xF8, and set bit 4 of global variable 0x8D if successful
-1 * -1 14
@ -143,14 +143,14 @@
</pre>
<br />
<h3><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Stations">Action 0 - Stations</a></h3>
<h4><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Stations#Minimum_bridge_height_.281B.29">Minimum bridge height (1B, or mappable property: station_min_bridge_height)</a></h4>
<h3 id="a0stations"><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Stations">Action 0 - Stations</a></h3>
<h4 id="station_min_bridge_height"><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Stations#Minimum_bridge_height_.281B.29">Minimum bridge height (1B, or mappable property: station_min_bridge_height)</a></h4>
<p>This property allows building bridges over stations.<br />
The bridge height property defines minimum clearances required for a bridge for each of the 8 station layouts (or 0 to not allow any bridge). Values are given in height level units (1 level == 8px).<br />
Each height value is 1 byte, the total property length is 8 bytes.
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_station_prop1B</font>, version 1</p>
<h4>Disallowed bridge pillars (mappable property: station_disallowed_bridge_pillars)</h4>
<h4 id="station_disallowed_bridge_pillars">Disallowed bridge pillars (mappable property: station_disallowed_bridge_pillars)</h4>
<p>This property describes which bridge pillars are not allowed on the station tile.<br />
It consists of 8 pillar flags, for each of the 8 station layouts.<br />
Each set of flags is 1 byte, the total property length is 8 bytes.<br />
@ -173,8 +173,8 @@
</table>
<br />
<h3><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Bridges">Action 0 - Bridges</a></h3>
<h4>Menu icons (14, or mappable property: bridge_menu_icon)</h4>
<h3 id="a0bridges"><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Bridges">Action 0 - Bridges</a></h3>
<h4 id="bridge_menu_icon">Menu icons (14, or mappable property: bridge_menu_icon)</h4>
<p>This property sets the GUI menu icon for bridge type, this is displayed when constructing a bridge<br />
This has the format:
<table>
@ -185,7 +185,7 @@
The total property length is 4 bytes.
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_bridge_prop14</font>, version 1</p>
<h4>Bridge pillars (mappable property: bridge_pillar_flags)</h4>
<h4 id="bridge_pillar_flags">Bridge pillars (mappable property: bridge_pillar_flags)</h4>
<p>This property describes the pillars present for each bridge sprite table.<br />
It consists of 6 pairs of pillar flags, for bridge sprite tables 0 - 5.<br />
Each pair consists of: X direction flags, Y direction flags<br />
@ -204,7 +204,7 @@
</table>
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_bridge_pillar_flags</font>, version 1</p>
<h4>Bridge availability flags (mappable property: bridge_availability_flags)</h4>
<h4 id="bridge_availability_flags">Bridge availability flags (mappable property: bridge_availability_flags)</h4>
<p>This property sets the availability flags for this bridge type.<br />
The property length is 1 byte. The format is:
<table>
@ -214,16 +214,16 @@
</table>
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_bridge_availability_flags</font>, version 1</p>
<h4>More bridges (16 instead of 13)</h4>
<h4 id="more_bridge_types">More bridges (16 instead of 13)</h4>
<p>This is indicated by the feature name: <font face="monospace">more_bridge_types</font>, version 1</p>
<h3><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Railtypes">Action 0 - Railtypes</a></h3>
<h4>Enable custom signal sprites for programmable pre-signals (mappable property: railtype_enable_programmable_signals)</h4>
<h3 id="a0railtypes"><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Railtypes">Action 0 - Railtypes</a></h3>
<h4 id="railtype_enable_programmable_signals">Enable custom signal sprites for programmable pre-signals (mappable property: railtype_enable_programmable_signals)</h4>
<p>This enables <a href="https://newgrf-specs.tt-wiki.net/wiki/Action3/Railtypes#Signal_sprites_.280B.29">Action 2/3 - Railtype custom signal sprites</a> for programmable pre-signals.<br />
Programmable pre-signals have the signal type value: 06.<br />
The property length is 1 byte. 0 is disabled (default). 1 is enabled.
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_railtype_programmable_signals</font>, version 1</p>
<h4>Enable restricted signal flag for custom signal sprites (mappable property: railtype_enable_restricted_signals)</h4>
<h4 id="railtype_enable_restricted_signals">Enable restricted signal flag for custom signal sprites (mappable property: railtype_enable_restricted_signals)</h4>
<p>This applies to <a href="https://newgrf-specs.tt-wiki.net/wiki/Action3/Railtypes#Signal_sprites_.280B.29">Action 2/3 - Railtype custom signal sprites</a>.<br />
When enabled, bit 24 of variable 18 (extra callback info) is set if the signal is restricted (has a routing restriction program attached).<br />
When enabled, the "Show restricted electric signals using default graphics" client setting and signal post recolouring is not applied.<br />
@ -231,15 +231,15 @@
The property length is 1 byte. 0 is disabled (default). 1 is enabled.
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_railtype_restricted_signals</font>, version 1</p>
<h4>Disable use of realistic braking with this rail type (mappable property: railtype_disable_realistic_braking)</h4>
<h4 id="railtype_disable_realistic_braking">Disable use of realistic braking with this rail type (mappable property: railtype_disable_realistic_braking)</h4>
<p>This applies to <a href="https://newgrf-specs.tt-wiki.net/wiki/Action3/Railtypes#Signal_sprites_.280B.29">Action 2/3 - Railtype custom signal sprites</a>.<br />
When this property is set realistic braking is disabled for trains of this railtype even when realistic braking is otherwise in effect.<br />
The property length is 1 byte. 0 is realistic braking is not disabled for this railtype. 1 is disable realistic braking for this railtype.
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_railtype_disable_realistic_braking</font>, version 1</p>
<br />
<h3><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Roadtypes">Action 0 - Roadtypes</a> and <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Tramtypes">Action 0 - Tramtypes</a></h3>
<h4>Extra road/tram type flags (mappable property: roadtype_extra_flags)</h4>
<h3 id="a0roadtypes"><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Roadtypes">Action 0 - Roadtypes</a> and <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Tramtypes">Action 0 - Tramtypes</a></h3>
<h4 id="roadtype_extra_flags">Extra road/tram type flags (mappable property: roadtype_extra_flags)</h4>
<p>This property sets the extra flags for this road/tram type.<br />
The property length is 1 byte. The format is:
<table>
@ -250,15 +250,15 @@
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_roadtype_extra_flags</font>, version 1</p>
<br />
<h3><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Stations">Variational Action 2 - Stations</a></h3>
<h4>Track type in purchase list (42)</h4>
<h3 id="varaction2_station"><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Stations">Variational Action 2 - Stations</a></h3>
<h4 id="varaction2_station_var42">Track type in purchase list (42)</h4>
<p>This is indicated by the feature name: <font face="monospace">varaction2_station_var42</font>, version 1</p>
<br />
<h3 id="feature-test">Action 14 - Type ID Mapping for Action 5</h3>
<h3 id="action5">Action 14 - Type ID Mapping for Action 5</h3>
<p>See <a href="https://newgrf-specs.tt-wiki.net/wiki/Action14">Action 14 Specification</a> and <a href="https://newgrf-specs.tt-wiki.net/wiki/Action5">Action 5 Specification</a> for background information.</p>
<p>The action 5 type ID mapping mechanism has the feature name: <font face="monospace">action5_type_id_mapping</font>, this document describes version 1.</p>
<p>Users of this mechanism SHOULD at minimum test for the presence of the feature above or test variable 8D, below.</p>
<h4>Action 5 type ID Mapping: C "A5TM"</h4>
<h4 id="A5TM">Action 5 type ID Mapping: C "A5TM"</h4>
<p>Each A5TM chunk (type C) describes an individual action 5 type ID mapping.<br />
Sub-chunks within each A5TM chunk may appear in any order, however except where otherwise noted each sub-chunk SHOULD only appear ONCE within an individual A5TM chunk.</p>
<p>Action 5 type ID mapping can be safely used on implementations which do not implement the type ID mapping mechanism if Action 5 sprites which use mapped type IDs are skipped if one or more of:
@ -267,16 +267,16 @@
<li>The feature name <font face="monospace">action5_type_id_mapping</font> is checked for.</li>
</ul>
Unknown Action 14 blocks are ignored, and do not need to be skipped.</p>
<h4>Property Name: C "A5TM" -> T "NAME"</h4>
<h4 id="A5TM-NAME">Property Name: C "A5TM" -> T "NAME"</h4>
<p>Within an A5TM chunk, the NAME text (type T) field contains the name of the type to map. The value of the language ID byte is ignored.</p>
<h4>Property ID: C "A5TM" -> B "TYPE"</h4>
<h4 id="A5TM-TYPE">Property ID: C "A5TM" -> B "TYPE"</h4>
<p>Within an A5TM chunk, the TYPE binary (type B) field contains the type ID to allocate to the named type, this value can used in Action 5 sprites. This is 1 byte. The value MUST be &lt; 128 (i.e bit 7 must be clear).<br />
It is possible to override existing type IDs, however this use is not recommended.</p>
<h4>Success Indicator Global Variable 0x8D Bit: C "A5TM" -> B "SETT"</h4>
<p>This behaves identically to the <a href="#SETT">C "A0PM" -> B "SETT"</a> case, above</p>
<h4>Fallback Mode: C "A5TM" -> B "FLBK"</h4>
<p>This behaves identically to the <a href="#FLBK">C "A0PM" -> B "FLBK"</a> case, above</p>
<h4>Example NFO:</h4>
<h4 id="A5TM-SETT">Success Indicator Global Variable 0x8D Bit: C "A5TM" -> B "SETT"</h4>
<p>This behaves identically to the <a href="#A0PM-SETT">C "A0PM" -> B "SETT"</a> case, above</p>
<h4 id="A5TM-FLBK">Fallback Mode: C "A5TM" -> B "FLBK"</h4>
<p>This behaves identically to the <a href="#A0PM-FLBK">C "A0PM" -> B "FLBK"</a> case, above</p>
<h4 id="A5TM-example">Example NFO:</h4>
<pre>
// Map action5 type "sample_action5_type" to type id 0x70, and set bit 5 of global variable 0x8D if successful
-1 * -1 14
@ -294,7 +294,7 @@
-1 sprites/sample.png 546 8 09 23 33 -26 0
-1 sprites/sample.png 594 8 09 23 33 -5 0
</pre>
<h4>Programmable pre-signal graphics (mappable type: programmable_signals)</h4>
<h4 id="programmable_signals">Programmable pre-signal graphics (mappable type: programmable_signals)</h4>
<p>Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf and <a href="https://newgrf-specs.tt-wiki.net/wiki/Action5#04_Signal_graphics.">Action 5 type 4 (signals)</a>;
red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing.
<table>

Loading…
Cancel
Save