Difference between revisions of "VariationalAction2/Road Stops"

From GRFSpecs
Jump to navigationJump to search
(Add parameterised variables)
(Add road waypoint value for var 41)
 
(2 intermediate revisions 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]].
 
|-
 
|-
|66||D||{{ottdp|14}}||Animation counter of nearby tile
+
|66||D||{{ottdp|14}}||Animation frame of nearby tile
 
|-
 
|-
 
|67||D||{{ottdp|14}}||Land info of nearby tiles
 
|67||D||{{ottdp|14}}||Land info of nearby tiles
Line 40: Line 42:
 
== Description ==
 
== Description ==
   
=== Animation counter of nearby tile (66) ===
+
=== 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||{{ottdp|15}} Road waypoint
  +
|}
  +
  +
=== Tile information (42) ===
  +
  +
The return value has the same values as [[VariationalAction2/Objects#Tile information (41)|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 [[TownZones|town zone]] and Manhattan distance of closest town (45) ===
  +
  +
Like [[VarAction2Industries#Get town zone and Manhattan distance of closest town (65)|industry var65]] but instead of an offset the current tile is used.
  +
  +
=== Get square of Euclidian distance of closest town (46) ===
  +
  +
Like [[VarAction2Industries#Get square of Euclidean distance of closest town (66)|industry var66]] but instead of an offset the current tile is used.
  +
  +
=== Player (company) information (47) ===
  +
  +
The return value has the same values as [[VariationalAction2/Vehicles#Player info (43)|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.
 
The parameter of this variable is a signed offset from the current tile.
Line 62: Line 151:
 
|-
 
|-
 
|0..7||If the tile is defined in the current GRF, this is the setID used in the definition. Otherwise, the content is undefined.
 
|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 has more than 256 road stops, this field may only be used to check for road stops in the range 0..254.
+
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
 
|8..9||0 - The tile uses original TTD graphics

Latest revision as of 19:45, 3 May 2024

Introduction

Variables

Variable Size Version Description
40 B Supported by OpenTTD 1414 Not supported by TTDPatch View/rotation
41 B Supported by OpenTTD 1414 Not supported by TTDPatch Stop type
42 W Supported by OpenTTD 1414 Not supported by TTDPatch Tile information, see below
43 D Supported by OpenTTD 1414 Not supported by TTDPatch Road type
44 D Supported by OpenTTD 1414 Not supported by TTDPatch Tram type
45 D Supported by OpenTTD 1414 Not supported by TTDPatch Get town zone and Manhattan distance of closest town
46 D Supported by OpenTTD 1414 Not supported by TTDPatch Get square of Euclidian distance of closest town
47 B Supported by OpenTTD 1414 Not supported by TTDPatch Player (company) information
48 See Base Stations.
49 B Supported by OpenTTD 1414 Not supported by TTDPatch Current animation frame
50 D Supported by OpenTTD 1515 Not supported by TTDPatch Miscellaneous road stop info
60-65 See Base Stations.
66 D Supported by OpenTTD 1414 Not supported by TTDPatch Animation frame of nearby tile
67 D Supported by OpenTTD 1414 Not supported by TTDPatch Land info of nearby tiles
68 D Supported by OpenTTD 1414 Not supported by TTDPatch Road stop info of nearby tiles
6A D Supported by OpenTTD 1414 Not supported by TTDPatch 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 Supported by OpenTTD 1515 Not supported by TTDPatch 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