My First Trainset

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

My First Trainset

Post 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 :)
Attachments
This is the passenger coach
This is the passenger coach
Passenger Coach.PNG (1.76 KiB) Viewed 5166 times
This is the locomotive
This is the locomotive
Locomotive.PNG (1.63 KiB) Viewed 5166 times
Image
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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)
Image
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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.)
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post 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.
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
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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?
Image
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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
Attachments
SF Passenger Coach
SF Passenger Coach
SF Passenger Coach.PNG (927 Bytes) Viewed 4996 times
SF HS'2000' Electric
SF HS'2000' Electric
SF HS'2000' Electric.PNG (1.81 KiB) Viewed 4996 times
SF H'1500' Diesel
SF H'1500' Diesel
SF H'1500' Diesel.PNG (1.88 KiB) Viewed 4996 times
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post 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.
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
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post by Samwise »

Thanks for the tip! Gonna try it right now!
Image
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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?
Attachments
You'll need this one
You'll need this one
Locomotive.PNG (1.63 KiB) Viewed 4898 times
Last edited by Samwise on 14 Apr 2006 18:03, edited 1 time in total.
Image
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post by Samwise »

BTW, Yet another graphic, a Bus this time
Attachments
SF H'500' Bus
SF H'500' Bus
SFH500Bus.PNG (4.94 KiB) Viewed 4896 times
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post 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).
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
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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 ;)
Image
User avatar
Yoeri
Route Supervisor
Route Supervisor
Posts: 470
Joined: 08 Aug 2005 13:42
Location: The Netherlands

Post 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! :)
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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 ;)
Attachments
trg1r.grf
(2.3 MiB) Downloaded 126 times
Image
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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..
Attachments
trg1r.grf
(2.3 MiB) Downloaded 156 times
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post 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!
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
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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..
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post 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.
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
User avatar
Samwise
Tycoon
Tycoon
Posts: 2459
Joined: 09 Apr 2006 18:50
Location: Oss, Netherlands, At home
Contact:

Post 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???)
Attachments
This one
This one
palette.PNG (819 Bytes) Viewed 4621 times
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

That looks to me like the DOS palette, flipped end-for-end.

This is the Windows palette.
Attachments
Palette.png
Palette.png (1.24 KiB) Viewed 4615 times
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
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot], Semrush [Bot] and 10 guests