GRFCODEC.EXE questions

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

User avatar
Andrex
Tycoon
Tycoon
Posts: 1308
Joined: 22 Nov 2002 05:08
Location: AR
Contact:

GRFCODEC.EXE questions

Post by Andrex »

1. In the guide you refer to a file called "trg1.grf" while the real name of the file is "trg1r.grf". I suppose both windows and DOS version of TTD uses the same names, so if this is simply a spelling error, it should be corrected.

2. I have decoded all GRF files from the TTD folder, however the backup file was created only for the main file, trg1r.grf. Why there are no backups for the others? (despite I know I can create them manually)

3. How can I run grfcodec.exe in the background, hiding its window? (by using the "RUN" option from Start menu plus -? command I suppose).
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

1) No .. Dos trg1.grf , Win trg1r.grf
2) the best to do is making your own backups
3) yes .. you will it but only a while but I will notsee if something goes wrong
what are you looking at? it's a signature!
Tom Cumming
Engineer
Engineer
Posts: 42
Joined: 09 Jan 2003 16:55

Re: GRFCODEC.EXE questions

Post by Tom Cumming »

Andrex wrote: 3. How can I run grfcodec.exe in the background, hiding its window? (by using the "RUN" option from Start menu plus -? command I suppose).
Just like any other program really - create a shortcut to it and set it to run minimised in the properties for the shortcut.
User avatar
Andrex
Tycoon
Tycoon
Posts: 1308
Joined: 22 Nov 2002 05:08
Location: AR
Contact:

Post by Andrex »

My mistake. Despite I knew that windows trick.

WHat I need to do is HIDE the program window while it is runing. And I need the command line ONLY.
User avatar
orudge
Administrator
Administrator
Posts: 25218
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Well, basically, just do a FindWindow and then a ShowWindow(hWnd, SW_HIDE) - easy enough in VB. If I have time/can be bothered, I'll do that. ;)
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Or recompile GRFCodec as a console application, and redirect stdin/stdout to somewhere else.

Btw, the backup is only generated when your encoding, not when decoding.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
orudge
Administrator
Administrator
Posts: 25218
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Er, you mean recompile as a GUI application, I assume? ;)
User avatar
mp3Pro
Tycoon
Tycoon
Posts: 1392
Joined: 21 Jan 2003 14:49
Location: My own home, Sc
Contact:

Post by mp3Pro »

/me keeps his fingers crossed
User avatar
orudge
Administrator
Administrator
Posts: 25218
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Oh, it's certainly possible (if you mean hiding the window).
User avatar
Andrex
Tycoon
Tycoon
Posts: 1308
Joined: 22 Nov 2002 05:08
Location: AR
Contact:

Post by Andrex »

I'm building a VB GUI to manage the grfcodec.exe to automatically perform its most common tasks, as you have imagined.

The best thing would be to incorporate those EXE into my program somehow, but since I have no idea how to do that, it will be enough with hiding the window.

Another question:
The color palette settings are valid only for decoding, or it may be applied when encoding also?
User avatar
mp3Pro
Tycoon
Tycoon
Posts: 1392
Joined: 21 Jan 2003 14:49
Location: My own home, Sc
Contact:

Post by mp3Pro »

for encodeing there a -m switch

Patchman explains [/url]
User avatar
Andrex
Tycoon
Tycoon
Posts: 1308
Joined: 22 Nov 2002 05:08
Location: AR
Contact:

HELP NOW PLZ!!!!

Post by Andrex »

I am having problems when encoding with the m switch.
This is the situation:

C:\AZ\TTDXP>grfcodec.exe -e -m 0 trgcr.grf
GRFCodec version 0.9 - Copyright (C) 1999-2002 by Josef Drexler
Encoding in temporary file C:\AZ\TTDXP\trgcr.new
Agh! Getting colour 216 but it has no map!ransparency: 57%, Redundancy: 78%)

With all GRF files I've tried, I get the same error, but with differnt values for everything. Also happens with the -m 1 switch of course.
User avatar
mp3Pro
Tycoon
Tycoon
Posts: 1392
Joined: 21 Jan 2003 14:49
Location: My own home, Sc
Contact:

Post by mp3Pro »

sounds like a question for josef
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Re: HELP NOW PLZ!!!!

Post by Patchman »

Andrex wrote:Encoding in temporary file C:\AZ\TTDXP\trgcr.new
Agh! Getting colour 216 but it has no map!ransparency: 57%, Redundancy: 78%)

With all GRF files I've tried, I get the same error, but with differnt values for everything. Also happens with the -m 1 switch of course.
This means you're either using the wrong -m switch, or that the graphics are using the wrong palette.

Remember that -m is for converting between DOS and Windows graphics. This means, with -m 1, the PCX file must be in the Windows palette, and the resulting GRF file will use the DOS palette. -m 0 works the other way round.

If the palette is correct already, you don't need the -m switch.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
orudge
Administrator
Administrator
Posts: 25218
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Andrex wrote:The best thing would be to incorporate those EXE into my program somehow, but since I have no idea how to do that, it will be enough with hiding the window.
Create a DLL file with the GRFCodec routines in (you'll have to modify the GRFCodec source a bit, but it's certainly possible), and call this from VB.
User avatar
Andrex
Tycoon
Tycoon
Posts: 1308
Joined: 22 Nov 2002 05:08
Location: AR
Contact:

Post by Andrex »

I think I will revome the -m swith from the program because I have no success when using it.
I have tried to convert WinTTD graphics into DOS, DOS graphics into Windows, with both -m 0 and -m 1 switches, and it doesn't work. I simply don't know what may be wrong.
User avatar
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Post by Rob »

As far as I know, and tested myself. It is only possible to change new made graphics. This means up to now it is only possible to change new vehicles for windows to dos and visa versa. Sadly enough. :cry:
It is not possible to change changed buildings and new made railroadsprites or bridges.
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)
Image
Still the best OS around
User avatar
Andrex
Tycoon
Tycoon
Posts: 1308
Joined: 22 Nov 2002 05:08
Location: AR
Contact:

Post by Andrex »

Rob wrote:As far as I know, and tested myself. It is only possible to change new made graphics. This means up to now it is only possible to change new vehicles for windows to dos and visa versa. Sadly enough. :cry:
It is not possible to change changed buildings and new made railroadsprites or bridges.
Are you talking about the -m switch or something? Because it is very possible to change buildings and stuff.

I'll leave the -m switch but with a warning message like "It may not work".
User avatar
mp3Pro
Tycoon
Tycoon
Posts: 1392
Joined: 21 Jan 2003 14:49
Location: My own home, Sc
Contact:

Post by mp3Pro »

I cant wait to try it out
User avatar
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Post by Rob »

I was refering to the post above mine. So yes, i'm talking about the -m switch. 8)
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)
Image
Still the best OS around
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 7 guests