Ceci est une ancienne révision du document !
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 |
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 in straight views) 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 above.
Gear, given as percentage in .dat files, is used to modify vehicles'power. The real power of a vehicle in game, i.e. what fixes its ability to accelerate, is the product of power and gear.
real power = power * gear
When reproducing real life vehicles, real life power is used as in game power. However, this power might be unfit to the game so gear is used to adjust it.
Moreover, the power given by an engine is not exactly proportionnal to the acceleration of the vehicle, there are plenty of other parameters to take into account, especially when the power indicated for a real vehicle (an electric loc for example) is its consumed power and not its output power.
Example: a 800 kW powered vehicle is reproduced in game but this power does not fit, the vehicle is underpowered. Then a gear over 100 (1) is added, for instance 130 (1,30).
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) :
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][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.
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)
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 :
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 :
To have a concrete example we are going to make the front of the AGV (old version) :We are going to use the graphical pattern as above, since the AGV is a train, use the line “track/MLM”. Take it with precision on the pattern and paste it in a new picture “AGV.png”. This is this picture :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.
Remove the red shape and the text “track/tram”. Then, since the AGV front is 11 length, remove the length units in excess to have only 11 units. Since the pattern is made of greys, we can use the replace color tool of photofiltre.
It's easy to remove the units in excess playing on the tolerance.
Then to change the rest of the pattern in a united and visible color (to easily remove it once the vehicle is placed), use the magic wand tool with a tolerance of 0 on the background, invert the selection to have only the pattern, use red as second color, switch the selection antialiasing on none, and delete.
So we have a usable pattern for a track vehicle with a length of 11 :There's just left to place our AGV pictures as here :
Then, parts of the pattern in excess are removed with the replace color tool and this is the source picture :
Now let's make the .dat file of this AGV front ! Start by making the graphical part of the .dat file with the pattern seen above :
Replace names and lines, our picture is named AGV.png and the only line is line n° 0 (the first line) :
Then you just have to add AGV's datas. For constraints, the AGV front can be placed after nothing (for a convoy's front), after an AGV rear (for multiple units train), before a front pantograph can. This is the result :
As well, to make the cars of an electric multiple unit appear in the electric tab, write “engine_type=electric”.