The International Simutrans Forum

 

Author Topic: Vehicle that deals with several freights  (Read 3406 times)

0 Members and 1 Guest are viewing this topic.

Offline vilvoh

  • One of the good guys
  • Administrator (Inactive)
  • *
  • Posts: 4504
  • I'm the constructor, the architect
    • Escala real
Vehicle that deals with several freights
« on: February 08, 2009, 12:56:35 PM »
I'm developing a truck for transporting coal, iron ore and steel. The first two goods are from category 2 and steel is from category 0. I'm using this dat...
Code: [Select]
obj=vehicle
name=Studebaker Proto-Truck
copyright=vilvoh
waytype=road
freight=Eisenerz
payload=15
speed=84
cost=514500
weight=3
power=136
gear=90
smoke=Diesel
engine_type=diesel
RunningCost=467
sound=1
intro_year=1963
retire_year=1986
Constraint[Prev][0]=none
EmptyImage[S]=stdb_a.0.0
EmptyImage[SE]=stdb_a.0.4
EmptyImage[E]=stdb_a.0.2
EmptyImage[NE]=stdb_a.0.6
EmptyImage[N]=stdb_a.0.1
EmptyImage[NW]=stdb_a.0.5
EmptyImage[W]=stdb_a.0.3
EmptyImage[SW]=stdb_a.0.7
## Iron ore
freightimagetype[1]=Eisenerz
FreightImage[1][S]=stdb_a.2.0
FreightImage[1][SE]=stdb_a.2.4
FreightImage[1][E]=stdb_a.2.2
FreightImage[1][NE]=stdb_a.2.6
FreightImage[1][N]=stdb_a.2.1
FreightImage[1][NW]=stdb_a.2.5
FreightImage[1][W]=stdb_a.2.3
FreightImage[1][SW]=stdb_a.2.7
## Coal
freightimagetype[2]=Kohle
FreightImage[2][S]=stdb_a.2.0
FreightImage[2][SE]=stdb_a.2.4
FreightImage[2][E]=stdb_a.2.2
FreightImage[2][NE]=stdb_a.2.6
FreightImage[2][N]=stdb_a.2.1
FreightImage[2][NW]=stdb_a.2.5
FreightImage[2][W]=stdb_a.2.3
FreightImage[2][SW]=stdb_a.2.7
## Steel
freightimagetype[3]=Stahl
FreightImage[3][S]=stdb_a.1.0
FreightImage[3][SE]=stdb_a.1.4
FreightImage[3][E]=stdb_a.1.2
FreightImage[3][NE]=stdb_a.1.6
FreightImage[3][N]=stdb_a.1.1
FreightImage[3][NW]=stdb_a.1.5
FreightImage[3][W]=stdb_a.1.3
FreightImage[3][SW]=stdb_a.1.

...and it doesn't seem to work. The game engine considers it as a vehicle that only can transport steel (Stahl) but when I put it a coal service line, it simply do not load any coal(Kohle). Is it possible to have a vehicle that may deal with several freights from different categories?

Offline TommPa9

  • Devotee
  • *
  • Posts: 2005
  • PAK128-CZ Grafik
  • Languages: CZ, DE, EN
Re: Vehicle that deals with several freights
« Reply #1 on: February 08, 2009, 01:01:48 PM »
try this version:

Code: [Select]
obj=vehicle
name=Studebaker Proto-Truck
copyright=vilvoh
waytype=road
freight=Eisenerz
payload=15
speed=84
cost=514500
weight=3
power=136
gear=90
smoke=Diesel
engine_type=diesel
RunningCost=467
sound=1
intro_year=1963
retire_year=1986
Constraint[Prev][0]=none
EmptyImage[S]=stdb_a.0.0
EmptyImage[SE]=stdb_a.0.4
EmptyImage[E]=stdb_a.0.2
EmptyImage[NE]=stdb_a.0.6
EmptyImage[N]=stdb_a.0.1
EmptyImage[NW]=stdb_a.0.5
EmptyImage[W]=stdb_a.0.3
EmptyImage[SW]=stdb_a.0.7
## Iron ore
freightimagetype[1]=Eisenerz
FreightImage[1][S]=stdb_a.2.0
FreightImage[1][SE]=stdb_a.2.4
FreightImage[1][E]=stdb_a.2.2
FreightImage[1][NE]=stdb_a.2.6
FreightImage[1][N]=stdb_a.2.1
FreightImage[1][NW]=stdb_a.2.5
FreightImage[1][W]=stdb_a.2.3
FreightImage[1][SW]=stdb_a.2.7
## Coal
freightimagetype[2]=Kohle
FreightImage[2][S]=stdb_a.2.0
FreightImage[2][SE]=stdb_a.2.4
FreightImage[2][E]=stdb_a.2.2
FreightImage[2][NE]=stdb_a.2.6
FreightImage[2][N]=stdb_a.2.1
FreightImage[2][NW]=stdb_a.2.5
FreightImage[2][W]=stdb_a.2.3
FreightImage[2][SW]=stdb_a.2.7
## Steel
freightimagetype[3]=Stahl
FreightImage[3][S]=stdb_a.1.0
FreightImage[3][SE]=stdb_a.1.4
FreightImage[3][E]=stdb_a.1.2
FreightImage[3][NE]=stdb_a.1.6
FreightImage[3][N]=stdb_a.1.1
FreightImage[3][NW]=stdb_a.1.5
FreightImage[3][W]=stdb_a.1.3
FreightImage[3][SW]=stdb_a.1.7

i have forget "7" in FreightImage[3][SW]

Offline martin

  • Web Team
  • Devotee
  • *
  • Posts: 66
  • Languages: EN, NL, DE
Re: Vehicle that deals with several freights
« Reply #2 on: February 08, 2009, 01:20:47 PM »
As far as I know you can have multiple types of freight (using 'freightimagetype[ x ]=") within the same goodscategory (based on "freight=") like in your dat file. But when you want to reuse the same images for vehicles to transport goods from a different category you'll have create a whole new object in your dat file....
Code: [Select]
obj=vehicle
name=Studebaker Proto-Truck
copyright=vilvoh
waytype=road
freight=Eisenerz
payload=15
speed=84
cost=514500
weight=3
power=136
gear=90
smoke=Diesel
engine_type=diesel
RunningCost=467
sound=1
intro_year=1963
retire_year=1986
Constraint[Prev][0]=none
EmptyImage[S]=stdb_a.0.0
EmptyImage[SE]=stdb_a.0.4
EmptyImage[E]=stdb_a.0.2
EmptyImage[NE]=stdb_a.0.6
EmptyImage[N]=stdb_a.0.1
EmptyImage[NW]=stdb_a.0.5
EmptyImage[W]=stdb_a.0.3
EmptyImage[SW]=stdb_a.0.7
## Iron ore
freightimagetype[1]=Eisenerz
FreightImage[1][S]=stdb_a.2.0
FreightImage[1][SE]=stdb_a.2.4
FreightImage[1][E]=stdb_a.2.2
FreightImage[1][NE]=stdb_a.2.6
FreightImage[1][N]=stdb_a.2.1
FreightImage[1][NW]=stdb_a.2.5
FreightImage[1][W]=stdb_a.2.3
FreightImage[1][SW]=stdb_a.2.7
## Coal
freightimagetype[2]=Kohle
FreightImage[2][S]=stdb_a.2.0
FreightImage[2][SE]=stdb_a.2.4
FreightImage[2][E]=stdb_a.2.2
FreightImage[2][NE]=stdb_a.2.6
FreightImage[2][N]=stdb_a.2.1
FreightImage[2][NW]=stdb_a.2.5
FreightImage[2][W]=stdb_a.2.3
FreightImage[2][SW]=stdb_a.2.7

## // Martin //  Changes from here
## don't remove the next line, it is used as separator...
-------------------------------
obj=vehicle
name=Studebaker Steel_Proto-Truck
copyright=vilvoh
waytype=road
freight=Stahl
payload=15
speed=84
cost=514500
weight=3
power=136
gear=90
smoke=Diesel
engine_type=diesel
RunningCost=467
sound=1
intro_year=1963
retire_year=1986
## Empty
Constraint[Prev][0]=none
EmptyImage[S]=stdb_a.0.0
EmptyImage[SE]=stdb_a.0.4
EmptyImage[E]=stdb_a.0.2
EmptyImage[NE]=stdb_a.0.6
EmptyImage[N]=stdb_a.0.1
EmptyImage[NW]=stdb_a.0.5
EmptyImage[W]=stdb_a.0.3
EmptyImage[SW]=stdb_a.0.7
## Steel
FreightImage[S]=stdb_a.1.0
FreightImage[SE]=stdb_a.1.4
FreightImage[E]=stdb_a.1.2
FreightImage[NE]=stdb_a.1.6
FreightImage[N]=stdb_a.1.1
FreightImage[NW]=stdb_a.1.5
FreightImage[W]=stdb_a.1.3
FreightImage[SW]=stdb_a.1.

Offline TommPa9

  • Devotee
  • *
  • Posts: 2005
  • PAK128-CZ Grafik
  • Languages: CZ, DE, EN
Re: Vehicle that deals with several freights
« Reply #3 on: February 08, 2009, 01:27:46 PM »
i don't know, but Freightimagetype[X]=yyyyyyy muss here been. Try compilate it.


oh! I'm sorry! It's stahl not sand!! I muss buy me any glasses!
« Last Edit: February 08, 2009, 01:32:29 PM by TommPa9 »

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Vehicle that deals with several freights
« Reply #4 on: February 08, 2009, 01:44:10 PM »
I can confirm what martin says. You need one vehicle per freight category.
Mmmm... if I could mix categories in my freight planes... ::)

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Vehicle that deals with several freights
« Reply #5 on: February 08, 2009, 01:55:29 PM »
What Martin said. Freight=? and that's it.

In 128 is at least one truck where one of the alternate loads is milk instead of bulk and the load part of image is just filled with one colour, so that adding new varieties later can be done quickly by filing that blob with texture and shading. And it does not show as carrying milk, and the milk freightimage never shows.

-> you just replicated that setting 1:1, adding into the pak "hidden" graphics with steel.

Offline sojo

  • Devotees (Inactive)
  • *
  • Posts: 851
  • Maintainer pak96.comic
    • German home of Simutrans
Re: Vehicle that deals with several freights
« Reply #6 on: February 08, 2009, 03:19:32 PM »
I had the same problem. And I have found why it not work. You have to use for the first good 0, than 1 and so one.

Offline vilvoh

  • One of the good guys
  • Administrator (Inactive)
  • *
  • Posts: 4504
  • I'm the constructor, the architect
    • Escala real
Re: Vehicle that deals with several freights
« Reply #7 on: February 08, 2009, 09:09:44 PM »
Thanks to all for the replies..Martin and Zeno were right, and VS has pointed out what seems strange to me when I mixed both categories:
[...] And it does not show as carrying milk, and the milk freightimage never shows.

In my case, it doesn't show the steel freightimage.

* now, vilvoh starts packing the object *