<ParamsToAdd> == <ParRep> || <ParamsToAdd> , <ParRep> || <ParamsToAdd> <ParRep> <ParRep> == <ParSel> || <RepeatCount> * <ParSelOrParAdd> || <RepeatCount> @ <ParSelOrParAdd> <ParSelOrParAdd> == <ParAdd> || <ParSel> <ParSel> == <ParChoice> | <ParChoice> || <ParSel> | <ParChoice> <ParChoice> == <ParAdd> || <Probability> : <ParAdd> <ParAdd> == [ <ParName> <AddMode> <ParamValue> ] || ( <ParamsToAdd> ) || <MacroName> <ParName> == <Name> <AddMode> == = || += || -= || #= <MacroName> == <Name> <ParamValue> == ... follows the syntax of the Parameter <ParName> <Probability> == <Simple> <RepeatCount> == <Integer>
<ParamsToAdd> parameter is a list of other parameters, which will be added to the actual set of parameters.
The simplest example (even if it has no advantage in this form):
M=STOP;C=NS_DE2R;AP=[BG=TREE1];
this line is equivalent with the following line:
M=STOP;C=NS_DE2R;BG=TREE1;
Why then this complicated form ? One can select different parameter sets:
M=STOP;C=NS_DE2R;AP=[BG=TREE1]|[FG=TREE2];
either TREE1 stays in the background, or TREE2 stays in the foreground.
This type of parameter can not only set (or replace, if was already set) a parameter, but it can, for example, extend it too
= means the content will reaplace the previous content - regardless of whether the parameter already had any content.+= means the content will be added after the existing part of the parameter (or set, if the parameter was unset/empty).-= means to insert it in the beginning of the existing parameter<= means to insert the new value before the insertion point.>= means to insert the new value after the insertion point.#= means to set the parameter only, when it is empty - it is not yet defined, or set to the empty string. This gives a possibility to set a default value for the parameter./= means to set the parameter only, if the new value is not empty. The insertion point is marked by @@ (by two at characters).
In case of a foreground / background definition the insertion point is a usefull possibility
to insert something directly in front of or behind the railway track.
The insertion point - toe @@ mark - will be skipped, automaticlly removed,
when analizing the parameter value.
M=STOP;C=NS_DE2R;BG=(M_STATION1:40;);AP=[BG=-TREE1:40-20;];
this line places the tree behind the station building,
as the parameter will be inserted before the existing part,
the resulting background definition will be BG=(TREE1:40-20;M_STATION1:40;);
M=STOP;C=NS_DE2R;BG=(M_STATION1:40;);AP=[BG=+TREE1:40-20;];
this line places the tree before the station building,
as the parameter will be inserted after the existing part,
the resulting background definition will be BG=(M_STATION1:40;TREE1:40-20;);
If you manipulate the foreground or background definition, it is a good practice always to close the background parts with a semicolon, even the last one. Maybe you will add one more part to the definition sometimes ...
In which cases is it usefull to define the parameters as <ParamsToAdd>
(using the AP= ; AP2= ; ENV=; parameters, or the WR= ; WE= ; WT= ; WL= ; WA= ; WM= ; parameters).
[BG= ] and [P=] parameters must be selected together.WR= ; WE= ; WA= ; WT= ; parameters define the parameter sets used only in that case the vehicles need a rail ( WR= ; ), a rail and a catenary ( WE= ; ) etc. This way you can define, for example, your own catenary, and let it show only, if the train is pulled by an electric engine. Of course, you can set the catenary in each individual movement line too, but setting the WE= ; parameter in the enclosing $SECTION command is easier, and in the case you want to modify the catenary definition you do not need to edit all the occurances in the movements, only the macro definition.ENV= ; parameter to all lines enclosed in a section - mostly to use common foreground and background elements.The syntax allows even the repetition for the addition parameters. Of course there is no use for a simple setting, setting the train speed 3 times is not stronger, as setting it only a single time. But repeating a background/foreground element, which is placed on a random position is usefull.
Look at the following macro definition:
$DEF BGBASE=[BG-=SKY02:..;TRBED5:..,^0;] $DEF TREE_SUMMER=TREE1|TREE3|TREE3A|TREE3B|TREE3C|TREE3D|TREE4|TREE4A|TREE4B|TREE4C|TREE4D|TREE4E|TREE5A|TREE5G|TREE5H $DEF TREES_SUMMER=0-10*20,10*(TREE_SUMMER,0-10*20) $DEF BG_SUMMER=1:0|2:1|3:2|4:3|6:4|4:5|3:6|2:7|1:8*[BG-=TREES_SUMMER:*+0-400;],[BG-=BG_GRAS1:..,-12;],BGBASEUsing the parameter
AP=BG_SUMMER;
in a movement or a segmentation command you will get a variable background -
a blue sky, some trees or even a forest, and gras below the trackbed.
The last macro repeats 0-8 times the [BG-=TREES_SUMMER:*+0-400;] part of the definition,
which itself is a repetition of 10 trees placed direct near each other or to a distance of 20 - 200 pixels.
Another example: freight trains running from left to right should be loaded with coal, in the other direction the wagons should be empty. You can use the parameter:
AP=[D=R]|[D=L][C-=[!E]];
Many loaded wagons has the modifier [E!BT: ... ] in the stock list:
if the E condition is defined,
the load will be removed (replaced by a transparent block).
The AP= ; parameter selects the running direction,
but together with the running direction it inserts the condition
as a global modifier into the train definition -
all the wagons will get the E condition,
and remove their loads (of course, you should compose the trains
only from such wagons having this modifier -
or, you can insert it yourself into the stock list or into the timetable file too).
A similar idea:
AP=|[M#=STOP][BG+=M_STATION1|CSD_STATION1|GUMPENRIEDASBACH:(20-80)+0=STATION;][P#=*STATION];
In the 50% of the cases there will be nothing - the leading | means a selection with an empty left part.
If the right part is selected, then
M=SIMPLE; is the default movement), it will be changed to M=STOP; If a movement already explicitely defined, it remains unchanged. So, shunting actions won't be disturbed, but the simple run through movement will be changed for stopping before the station building. If you want to let some trains run through (express trains or freight trains), you should insert the M=SIMPLE; movement parameter explicitely into the movement lines, in that case this additional parameter won't change the existing movement type.WE= ; parameter adds some catenary elemnets to the background definitions, they will follow the station building (resulting in a catenary piller staying before the station building, not behind it). The position of the station building is between 20% and 80% of the screen width, and this position is named STATION#= mode of the P parameter setting, a new P= parameter will be defined only if there was no such parameter there before.