Traductions possibles :
  • English
  • Français (French)

Ceci est une ancienne révision du document !


Vehicles

Graphics

A vehicle's picture needs eight pictures : one for each direction of the vehicle (North, North-East, East, South-East, South, etc …). Symmetrical vehicles would have same pictures twice (same North and South for example). Vehicles can have different length : each length unit is four pixels in Noth, South, East and West pictures. For diagonal pictures it's a decimal number so the two extremities of the pattern chosen for a defined length will be on each other. This is the graphical pattern :

The default length is 8 (32 pixels) if you don't define it in the .dat file. On this pattern, each length is made of a different grey, to use this pattern, take the necessary line according to the way type, delete, thanks to replace color tool and playing on the tolerance, the greys until the right length of the vehicle. The pink unit is the default length (8). The light grey is the front of the vehicle. The background of this picture is the trensparency color for Simutrans. For suspended monorails, the pattern doesn't show the base of the vehicle but its roof.

This is the .dat pattern according to the graphical pattern for a vehicle or the empty graphic of a vehicle : (x = number of the line, name = name of the source picture witheout .png extension)

EmptyImage[S]=name.x.2
EmptyImage[E]=name.x.0
EmptyImage[SE]=name.x.1
EmptyImage[NE]=name.x.3
EmptyImage[N]=name.x.4
EmptyImage[W]=name.x.6
EmptyImage[NW]=name.x.5
EmptyImage[SW]=name.x.7

Essential parameters

This is the parameters for a vehicle :

Parameter
Description Content
Example
obj object type vehicle
name name text SNFOS_Aero_front
waytype way type internal name maglev_track
cost price (*100c) number 5000000
weight weight (t) number 35
runningcost running cost (0,01c/km) number 90
engine_type energy used internal name fuel_cell
speed max speed (km/h) number 550
freight freight content internal name Passagiere
payload quantity of content number 65
power power (kw) number 4200
gear gear (*0,01) number 100
intro_year introduction year number 2019
intro_month introduction month number 11
retire_year retire year number 2039
retire_month retire month number 11
smoke smoke internal name steam
sound sound at starting see below 0
length length of the vehicle number 8
copyright name of the creator text Gauthier
Constraint see below

waytype

engine_type

freight

gear

The gear allows to keep the real power of a vehicle and then multiply it in the game so the vehicle can be used normaly.

ingame power = power

Example : if a 800 kw powered vehicle is reproduces but this power isn't sufficiant for the vehicle to be used, a gear > 100 (1) is added, for example 130 (1,30).

smoke

sound

Constraint

This parameter defines which vehicle can be placed before and which vehicle can be placed after a vehicle. If it's not defined, the vehicle can be placed before or after any vehicle witheout constraints.

There's one possible vehicle per line, a constraint line is written as this (example) :

Constraint[Prev][0]=none

Prev : vehicle can be placed before

Next : vehicle can be placed after

0,1,2,3,… : it's necessary to order constraints Prev and Next by giving them a number, example :

Constraint[Prev][0]=vehicle1

Constraint[Prev][1]=vehicle2

Constraint[Prev][2]=vehicle3

Constraint[Next][0]=vehicle4

The content can be the name of a vehicle (the name of the paramter “name” of the chosen vehicle) or “none” so nothing can be put before or after the vehicle. “none” must be placed at the last in Prev or Next constraints, makeobj stops reading them when it reads “none”, if vehicles are placed after, they won't be cared. If a vehicle has not a “none” it will be necessary to place a vehicle before or after.

For a vehicle to be put after another, the first vehicle must be in Constraint[Prev] of the second one which must be in the constraint[Next] of the first one.

Example of constraint (SNCF_z22500_ZRBx_front)

Constraint[Prev][0]=SNCF_z22500_ZRBx_rear
Constraint[Prev][1]=none
Constraint[Next][0]=SNCF_z22500_ZBx_ZAB

Vehicle with freight images

Some vehicles, almost freight ones, have a different picture when they are empty or loaded. This is the necessary parameters, for example with two different freight images for two different goods :

freightimagetype[0]=good1
freightimagetype[1]=good2


freightimage[0][S]=image.x.2
freightimage[0][E]=image.x.0
freightimage[0][SE]=image.x.1
freightimage[0][SW]=image.x.3
freightimage[0][N]=image.x.4
freightimage[0][W]=image.x.6
freightimage[0][NW]=image.x.5
freightimage[0][NE]=image.x.7


freightimage[1][S]=image.x².2
freightimage[1][E]=image.x².0
freightimage[1][SE]=image.x².1
freightimage[1][SW]=image.x².3
freightimage[1][N]=image.x².4
freightimage[1][W]=image.x².6
freightimage[1][NW]=image.x².5
freightimage[1][NE]=image.x².7

First goods are defined using their internal names. The used number is put in brackets. Then the graphical pattern of the base picture of a vehicle can be used here if you use freightimage[n°] instead of EmptyImage. In the example below, freightimage[0] are for the vehicle loaded with good1 and freightimage[1] is for the vehicle loaded with good2. x and x² are the number of the lines of these pictures.

Example with bullk wagons of Cirrus :

EmptyImage[S]=cirrus.8.2
EmptyImage[E]=cirrus.8.0
EmptyImage[SE]=cirrus.8.1
EmptyImage[SW]=cirrus.8.3
EmptyImage[N]=cirrus.8.4
EmptyImage[W]=cirrus.8.6
EmptyImage[NW]=cirrus.8.5
EmptyImage[NE]=cirrus.8.7
freightimagetype[0]=Kohle
freightimagetype[1]=Eisenerz
freightimagetype[2]=Stone
freightimagetype[3]=Sand
freightimagetype[4]=fertilizer
freightimagetype[5]=waste
freightimage[0][S]=cirrus.11.2
freightimage[0][E]=cirrus.11.0
freightimage[0][SE]=cirrus.11.1
freightimage[0][SW]=cirrus.11.3
freightimage[0][N]=cirrus.11.4
freightimage[0][W]=cirrus.11.6
freightimage[0][NW]=cirrus.11.5
freightimage[0][NE]=cirrus.11.7
freightimage[1][S]=cirrus.9.2
freightimage[1][E]=cirrus.9.0
freightimage[1][SE]=cirrus.9.1
freightimage[1][SW]=cirrus.9.3
freightimage[1][N]=cirrus.9.4
freightimage[1][W]=cirrus.9.6
freightimage[1][NW]=cirrus.9.5
freightimage[1][NE]=cirrus.9.7
freightimage[2][S]=cirrus.12.2
freightimage[2][E]=cirrus.12.0
freightimage[2][SE]=cirrus.12.1
freightimage[2][SW]=cirrus.12.3
freightimage[2][N]=cirrus.12.4
freightimage[2][W]=cirrus.12.6
freightimage[2][NW]=cirrus.12.5
freightimage[2][NE]=cirrus.12.7
freightimage[3][S]=cirrus.10.2
freightimage[3][E]=cirrus.10.0
freightimage[3][SE]=cirrus.10.1
freightimage[3][SW]=cirrus.10.3
freightimage[3][N]=cirrus.10.4
freightimage[3][W]=cirrus.10.6
freightimage[3][NW]=cirrus.10.5
freightimage[3][NE]=cirrus.10.7
freightimage[4][S]=cirrus.10.2
freightimage[4][E]=cirrus.10.0
freightimage[4][SE]=cirrus.10.1
freightimage[4][SW]=cirrus.10.3
freightimage[4][N]=cirrus.10.4
freightimage[4][W]=cirrus.10.6
freightimage[4][NW]=cirrus.10.5
freightimage[4][NE]=cirrus.10.7
freightimage[5][S]=cirrus.11.2
freightimage[5][E]=cirrus.11.0
freightimage[5][SE]=cirrus.11.1
freightimage[5][SW]=cirrus.11.3
freightimage[5][N]=cirrus.11.4
freightimage[5][W]=cirrus.11.6
freightimage[5][NW]=cirrus.11.5
freightimage[5][NE]=cirrus.11.7

Un véhicule pas à pas

Comme exemple concret nous allons refaire l'avant de l'AGV donc voici les graphismes :Nous allons utiliser la trame graphique donnée plus haut, l'AGV étant un train nous utiliserons la ligne “track/MLM”. Prenez-là avec prcision sur la trame et faites-en une nouvelle image “AGV.png”. Voici donc cette image :Supprimez le cadre rouge et le texte “track/MLM”. Ensuite sachant que l'avant d'AGV a une longueur de 11, supprimons les longueurs en trop pour n'avoir que 11 longueurs. Etant donné que la trame est faite à partir de niveaux de gris, on peut utiliser l'outil de remplacement de couleur de photofiltre.

En jouant sur la tolérence on supprime facilement les carrés en trop.

Ensuite afin de changer le reste de la trame en une couleur unie et repérable (pour la supprimer facilement une fois le véhicule placé), on utilise l'outil baguette magique avec tolérance 0 sur le fond, on inverse la sélection pour n'avoir dedans que la trame, après avoir mis du rouge en couleur secondaire on supprime, en s'étant assuré d'avoir supprimé le lissage des sélections.

On obtient ainsi une trame exploitable pour un véhicule ferroviaire de longueur 11 :Il ne reste plus qu'à placer nos images d'AGV comme ceci :

Bien sûr ici j'ai utilisé la transparence pour que voyez où placer le véhicule exactement mais il ne faudra pas l'utiliser pour placer vos images.

Ensuite on supprimer les morceaux de trame en trop avec l'outil remplacer les couleurs et voila l'image source :

Ici on n'a une image avec une seule ligne car l'exercice ne concerne qu'un seul véhicule, mais l'image source de l'AGV contient cinq lignes en réalité. On peut mettre autant de lignes qu'on veut tant que l'ordinateur peut gérer l'image en entier. L'image du cirrus fait 53 lignes par exemple.

Attaquons maintenant au .dat de cet avant d'AGV ! Pour commencer mettons la partie graphique du .dat à partir de la trame vue plus haut :

EmptyImage[S]=nom.x.2
EmptyImage[E]=nom.x.0
EmptyImage[SE]=nom.x.1
EmptyImage[NE]=nom.x.3
EmptyImage[N]=nom.x.4
EmptyImage[W]=nom.x.6
EmptyImage[NW]=nom.x.5
EmptyImage[SW]=nom.x.7

Faisons les remplacements adéquats sachant que notre image se nomme AGV.png et que la ligne de l'avant est la ligne n° 0 (la première ligne) :

EmptyImage[S]=AGV.0.2
EmptyImage[E]=AGV.0.0
EmptyImage[SE]=AGV.0.1
EmptyImage[NE]=AGV.0.3
EmptyImage[N]=AGV.0.4
EmptyImage[W]=AGV.0.6
EmptyImage[NW]=AGV.0.5
EmptyImage[SW]=AGV.0.7

Ensuite il suffit d'ajouter les données de l'AGV. Pour les constraints on sait que l'avant d'AGV doit pouvoir se placer derrière rien (pour un avant de convoi), derrière un arrière d'AGV (pour les unités multiples), on doit pouvoir placer derrière cet avant d'AGV une voiture à pantographe avant. Voila le résultat final :

obj=vehicle
name=Alstom_AGV_front
waytype=track
length=11
payload=40
speed=360
power=1520
gear=230
cost=14050000
weight=41
runningcost=160
copyright=Gauthier
intro_year=2011
intro_month=1
engine_type=electric
freight=Passagiere
Constraint[Prev][0]=Alstom_AGV_rear
Constraint[Prev][1]=none
Constraint[Next][0]=Alstom_AGV_frontcar
EmptyImage[S]=AGV.0.2
EmptyImage[E]=AGV.0.0
EmptyImage[SE]=AGV.0.1
EmptyImage[NE]=AGV.0.3
EmptyImage[N]=AGV.0.4
EmptyImage[W]=AGV.0.6
EmptyImage[NW]=AGV.0.5
EmptyImage[SW]=AGV.0.7
Pour faire apparaitre la motrice d'un train bloc (comme le TGV par exemple) dans l'onglet des trains de passagers, mettez freight=passagiere.