GRDTOGRF:Converts graphic sets in EXE/GRD files to GRF 0.4.1
Moderator: Graphics Moderators
- George
- Tycoon
- Posts: 4364
- Joined: 16 Apr 2003 16:09
- Skype: george-vb
- Location: Varna, Bulgaria
- Contact:
I'm ready to test it!eis_os wrote:Current Status / Feature list:
Coverts exe and grd to grf files,
can convert files that patches more than one file aswell.
Maps the sprite numbers from trg(1)c.grf (arctic) and trg(1)h.grf automaticly to the right sprites, adds a action 7 for climate...
I will write the map data for toyland soon too.
What it doesn't do and aren't planed is that the Action A gets packed so it doesn't write a seperate action a for each sprite.
Maybe I find a easy way to do this...
A little beta testing shouldn't harm, so pm please if you have something (prefered windows stuff) or want to beta test
Suggestion:
Could it get a parameter - GRFID?
My GRF Routine already loads the complete data of one GRD file in memory. So I need to write some lookahead function so it will pack the sprite numbers, and to recalc the right size of sprites written to the file ...
Hmm, GRFID, currently I use a dummy not counted grfid FF FF so all versions of TTDPatch should load it.
This will get a little complicate if there are more than grd file in a diff exe.
I think I could add a option to add a changeable action 8, have to rewrite the option parser than...
Like this -g OE 20
will create action 8 that starts with number 20 and then count up...
Maybe -c and -d for copyright and description string
Screendump of my current version:
Hmm, GRFID, currently I use a dummy not counted grfid FF FF so all versions of TTDPatch should load it.
This will get a little complicate if there are more than grd file in a diff exe.
I think I could add a option to add a changeable action 8, have to rewrite the option parser than...
Like this -g OE 20
will create action 8 that starts with number 20 and then count up...
Maybe -c and -d for copyright and description string
Screendump of my current version:
Code: Select all
bash-2.05b$ ./grdtogrf.exe EuropeanRoadset_v111DOS.exe
GRDTOGRF version 0.2 - Copyright (C) 2003 by Oskar Eisemuth
Generated from: trg1.grf
Reading GRD Data
Number of Sprites: 183
100% [=========================]
Writing temporary file grdtogrf.tmp
100% [=========================]
Flushing Data
Renaming grdtogrf.tmp to EuropeanRoadset_v111DOS.grf
Done
Generated from: trgc.grf
Using mapdata for: trgc
Reading GRD Data
Number of Sprites: 45
100% [=========================]
Writing temporary file grdtogrf.tmp
100% [=========================]
Flushing Data
Renaming grdtogrf.tmp to EuropeanRoadset_v111DOS1.grf
Done
Generated from: trgh.grf
Using mapdata for: trgh
Reading GRD Data
Number of Sprites: 82
100% [=========================]
Writing temporary file grdtogrf.tmp
100% [=========================]
Flushing Data
Renaming grdtogrf.tmp to EuropeanRoadset_v111DOS2.grf
Done
bash-2.05b$
Ok I have made the first public release,
you can find it on my site for ttdpatch.
It's the first offical version, don't expect a lot docs, simple try -h as commandline switch.
Version 0.3.1:
map all sprite numbers for the three extra climates
should make a proper climate action
write a GRFID number and/or description & copyright string.
(thats not well done currently, but sometimes it works)
-g OE 1 -i "A Testfile" "no copyright"
packs action A entrys, maybe I will make it as an default option so you can disable it if you like...
you can find it on my site for ttdpatch.

It's the first offical version, don't expect a lot docs, simple try -h as commandline switch.
Version 0.3.1:
map all sprite numbers for the three extra climates
should make a proper climate action
write a GRFID number and/or description & copyright string.
(thats not well done currently, but sometimes it works)
-g OE 1 -i "A Testfile" "no copyright"
packs action A entrys, maybe I will make it as an default option so you can disable it if you like...
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...


Have you ever read some action code specifc?
-i fills description and copyright.
If you don't use these switch my tool will write a dummy Action 8 with a description "Created by grdtogrf" and a dummy GRFID
The <grf-id> is four bytes long, the first two bytes you should use your initials. The next two are versions or project id. -> switch -g <initials> <number> (the number can be given as hex aswell: 0xaabb, beware they will be reversed)Action 8: Define GRF ID
Data is <08> <version> <grf-id> <description> <copyright>
-i fills description and copyright.
If you don't use these switch my tool will write a dummy Action 8 with a description "Created by grdtogrf" and a dummy GRFID
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...


-
- Tycoon
- Posts: 3849
- Joined: 20 Jan 2003 14:51
- Location: Broadstone, Dorset
- Contact:
Great tool, Oskar but I have a few question. I copied what you did with my European Roadset and I did get the grf's. I thought well, why not put them in <Dir> newgrf and put them in newgrf.cfg as well. Might work... But it doesn't, it says 'Error opening file...'. Is this becasue TTDPatch has to be told to look for these new files or is it something else?
Second thing is I can't get the -i switch to work. If I place it before the exe to be grf'ed your tool says 'No GRD specified'. Putting it behind it gives me the help screen
. I bet it is something I do wrong, me and the DOS command line never liked eachother (I'm a GUI-centered person).
Second thing is I can't get the -i switch to work. If I place it before the exe to be grf'ed your tool says 'No GRD specified'. Putting it behind it gives me the help screen

-
- Tycoon
- Posts: 3849
- Joined: 20 Jan 2003 14:51
- Location: Broadstone, Dorset
- Contact:
The limit isn't so much trouble ...
A complete action a replacement of a climate would eat around 5000 Sprites, you have 11484.
Since 2.0 beta 5 Changelog:
Second question: you have to use two parameters like this with quotes:
-i "Description" "Copyright"
Post your exact commandline if it doesn't work...
Ohh and before I forget, tell me which TTDPatch Version you use ...
and relook the filenames:
EuropeanRoadset_v111DOS.grf
I have in my cfg, because it's simple in the main ttd folder.
(The dos version can't use long filenames if I am right)
A complete action a replacement of a climate would eat around 5000 Sprites, you have 11484.
Since 2.0 beta 5 Changelog:
You can't use two sets the same time, would be very useless, so I don't think you will get the maximum soon. The only big reason could be memory problems." - allow 11484 *active* real sprites, and unlimited (I think...) pseudo-sprites or inactive sprites, only available memory is the limit"
Read the license..., if he don't hide the copyright message it's ok...Prof. Frink wrote:Maybe Andrex will make a GRD2GRF wizard like GRF wizard...
I had no problems with a converted Europeanset but one Depot is screwy -> Dos PaletteHyronymus wrote:Great tool, Oskar but I have a few question. I copied what you did with my European Roadset and I did get the grf's. I thought well, why not put them in <Dir> newgrf and put them in newgrf.cfg as well. Might work... But it doesn't, it says 'Error opening file...'. Is this becasue TTDPatch has to be told to look for these new files or is it something else?
Second thing is I can't get the -i switch to work. If I place it before the exe to be grf'ed your tool says 'No GRD specified'. Putting it behind it gives me the help screen. I bet it is something I do wrong, me and the DOS command line never liked eachother (I'm a GUI-centered person).
Second question: you have to use two parameters like this with quotes:
-i "Description" "Copyright"
Post your exact commandline if it doesn't work...
Ohh and before I forget, tell me which TTDPatch Version you use ...
and relook the filenames:
EuropeanRoadset_v111DOS.grf
I have in my cfg, because it's simple in the main ttd folder.
(The dos version can't use long filenames if I am right)
Who is online
Users browsing this forum: No registered users and 9 guests