Page 10 of 11
trying to decode .grf
Posted: 17 Aug 2003 04:21
by ttd player
Is there a reason why GRF Wizard won't decode the db set or any of the other custom .grf files available out there? Are they protected from decoding?
The reason I want to decode them is to have a working example of how to code my own sprites & pseudo sprites (maybe someone could give me a working set?).
Also, was wondering why the .nfo files for the default ttd .grf files don't show any vehicle pseudo-sprites?
Finally, I tried to encode my own .nfo file and .pcx file but there was no way to enter them into the GRF Wizard. What's up with that? Do I have to put my own vehicles & code into the trg1r.nfo and trg1r.pcx?
I'm mystified

problem understanding cargosetw
Posted: 18 Aug 2003 05:42
by nilsi
@ttd player: i never use graph wizard, so i can not help you with that :-(
in game grf files do not have pseudo sprites, the properties of the vehicles are hardcoded in the exe file
with grfcodec decoding of any grf is no problem, sometimes you only have to give an additional -p parameter
edit: you can of course build your own vehicles in own grf files, but i am still learning how :-/
@ others
now my question: in cargosetw there are
action zero entries with no data at all... they are not documented in sprites.txt as far as i know. What do they do? The code snippet should define a 4 sprite set and i would understand dummy 1x1 pixel regular sprites.
are they just NOPs to save space ?
8 * 4 01 00 01 04
9 * 1 00
10 D:\ttgrfnm\SPRITES\cargosetw.pcx 178 8 01 1 52 -14 -7
11 * 1 00
12 * 1 00
Thank you for answering,
Nils
Re: problem understanding cargosetw
Posted: 18 Aug 2003 06:15
by George
nilsi wrote:@ttd player: i never use graph wizard, so i can not help you with that

in game grf files do not have pseudo sprites, the properties of the vehicles are hardcoded in the exe file
with grfcodec decoding of any grf is no problem, sometimes you only have to give an additional -p parameter
edit: you can of course build your own vehicles in own grf files, but i am still learning how :-/
@ others
now my question: in cargosetw there are
action zero entries with no data at all... they are not documented in sprites.txt as far as i know. What do they do? The code snippet should define a 4 sprite set and i would understand dummy 1x1 pixel regular sprites.
are they just NOPs to save space ?
8 * 4 01 00 01 04
9 * 1 00
10 D:\ttgrfnm\SPRITES\cargosetw.pcx 178 8 01 1 52 -14 -7
11 * 1 00
12 * 1 00
Thank you for answering,
Nils
They are empty sprites which would be never shown. Empty sprites, that are shown, has to be 1x1 transperent sprites
Posted: 18 Aug 2003 07:39
by Dinges
yep, easy to use things, they are especialy handy when experimenting arround with a file and you need to (temporary) disable a psuedo-sprite...
Posted: 18 Aug 2003 08:17
by nilsi
I see... good to know :-)
so sprites.txt is not completely correct here
"The following num-sprites times num-dirs sprites will be actual sprites,
not pseudo-sprites."
Thank you all for being patient with me ;-)
Posted: 18 Aug 2003 08:26
by Dinges
well, this isn't a normal sprite:
Posted: 18 Aug 2003 13:54
by nilsi
@ dinges: i understand,
but according to sprites.txt there must be a normal one
Posted: 31 Aug 2003 18:43
by Patchman
It doesn't have to be. It's just that the patch assumes it to be a regular sprite.
However, this sprite is never used, so it doesn't matter what it is. A pseudo-sprite is the smallest amount of bytes, so using a pseudo-sprite for this means that you save some bytes.
This set of four sprites is used to display a vehicle in the purchase list, where only one orientation will ever be needed. The first and the last two will never be shown, so it doesn't matter what they contain.
[Note: I renamed this thread, because the old thread is still in the old forum and so far down the list that no-one could be confused now.]
Posted: 11 Jun 2004 10:17
by New Graphics
Hi,
This my first train graphic, it's not finish yet,
and I don't think it will.
Anyway......
Take a look.
Posted: 11 Jun 2004 10:19
by Purno
New Graphics wrote:Hi,
This my first train graphic, it's not finish yet,
and I don't think it will.
Anyway......
Take a look.
Doesn't look bad. But what is it?
Posted: 11 Jun 2004 12:15
by New Graphics
Well,
It's an ugly train, fantacy train.
I was realy just training, but it was mutch better then i thougth.
help wantet
Posted: 16 Sep 2004 19:51
by bjarnek
after i make line 2*x ind my dsbtestw.nfo my game break down...
i have olmost giving up...// Automatically generated by GRFCODEC. Do not modify!
// (Info version 4)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
0 * 4 15 00 00 00
1 * 8 08 04 50 50 50 50 00 00
2 * 21 00 00 00 07 01 37 00 56 40 03 14 04 32 00 08 AF 09 32 11 51 00
3 * 9 00 00 01 01 1B 12 FD FF 68
4 * 9 00 00 01 01 1C 12 FD FF 68
5 * 4 01 00 01 08
6 d:\mps\transport tycoon\sprites\dsbtestw.pcx 114 8 01 23 8 -3 -9
7 d:\mps\transport tycoon\sprites\dsbtestw.pcx 130 8 09 22 22 -14 -12
8 d:\mps\transport tycoon\sprites\dsbtestw.pcx 162 8 01 15 32 -14 -11
9 d:\mps\transport tycoon\sprites\dsbtestw.pcx 210 8 09 22 22 -5 -11
10 d:\mps\transport tycoon\sprites\dsbtestw.pcx 242 8 01 25 8 -3 -9
11 d:\mps\transport tycoon\sprites\dsbtestw.pcx 258 8 09 22 22 -14 -12
12 d:\mps\transport tycoon\sprites\dsbtestw.pcx 290 8 01 15 32 -14 -11
13 d:\mps\transport tycoon\sprites\dsbtestw.pcx 338 8 09 22 22 -5 -11
14 * 9 02 00 00 01 01 00 00 00 00
15 * 4 01 00 02 04
16 * 9 02 00 01 01 01 00 00 00 00
17 * 9 02 00 02 01 01 01 00 01 00
18 * 7 03 00 01 00 00 00 00
19 * 7 03 00 81 1B 00 01 00
20 * 7 03 00 81 1C 00 02 00
Posted: 16 Sep 2004 21:13
by Patchman
Why do you have another action 1 in line 15? It doesn't have any real sprites following it, so it must be a mistake. You probably forgot to add the eight lines of sprites there that you'll be using for the passenger and mail wagons.
help wantet
Posted: 16 Sep 2004 21:26
by bjarnek
No i have not orgot the sprite entry.. I have forget to delete some lines after modifikstions.
question
Posted: 21 Sep 2004 08:25
by bjarnek
how did i make a train to only go on el-traks.
Actions # ?
Posted: 27 Oct 2004 11:04
by ttdx_artist
i'm having problems with my NFO editor, it keeps saying that my version of MSFlexGrid is outdated, I know that Andres said that it isn't completely compatible with WIN98SE, but he didn't say that it definatly wouldn't work, does anyone else here use WIN98SE and the NFO Editor? If you do, can you please tell me how to fix this problem....ARRGHHHHHHH!!!!

Posted: 21 Jan 2005 09:19
by Birdey
I am new to this so hopefully u wont delete my post but...
I have followed the "How to get started on NFO editing " on the
http://wiki.ttdpatch.net/tiki-index.php ... oundations site and i get up to "4. Encode and decode again your own file" it always came up with:
"C:\TransportTycoon>grfcodc -e mytrain.grf -p2
GRFCodc version 0.9.5 - Copyright <C> 1999-2003 by josef Drexler
Creating C:\TransportTycoon SPRITES: File exists"
Plz help
Birdey
Posted: 21 Jan 2005 14:20
by Patchman
That's not a problem as such, you just have to follow the next step in the instruction:
Code: Select all
ren mytrain.new mytrain.grf (this is necessary only the first time)
Posted: 21 Jan 2005 21:00
by Birdey
ok that works and it creates a "mytrain.grf" in my ttd directory but when i type in "grfcodec -d mytrain.grf -p 2" it comes up in window that says:
"grfcodec.exe has encountered a problem and needs to close. We are sorry for the inconvenience."
and if i do it with grf wizzard it comes up with:
"grfwizzard.exe has encountered a problem and needs to close. We are sorry for the inconvenience."
thankz for the help
Posted: 21 Jan 2005 21:26
by Patchman
For some reason it seems to make a corrupt .grf file, though I have no idea why...