Difference between revisions of "VariationalAction2/Road Stops"
(Add non-parameterised variables) |
(Add road waypoint value for var 41) |
||
(One intermediate revision by the same user not shown) | |||
Line 24: | Line 24: | ||
|- |
|- |
||
|49||B||{{ottdp|14}}||Current animation frame |
|49||B||{{ottdp|14}}||Current animation frame |
||
+ | |- |
||
+ | |50||D||{{ottdp|15}}||Miscellaneous road stop info |
||
|- |
|- |
||
|60-65|| || ||See [[VariationalAction2/BaseStation|Base Stations]]. |
|60-65|| || ||See [[VariationalAction2/BaseStation|Base Stations]]. |
||
Line 66: | Line 68: | ||
|- |
|- |
||
|1||Freight/lorry stop |
|1||Freight/lorry stop |
||
+ | |- |
||
+ | |2||{{ottdp|15}} Road waypoint |
||
|} |
|} |
||
Line 112: | Line 116: | ||
The return value is the animation frame of the current tile. |
The return value is the animation frame of the current tile. |
||
+ | |||
+ | === Miscellaneous road stop info (50) === |
||
+ | |||
+ | {| |- |
||
+ | !Bits!!Meaning |
||
+ | |- |
||
+ | |0..3||Not implemented. |
||
+ | |- |
||
+ | |4||Bit set if the road stop is being drawn in the build window. |
||
+ | |- |
||
+ | |5..31||Undefined, reserved for future use |
||
+ | |} |
||
=== Animation frame of nearby tile (66) === |
=== Animation frame of nearby tile (66) === |
Latest revision as of 19:45, 3 May 2024
Introduction
Variables
Variable | Size | Version | Description |
---|---|---|---|
40 | B | 14 | View/rotation |
41 | B | 14 | Stop type |
42 | W | 14 | Tile information, see below |
43 | D | 14 | Road type |
44 | D | 14 | Tram type |
45 | D | 14 | Get town zone and Manhattan distance of closest town |
46 | D | 14 | Get square of Euclidian distance of closest town |
47 | B | 14 | Player (company) information |
48 | See Base Stations. | ||
49 | B | 14 | Current animation frame |
50 | D | 15 | Miscellaneous road stop info |
60-65 | See Base Stations. | ||
66 | D | 14 | Animation frame of nearby tile |
67 | D | 14 | Land info of nearby tiles |
68 | D | 14 | Road stop info of nearby tiles |
6A | D | 14 | GRFID of nearby tiles |
69 | See Base Stations. |
Description
View/rotation (40)
Value | Type | Description |
---|---|---|
0 | Bay | Facing north-east |
1 | Bay | Facing south-east |
2 | Bay | Facing south-west |
3 | Bay | Facing north-west |
4 | Drive-through | X-axis: north-east to south-west |
5 | Drive-through | Y-axis: north-west to south-east |
Stop type (41)
Value | Meaning |
---|---|
0 | Passenger/bus stop |
1 | Freight/lorry stop |
2 | 15 Road waypoint |
Tile information (42)
The return value has the same values as object var41.
Road type (43)
This has the value of the (translated) roadtype the road stop is built on, or the current roadtype in the build GUI.
If the roadtype has no entry in the roadtype translation table of the GRF, this value will be FFh.
If no translation table is present, the raw value will be returned.
Note: only exact matches of roadtypes are reported. If the translation table of the GRF does not contain the exact roadtype FFh is returned.
If the tile has no road at all (tram only) FFFFFFFFh is returned.
Tram type (44)
This has the value of the (translated) tramtype the road stop is built on, or the current tramtype in the build GUI.
If the tramtype has no entry in the tramtype translation table of the GRF, this value will be FFh.
If no translation table is present, the raw value will be returned.
Note: only exact matches of tramtypes are reported. If the translation table of the GRF does not contain the exact tramtype FFh is returned.
If the tile has no tram at all (road only) FFFFFFFFh is returned.
Get town zone and Manhattan distance of closest town (45)
Like industry var65 but instead of an offset the current tile is used.
Get square of Euclidian distance of closest town (46)
Like industry var66 but instead of an offset the current tile is used.
Player (company) information (47)
The return value has the same values as vehicle var43. The company used is the road stop owner.
Animation Frame (49)
The return value is the animation frame of the current tile.
Miscellaneous road stop info (50)
Bits | Meaning |
---|---|
0..3 | Not implemented. |
4 | Bit set if the road stop is being drawn in the build window. |
5..31 | Undefined, reserved for future use |
Animation frame of nearby tile (66)
The parameter of this variable is a signed offset from the current tile.
If the selected tile is a road stop tile that belongs to the current station, its animation state is returned. Otherwise, FFFFFFFFh is returned.
Land info of nearby tiles (67)
The parameter of this variable is a signed offset from the current tile.
Returns the same values as industry tile var60.
Road stop info of nearby tiles (68)
The parameter of this variable is a signed offset from the current tile.
The returned value is FFFFFFFFh if the selected tile isn't a road stop tile. Otherwise, the returned value can be separated to the following parts:
Bits | Meaning |
---|---|
0..7 | If the tile is defined in the current GRF, this is the setID used in the definition. Otherwise, the content is undefined.
Note that this field is clamped to the range 0..255. Therefore if the current GRF defines road stops with a setID > 255, this field may only be used to check for road stops in the range 0..254. |
8..9 | 0 - The tile uses original TTD graphics
1 - The tile is defined in the current GRF 2 - The tile is defined in another GRF |
10 | Set if the selected tile belongs to the current station, clear otherwise |
11 | Set if the selected tile has a different view/rotation, cleat if the same view/rotation |
12..15 | View/rotation of the selected tile |
16..19 | 0 - Passenger/bus stop
1 - Freight/lorry stop |
20 | Set if the stop type (passenger/bus or freight/lorry) is the same as the current tile |
21..31 | Undefined, reserved for future use |
GRFID of nearby road stop tile (6A)
The parameter of this variable is a signed offset from the current tile.
The returned value is one of the following:
- FFFFFFFFh if the selected tile isn't a road stop tile
- 00000000h if the selected station is a default road stop (not a NewGRF road stop)
- otherwise, the GRFID of the GRF which defined the type of the selected road stop tile