Difference between revisions of "VariationalAction2/Objects"
Planetmaker (talk | contribs) |
|||
Line 84: | Line 84: | ||
==Count of object, distance of closest instance (64)== |
==Count of object, distance of closest instance (64)== |
||
− | Returns the same values as [[VarAction2Industries#Count_of_industry_distance_of_closest_instance_67_68_|industry var67]]. The |
+ | Returns the same values as [[VarAction2Industries#Count_of_industry_distance_of_closest_instance_67_68_|industry var67]]. The distance is from the current tile. |
Revision as of 19:53, 1 September 2010
Variational Action 2 Variables for Objects
Variational Action 2 Variables for Objects
||Variable|Size|Content
40|D|Relative position, like Industry Tile var43
41|W|Tile information, see below
42|D|Construction date from year 0
43|W|Animation counter, see below
44|B|Object founder information
45|D|Get town zone and Manhattan distance of closest town
46|D|Get square of Euclidian distance of closest town
60|W|Get object type at offset
61|B|Get random bits at offset
62|D|Land info of nearby tiles
63|W|Animation counter of nearby tile
64|D|Count of object, distance of closest instance||
Tile information (41)
The return value has the format of ss0t where t is the terrain type which the tile is on, same values as canal var81.
As of TTDPatch r2088, ss contains the slope data of the tile, same format as for industrytile var60. The meaning of the individual bits is:
||Bit|Meaning
0|West corner is above the lowest
1|South corner is above the lowest
2|East corner is above the lowest
3|North corner is above the lowest
4|The tile is a steep slope (*)||
(*) - Currently, objects are not allowed on steep slopes so this should be ignored for now.
Animation Counter (43)
The return value has the format of ccaa, where c is the colour of the object, a is the animation counter (note that action0, property 10, bit 6 must be set for this to work).
Object founder information (44)
This byte contains the ID of the company that funded the object, or 10h if the object was placed in the scenario editor.
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.
Get object type at offset (60)
Returns the same values as industry var60. The offset it from the current tile.
Get random bits at offset (61)
Returns the same values as industry var61. The offset it from the current tile.
Land info of nearby tiles (62)
Returns the same values as industry tile var60. The offset it from the current tile.
Animation counter of nearby tile (63)
Returns the var 43 of another tile given by the offset.
Count of object, distance of closest instance (64)
Returns the same values as industry var67. The distance is from the current tile.