Difference between revisions of "NML:Canals"

From GRFSpecs
Jump to navigationJump to search
(Add: dike_map variable and its values as of NML 2074)
(→‎Canal properties: FEAT_CANAL should be FEAT_CANALS)
Line 60: Line 60:
 
==Canal properties==
 
==Canal properties==
   
item (FEAT_CANAL, item_name, id) { ... }
+
item (FEAT_CANALS, item_name, id) { ... }
   
 
{| class="t"
 
{| class="t"
Line 71: Line 71:
 
| There is currently only one possible bit: <code style="color:darkgreen">WATERFEATURE_ALTERNATIVE_SPRITES</code>
 
| There is currently only one possible bit: <code style="color:darkgreen">WATERFEATURE_ALTERNATIVE_SPRITES</code>
 
|}
 
|}
 
   
 
== Canal variables ==
 
== Canal variables ==

Revision as of 20:41, 11 January 2018

Props, Vars and CBs

Canal ids

The used item ID defines what sprites this item provides. Item IDs should be picked from the following table (WF_XXX).

The 'normal sprites' column contains the amount of sprites that should be provided for this feature. If the appropriate bit in the graphics_flags-property (see below) the amount of sprites stated in the 'alternative sprites' column must be provided instead.

name use normal sprites alternative sprites
WF_WATERCLIFFS Supported by OpenTTD 1.1 (r20352)1.1 Supported by TTDPatch 2.6 (r1573)2.6 water for canals / locks 4 slope sprites 1 flat ground sprite followed by 4 slope sprites
WF_LOCKS Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5 Locks 24 undefined
WF_DIKES Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.52.5 Dikes 12 undefined
WF_CANAL_GUI Not supported by OpenTTD Supported by TTDPatch 2.52.5 Canal GUI 1 undefined
WF_FLAT_DOCKS Not supported by OpenTTD Supported by TTDPatch 2.52.5 Flat docks 4 undefined
WF_RIVER_SLOPE Supported by OpenTTD 1.1 (r20352)1.1 Supported by TTDPatch 2.6 (r1573)2.6 River water 4 1 flat ground sprite followed by 4 slope sprites
WF_RIVERBANKS Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.62.6 Riverbanks 12*5 (Last 4 for slopes) undefined
WF_RIVER_GUI Not supported by OpenTTD Supported by TTDPatch 2.62.6 River GUI 2 undefined
WF_BUOY Supported by OpenTTD 1.2 (r22973)1.2 Not supported by TTDPatch Buoy 1 undefined


Canal properties

 item (FEAT_CANALS, item_name, id) { ... }
name value range comment
graphic_flags bitmask(flags) There is currently only one possible bit: WATERFEATURE_ALTERNATIVE_SPRITES

Canal variables

name value range comment
tile_height 0 .. max_tile_height NML 0.2 Tile height in pixels (=tiles * 8).

NML 0.3 Tile height in tiles.

terrain_type TILETYPE_XXX
TILETYPE_NORMAL
Normal grass in all climates
TILETYPE_DESERT
TILETYPE_RAIN_FOREST
In tropical climate only: some tiles in the mountains, distant from desert and sea
TILETYPE_SNOW
dike_map bitmask(CANAL_DIRECTION_XXX, ...) Supported by OpenTTD 1.4 (r25229)1.4 Not supported by TTDPatch bitmask of the directions where there is a dike: CANAL_DIRECTION_XXX where XXX:
along the grid
NORTHEAST = 0
SOUTHEAST = 1
SOUTHWEST = 2
NORTHWEST = 3
vertical and horizontal
EAST = 4
SOUTH = 5
WEST = 6
NORTH = 7
random_bits 0 .. 255 random bits of that tile

Canal callbacks

callback return value comment
default spriteset graphics for the canal id
sprite_offset numeric offset into the spriteset for the canal id