Difference between revisions of "NML:Replace new sprites"

From GRFSpecs
Jump to navigationJump to search
m (OTTD_GUI now supports up to 162 sprites)
m (Use proper references)
Line 62: Line 62:
 
|-
 
|-
 
| NEW_SIGNALS
 
| NEW_SIGNALS
 
| any <ref>Any number of sprites is allowed here, however both OpenTTD and NML don't (yet) support the other features required to use these sprites.</ref>
| any (a)
 
 
|-
 
|-
 
| SLOPED_RAILS
 
| SLOPED_RAILS
Line 80: Line 80:
 
|-
 
|-
 
| FLAGS
 
| FLAGS
 
| 36 <ref name="offset">Any number of sprites can be specified up to the stated maximum. Furthermore the <code style="color:darkgreen">offset</code> variable can be used, see below for more info.</ref>
| 36 (b)
 
 
|-
 
|-
 
| OTTD_GUI
 
| OTTD_GUI
| 162 (b)
+
| 162 <ref name="offset" />
 
|-
 
|-
 
| AIRPORT_PREVIEW
 
| AIRPORT_PREVIEW
  +
| 9 <ref name="offset" />
| 9 (b)
 
 
|}
 
|}
   
  +
<references />
(a) Any number of sprites is allowed here, however both OpenTTD and NML don't (yet) support the other features required to use these sprites.
 
 
(b) Any number of sprites can be specified up to the stated maximum. Furthermore the <code style="color:darkgreen">offset</code> variable can be used, see below for more info.
 
   
 
The amount of sprites has to be equal to the number given in the table, except in the cases of (a) and (b). Having less sprites results in an error. Having more sprites is allowed to provide future compatibility, but a warning will be issued.
 
The amount of sprites has to be equal to the number given in the table, except in the cases of (a) and (b). Having less sprites results in an error. Having more sprites is allowed to provide future compatibility, but a warning will be issued.

Revision as of 09:12, 5 October 2011

Block Syntax

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
TTDP_GUI 93
CANALS 65
ONE_WAY_ROAD 6
COLOURMAP_2CC 256
TRAMWAY 113
SNOWY_TEMPERATE_TREES 133
COAST_TILES 16
COAST_TILES_BASEGFX 10
COAST_TILES_DIAGONAL 18
NEW_SIGNALS any [1]
SLOPED_RAILS 12
AIRPORTS 15
ROAD_STOPS 8
AQUEDUCTS 8
AUTORAIL 55
FLAGS 36 [2]
OTTD_GUI 162 [2]
AIRPORT_PREVIEW 9 [2]
  1. Any number of sprites is allowed here, however both OpenTTD and NML don't (yet) support the other features required to use these sprites.
  2. 2.0 2.1 2.2 Any number of sprites can be specified up to the stated maximum. Furthermore the offset variable can be used, see below for more info.

The amount of sprites has to be equal to the number given in the table, except in the cases of (a) and (b). Having less sprites results in an error. Having more sprites is allowed to provide future compatibility, but a warning will be issued.

Parameter two <image-file> is a literal (quoted) string that specifies the file where the sprites are located.

Parameter <offset> is optional and has a default value of 0. Values greater than zero are only allowed in the case of the sprite types marked with (b). Setting this value sets an offset into the block of sprites, so only a subset of the sprites (starting at offset) will be replaced.