png--> grf
Moderator: Graphics Moderators
- RSpeed tycoonfreak
- Transport Coordinator
- Posts: 349
- Joined: 02 Feb 2006 13:17
- Location: Azewijn The netherlands
- Contact:
png--> grf
Hello,
I just drawed my first building (new hq stage 4).
It's now in png and I want it in my game!
I read somewhere that I have to make a nfo file too but I also don't know how to do that.
Could anyone tell me what I have to do?
I just drawed my first building (new hq stage 4).
It's now in png and I want it in my game!
I read somewhere that I have to make a nfo file too but I also don't know how to do that.
Could anyone tell me what I have to do?
It's very complicated, I can tell you that. You can look at http://wiki.ttdpatch.net/tiki-index.php ... phicsSpecs for some info...
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.

Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
It depens how good is your english.... Basics is easy to understand, but when you are going on, then the English is going harder imo.(more specific wordsUhhh the basics at max take 1 day

TT-Screenshot Of The Month - 2012 July, winner!
TT-Screenshot Of The Month - 2013 May, winner tie with Purno!
TT-Screenshot Of The Month - 2014 February, winner!
TT-Screenshot Of The Month - 2014 June, winner tie with alluke!
TT-Screenshot Of The Month - 2014 April, winner!
My screen shot thread ---> Have a look
TT-Screenshot Of The Month - 2013 May, winner tie with Purno!
TT-Screenshot Of The Month - 2014 February, winner!
TT-Screenshot Of The Month - 2014 June, winner tie with alluke!
TT-Screenshot Of The Month - 2014 April, winner!
My screen shot thread ---> Have a look
- Born Acorn
- Tycoon
- Posts: 7596
- Joined: 10 Dec 2002 20:36
- Skype: bornacorn
- Location: Wrexham, Wales
- Contact:
- webfreakz.nl
- Director
- Posts: 627
- Joined: 11 Aug 2005 08:22
- Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
- Contact:
You can use grfdiff to create a win32 binary that will modify your ttd grf files.
You can use grfdiff to create a grd file that will tell grfmerge how to modify your ttd grf files.
Somehow, I don't think that those are improvements.
But it's the output from grd2grf is an action A grf. Those should not be able to cause desyncs.
You can use grfdiff to create a grd file that will tell grfmerge how to modify your ttd grf files.
Somehow, I don't think that those are improvements.
But it's the output from grd2grf is an action A grf. Those should not be able to cause desyncs.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- RSpeed tycoonfreak
- Transport Coordinator
- Posts: 349
- Joined: 02 Feb 2006 13:17
- Location: Azewijn The netherlands
- Contact:
This is what someone told me to do if I want to make my own graphics:
PNG -> PCX
PCX + NFO + Grfcodec -e -> GRF
Well I have a PCX file now and my question is: what to do?
I know I need an NFO File but how do I make one?
I took a look at the wiki page but thats about trains, but how about buildings?
I have these programs:
-Grf wizard 1.9.0.1
-Grdtogrf,
-Grfcodec,
-And Nfo Editor. 1.1.0.6
Are there any programs that I need to have?
PNG -> PCX
PCX + NFO + Grfcodec -e -> GRF
Well I have a PCX file now and my question is: what to do?
I know I need an NFO File but how do I make one?
I took a look at the wiki page but thats about trains, but how about buildings?
I have these programs:
-Grf wizard 1.9.0.1
-Grdtogrf,
-Grfcodec,
-And Nfo Editor. 1.1.0.6
Are there any programs that I need to have?
Visit The Fake Airport Website

Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
It's 5am, I have nothing better to do, so quick and dirty guide to replacing the HQ sprites using an action A.
1) decode trg1r.grf, if you haven't already. Open the pcx file and find the HQ sprites (2603 to 2631).
2) Paste your new HQ sprites into trg1r.pcx, over the existing ones. Hopefully they are the same size - if not, you will have to adjust the sizes and offsets later on. Save the pcx file.
3) Create a new text document. This will be your NFO file. Name it <whatever>.nfo, where <whatever> is what you'll want the grf file to be called.
4) Paste the following into the nfo file:
This is the header which all NFO files must have, and your sprite 0.
5) Add the action 8 psuedosprite. eg:
See the action 8 wiki page for exactly how the action 8 works.
6) Add the action A psuedosprite. This will look something like this:
where 1D is the number of sprites to replace (29 = 1D in hex), and 2B 0A is the sprite number to start replacing from (2603 = A2B in hex, which with the bytes in little-endian order becomes 2B 0A). If you don't want to replace all the HQ sprites, adjust these numbers so it's replacing the sprites you want to replace.
7) open trg1r.nfo, find the lines for the sprites you have replaced (the sprite numbers are the same as appear in the pcx), and copy and paste them into your nfo file after the action A sprite. If your sprites aren't exactly the same size as the defaults, you'll have to adjust the sizes and offsets at the end of the lines - the format is given in the NFO header. But don't worry about this until you've got the grf file working - you can always go back and adjust later.
Your nfo file should now look something like this:
8) Save the nfo file and run it through nforenum. This should fix up the sprite numbers and tell you if you've got any errors.
9) if you don't have any errors, encode with grfcodec, and you should have a working grf file.
Good luck, have fun...
You won't need anything on that list except grfcodec, and you will also need nforenum.RSpeed tycoonfreak wrote: -Grf wizard 1.9.0.1
-Grdtogrf,
-Grfcodec,
-And Nfo Editor. 1.1.0.6
1) decode trg1r.grf, if you haven't already. Open the pcx file and find the HQ sprites (2603 to 2631).
2) Paste your new HQ sprites into trg1r.pcx, over the existing ones. Hopefully they are the same size - if not, you will have to adjust the sizes and offsets later on. Save the pcx file.
3) Create a new text document. This will be your NFO file. Name it <whatever>.nfo, where <whatever> is what you'll want the grf file to be called.
4) Paste the following into the nfo file:
Code: Select all
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 6)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
0 * 4 00 00 00 00
5) Add the action 8 psuedosprite. eg:
Code: Select all
1 * 1 08 06 55 55 01 01 "My HQ" 00 "By Me" 00
6) Add the action A psuedosprite. This will look something like this:
Code: Select all
1 * 1 0A 01 1D 2B 0A
7) open trg1r.nfo, find the lines for the sprites you have replaced (the sprite numbers are the same as appear in the pcx), and copy and paste them into your nfo file after the action A sprite. If your sprites aren't exactly the same size as the defaults, you'll have to adjust the sizes and offsets at the end of the lines - the format is given in the NFO header. But don't worry about this until you've got the grf file working - you can always go back and adjust later.
Your nfo file should now look something like this:
Code: Select all
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 6)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
0 * 4 00 00 00 00
1 * 1 08 06 55 55 01 01 "My HQ" 00 "By Me" 00
1 * 1 0A 01 1D 2B 0A
2603 sprites/trg1r.pcx 114 9640 09 31 64 -31 0
2604 sprites/trg1r.pcx 194 9640 09 31 64 -31 0
2605 sprites/trg1r.pcx 274 9640 09 31 64 -31 0
2606 sprites/trg1r.pcx 354 9640 09 31 64 -31 0
2607 sprites/trg1r.pcx 434 9640 09 31 64 -31 0
2608 sprites/trg1r.pcx 514 9640 09 31 64 -31 0
2609 sprites/trg1r.pcx 594 9640 09 31 64 -31 0
2610 sprites/trg1r.pcx 674 9640 09 31 64 -31 0
2611 sprites/trg1r.pcx 2 9752 09 31 64 -31 0
2612 sprites/trg1r.pcx 82 9752 09 15 59 -26 0
2613 sprites/trg1r.pcx 146 9752 09 31 64 -31 0
2614 sprites/trg1r.pcx 226 9752 09 18 32 1 -3
2615 sprites/trg1r.pcx 274 9752 09 31 64 -31 0
2616 sprites/trg1r.pcx 354 9752 09 5 4 -31 12
2617 sprites/trg1r.pcx 370 9752 09 31 64 -31 0
2618 sprites/trg1r.pcx 450 9752 09 31 64 -31 0
2619 sprites/trg1r.pcx 530 9752 09 53 64 -31 -22
2620 sprites/trg1r.pcx 610 9752 09 31 64 -31 0
2621 sprites/trg1r.pcx 690 9752 09 42 63 -30 -24
2622 sprites/trg1r.pcx 2 9816 09 31 64 -31 0
2623 sprites/trg1r.pcx 82 9816 09 21 32 -31 -6
2624 sprites/trg1r.pcx 130 9816 09 31 64 -31 0
2625 sprites/trg1r.pcx 210 9816 09 31 64 -31 0
2626 sprites/trg1r.pcx 290 9816 09 73 64 -31 -44
2627 sprites/trg1r.pcx 370 9816 09 31 64 -31 0
2628 sprites/trg1r.pcx 450 9816 09 21 32 1 -6
2629 sprites/trg1r.pcx 498 9816 09 31 64 -31 0
2630 sprites/trg1r.pcx 578 9816 09 69 64 -31 -48
2631 sprites/trg1r.pcx 658 9816 09 31 64 -31 0
9) if you don't have any errors, encode with grfcodec, and you should have a working grf file.
Good luck, have fun...
- RSpeed tycoonfreak
- Transport Coordinator
- Posts: 349
- Joined: 02 Feb 2006 13:17
- Location: Azewijn The netherlands
- Contact:
thank's ,I'll try
btw, Here in the netherlands It's 25th Februari 21:00 (9PM)
btw, Here in the netherlands It's 25th Februari 21:00 (9PM)
Visit The Fake Airport Website

Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
- RSpeed tycoonfreak
- Transport Coordinator
- Posts: 349
- Joined: 02 Feb 2006 13:17
- Location: Azewijn The netherlands
- Contact:
ehm, How do I decode it? 

Visit The Fake Airport Website

Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Using grfcodec.RSpeed tycoonfreak wrote:ehm, How do I decode it?
The readme should contain all the information you need.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- RSpeed tycoonfreak
- Transport Coordinator
- Posts: 349
- Joined: 02 Feb 2006 13:17
- Location: Azewijn The netherlands
- Contact:
It doesn't work.
If I use grf wizard and i select the path to grfcodec I get this: (error1)
And how do I use grfcodec?
Do I have to drag the trg1r.grf on the grf codec.exe?
because if I do that nothing is happening.
Do I have to open the grfcodec.exe?
because if I do that I get a dos screen for about 0,1 sec. and then it's gone.
Please help even if i sound completely stupid now,
because my english is not that good.

If I use grf wizard and i select the path to grfcodec I get this: (error1)
And how do I use grfcodec?
Do I have to drag the trg1r.grf on the grf codec.exe?
because if I do that nothing is happening.
Do I have to open the grfcodec.exe?
because if I do that I get a dos screen for about 0,1 sec. and then it's gone.
Please help even if i sound completely stupid now,
because my english is not that good.



- Attachments
-
- error1.PNG (9.36 KiB) Viewed 4496 times
Visit The Fake Airport Website

Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Okay,
1) create a new shortcut in the directory where you have put grfcodec. In "type the location of the item", type cmd.exe, click next, click finish.
2) right click on the shortcut and select properties. In 'Start in', it will probably have "%windir%". Delete this so the 'Start in' dialogue is empty, click okay.
3) copy trg1r.grf to the directory.
4) run the shortcut. You will get a DOS prompt. Type:
This will create a SPRITES subdirectory, and put the pcx and nfo files in it. This subdirectory is where you will want to create your new nfo file. You can use this same shortcut for decoding and encoding grf files in the future.
I should warn you, I'm not going to be this helpful for much longer...
1) create a new shortcut in the directory where you have put grfcodec. In "type the location of the item", type cmd.exe, click next, click finish.
2) right click on the shortcut and select properties. In 'Start in', it will probably have "%windir%". Delete this so the 'Start in' dialogue is empty, click okay.
3) copy trg1r.grf to the directory.
4) run the shortcut. You will get a DOS prompt. Type:
Code: Select all
grfcodec -d trg1r.grf
I should warn you, I'm not going to be this helpful for much longer...
- RSpeed tycoonfreak
- Transport Coordinator
- Posts: 349
- Joined: 02 Feb 2006 13:17
- Location: Azewijn The netherlands
- Contact:
Thanks you're very helpful but I think I need youre help one more time:
If i type grfcodec -d trg1r.grf
it says:
grfcodec are not recognised as an internal or external task, programme or batchfile.
(It's maybe not exactly what it suppose to be but I translated it with a translator)
If you or anybody else solve this problem I think i don't need help anymore.
If i type grfcodec -d trg1r.grf
it says:
grfcodec are not recognised as an internal or external task, programme or batchfile.
(It's maybe not exactly what it suppose to be but I translated it with a translator)
If you or anybody else solve this problem I think i don't need help anymore.

- Attachments
-
- error2.PNG (10.12 KiB) Viewed 4468 times
Visit The Fake Airport Website

Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Hobbys: being 18 years old, soccer, go karting, and transport tycoon.
Interesting. I wasn't aware that program was broken too. But it fits; all the rest of the software that person wrote is broken. (grfcodec works just fine from directories containing whitespace; I just checked.)RSpeed tycoonfreak wrote:If I use grf wizard...
EDIT: Re-read Pikka's instructions. You forgot a step.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Actually, there's another option too: You moved the shortcut to a directory other than the one containing grfcodec.
If that's the case, change #2 to "Enter the directory containing grfcodec and the grf files in the 'Start in' dialogue".
If that's the case, change #2 to "Enter the directory containing grfcodec and the grf files in the 'Start in' dialogue".
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
would probably work for a normal GRF, but not for OTTDs 34bpp, for a start, the 32bpp base image is, 32 bit, including RGB+Alpha. PCX is only 24bit, RGB only. so, the alpha is already gone out of the windows, and we havn't even looked at the 2bit CC overlay yet.RSpeed tycoonfreak wrote: PNG -> PCX
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
Who is online
Users browsing this forum: Google [Bot] and 31 guests