The International Simutrans Forum

Community => Simutrans Gaming Discussion => Topic started by: vilvoh on February 08, 2009, 12:56:35 pm

Title: Vehicle that deals with several freights
Post by: vilvoh 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?
Title: Re: Vehicle that deals with several freights
Post by: TommPa9 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]
Title: Re: Vehicle that deals with several freights
Post by: martin 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.
Title: Re: Vehicle that deals with several freights
Post by: TommPa9 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 gl****es!
Title: Re: Vehicle that deals with several freights
Post by: Zeno 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... ::)
Title: Re: Vehicle that deals with several freights
Post by: VS 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.
Title: Re: Vehicle that deals with several freights
Post by: sojo 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.
Title: Re: Vehicle that deals with several freights
Post by: vilvoh 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 *