Difference between revisions of "Sample NFO file"

From TTWiki
Jump to navigationJump to search
m (3 revisions)
(Reformat and update)
Line 1: Line 1:
 
'''''A simple NFO file'''''
 
 
=Sample NFO File=
 
 
 
Here's a simple, complete .nfo file.
 
Here's a simple, complete .nfo file.
   
Line 10: Line 5:
 
You must include the first three comment lines or the file won't work.
 
You must include the first three comment lines or the file won't work.
   
  +
<pre>
<pre>~pp~// Automatically generated by GRFCODEC. Do not modify!
+
// Automatically generated by GRFCODEC. Do not modify!
 
 
// (Info version 4)
 
// (Info version 4)
 
 
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
 
// 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
  +
</pre>
   
 
Instead of the XX XX XX XX in sprite #1, use your own graphics ID. See [[grfspecs:Action8|action 8]] on how to decide what it should be.
&nbsp;0 * 4 0D 00 00 00
 
 
&nbsp;1 * 8 08 04 XX XX XX XX 00 00
 
 
&nbsp;2 * 7 00 00 01 01 XX 12 FD
 
 
&nbsp;3 * 4 01 00 01 08
 
 
&nbsp;4 sprites/train.pcx 98 8 01 18 8 -3 -10
 
 
&nbsp;5 sprites/train.pcx 114 8 09 14 20 -14 -6
 
 
&nbsp;6 sprites/train.pcx 146 8 01 12 28 -14 -6
 
 
&nbsp;7 sprites/train.pcx 194 8 09 16 20 -4 -8
 
 
&nbsp;8 sprites/train.pcx 226 8 01 18 8 -3 -10
 
 
&nbsp;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~/pp~</pre>
 
 
Instead of the XX XX XX XX in sprite #1, use your own graphics ID. See [[Action8|action 8]] on how to decide what it should be.
 
   
For the XX in sprite #2 and #13 substitute the [[VehicleIDs|train engine number]] you want to change, e.g. use 00 to replace the Kirby Paul Tank.
+
For the XX in sprite #2 and #13 substitute the [[grfspecs:VehicleIDs|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.
 
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.
Line 52: Line 33:
 
A very brief summary of the pseudo sprites:
 
A very brief summary of the pseudo sprites:
 
#0: define how many sprites are in the file (13 decimal=0D)
 
#0: define how many sprites are in the file (13 decimal=0D)
#1: [[Action8|action 8]]; set the GRFID of this .grf file, and define the version
+
#1: [[grfspecs:Action8|action 8]]; set the GRFID of this .grf file, and define the version
#2: [[Action0|action 0]]; set the train engine properties (in this case the sprite)
+
#2: [[grfspecs:Action0|action 0]]; set the train engine properties (in this case the sprite)
#3: [[Action1|action 1]]; declare the next 8 sprites as actual vehicle sprites
+
#3: [[grfspecs:Action1|action 1]]; declare the next 8 sprites as actual vehicle sprites
 
#4 through #11 are therefore vehicle sprites
 
#4 through #11 are therefore vehicle sprites
#12: [[Action2Vehicles|action 2]]; declare cargo ID 0
+
#12: [[grfspecs:Action2Vehicles|action 2]]; declare cargo ID 0
#13: [[Action3|action 3]]; attach cargo ID 0 to the engine
+
#13: [[grfspecs:Action3|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 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.
 
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.
  +
[[Category:Tutorials]][[Category:GRF Tutorial]]

Revision as of 17:21, 30 July 2011

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.