NML:Replace new sprites

From GRFSpecs
Jump to: navigation, search
Block Syntax

Over time, several features have been added to OpenTTD that require new sprites. As these sprites are not present in the original base graphics and only found in the extra grf of each base set. They cannot be replaced using a normal replace block. Instead, a replacenew block has to be used. The semantics are like this:

replacenew [<block-name>](<type>, [<image-file>[, <offset>]]) {
	list of realsprites
}

A <block_name> is optional but required, if you want to define alternative sprites for the sprite block so that it can be referenced there.

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.

For information on what sprites are needed and in what order, it's generally best to look at the OpenGFX source [1], in the sprites/extra directory.

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
CANALS 65
ONE_WAY_ROAD 6
COLOURMAP_2CC 256
TRAMWAY 113
COAST_TILES 16[1]
COAST_TILES_BASEGFX 10[1]
COAST_TILES_DIAGONAL 18[1]
SLOPED_RAILS 12
AIRPORTS 15
ROAD_STOPS 8
AQUEDUCTS 8
AUTORAIL 55
FLAGS 36
OTTD_GUI 175
AIRPORT_PREVIEW 9
RAILTYPE_TUNNELS 16
OTTD_RECOLOUR 1

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.

  1. 1.0 1.1 1.2 1.3 This type does not support the use of an offset. Thus the exact amount of sprites must be supplied.