<ParamsToAdd>

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


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

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

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;],BGBASE
Using 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

Last edited: 2023-04-24 18:16:18