News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Vehicle with a single color.

Started by sheldon_cooper, August 05, 2015, 03:19:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sheldon_cooper

Hello! Recently I downloaded two files, one pak, and the other dat, this is an American Pak128 truck found in the old forum.

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 :

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/

Václav

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

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

Ters

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.

sheldon_cooper

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.

Ters

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.

sheldon_cooper

#5
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.

Ters

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).

sheldon_cooper

#7
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.

sheldon_cooper

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


then set up the dat according to the pictures


in cmd (DOS prompt), looks like this:



what am I doing wrong?

Ters

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.

An_dz

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


Václav

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

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

sheldon_cooper

finally managed to without giving the error in makeobj! But is giving this problem in the game to add to the folder.


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?

Ters

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.)

Václav

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.


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

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní


Václav

With size 4kb you coulkd attach it to post. dat is allowed type of file.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

sheldon_cooper

I did not know. :) but you managed to download? If so, dat is correct?

sheldon_cooper

Finally I managed !!!  ;D ;D ;D

Now it's only align, and repeat this for the other vehicles.
thank you all !! :D

Václav

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.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

sheldon_cooper

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