My inability to make newGRFs

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
Mr Pattle
Engineer
Engineer
Posts: 49
Joined: 16 Feb 2007 20:21
Location: deepest darkest Suffolk

My inability to make newGRFs

Post by Mr Pattle »

I've been away from these forums for quite a while now (just silently observing), but in the last week or so, I decieded to try and learn how to make newGRFs. However, I seem to have hit a bit of a snag. Using Purno's tutorial, I drew a new passenger carriage, and, eager to get it working, download GRFCodec, and followed the tutorial here, but swapping the example of an SH 125 for the passenger carriage. I changed everything that seemed appropiete (number of sprites, engine ID, etc.) in the example code, but still find it doesn't work. I must have done something wrong, and I am hoping one of you learned gentlemen out there could give me some advice.

The code I have in my GRF is this:

Code: Select all

// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    0 * 4 09 00 00 00
    1 * 8 08 06 "MP" 14 99 00 00
    2 * 4 01 00 01 04
    3 data\sprites/trg1r18.PCX 194 280 01 22 8 -3 -10
    4 data\sprites/trg1r18.PCX 210 280 09 17 22 -14 -7
    5 data\sprites/trg1r18.PCX 242 280 01 12 32 -14 -6
    6 data\sprites/trg1r18.PCX 290 280 09 17 22 -4 -8
    7 * 9 02 00 00 01 01 00 00 00 00
    8 * 7 03 00 01 1B 00 00 00
    9 * 7 00 00 01 01 16 12 FD
When I try to run the GRF in openTTD, the pessenger carriage remains the same, while both halfs of the SH 125 face the same direction (probably because I reduced the sprite no. from 8 to 4)
Please could someone tell me where I have gone wrong.
Formerly Known as 'Geoff Holemanson'.

"All opinions are not equal. Some are a very great deal more robust, sophisticated and well supported in logic and argument than others." Douglas Adams


Please don't e-mail me unless it's important.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: My inability to make newGRFs

Post by Zephyris »

Action 3 defines a new graphics set for a vehicle
Action 0 changes vehicle properties, including allowing the use of new graphics
Both refer to the appropriate VehID - and both have to match which is your mistake :).

Your Action 3 (line 8 ) refers to feature 00 vehid 1B - rail passenger carriage, whilst your Action 0 (line 9) refers to feature 00 VehID 16 - SH '125'. Ie. you are defining new graphics for the passenger carriage, but not letting it use them, and you are allowing the SH '125' to use new graphics, but not providing any to use.

It should be either:

Code: Select all

    8 * 7 03 00 01 16 00 00 00
    9 * 7 00 00 01 01 16 12 FD
to change the SH '125' gfx

or:

Code: Select all

    8 * 7 03 00 01 1B 00 00 00
    9 * 7 00 00 01 01 1B 12 FD
to change the passenger carriage gfx

edit: clarified explanation
User avatar
Mr Pattle
Engineer
Engineer
Posts: 49
Joined: 16 Feb 2007 20:21
Location: deepest darkest Suffolk

Re: My inability to make newGRFs

Post by Mr Pattle »

thank you very much for your help, zephyris. I'm correcting my mistake now, and once I've finished this (very) simple grf, hope to move onto something perhaps worthy of posting on this forum.
Formerly Known as 'Geoff Holemanson'.

"All opinions are not equal. Some are a very great deal more robust, sophisticated and well supported in logic and argument than others." Douglas Adams


Please don't e-mail me unless it's important.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: My inability to make newGRFs

Post by FooBar »

Is is just me, or is there a typo in your signature?
And niether is Holemanson
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: My inability to make newGRFs

Post by DaleStan »

While we're at it, that's not how you spell "thourghly" either.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 23 guests