From 98f889f0abc44477a16a7013d1b36c76383e0000 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 19 Oct 2020 19:43:57 +0100 Subject: [PATCH] Documentation: Add NML documentation for non-standard NewGRF features --- README.md | 1 + docs/newgrf-additions-nml.html | 89 ++++++++++++++++++++++++++++++++++ docs/newgrf-additions.html | 3 +- 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 docs/newgrf-additions-nml.html diff --git a/README.md b/README.md index bd5d9213f9..bba60a7597 100644 --- a/README.md +++ b/README.md @@ -273,6 +273,7 @@ See [jgrpp-changelog.md](jgrpp-changelog.md) for changelog. * Increase per-vehicle order limit from 254 to 64k. (added in v0.38.0). * Various minor fixes, see changelog. * [NewGRF specification additions](docs/newgrf-additions.html) ([online copy](https://htmlpreview.github.io/?https://github.com/JGRennison/OpenTTD-patches/blob/jgrpp/docs/newgrf-additions.html)). + * [NML specification additions](docs/newgrf-additions-nml.html) ([online copy](https://htmlpreview.github.io/?https://github.com/JGRennison/OpenTTD-patches/blob/jgrpp/docs/newgrf-additions-nml.html)). * [Low-level code/performance changes](docs/jgrpp-low-level-changes.md). * Translations diff --git a/docs/newgrf-additions-nml.html b/docs/newgrf-additions-nml.html new file mode 100644 index 0000000000..22a237283c --- /dev/null +++ b/docs/newgrf-additions-nml.html @@ -0,0 +1,89 @@ + + + + + JGR's Patchpack - Additions to NewGRF Specifications (NML) + + + +

Additions to NewGRF Specifications in JGR's Patchpack in NML

+

This document describes non-standard additions to the Official OpenTTD NML Specifications which are present in this patchpack and the associated NML fork. +

These additions MAY also be present in other patchpacks. They MAY be removed or moved in future, if necessary.

+ +

Not all standard NewGRF features are supported by NML, consequently not all non-standard additions to the specifications are supported by this patchpack's associated NML fork, or are listed in this document.
+ See the associated non-NML document for more details.

+ +

All of the non-standard features listed below will automatically emit suitable feature tests, conditionals, etc. such that NewGRFs which use these features will work correctly + on OpenTTD versions which do not support these features, including standard trunk OpenTTD and older/other patchpack versions.

+ +

Railtypes properties

+ + + + + + + + +
PropertyValue rangeComment
enable_programmable_pre_signals0 or 1 + Enable programmable pre-signal graphics in railtype signals.
+ Programmable pre-signals have a signal type (getbits(extra_callback_info2, 16, 8)) of 6. +
enable_restricted_signals0 or 1 + Enable restricted signal flag in railtype signals.
+ When enabled, bit 24 of variable extra_callback_info2 is set if the signal is restricted (has a routing restriction program attached).
+ When enabled, the "Show restricted electric signals using default graphics" client setting and signal post recolouring is not applied.
+ This flag must only be set if a different sprite is returned when bit 24 of extra_callback_info2 is set. +
+

Roadtype properties

+ + + + + +
PropertyValue rangeComment
roadtype_extra_flagsbitmask(ROADTYPE_EXTRA_FLAG_XXX, ...) +
+
NO_SCRIPT_BUILD
+
Scripts (AI/GS) may not build this roadtype
+
NO_TOWN_MODIFY
+
Towns may not modify tiles of this roadtype in any way whatsoever
+
+
+

Tramtype properties

+ + + + + +
PropertyValue rangeComment
tramtype_extra_flagsbitmask(TRAMTYPE_EXTRA_FLAG_XXX, ...) +
+
NO_SCRIPT_BUILD
+
Scripts (AI/GS) may not build this tramtype
+
NO_TOWN_MODIFY
+
Towns may not modify tiles of this tramtype in any way whatsoever
+
+
+

Replace new sprites

+ + + + + +
TypeNumber of sprites Comment
PROGRAMMABLE_PRE_SIGNAL32 + Programmable pre-signals +

Signal graphics come in groups of 16. These groups contain sprites in the same order as sprites 1275-1290 in trg1[r].grf and Action 5 type 4 (signals); + red, then green, for each of: SW-facing, NE-facing, NW-facing, SE-facing, E-facing, W-facing, S-facing, N-facing. + + + + +
GroupContents
0Semaphore programmable pre-signals
1Lighted programmable pre-signals
+

+ + diff --git a/docs/newgrf-additions.html b/docs/newgrf-additions.html index 620b461cd9..41a913e882 100644 --- a/docs/newgrf-additions.html +++ b/docs/newgrf-additions.html @@ -21,6 +21,7 @@

Additions to NewGRF Specifications in JGR's Patchpack

This document describes non-standard additions to the Official OpenTTD NewGRF Specifications which are present in this patchpack.

These additions MAY also be present in other patchpacks. They MAY be removed or moved in future, if necessary.

+

A subset of the features listed below are also supported in a fork of NML, see the associated NML document for more details.

NewGRFs which use any of these features SHOULD use the feature testing mechanism described below to check whether individual added features are supported.

Action 14 - Feature Tests

@@ -225,7 +226,7 @@

Enable restricted signal flag for custom signal sprites (mappable property: railtype_enable_restricted_signals)

This applies to Action 2/3 - Railtype custom signal sprites.
When enabled, bit 24 of variable 18 (extra callback info) is set if the signal is restricted (has a routing restriction program attached).
- When enabled, the "Show restricted electric signals using default graphics" client setting is not applied.
+ When enabled, the "Show restricted electric signals using default graphics" client setting and signal post recolouring is not applied.
This flag should only be set if the Action 2/3 actually returns a different sprite when bit 24 of variable 18 is set. The property length is 1 byte. 0 is disabled (default). 1 is enabled.