Page 1 of 1
NFO Action 0 Error
Posted: 11 Jan 2008 12:19
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
Re: NFO Action 0 Error
Posted: 11 Jan 2008 12:33
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).
Re: NFO Action 0 Error
Posted: 11 Jan 2008 14:33
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
Re: NFO Action 0 Error
Posted: 11 Jan 2008 14:43
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.
Re: NFO Action 0 Error
Posted: 11 Jan 2008 15:21
by jvassie
So to correct this i need to add another 00? Would it then be 00 B0 or 0B 00?
Re: NFO Action 0 Error
Posted: 11 Jan 2008 15:31
by michael blunck
jvassie wrote:Would it then be 00 B0 or 0B 00?
LSB first.
regards
Michael
Re: NFO Action 0 Error
Posted: 11 Jan 2008 15:32
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?
Re: NFO Action 0 Error
Posted: 11 Jan 2008 16:00
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
Re: NFO Action 0 Error
Posted: 11 Jan 2008 16:04
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.

Re: NFO Action 0 Error
Posted: 11 Jan 2008 16:28
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)
Re: NFO Action 0 Error
Posted: 11 Jan 2008 16:35
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.
Re: NFO Action 0 Error
Posted: 11 Jan 2008 16:38
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.