From 6903e5c9373cdd770f97657ad25f7e6734d0ecf6 Mon Sep 17 00:00:00 2001
From: Jonathan G Rennison This document describes the non-standard addition of the NewGRF road stops feature to the Official OpenTTD NML Specifications, as implemented in this patchpack, and the associated NML fork
- This feature does not match OpenTTD PR #7955 in a number of key areas, this feature may not necessarily match implementations of NewGRF road stops in other patches, branches, etc.
- This feature as implemented here MAY also be present in other patchpacks. This document describes the non-standard additions to the NewGRF road stops feature in the Official OpenTTD NML Specifications, as implemented in this patchpack, and the associated NML fork These additions and the official specification do not match the obsolete OpenTTD PR #7955 which used a different NewGRF interface. The feature identifier is FEAT_ROADSTOPS, (the PARENT scope for this feature is the road stop's station's town). See the associated non-NML document for more details on the NewGRF road stops feature. This feature will be automatically skipped when loaded into a version of OpenTTD which does not support this feature. This feature will be automatically skipped when loaded into a version of OpenTTD which does not support this feature (before 14.0). Sections:
RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY RST_DRAW_FLAG_WAYPOINT_GROUNDNewGRF Road Stops Addition to NewGRF Specifications in JGR's Patchpack in NML
- Additions to the NewGRF Road Stops Specification in JGR's Patchpack in NML
+
+ The additions here are compatible with the specification and OpenTTD 14.0, such that GRFs can run on OpenTTD 14.0 and also optionally use patchpack extensions where available.
There is no permanent storage associated with this feature.
- If this feature is the only significant thing in this GRF, then extended_feature_test("road_stops") SHOULD be called and some message, error or other form of
- signalling to the user used to inform the user that this version of OpenTTD does not support the feature, if the return value is false.
- Otherwise the GRF could silently do nothing instead of the expected functionality, creating confusion for end users.
+ If this feature is the only significant thing in this GRF, then version_openttd(14, 0) || extended_feature_test("road_stops") MAY be called and some message, error or other form of
+ signalling to the user used to inform the user that this version of OpenTTD does not support the feature, if the value is false.
@@ -58,7 +57,7 @@
Predefined classes include:
@@ -70,7 +69,7 @@
classname string You only need to set this for one object in every class.
Draw road overlays for drive-through stops.
- Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).
RST_GENERAL_FLAG_RANDOM_ANIMATION
Animation callback requires random bits in variable extra_callback_info1.
RST_GENERAL_FLAG_NO_ONE_WAY_OVERLAY
- Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using the one_way_info variable.
RST_GENERAL_FLAG_NO_CATENARY
Do not show catenary graphics. (This only takes effect from road_stops version 2).
RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY
@@ -92,12 +91,12 @@
RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY
Only show in the tram build menu (not road). (This only takes effect from road_stops version 4).
RST_GENERAL_FLAG_BUILD_MENU_DRAW_DISABLED_VIEWS
- Use custom graphics for disabled road stop views. (This only takes effect from road_stops version 8).
RST_GENERAL_FLAG_DRAW_MODE_REGISTER
- Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the draw_mode property. (This only takes effect from road_stops version 9).
Which bridge pillars are disallowed on the tile for each of the 6 views/rotations.
RST_BRIDGE_PILLAR_FLAG_CORNER_W
Pillar in west corner
Name | Value range | Comment |
---|---|---|
view | 0..5 | The view/rotation of the road stop |
stop_type | RST_TYPE_XXX | XXX = BUS | TRUCK | WAYPOINT |
stop_type | RST_TYPE_XXX | XXX = BUS | TRUCK | WAYPOINT (Not in standard specification) |
terrain_type | TILETYPE_XXX | XXX = NORMAL | DESERT | RAIN_FOREST | SNOW |
tile_slope | SLOPE_XXX | See tile slopes for an overview of possible values |
has_road | 0 | 1 | 1 is this road stop has road |
waiting_triggers | 0..255 | Waiting triggers |
random_bits | 0..16777215 | All random bits |
random_bits_tile | 0..255 | Random bits (per tile), see also random_bits_station |
one_way_info | RST_OWI_XXX | One-way road information of drive-through stop tile XXX = TWO_WAY | WEST_BOUND | EAST_BOUND | NO_ENTRY |
one_way_info_inferred | RST_OWI_XXX | Inferred one-way road information of drive-through stop tile XXX = TWO_WAY | WEST_BOUND | EAST_BOUND | NO_ENTRY |
drawn_in_gui | 0 | 1 | 1 if this road stop is being drawn in the build window |
one_way_info Not in standard specification | RST_OWI_XXX | One-way road information of drive-through stop tile XXX = TWO_WAY | WEST_BOUND | EAST_BOUND | NO_ENTRY |
one_way_info_inferred Not in standard specification | RST_OWI_XXX | Inferred one-way road information of drive-through stop tile XXX = TWO_WAY | WEST_BOUND | EAST_BOUND | NO_ENTRY |
drawn_in_gui Not in standard specification | 0 | 1 | 1 if this road stop is being drawn in the build window |
This document describes the non-standard addition of the NewGRF road stops feature to the Official OpenTTD NewGRF Specifications, as implemented in this patchpack. - This feature does not match OpenTTD PR #7955 in a number of key areas, this feature may not necessarily match implementations of NewGRF road stops in other patches, branches, etc. - This feature as implemented here MAY also be present in other patchpacks.
+This document describes the non-standard additions to the NewGRF road stops feature in the Official OpenTTD NewGRF Specifications (OpenTTD 14.0 and later), as implemented in this patchpack. + The additions here are compatible with the specification and OpenTTD 14.0, such that GRFs can run on OpenTTD 14.0 and also optionally use patchpack extensions where available.
+These additions and the official specification do not match the obsolete OpenTTD PR #7955 which used a different NewGRF interface.
See the NewGRF additions document for background information on additions to the NewGRF specifications.
-A subset of the functionality listed below is also supported in a fork of NML, see the associated NML road stops and NML additions documents for more details.
-NewGRFs which use this feature SHOULD use the feature testing mechanism to check whether the road stop feature and/or feature ID mapping is supported.
-NewGRFs which use this feature MUST use the feature ID mapping mechanism to map the non-standard NewGRF road stop feature to a local feature ID.
-This feature is indicated by the feature name: road_stops, version 1.
+
The functionality listed below is also supported in a fork of NML, see the associated NML road stops and NML additions documents for more details.
+NewGRFs which use this feature MAY use the feature testing mechanism to check whether/which extensions to the road stop feature are supported.
+NewGRFs which use this feature MAY use the feature ID mapping mechanism to map the road stop feature to local feature ID 0x14 to additionally support earlier + versions of this patchpack before the feature was added to the specification, otherwise feature ID 0x14 may be used without any mapping (as per the specification).
+These extensions are indicated by the feature name: road_stops, version 1.
The feature name to use for feature ID mapping is road_stops.
Features/properties/variables which require a higher version will indicate the required version. Unless indicated otherwise these will fall back to doing nothing on versions which do not support them.
See the Action 0 Specification for background information.
+See the Action 0 Roadstops Specification for background information.
Properties:Number | Mappable name | Size in bytes | Description | |
---|---|---|---|---|
08 | roadstop_class_id | 4 | Class ID | |
09 | roadstop_stop_type | 1 | Stop type availability | |
0A | roadstop_stop_name | 2 | Name | |
0B | roadstop_class_name | 2 | Class name | |
0C | roadstop_draw_mode | 1 | Draw mode | |
0D | roadstop_random_trigger_cargoes | 4 | Random trigger cargoes | |
0E | roadstop_animation_info | 2 | Animation info | |
0F | roadstop_animation_speed | 1 | Animation speed | |
10 | roadstop_animation_triggers | 2 | Animation triggers | |
11 | roadstop_callback_mask | 1 | Callback flags | |
12 | roadstop_general_flags | 4 | General flags | |
13 | roadstop_min_bridge_height | 6 | Minimum bridge heights | |
14 | roadstop_disallowed_bridge_pillars | 6 | Disallowed bridge pillars | |
15 | roadstop_cost_multipliers | 2 | Cost multipliers | |
16 | roadstop_height | 1 | Height (for build window) | |
Number | Mappable name | Size in bytes | Description | Difference to specification |
08 | roadstop_class_id | 4 | Class ID | WAYP (road waypoints) |
09 | roadstop_stop_type | 1 | Stop type availability | |
0A | roadstop_stop_name | 2 | Name | |
0B | roadstop_class_name | 2 | Class name | |
0C | roadstop_draw_mode | 1 | Draw mode | Bit 2 |
0D | roadstop_random_trigger_cargoes | 4 | Random trigger cargoes | |
0E | roadstop_animation_info | 2 | Animation info | |
0F | roadstop_animation_speed | 1 | Animation speed | |
10 | roadstop_animation_triggers | 2 | Animation triggers | |
11 | roadstop_callback_mask | 1 | Callback flags | |
12 | roadstop_general_flags | 4 | General flags | Bits 1, 7, 8 |
13 | roadstop_min_bridge_height | 6 | Minimum bridge heights | Not in spec |
14 | roadstop_disallowed_bridge_pillars | 6 | Disallowed bridge pillars | Not in spec |
15 | roadstop_cost_multipliers | 2 | Cost multipliers | |
16 | roadstop_height | 1 | Height (for build window) | Not in spec |
Name | Class ID | Meaning |
---|---|---|
DFLT | 44 46 4C 54 | Default bus and lorry stops |
WAYP | 57 41 59 50 | This class is used for road waypoints |
WAYP | 57 41 59 50 | This class is used for road waypoints. This is reserved in the specification, but not implemented. |
Bit | Value | Meaning |
---|---|---|
0 | 1 | Callback 141 needs random bits in variable 10 |
1 | 2 | Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using bits 0..1 of variable 50. |
1 | 2 | Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using bits 0..1 of variable 50. This is not in the specification. |
2 | 4 | Do not show catenary graphics.This requires road_stops, version 2. |
3 | 8 | Only allow drive-through stops (not bay stops).This requires road_stops, version 2. |
4 | 10 | Do not automatically build connecting road pieces.This requires road_stops, version 3. |
5 | 20 | Only show in the road build menu (not tram).This requires road_stops, version 4. |
6 | 40 | Only show in the tram build menu (not road).This requires road_stops, version 4. |
7 | 80 | Use custom graphics for disabled road stop views.This requires road_stops, version 8. |
8 | 100 | Read the road stop draw mode from variable 0x100, this overrides the roadstop_draw_mode property.This requires road_stops, version 9. |
7 | 80 | Use custom graphics for disabled road stop views.This requires road_stops, version 8. This is not in the specification. |
8 | 100 | Read the road stop draw mode from variable 0x100, this overrides the roadstop_draw_mode property.This requires road_stops, version 9. This is not in the specification. |
This property allows or disallows building bridges over road stops.
The bridge height property defines minimum clearances required for a bridge for each of the 6 views/rotations (or 0 to not allow any bridge). Values are given in height level units (1 level == 8px).
- Each height value is 1 byte, the total property length is 6 bytes.
+ Each height value is 1 byte, the total property length is 6 bytes.
+ This property is not in the specification.
This property describes which bridge pillars are not allowed on the road stop tile.
It consists of a set of pillar flags, for each of the 6 road stop views/rotations.
Each set of flags is 1 byte, the total property length is 6 bytes.
- Each set of flags has the format described in the bridge_pillar_flags property section.
+ Each set of flags has the format described in the bridge_pillar_flags property section.
+ This property is not in the specification.
This property sets the build and removal cost multipliers.
@@ -186,7 +192,8 @@
The nominal height for the road stop preview is set to at least: 32 + "value of this property" * 8.
This similar to Object variable 16.
The total property length is 1 byte.
- This requires road_stops, version 6.
+ This requires road_stops, version 6.
+ This property is not in the specification.
@@ -212,36 +219,36 @@
See the Variational Action 2 Specification for background information.
+See the Variational Action 2 Road Stops Specification for background information.
The parent scope for this feature is the road stop's station's town.
Variables:Number | Mappable name | Description | |
---|---|---|---|
40 | roadstop_view | View/rotation | |
41 | roadstop_type | Stop type | |
42 | roadstop_terrain_type | Terrain type | |
43 | roadstop_road_type | Road type | |
44 | roadstop_tram_type | Tram type | |
45 | roadstop_town_zone | Town zone and Manhattan distance of town | |
46 | roadstop_town_distance_squared | Square of Euclidean distance of town | |
47 | roadstop_company_info | Player/company info | |
48 | Bitmask of accepted cargoes (BaseStation) | ||
49 | roadstop_animation_frame | Current animation frame | |
50 | roadstop_misc_info | Miscellaneous info | |
60 | Amount of cargo waiting (BaseStation) | ||
61 | Time since last cargo pickup (BaseStation) | ||
62 | Rating of cargo (BaseStation) | ||
63 | Time spent on route (BaseStation) | ||
64 | Information about last vehicle picking cargo up (BaseStation) | ||
65 | Amount of cargo acceptance (BaseStation) | ||
66 | roadstop_animation_frame_nearby_tiles | Animation frame of nearby tile | |
67 | roadstop_land_info_nearby_tiles | Land info of nearby tiles | |
68 | roadstop_road_stop_info_nearby_tiles | Road stop info of nearby tiles | |
roadstop_road_stop_info_nearby_tiles_v2 | Road stop info of nearby tiles (v2) | ||
69 | Information about cargo accepted in the past (BaseStation) | ||
6A | roadstop_road_stop_grfid_nearby_tiles | GRFID of nearby road stop tiles | |
6B | roadstop_road_info_nearby_tiles | Road info of nearby plain road tiles | |
Number | Mappable name | Description | Difference to specification |
40 | roadstop_view | View/rotation | |
41 | roadstop_type | Stop type | Road waypoint |
42 | roadstop_terrain_type | Terrain type | |
43 | roadstop_road_type | Road type | |
44 | roadstop_tram_type | Tram type | |
45 | roadstop_town_zone | Town zone and Manhattan distance of town | |
46 | roadstop_town_distance_squared | Square of Euclidean distance of town | |
47 | roadstop_company_info | Player/company info | |
48 | Bitmask of accepted cargoes (BaseStation) | ||
49 | roadstop_animation_frame | Current animation frame | |
50 | roadstop_misc_info | Miscellaneous info | Not in spec |
60 | Amount of cargo waiting (BaseStation) | ||
61 | Time since last cargo pickup (BaseStation) | ||
62 | Rating of cargo (BaseStation) | ||
63 | Time spent on route (BaseStation) | ||
64 | Information about last vehicle picking cargo up (BaseStation) | ||
65 | Amount of cargo acceptance (BaseStation) | ||
66 | roadstop_animation_frame_nearby_tiles | Animation frame of nearby tile | |
67 | roadstop_land_info_nearby_tiles | Land info of nearby tiles | |
68 | roadstop_road_stop_info_nearby_tiles | Road stop info of nearby tiles | Road waypoint, bits 24 - 31 |
roadstop_road_stop_info_nearby_tiles_v2 | Road stop info of nearby tiles (v2) | Not in spec | |
69 | Information about cargo accepted in the past (BaseStation) | ||
6A | roadstop_road_stop_grfid_nearby_tiles | GRFID of nearby road stop tiles | |
6B | roadstop_road_info_nearby_tiles | Road info of nearby plain road tiles | Not in spec |
See the Random Action 2 Specification for background information.
+See the Random Action 2 Road Stops Specification for information.
+ +Road stops have 16+8 random bits. Bits 0 to 15 are a property of the station as a whole, and bits 16 to 23 are different for each tile. @@ -477,6 +491,7 @@ Triggers 04, 08, and 10 only affect the tile on which they occur, as well as the random bits of the station, but not other tiles.