The International Simutrans Forum

Community => Simutrans Help Center => Topic started by: sheldon_cooper on August 05, 2015, 03:19:08 AM

Title: Vehicle with a single color.
Post by: sheldon_cooper on August 05, 2015, 03:19:08 AM
Hello! Recently I downloaded two files, one pak, and the other dat, this is an American Pak128 truck found in the old forum.
(http://i.imgur.com/aqLReXC.png)
As you can see, the various color variation, however, to download this pak, and puts it in the game, there is only the blue truck, to play :
(http://i.imgur.com/uHJKsoB.png)
The question is, how do I do for the other colors appear in the game? Is it any setting in pak file? If so, how do I set for the other colors appear in the game?
This is the old forum where I found this pak truck: http://archive.forum.simutrans.com/topic/05085.0/ (http://archive.forum.simutrans.com/topic/05085.0/)
Title: Re: Vehicle with a single color.
Post by: Václav on August 05, 2015, 05:33:02 AM
There are two ways:

1. You make more objects that differs by colour (and object name) but shape will be the same
2. You will use any special colour that is (in game) replaced by any else colour depending on player colour settings
Title: Re: Vehicle with a single color.
Post by: Ters on August 05, 2015, 05:54:58 AM
The pak file is only made from the first row of images in the file posted. In that post, it appears that the only dat file was made when there was only a single row. It was probably recompiled with the new image set, but not modified to use the entire file. Only shunter knows for sure, but there is no active member by that name here.

So you'll have to pick up where Joker and shunter left off, by following Václav's advice. So no simple settings. You will have to become a pak file author.
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 06, 2015, 02:20:27 AM
Quote from: Václav on August 05, 2015, 05:33:02 AM
There are two ways:

1. You make more objects that differs by colour (and object name) but shape will be the same
2. You will use any special colour that is (in game) replaced by any else colour depending on player colour settings
I did what you said, and unfortunately the changes had no effect. But thanks for the tip! :)
Quote from: Ters on August 05, 2015, 05:54:58 AMYou will have to become a pak file author.
Unfortunately not know create or edit any pak file.
but I'm trying to talk to the Joker, yet he did not answer me, but I will wait.
Title: Re: Vehicle with a single color.
Post by: Ters on August 06, 2015, 04:35:51 AM
Quote from: sheldon_cooper on August 06, 2015, 02:20:27 AM
I did what you said, and unfortunately the changes had no effect.

Quote from: sheldon_cooper on August 06, 2015, 02:20:27 AM
Unfortunately not know create or edit any pak file.

You can't do the former without doing the latter, so a bit contradicting statements there.
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 07, 2015, 12:39:38 AM
I understand, but what I meant was that the changes I made was to duplicate the file and keep the original.
Example: File 1 (original): vehicle.PeterbiltP379
File 2: (duplicate) vehicle.Peterbilt.pink P379.
I think that's what Václav wanted to refer. I guess! ???
Quote from: Václav on August 05, 2015, 05:33:02 AM
There are two ways:

1. You make more objects that differs by colour (and object name) but shape will be the same
already when you say:
Quote from: Ters on August 05, 2015, 05:54:58 AMYou will have to become a pak file author.
I thought I would have to continue to do the project where it left off. That I can not do. it is more complex.
Title: Re: Vehicle with a single color.
Post by: Ters on August 07, 2015, 05:43:37 PM
Quote from: sheldon_cooper on August 07, 2015, 12:39:38 AM
I understand, but what I meant was that the changes I made was to duplicate the file and keep the original.
Example: File 1 (original): vehicle.PeterbiltP379
File 2: (duplicate) vehicle.Peterbilt.pink P379.
I think that's what Václav wanted to refer.

He meant duplicate the dat-file, and then change the duplicates to use different colors. And that is done by editing the contents of the dat file, not putting a color in its name. After that, the pak file(s) must built from the dat files and the png file. The file name is completely irrelevant (except maybe ground.pak).
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 08, 2015, 02:53:00 AM
Now I understand! Thank you!  :) I do not know how I will do to edit the dat and png for pak, but I'll see what I can do.
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 09, 2015, 09:31:37 PM
I learned how to assemble the pak file, but the file is invisible in the game.
I did so clipped a PNG image in 128x128

(http://i.imgur.com/aktvrRU.png)
then set up the dat according to the pictures

(http://i.imgur.com/cts67r9.jpg)
in cmd (DOS prompt), looks like this:

(http://i.imgur.com/l4T9zCz.jpg)

what am I doing wrong?
Title: Re: Vehicle with a single color.
Post by: Ters on August 09, 2015, 10:29:33 PM
You don't have to do anything with the png, just the dat. The only thing that needs changing should be the name, and the row it grabs the images from.
Title: Re: Vehicle with a single color.
Post by: An_dz on August 10, 2015, 09:49:17 PM
makeobj is looking for an image called p379.png. The numbers after dots are the Y.X coordinates of the tiles.

All you have to do is in the original dat file you add some dashes after the end of the original stuff, and duplicate all the text after the dashes and then change the first 0s to 1s in the image parameter, then you duplicate again and change to 2s and so on. It may look like this (cutting some parts):
(...)
Image[NE]=p379.0.6
Image[SW]=p379.0.7
---
obj=vehicle
name=Peterbilt p379 red
(...)
Image[NW]=p379.1.5
Image[NE]=p379.1.6
Image[SW]=p379.1.7
---
obj=vehicle
name=Peterbilt p379 green
(...)
Image[NW]=p379.2.5
Image[NE]=p379.2.6
Image[SW]=p379.2.7
---
obj=vehicle
name=Peterbilt p379 USA flag
(...)
Image[NW]=p379.8.5
Image[NE]=p379.8.6
Image[SW]=p379.8.7
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 11, 2015, 12:35:33 AM
So I can use this image to use along with on dat?
Quote from: sheldon_cooper on August 05, 2015, 03:19:08 AM
(http://i.imgur.com/aqLReXC.png)
Title: Re: Vehicle with a single color.
Post by: Václav on August 15, 2015, 05:54:34 AM
Quote from: sheldon_cooper on August 06, 2015, 02:20:27 AM
I did what you said, and unfortunately the changes had no effect. But thanks for the tip! :)
... oh, previously I thought you have experience with making dats. But I was wrong, it seems.

Yes ... In one dat file may be prepared many vehicles, including vehicles that have graphics elsewhere (it means that dat file may contain vehicles that use different png files - but it is deprecated).

In accordance with An_dz and Ters, change dat file with copying of dats of the first vehicle - and change coords and dat name of vehicle. So, there will be (for example - but in code borrowed from previous posts are not all coords needed for correction function of vehicle):


obj=vehicle
name=Peterbilt p379 blue
(...)
Image[NW]=p379.0.5
Image[NE]=p379.0.6
Image[SW]=p379.0.7
---
obj=vehicle
name=Peterbilt p379 red
(...)
Image[NW]=p379.1.5
Image[NE]=p379.1.6
Image[SW]=p379.1.7
---
obj=vehicle
name=Peterbilt p379 green
(...)
Image[NW]=p379.2.5
Image[NE]=p379.2.6
Image[SW]=p379.2.7
---
obj=vehicle
name=Peterbilt p379 USA flag
(...)
Image[NW]=p379.8.5
Image[NE]=p379.8.6
Image[SW]=p379.8.7
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 16, 2015, 04:00:50 AM
finally managed to without giving the error in makeobj! But is giving this problem in the game to add to the folder.
(http://i.imgur.com/WPDzJVs.png)
(http://i.imgur.com/2O43k7O.png)
I did exactly recommended, but as the Ters said:
Quote from: Ters on August 05, 2015, 05:54:58 AM
The pak file is only made from the first row of images in the file posted.
how do I solve this problem?
Title: Re: Vehicle with a single color.
Post by: Ters on August 16, 2015, 08:16:41 AM
Quote from: sheldon_cooper on August 16, 2015, 04:00:50 AM
how do I solve this problem?

Change the row number for all vehicles but one, just as Václav shows. (Pay attention to the image lines.)
Title: Re: Vehicle with a single color.
Post by: Václav on August 16, 2015, 08:58:26 AM
Quote from: Ters on August 16, 2015, 08:16:41 AM
Quote from: sheldon_cooper on August 16, 2015, 04:00:50 AM
finally managed to without giving the error in makeobj!

But is giving this problem in the game to add to the folder.
(http://i.imgur.com/WPDzJVs.png)(http://i.imgur.com/2O43k7O.png)

I did exactly recommended, but as the Ters said: how do I solve this problem?

Change the row number for all vehicles but one, just as Václav shows. (Pay attention to the image lines.)
Thanks.

For better explanation, sheldon:

Blue
Image[direction]=file.0.x
Red
Image[direction]=file.1.x
Green
Image[direction]=file.2.x
Yellow
Image[direction]=file.3.x
Purple
Image[direction]=file.4.x
Black
Image[direction]=file.5.x
White
Image[direction]=file.6.x
Flames and smoke
Image[direction]=file.7.x
Flag
Image[direction]=file.8.x
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 16, 2015, 02:06:58 PM
My dat file I get this:
https://www.dropbox.com/s/0h5ure1tptwx23j/p379.dat?dl=0
Title: Re: Vehicle with a single color.
Post by: Václav on August 16, 2015, 08:42:58 PM
With size 4kb you coulkd attach it to post. dat is allowed type of file.
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 16, 2015, 09:34:22 PM
I did not know. :) but you managed to download? If so, dat is correct?
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 17, 2015, 03:02:27 AM
Finally I managed !!!  ;D ;D ;D
(http://i.imgur.com/qDo4K6V.png)
Now it's only align, and repeat this for the other vehicles.
thank you all !! :D
Title: Re: Vehicle with a single color.
Post by: Václav on August 17, 2015, 05:41:20 AM
Quote from: sheldon_cooper on August 16, 2015, 09:34:22 PM
I did not know. :) but you managed to download? If so, dat is correct?
Generally - but between each object must be line with three or more dashes.
Title: Re: Vehicle with a single color.
Post by: sheldon_cooper on August 23, 2015, 12:18:54 AM
Hello! After a busy week, I finished hit all the colors of the trucks, and make it appear the game. Thank you for your help!  :D
(http://i.imgur.com/vvSeFM2.png)