Difference between revisions of "Sample NFO file"

From TTWiki
Jump to navigationJump to search
(Reformat and update)
m (moved SampleNfoFile to Sample NFO file: Add spaces)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
  +
{{NFOTutorial}}
  +
 
Here's a simple, complete .nfo file.
 
Here's a simple, complete .nfo file.
   

Latest revision as of 12:00, 1 March 2012

Here's a simple, complete .nfo file.

It defines one train engine, no stats modified, 8 different directions (i.e. not symmetric like the SH 40), no differences based on cargo type or other factors.

You must include the first three comment lines or the file won't work.

// Automatically generated by GRFCODEC. Do not modify!
// (Info version 4)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
  0 * 4 0D 00 00 00
  1 * 8 08 04 XX XX XX XX 00 00
  2 * 7 00 00 01 01 XX 12 FD
  3 * 4 01 00 01 08
  4 sprites/train.pcx 98 8 01 18 8 -3 -10
  5 sprites/train.pcx 114 8 09 14 20 -14 -6
  6 sprites/train.pcx 146 8 01 12 28 -14 -6
  7 sprites/train.pcx 194 8 09 16 20 -4 -8
  8 sprites/train.pcx 226 8 01 18 8 -3 -10
  9 sprites/train.pcx 242 8 09 16 20 -14 -7
 10 sprites/train.pcx 274 8 01 12 28 -14 -6
 11 sprites/train.pcx 322 8 09 14 20 -4 -6
 12 * 9 02 00 00 01 01 00 00 00 00
 13 * 7 03 00 01 XX 00 00 00

Instead of the XX XX XX XX in sprite #1, use your own graphics ID. See action 8 on how to decide what it should be.

For the XX in sprite #2 and #13 substitute the train engine number you want to change, e.g. use 00 to replace the Kirby Paul Tank.

You will probably have to modify the PCX file name, the X and Y coordinates of the sprites (first two numbers after the PCX file name), as well as the X and Y offsets (last two numbers). Possibly the X and Y sizes too.

A very brief summary of the pseudo sprites:

  1. 0: define how many sprites are in the file (13 decimal=0D)
  2. 1: action 8; set the GRFID of this .grf file, and define the version
  3. 2: action 0; set the train engine properties (in this case the sprite)
  4. 3: action 1; declare the next 8 sprites as actual vehicle sprites
  5. 4 through #11 are therefore vehicle sprites
  6. 12: action 2; declare cargo ID 0
  7. 13: action 3; attach cargo ID 0 to the engine

If you want to modify the train properties (currently only the sprite prop. 12 is set to FD), change the second 01 in sprite #2 to the number of properties, add them at the end of the line, and adjust the number of bytes.

If you want to make it look different depending on cargo, add them after sprite #11, and modify sprite #3 appropriately. Then define more cargo IDs using action 2 and tell action 3 when to use which ID. Don't forget to adjust the total number of sprites specified in sprite #1.