Difference between revisions of "NML:Replace new sprites"
(Add action5 type RAILTYPE_TUNNELS) |
(Mark image-file as optional) |
||
Line 3: | Line 3: | ||
Over time, several features have been added to TTDPatch and OpenTTD that require new sprites. As these sprites are not present in the original base graphics, they cannot be replaced using a normal <code style="color:darkgreen">replace</code> block. Instead, a <code style="color:darkgreen">replacenew</code> block has to be used. The semantics are like this: |
Over time, several features have been added to TTDPatch and OpenTTD that require new sprites. As these sprites are not present in the original base graphics, they cannot be replaced using a normal <code style="color:darkgreen">replace</code> block. Instead, a <code style="color:darkgreen">replacenew</code> block has to be used. The semantics are like this: |
||
− | replacenew(<type>, <image-file>[, <offset>]) { |
+ | replacenew(<type>, [<image-file>[, <offset>]]) { |
[[NML:Realsprites|list of realsprites]] |
[[NML:Realsprites|list of realsprites]] |
||
} |
} |
||
Line 92: | Line 92: | ||
|} |
|} |
||
− | Parameter two <code style="color:darkgreen"><image-file></code> is a literal (quoted) string that specifies the file where the sprites are located. |
+ | Parameter two <code style="color:darkgreen"><image-file></code> (optional) is a literal (quoted) string that specifies the default file where the sprites are located. This may be overridden per-sprite. |
Parameter <code style="color:darkgreen"><offset></code> is optional and has a default value of 0. Setting this value sets an offset into the block of sprites, so only a subset of the sprites (starting at <code style="color:darkgreen">offset</code>) will be replaced. An offset is not allowed in the case of the sprite types marked with <ref name="no_offset" />. Don't use offsets, if you want you NewGRF compatible with TTDPatch. |
Parameter <code style="color:darkgreen"><offset></code> is optional and has a default value of 0. Setting this value sets an offset into the block of sprites, so only a subset of the sprites (starting at <code style="color:darkgreen">offset</code>) will be replaced. An offset is not allowed in the case of the sprite types marked with <ref name="no_offset" />. Don't use offsets, if you want you NewGRF compatible with TTDPatch. |
Revision as of 21:19, 3 March 2012
Vehicles, Stations, Canals, Bridges, Towns, Houses, Industries (Tiles), Cargos, Airports+Tiles, Objects, Railtypes, Roadtypes, Tramtypes, Terrain
Over time, several features have been added to TTDPatch and OpenTTD that require new sprites. As these sprites are not present in the original base graphics, they cannot be replaced using a normal replace
block. Instead, a replacenew
block has to be used. The semantics are like this:
replacenew(<type>, [<image-file>[, <offset>]]) { list of realsprites }
The <type>
parameter indicates the type of sprites that will be replaced. It should be an identifier from the first column of the following table.
Type | Number of sprites |
---|---|
PRE_SIGNAL | 48 |
PRE_SIGNAL_SEMAPHORE | 112 |
PRE_SIGNAL_SEMAPHORE_PBS | 240 |
CATENARY | 48 |
FOUNDATIONS_SLOPES | 74 |
FOUNDATIONS_SLOPES_HALFTILES | 90 |
TTDP_GUI_25 | 73[1] |
TTDP_GUI | 93[1] |
CANALS | 65 |
ONE_WAY_ROAD | 6 |
COLOURMAP_2CC | 256 |
TRAMWAY | 113 |
SNOWY_TEMPERATE_TREES | 133[1] |
COAST_TILES | 16[1] |
COAST_TILES_BASEGFX | 10[1] |
COAST_TILES_DIAGONAL | 18[1] |
NEW_SIGNALS | any [2] |
SLOPED_RAILS | 12 |
AIRPORTS | 15 |
ROAD_STOPS | 8 |
AQUEDUCTS | 8 |
AUTORAIL | 55 |
FLAGS | 36 |
OTTD_GUI | 162 |
AIRPORT_PREVIEW | 9 |
RAILTYPE_TUNNELS | 16 |
Parameter two <image-file>
(optional) is a literal (quoted) string that specifies the default file where the sprites are located. This may be overridden per-sprite.
Parameter <offset>
is optional and has a default value of 0. Setting this value sets an offset into the block of sprites, so only a subset of the sprites (starting at offset
) will be replaced. An offset is not allowed in the case of the sprite types marked with [1]. Don't use offsets, if you want you NewGRF compatible with TTDPatch.