News:

SimuTranslator
Make Simutrans speak your language.

Vehicle that deals with several freights

Started by vilvoh, February 08, 2009, 12:56:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vilvoh

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

Escala Real...a blog about Simutrans in Spanish...

TommPa9

try this version:


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]

martin

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

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.

TommPa9

#3
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!

Zeno

I can confirm what martin says. You need one vehicle per freight category.
Mmmm... if I could mix categories in my freight planes... ::)

VS

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.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

sojo

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.
"English is a easy language. But not for me." ;) sojo

follow simutrans_de on Twitter
- A home for Simutrans (in german)

vilvoh

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:
Quote from: VS on February 08, 2009, 01:55:29 PM
[...] 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 *

Escala Real...a blog about Simutrans in Spanish...