JTraffic Screensaver



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


this line is equvalent with the following line:


Why then this complicated form ? One can select different parameter sets:


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 extend it too. Using the += characters the content will be added after the existing part of the parameter, -= means to insert it in the beginning of the existing parameter:


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


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

The #= means: the parameter will be set only if it wasn't set before (it gives a default value for the named parameter, but doesn't change it's value, if it is already given).

In which cases is it usefull to define the parameters in this way:

  • You want to select between more parameter sets, but they must remain together - for example, if the background is a big station, the train should stop at the end of the platform, if only a small house, it should stop before the station building - the corresponding [BG= ] and [P=] parameters must be selected together.
  • You can define macros for a complex background construct, and use it on several places.
  • The 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.
  • You can delegate a parameter set by the 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 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


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:


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 stokc list or into the timetable file too).

A similar idea:


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

  • if the movement is not defined (the 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.

  • The background picture will be extended by a station building. The building comes after the other background elements, but before the pathway will be generated - if a WE= ; parameter add 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

  • The stop position is this named position - the middle of the train will stop before the building. If the movement defines already a stop position, it won't be changed due to the #= mode of the P parameter setting, a new P= parameter will be defined only if there was no such parameter there before.

The Configuration Window
Program Window
Stock List
Description Editor
Graphic Testpad
Timetable Editor
Timetable Syntax and Semanics
The timetable header
Sections, Groups, Lines, Scenes
Stock List File