From c3741ca0e916c3023b8db7890b249de598732342 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 28 Oct 2020 21:59:02 +0000 Subject: [PATCH] Documentation: Add docs on AI/GS additions --- README.md | 1 + docs/jgrpp-low-level-changes.md | 1 + docs/script-additions.html | 44 +++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 docs/script-additions.html diff --git a/README.md b/README.md index e546e8de9d..56d269c177 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,7 @@ See [jgrpp-changelog.md](jgrpp-changelog.md) for changelog. * 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)). + * [AI/GS script additions](docs/script-additions.html) ([online copy](https://htmlpreview.github.io/?https://github.com/JGRennison/OpenTTD-patches/blob/jgrpp/docs/script-additions.html)). * [Low-level code/performance changes](docs/jgrpp-low-level-changes.md). * Translations diff --git a/docs/jgrpp-low-level-changes.md b/docs/jgrpp-low-level-changes.md index ddfb261391..7fa73ffeff 100644 --- a/docs/jgrpp-low-level-changes.md +++ b/docs/jgrpp-low-level-changes.md @@ -117,6 +117,7 @@ Pre-filter SaveLoad descriptor arrays for current version/mode, for chunks with ### AI/GS +[AI/GS script additions](docs/script-additions.html). Add AI/GS method to get current day length. Add GS method to create river tiles. Add workaround for performance issues attempting to create a town when no town names are left. diff --git a/docs/script-additions.html b/docs/script-additions.html new file mode 100644 index 0000000000..16bce206fc --- /dev/null +++ b/docs/script-additions.html @@ -0,0 +1,44 @@ + + + + + JGR's Patchpack - Additions to Script Specifications (AI and GameScript) + + + +

Additions to AI/GS Script Specifications in JGR's Patchpack

+

This document describes non-standard additions to the Official OpenTTD AI and GS 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.

+ +

Scripts which use any of these features SHOULD check whether the feature is present and if not, fallback to not using it and/or emitting a clear and end-user friendly error message.
+ Testing for the presence of methods may be done using the "in" operator.

+ +

Date: GSDate Class and AIDate Class

+
+

Additional Static Public Member Functions:

+
+
static int32 GetDayLengthFactor ()
+
Get current day length factor
+
+
+ +

Marine: GSMarine Class and AIMarine Class

+
+

Additional Static Public Member Functions:

+
+
static bool BuildRiver (TileIndex tile)
+
Builds a river on tile (subject to permissions/settings)
+
All other details are the same as BuildCanal
+
+
+ +