Action0/Objects

From GRFSpecs
< Action0
Revision as of 12:13, 28 August 2010 by Rubidium (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Action 0 properties for new objects

Action 0 - Properties for new objects

Defining properties of new objects.

{maketoc}

Unlike vehicles or new stations, most new objects have no real equivalent in TTD.

The IDs are therefore free to be chosen and will in fact be allocated automatically by the patch. In action 0, you only specify IDs relative to the set, i.e. the ID of the first object type is 00, the second object type is 01 and so on. In total, each game can only have 255 object IDs for all active grf files.

The property you must set for each object ID is 08 (in addition to defining an action 3 for it). Also, all object IDs must get their classes in the right order, starting from ID 00 onwards.

-=Properties=-

||Number|Version|Size|Description

08|a|D|Class ID, see below

09|a|W|Text ID for class

0A|a|W|Text ID for this object

0B|a|B|Climate availability

0C|a|B|Byte representing size, see below

0D|a|B|Object Cost Factor

0E|a|D|Introduction date, see below

0F|a|D|End of life date, see below

10|a|W|Object flags, see below||

Check Graphical Representation of the newObject Specifications|nocache

-=Comments=-

Object class (08)

Unlike station classes, there is currently no default yet, planned are TRNS for transmitters and LTHS for lighthouses. You have to set the class ID before any other property. Characters allowed in the IDs are A-Z, 0-9.

Object class text ID (09)

The text ID for this class (word value). This textid should be either a TTD textid or a D4xx textid (set via D0xx in action4).

When specifying an object, you don't need to set a class name again if you already did for another one with the same class.

Object text ID (0A)

The text ID for the object for query and selection (word value). Same requirements as for property09.

Object size (0C)

The object size up to 15x15 tiles.

This byte value is divided into two nibbles. The first defines the size in y direction and the second defines the size in x (i.e., stored as YX).

Note that any value lower than 0x11 will be rejected.

Build Cost (0D)

The build cost multiplier. This is multiplied by the number of tiles for evaluation of construction and removal costs of an object.

Introduction date (0E)

Introduction date of an object, in days since the year 0. This takes account of leap years; divisible by 4, but not 100 unless 400. A start date of 1920-01-01 is obtained with a value of 701265 (51 B3 0A 00). In TTDPatch anything before 1920 is considered to be always available, and it should allow for objects to work past 2044, the date is also the very first date you can build the object.

End of life date (0F)

Last year an object can be build, in days since the year 0. Same requirements as above. Also note that it must be a minimum of a year (365 days) after the introduction date or TTDPatch will ignore it.

Object flags (10)

The following flags control object behaviour and are cached for built objects, so changing these flags will have no effect on already constructed objects.

||Bit|Value|Version|Meaning

0|1|a|Only Available in the scenario editor (1)

1|2|a|Irremovable (2)

2|4|a|Anything Can Remove (owned land behaviour)

3|8|a|Allow construction of the object on water

4|16|a|Removal cost is actually income (owned land behaviour)

5|32|a|Do not display foundations if on a slope

6|64|a|Object has animation (3)

7|128|a|Only available during game play (1)

8|256|b|Allows 2cc mapping for objects instead of the default 1cc

9|512|c|Disallows construction on land (also has bit 3 behaviour)

10|1024|c|Draws the water under the object (4)||

c - TTDPatch r2331

(1) - Note that bits 0 and 7 are incompatible and setting both will make an object completely unavailable.

(2) - Object cannot be removed through normal dynamite, control must be held and the removal cost will be multiplied by 25 (this is the usual behaviour for most class A objects in TTDPatch).

(3) - Setting this flag will allow the object's animation counter to be increased, must be set if you plan to make use of animations.

(4) - Only applies when built on top of a water tile, also replaces the ground tile of the object completely. (Does not work when object built on sloped water tiles).