|
TTDPatch Site |
Action2HousesIndustryTiles
Action 2 for houses and industry tilesDefining an action 2 for houses, industry tiles and objectsFor houses, industry, and object tiles, the action 2 data looks as follows: (basic format) <Sprite-number> * <Length> 02 07/09/0F <set-id> 00 <groundsprite> <buildingsprite> <xoffset> <yoffset> <xextent> <yextent> <zextent>
In the above, xofs, yofs, xextent, yextent and zextent define the 3D bounding box of the building sprite not including the ground sprite. The z-offset is always zero for buildings (TTD doesn't support floating buildings). Please note that xofs/xextent and yofs/yextent pairs that place the bounding box off the tile are not recommended. Since 2.0.1 alpha 55 vcs 3, houses, industry (and object) tiles support an extended syntax as well, which looks as follows: <Sprite-number> * <Length> 02 07/09/0F <set-id> <num-sprites> <groundsprite> [<buildingsprite> (<xoffset> <yoffset> <zoffset> <xextent> <yextent> <zextent>) | (<xpixeloffset> <ypixeloffset> 80)]...
Note: restrictions for sprites sharing their bounding box are the same as explained for station tiles. Since OpenTTD r18959 you can draw multiple ground sprites for a tile, which is useful if you want to use the usual grass/water/concrete groundtile, but still need to add features to it without using a new bounding box. To do so use the syntax of sprites sharing the previous bounding box, but use it before the first bounding box definition. xpixeloffset and ypixeloffset refer to the usual spot of groundtiles. The same feature is also partially supported in TTDPatch since 2.6 r2313: TTDPatch ignores the xpixeloffset and ypixeloffset fields and always uses (0,0) for the offset. If you are developing a GRF that needs to be compatible with both OpenTTD and TTDPatch, you should always keep xpixeloffset and ypixeloffset zero to get the same effect in both games. Sprite definitionThe ground and building sprite fields have the following format:
Since 2.0.1 alpha 57, the groundsprite value can be zero if no ground sprite is needed (this is useful if you need to draw custom foundations). Ground sprites are always drawn normally, so bit 30 is ignored for them. Bit 30 may get a different meaning for ground sprites in a later version of TTDPatch, so please leave it zero for now. This does not apply to additional groundsprites using the "<xpixeloffset> <ypixeloffset> 80"-syntax (see above); for these bit 30 has the same meaning as for building sprites. Colour translation special sprite numberThis is used only if bits 14 or 15 are nonzero. Bits 16-29 must be the number of a regular TTD sprite containing a colour translation table (see below for available translation tables). For transparent mode, a suitable translation table is needed, e.g. that of TTD“s sprite number 802 (s.b.). See RecolorSprites for more information on the usage of transparent and recolouring sprites. For houses, if no recolour sprite is given but recolouring is turned on in bits 14-15, there are two possibilities:
For industry tiles, if this field is zero, but recolouring is turned on in bits 14 or 15, the colour of the containing industry will automatically be applied. For the colour translation, you can use the following sprite numbers:
In the above table, "player colour" means the "magic blue" color used, for example, on the vehicles, while "brownish red" means the "magic" color used on some town buildings (on the tall office block, for example). Mapping 775 is an identity function (maps each color to itself), so you can use it in cases where a remapping is needed, but you don't want to recolor anything. The ground sprite should be exactly the same size and shape as TTD's flat tile. In general, it shouldn't contain anything that has a z-dimension because any non-ground sprite will cover it. Useful values for ground sprites:
Please note that all the ground sprite becomes visible in "transparent buildings" mode, so you should draw parts that seem to be hidden as well. Sprite typeIf bit 31 is clear, the bottom 14 bits contain a regular TTD sprite number. If bit 31 is set, the bottom 14 bits contain a number of a sprite set in the most recent action 1, and the used sprite is decided according to the current construction state and the number of sprites in the set:
Object buy menu spriteCurrently only the ground sprite is used for menu. In internal builds however, all sprites defined in an extended format style sprite are used. (Lakie) Created by: system last modification: Monday 26 of July, 2010 [22:03:54 UTC] by mb |
Login Search
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||