Page 1 of 2
My First Trainset
Posted: 13 Apr 2006 20:23
by Samwise
I made my first trainset with Purno's Drawing Tutorials, and I like to show them here, it's a locomotive and a passenger coach.
Note: If anyone can code these things in a .grf file, I will be very happy

I'd like to have my own made graphics in my game

Posted: 13 Apr 2006 20:26
by Samwise
It means that the passenger coach appears at 1950, and the locomotive at 1975. The locomotive should go 120 km/h and has 2500 HP. It would cost at 1975 about 30k, and the passenger coach same as a normal one. (same capicaty etc)
Posted: 14 Apr 2006 06:23
by Samwise
I tried to make a .grf file on my own, but when I do
grfcodec -e mytrain.grf -p 2 it saids that he can't read truecolour PCX files! What should I do against this? (I converted a .PNG 256 colour image to .PCX with irfanview.)
Posted: 14 Apr 2006 07:39
by DaleStan
Convert it to a 256 color PCX file, not a truecolor PCX. Grab the appropriate palette from any of grfcodec's output PCXen. (I can't help with Infranview; find me saying both "GIMP" and "palette" for help in The GIMP.)
And -p is only relevant for decoding, not encoding.
Posted: 14 Apr 2006 08:31
by Samwise
I already figured it out, but thanks anyway!

But now I have the problem when I -d the mytrain.grf -p 2 the mytrain.pcx is negative! (weird pink colour) Is that normal?
Posted: 14 Apr 2006 13:06
by Samwise
Jet another train: SF H'1500' Diesel (I create and number my own trainset in this topic.) So far:
If you find anything that's wrong in the graphic, please post it here.
The SF H'1500' Diesel was created with only paint, no tutorial
Posted: 14 Apr 2006 16:16
by DaleStan
Darkmast49 wrote:I already figured it out, but thanks anyway!

But now I have the problem when I -d the mytrain.grf -p 2 the mytrain.pcx is negative! (weird pink colour) Is that normal?
No. What happens if you decode without -p 2?
If that works correctly, you acquired a DOS palette, not a Windows palette. Re-encode with -m 0, decode with -p 2, and use the palette from that PCX instead.
If that doesn't work, the palette on your input PCX was borken, any you'll have to recreate it. Most programs have helpful options: "optimize palette", "remove unused palette entries", or similar. Turn it/them off; it/they *WILL* break your PCX.
Posted: 14 Apr 2006 17:52
by Samwise
Thanks for the tip! Gonna try it right now!
Posted: 14 Apr 2006 17:58
by Samwise
Still same problem.. could you please figure it out for me?(only include the picture in .pcx at a .grf file, I wanna try the rest.. I'm learning

)
When you do, please post it here when your done ok?
Posted: 14 Apr 2006 18:00
by Samwise
BTW, Yet another graphic, a Bus this time
Posted: 14 Apr 2006 18:33
by DaleStan
Darkmast49 wrote:Still same problem.. could you please figure it out for me?(only include the picture in .pcx at a .grf file, I wanna try the rest.. I'm learning

)
It seems to me that the problem is a broken .pcx[0], and me generating a correctly paletted .pcx won't really solve the problem of you not knowing how to properly generate a .pcx file. If you can't figure out how to capture a palette with Infranview, then the next best option is to decode any grf file with -p 2 and copy/paste your sprites into that .pcx file.
If you are using The GIMP, there's an checkbox for "Remove unused colors from final palette" option when converting to indexed colors (Image->Mode->Indexed), uncheck that and everything will be fine.
At some point, this thread should probably be moved to the TTDPatch Graphics forum; the general division seems to be 256-color sprites/grfs go there, 32bpp images go here.
[0] If you zip up the PCX that you are feeding into grfcodec and post that, I'll verify that theory. The .png you posted is truecolor, but appears to use only colors in the TTD palette (or colors so close as to be visually identical).
Posted: 14 Apr 2006 19:10
by Samwise
If you excist.. MODERATORS WHERE ARE YOU?? please move topic to TTDpatch graphics...
But I don't understand the problem about broken .pcx.. I first create my train using the well known 256 color palette in paint, then I save it as .png. Then I open it with window and I do save as.. and choose for .PCX. Could that go wrong or somethin??
Please help me, yust started with .grf

Posted: 14 Apr 2006 20:09
by Yoeri
wow your graphics looks very nice! I barely play TTD anymore ( I know, it's a shame), as I'm more in the Blender now. Good luck!

Posted: 14 Apr 2006 20:28
by Samwise
IT TOTALLY WORKED! I replaced some graphics from trg1r.grf to make place for my bus and it worked! If you download the .grf file below and put it into the data map, you will see that the hereford leopard bus and the foster bus is replaced by my creation

Posted: 14 Apr 2006 21:38
by Samwise
New .grf file, I added my other locomotives and my passenger car as well. Yust download the .grf below and put it in your data folder.
Note: please BACKUP the trg1r.grf before continuing so that you still have the old graphics for the trains etc..
Posted: 14 Apr 2006 23:59
by DaleStan
Don't do that, Darkmast49.
It's a horribly huge download, it can't be combined with other similar changes, and it's in violation of copyright.
Release a proper GRF instead.
Darkmast49 wrote:But I don't understand the problem about broken .pcx.. I first create my train using the well known 256 color palette in paint, then I save it as .png. Then I open it with window and I do save as.. and choose for .PCX. Could that go wrong or somethin??
Yes, it could. Anything could go wrong with a description like that, and I wouldn't have the first idea what. BE PRECISE!
Posted: 15 Apr 2006 07:46
by Samwise
DaleStan wrote:Don't do that, Darkmast49.
It's a horribly huge download, it can't be combined with other similar changes, and it's in violation of copyright.
Release a proper GRF instead.
Darkmast49 wrote:But I don't understand the problem about broken .pcx.. I first create my train using the well known 256 color palette in paint, then I save it as .png. Then I open it with window and I do save as.. and choose for .PCX. Could that go wrong or somethin??
Yes, it could. Anything could go wrong with a description like that, and I wouldn't have the first idea what. BE PRECISE!
oh ok I'm sorry about violation of copyright.. But still it works

And what do you mean with precise.. I first create a train, save it as .png, goes OK. Then I open it with irfanview and save it as .pcx, goes OK as well. Then I create a mytrain.nfo with this info:
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 6)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
0 sprites/mytrain.pcx 18 8 01 22 8 -3 -10
1 sprites/mytrain.pcx 34 8 11 2 20 32 16
2 sprites/mytrain.pcx 66 8 34 2 28 66 13
3 sprites/mytrain.pcx 114 8 68 2 20 88 14
4 sprites/mytrain.pcx 146 8 90 2 8 97 23
5 sprites/mytrain.pcx 162 8 99 2 20 119 14
6 sprites/mytrain.pcx 194 8 21 2 28 153 13
7 sprites/mytrain.pcx 242 8 55 2 20 176 16
and save it, then I run cmd, go to the folder and write:
grfcodec -e mytrain.grf -p 2..
Then I do grfcodec -d mytrain.grf -p 2 (to check if it works) and then I have that weird pink color at mytrain.pcx..
Posted: 15 Apr 2006 18:13
by DaleStan
Then something trashed your palette.
How many entries does your palette have? If it does not have 256 entries, your palette is borked.
What is color is the first palette entry? If it is not blue, your palette is borked.
What color are the second through tenth colors in the palette? If they are not pinks, your palette is borked.
What color are the last ten colors? If it is not nine pinks followed by pure white, your palette is borked.
You MUST, MUST, MUST use the correct palette for your .pcx files. If you do not, your .grf will be as broken as the palette was.
DaleStan wrote:If you can't figure out how to capture a palette with Infranview, then the next best option is to decode any grf file with -p 2 and copy/paste your sprites into that .pcx file.
... and then use that .pcx file to generate a new grf, rather than rebuilding the old grf.
Posted: 15 Apr 2006 19:01
by Samwise
This is the palette I use: (I got it from Purno's Drawing Tutorials..)
And it's a little bit strange.. cuz I pasted some of my own made graphics into trg1r.grf (replacing other graphics) and then used grfcodec -e trg1r.grf -p 2 and builded it, and it's all working fine in my games.. How is it possible that to create other .grf files it totally fails?? (note, I hope it's not illegal to paste graphics into trg1r.grf for personal use???)
Posted: 15 Apr 2006 19:47
by DaleStan
That looks to me like the DOS palette, flipped end-for-end.
This is the Windows palette.