Documentation: Add docs on AI/GS additions
This commit is contained in:
@@ -274,6 +274,7 @@ See [jgrpp-changelog.md](jgrpp-changelog.md) for changelog.
|
|||||||
* Various minor fixes, see 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)).
|
* [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)).
|
* [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).
|
* [Low-level code/performance changes](docs/jgrpp-low-level-changes.md).
|
||||||
|
|
||||||
* Translations
|
* Translations
|
||||||
|
@@ -117,6 +117,7 @@ Pre-filter SaveLoad descriptor arrays for current version/mode, for chunks with
|
|||||||
|
|
||||||
### AI/GS
|
### AI/GS
|
||||||
|
|
||||||
|
[AI/GS script additions](docs/script-additions.html).
|
||||||
Add AI/GS method to get current day length.
|
Add AI/GS method to get current day length.
|
||||||
Add GS method to create river tiles.
|
Add GS method to create river tiles.
|
||||||
Add workaround for performance issues attempting to create a town when no town names are left.
|
Add workaround for performance issues attempting to create a town when no town names are left.
|
||||||
|
44
docs/script-additions.html
Normal file
44
docs/script-additions.html
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
<title>JGR's Patchpack - Additions to Script Specifications (AI and GameScript)</title>
|
||||||
|
<style type="text/css">
|
||||||
|
td li { white-space: nowrap; text-align: left; }
|
||||||
|
th { white-space: nowrap; text-align: center; }
|
||||||
|
td, th { border: 1px solid #CCCCCC; padding: 0px 5px; }
|
||||||
|
table { border-collapse: collapse; empty-cells: show; }
|
||||||
|
.code { font-family: "Courier New", Courier, mono; color: darkgreen; }
|
||||||
|
.methodtext{ margin-left: 3em; }
|
||||||
|
.indent { margin-left: 1em; }
|
||||||
|
dt { font-weight: bold; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>Additions to AI/GS Script Specifications in JGR's Patchpack</h2>
|
||||||
|
<p>This document describes non-standard additions to the Official OpenTTD <a href="https://docs.openttd.org/ai-api/">AI</a> and <a href="https://docs.openttd.org/gs-api/">GS</a> Specifications which are present in this patchpack.
|
||||||
|
<p>These additions MAY also be present in other patchpacks. They MAY be removed or moved in future, if necessary.</p>
|
||||||
|
|
||||||
|
<p>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.<br>
|
||||||
|
Testing for the presence of methods may be done using the "in" operator.</p>
|
||||||
|
|
||||||
|
<h3>Date: <a href="https://docs.openttd.org/gs-api/classGSDate.html">GSDate Class</a> and <a href="https://docs.openttd.org/ai-api/classAIDate.html">AIDate Class</a></h3>
|
||||||
|
<div class="indent">
|
||||||
|
<h4>Additional Static Public Member Functions:</h4>
|
||||||
|
<div class="indent">
|
||||||
|
<div class="code">static int32 GetDayLengthFactor ()</div>
|
||||||
|
<div class="methodtext">Get current day length factor</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Marine: <a href="https://docs.openttd.org/gs-api/classGSMarine.html">GSMarine Class</a> and <a href="https://docs.openttd.org/ai-api/classAIMarine.html">AIMarine Class</a></h3>
|
||||||
|
<div class="indent">
|
||||||
|
<h4>Additional Static Public Member Functions:</h4>
|
||||||
|
<div class="indent">
|
||||||
|
<div class="code">static bool BuildRiver (TileIndex tile)</div>
|
||||||
|
<div class="methodtext">Builds a river on tile (subject to permissions/settings)</div>
|
||||||
|
<div class="methodtext">All other details are the same as BuildCanal</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Reference in New Issue
Block a user