NFO Action 0 Error

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
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

NFO Action 0 Error

Post by jvassie »

Hi there, i thought id bite the bullet and start trying to learn how to code in NFO, so ive followed the tutorial, that grf worked fine, just trying to expand out a bit now.

Was changing the properties of the engine, ran it through NFORenum and got given this error (shown with the NFO segment in question)

Code: Select all

//!!Fatal Error (47): Offset 19: Invalid property 9C.
    3 * 29	 00 00 11 01 16 00 2ACD 03 35 04 60 06 01 05 00 09 B0 0B 9C4 12 FD 16 90 19 28 1F C8
Prop. 0B is to set the Power i believe, which in HP i would like to be 2500, in Hex i found this converted to 9C4, however this doesn't seem to be the correct format?

Any help with this would be greatly appreciated.

Thanks
James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Re: NFO Action 0 Error

Post by Maedhros »

Have a look at the section labelled "Byte order", here: http://wiki.ttdpatch.net/tiki-index.php ... nsDetailed. Power is a word-sized property, so first you need to split it up into two bytes, giving you 09 C4, then swap the bytes around to give the value in little-endian byte-order, giving you C4 09. You'll also need to do the same for the introduction date (property 00).
No-one's more important than the earthworm.
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Re: NFO Action 0 Error

Post by jvassie »

Ok, thanks for that, i changed it to the following, however i got a similar error from NFORenum :?

Code: Select all

//!!Fatal Error (47): Offset 19: Invalid property C4.
    3 * 29	 00 00 11 01 16 00 CD 2A 03 35 04 60 06 01 05 00 09 B0 0B C4 09 12 FD 16 90 19 28 1F C8
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Re: NFO Action 0 Error

Post by Maedhros »

Ah. Property 09 (max speed) is also a word, but you've only provided a byte. NFORenum thinks that 0B is the high byte of the speed, and not the next property you want to change.
No-one's more important than the earthworm.
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Re: NFO Action 0 Error

Post by jvassie »

So to correct this i need to add another 00? Would it then be 00 B0 or 0B 00?
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: NFO Action 0 Error

Post by michael blunck »

jvassie wrote:Would it then be 00 B0 or 0B 00?
LSB first.

regards
Michael
Image
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Re: NFO Action 0 Error

Post by jvassie »

michael blunck wrote:
jvassie wrote:Would it then be 00 B0 or 0B 00?
LSB first.

regards
Michael
Edit: least significant byte first?

So that would be 00 B0 i guess hehe

Edit Again: It seems NFO Renum is still not happy, i think ive specified 11 properties, yet it asks for 6 more.

//!!Error (63): Expected 6 more properties.
3 * 30 00 00 11 01 16 00 CD 2A 03 35 04 60 06 01 05 00 09 00 B0 0B C4 09 12 FD 16 90 19 28 1F C8

Specified 11 properties to change, and theres 11 there (alternate bold/non-bold highlighting)

and in code form:

Code: Select all

//!!Error (63): Expected 6 more properties.
    3 * 30	 00 00 11 01 16 00 CD 2A 03 35 04 60 06 01 05 00 09 00 B0 0B C4 09 12 FD 16 90 19 28 1F C8
Am i missing any more 00's to end a property?
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: NFO Action 0 Error

Post by michael blunck »

i think ive specified 11 properties
11d !=11h

And, BTW, try to be clear, e.g. like this:

Code: Select all

  -1 * 64       00 00 19 01 63
                        00 47 04        // 1923
                        02 08
                        03 2D
                        04 2D
                        05 00
                        06 03
                        07 00
                        08 00
                        09 3C 00        // 60 km/h
                        0B 4C 04        // 1100 hp
                        0D C8
                        0E 30 4C 00 00
                        12 FD
                        13 00
                        14 00
                        15 00
                        16 72           // 114t
                        17 07
                        18 00
                        19 00
                        1A 02
                        1E D0   // CBs: sound + recolour
                        1F 29   // 180kN
                        21 00   // normal
                        2A 0F A5 0A 00  // 1910

instead of your cryptic long lines of code. Document your code!

regards
Michael
Image
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Re: NFO Action 0 Error

Post by Maedhros »

jvassie wrote:
michael blunck wrote:LSB first.
Edit: least significant byte first?

So that would be 00 B0 i guess hehe
Nope, it should be B0 00, unless you want your train travelling at 45 056 km/h. ;-)
No-one's more important than the earthworm.
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: NFO Action 0 Error

Post by DJ Nekkid »

or just use /w behind it, and the whole thing is solved :)

0B /W2500 :) (might need nforenum for it, but that tool just makes all coding tons easier anyway)

can also use /B165 (for weight for example) so you dont have to convert the wanted values to hex...

(/Byte and /Word)
Member of the
ImageImage
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: NFO Action 0 Error

Post by DaleStan »

7of9 wrote:or just use /w behind it, and the whole thing is solved :)
But use a backslash, please. NFORenum and GRFCodec will both complain loudly if you use a forward slash.
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
User avatar
jvassie
Tycoon
Tycoon
Posts: 3421
Joined: 18 Dec 2002 18:00
Location: High Wycombe, England
Contact:

Re: NFO Action 0 Error

Post by jvassie »

7of9 wrote:or just use /w behind it, and the whole thing is solved :)

0B /W2500 :) (might need nforenum for it, but that tool just makes all coding tons easier anyway)

can also use /B165 (for weight for example) so you dont have to convert the wanted values to hex...

(/Byte and /Word)
Oh wow, you can do that? Thats sweet!

Will heed the backslash's DaleStan :) Thanks for the heads-up.
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 17 guests