Page 1 of 2

WIN - DOS conversion

Posted: 14 Aug 2003 18:46
by Marcel
This is a requested tutorial how to convert dos graphics to win and vice versa.

I will explain first how to convert .exe files from win to dos.

1. Find out to which grf file the .exe is corresponding to, on dos mode use the command: nameoffile.exe -l. You will also get information about the changed spritenumbers. Remember them.

2. Rename the corresponding grf file to a win file. Do this by adding a "r" in the filename. For example trg1.grf will be trg1r.grf. Execute the exe file. Rename the file back to its original name.

3. Decode the grf file. You can use the grf wizard for this, get it on Andrex`s site. You will be asked which colour palette should be used, take the Win palette. You will get a folder named "sprites". Rename it to "spriteswin", or whatever you want. Now decode the file again, using the dos palette. This is necessary when the exe file changes the size of the sprite.

4. You now have two pcx - files, one with the win colours, one with the dos colours. For the next step you can use any graphic program which can handle pcx files. Open the file with the win palette (in the spriteswin folder), copy the sprites you have remembered in the first step and copy them in the file with the dos palette. They must be on the same place, do this careful. Save the file. You will not need the win palette file (yes, in the sriteswin folder) anymore, delete it.

5. Encode the sprites now, use again the wizard for the easiest way. You can use also the wizard to create an exe file for your conversion.

6. Sometimes there are graphic errors like blinking dots, you have to remove them manually. Do this by changing the colour with a similar one. But this is very seldom.

A dos - win conversion works on the same way, but have in mind that you have to rename the grf file from win to dos (remove the "r"), copy the sprites from the dos palette pcx file....

For a grf conversion, like the traffic sets for example, start at step 3. You will have to copy/paste all sprites in the pcx file.

This looks very complicated, maybe it is not the best way to do this, but it works well, and that is the point. Try it a few times, you will understand why and how it works, and you can convert a file in a few minutes. Or ask someone to do it for you, for example me. :wink:

Posted: 14 Aug 2003 18:57
by Dinges
A little more feedback on Graphic files found in newgrf folder:

they can be changed easyer than .exe file, use this:

Code: Select all

grfcodec -e tempenh2w.grf -m 1
copy tempenh2w.grf tempenh2.grf
grfcodec -e tempenh2w.grf
to convert such file to DOS...

Posted: 14 Aug 2003 19:00
by Marcel
Yes, but this works only when all sprites should be converted, when you have at least on sprite in the pcx file which should not be changed, no way.

Posted: 14 Aug 2003 19:04
by Dinges
Mostly GRF files have that...

Posted: 14 Aug 2003 19:07
by Marcel
We know that, but maybe someone is out there who tries to convert exe -files on the way you said, wondering about funny results.

Posted: 14 Aug 2003 19:10
by Dinges
So, don't do it, unless you are sure you going convert all sprites...

I glued this topic, I hope you don't mind...

Posted: 14 Aug 2003 19:25
by Hyronymus
Dinges wrote:A little more feedback on Graphic files found in newgrf folder:

they can be changed easyer than .exe file, use this:

Code: Select all

grfcodec -e tempenh2w.grf -m 1
copy tempenh2w.grf tempenh2.grf
grfcodec -e tempenh2w.grf
to convert such file to DOS...
So to Windows it should be as easy as

Code: Select all

grfcodec -e tempenh2.grf -m 0
copy tempenh2.grf tempenh2w.grf
grfcodec -e tempenh2w.grf
I think it should be like this and that there is an error in your last code line, Dinges. You wrote tempenh2w.grf but that doens't exist anymore after copy command.

Posted: 14 Aug 2003 19:27
by Dinges
it does, I copyed, not moved it...

remember what it does

1. Make the file for DOS
2. Copy the file with another name (usualy withour 'w')
3. Make the file for WIN

Rember that if you do this, you should work in the pallete you make last (this time it is WIN)

Posted: 14 Aug 2003 19:38
by Hyronymus

Code: Select all

grfcodec -e tempenh2w.grf -m 1
copy tempenh2w.grf tempenh2.grf
grfcodec -e tempenh2w.grf
This does the following:
- encode tempenh2w.grf to DOS palette
- make a copy of tempenh2w.grf named tempenh2.grf
- encode tempenh2w.grf again

So actually the copy is the version that should work onder DOS, right?

Posted: 15 Aug 2003 08:48
by Dinges
yes

Posted: 15 Aug 2003 11:04
by eis_os
Looks like you using the batch I suggested on #tycoon 8)

Posted: 15 Aug 2003 12:12
by Hyronymus
Dinges wrote:yes
Well, guess what: I tried to convert from DOS to Windows and it doesn't work. It's still the wrong palette!

Posted: 15 Aug 2003 12:52
by Dinges
file like DBset, tempenh and other graphic files found in newgrf folder should work fine...

Posted: 15 Aug 2003 12:56
by Hyronymus
Well, I had my fill of it for now. I'm not gonna try it myself, if anybody else feels like trying to convert dbsetw to dbset: be my guest. Of course (sneaky as I am) I need to here from you how you managed.

Posted: 15 Aug 2003 13:02
by Dinges
You say you couldn't convert DBset :?:

hmm, I wonder how MB made it then...

Posted: 15 Aug 2003 13:03
by Hyronymus
No, I meant converting from DOS to Windows in general. And I suppose MB started in Windows and converted to DOS, something that does seem to work.

Posted: 15 Aug 2003 13:04
by Dinges
Hyronymus wrote:No, I meant converting from DOS to Windows in general. And I suppose MB started in Windows and converted to DOS, something that does seem to work.
hmmm, my tempenh DOS worked didn't it :?:

Posted: 15 Aug 2003 19:33
by George
Hyronymus wrote:No, I meant converting from DOS to Windows in general. And I suppose MB started in Windows and converted to DOS, something that does seem to work.
If you my long vehicles are correct in dos, than win->dos convertion works. I can't check the dos version myself.

Posted: 15 Aug 2003 20:29
by Hyronymus
Please guys, is it so hard to get? You are all talking about Windows->DOS conversion. I'm trying to convert from DOS->Windows and that doesn't work (yet).

Posted: 16 Aug 2003 09:13
by Dinges
George wrote:
Hyronymus wrote:No, I meant converting from DOS to Windows in general. And I suppose MB started in Windows and converted to DOS, something that does seem to work.
If you my long vehicles are correct in dos, than win->dos convertion works. I can't check the dos version myself.
Longvehicles DOS seems to work, nobody cries about it :!: