The International Simutrans Forum

 

Author Topic: Vehicle with a single color.  (Read 9372 times)

0 Members and 1 Guest are viewing this topic.

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Vehicle with a single color.
« 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.

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/

Offline Václav

  • Devotee
  • *
  • Posts: 3266
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Vehicle with a single color.
« Reply #1 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

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5520
  • Languages: EN, NO
Re: Vehicle with a single color.
« Reply #2 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.

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #3 on: August 06, 2015, 02:20:27 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! :)
You 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5520
  • Languages: EN, NO
Re: Vehicle with a single color.
« Reply #4 on: August 06, 2015, 04:35:51 AM »
I did what you said, and unfortunately the changes had no effect.

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.

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #5 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! ???
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:
You 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.
« Last Edit: August 07, 2015, 01:05:36 AM by sheldon_cooper »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5520
  • Languages: EN, NO
Re: Vehicle with a single color.
« Reply #6 on: August 07, 2015, 05:43:37 PM »
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).

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #7 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.
« Last Edit: August 08, 2015, 03:23:48 AM by sheldon_cooper »

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #8 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


then set up the dat according to the pictures


in cmd (DOS prompt), looks like this:



what am I doing wrong?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5520
  • Languages: EN, NO
Re: Vehicle with a single color.
« Reply #9 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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2890
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Vehicle with a single color.
« Reply #10 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):
Code: [Select]
(...)
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

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #11 on: August 11, 2015, 12:35:33 AM »
So I can use this image to use along with on dat?


Offline Václav

  • Devotee
  • *
  • Posts: 3266
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Vehicle with a single color.
« Reply #12 on: August 15, 2015, 05:54:34 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):

Code: [Select]
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

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #13 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:
The pak file is only made from the first row of images in the file posted.
how do I solve this problem?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5520
  • Languages: EN, NO
Re: Vehicle with a single color.
« Reply #14 on: August 16, 2015, 08:16:41 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.)

Offline Václav

  • Devotee
  • *
  • Posts: 3266
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Vehicle with a single color.
« Reply #15 on: August 16, 2015, 08:58:26 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

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #16 on: August 16, 2015, 02:06:58 PM »

Offline Václav

  • Devotee
  • *
  • Posts: 3266
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Vehicle with a single color.
« Reply #17 on: August 16, 2015, 08:42:58 PM »
With size 4kb you coulkd attach it to post. dat is allowed type of file.

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #18 on: August 16, 2015, 09:34:22 PM »
I did not know. :) but you managed to download? If so, dat is correct?

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #19 on: August 17, 2015, 03:02:27 AM »
Finally I managed !!!  ;D ;D ;D

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

Offline Václav

  • Devotee
  • *
  • Posts: 3266
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Vehicle with a single color.
« Reply #20 on: August 17, 2015, 05:41:20 AM »
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.

Offline sheldon_cooper

  • *
  • Posts: 177
  • Languages: PT,EN
Re: Vehicle with a single color.
« Reply #21 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