Skip to content

Signals

Signal config

An .ini file — the signal config — describes which lenses a signal model has, where they are and what is lit for each aspect. It works the same way for the main route signals (svetofor*.dat) and for side signals (objects.dat objects: branch exit signals, dwarf, shunting and repeater signals).

Which aspect a signal shows is decided by the game: route branches, the scenario, the instructor screen, the multiplayer server. The config only says how that aspect looks on this model: which lenses are lit, in which colour, whether they flash.

A signal without a config is drawn as before: a main signal with the built-in heights, a side signal with a single light.

Where the config lives

The config is looked up by the record name in objects.ref, not by the model file name:

  1. <record name>.ini next to the .dmd of that record — only when the shared one does not fit: a route model whose lenses sit elsewhere;
  2. data\global\signals\<record name>.ini — shared configs;
  3. neither — built-in drawing.

The file found is a complete definition: the next level is not merged into it.

Why the record name: one model often carries different signals (sig_k5p and sig_k5m, sig_k3p and sig_k3m), and lens colours depend on the purpose. So identical signals under different names each get their own file. When a record is renamed, its .ini has to be renamed too; the Route Editor does it for you (see "Editing" below).

Format

Same as a locomotive config.ini: key=value, values separated by spaces, a line starting with ; is a comment.

Coordinates are metres in the signal model space: X — sideways (right in the travel direction), Y — along the track (the signal face looks towards −Y, at the approaching train), Z — up from the rail head.

Key Value
lens.<id>=X Y Z colour [size] [DistScale] A lens. <id> is any name (r, y1, w2…), any number of lenses. Colour: red, yellow, green, white, blue. Size multiplies the light (1). DistScale multiplies the distance to the lens that the light size depends on (0.75 for shunting signals)
aspect.<aspect>=<lights> What is lit for the aspect. Lights separated by spaces: <id> — the lens in its own colour, <id>:<colour> — the same lens in another colour, a trailing * — flashing. An empty value — nothing is lit
aspect.<aspect>=@<aspect> Show as another aspect
aspect.<aspect>[<flag>]=… Variant for the main signal flag (4th field of svetofor*.dat): used when the flag contains this text; of several matches, the longest wins. Case-sensitive
plate=X Y Z stepX stepY stepZ Name plate: the first sign at X Y Z, every next one a step further
strip=<object> X Y Z Body of the "P" strip (when the flag contains P)
route_indicator=<object> X Y Z Route indicator
offset=X Y Z [angle] Shift and rotation (degrees around Z) of the whole main signal from where the game places it: model, lenses, plate, strip, indicator. E.g. a head on an overhead line portal: offset=-2.5 0 3

Aspects

Name Code Meaning
off 0 off
red 1 red
yellow 2 yellow
green 3 green
green_clear 4 green, the next block is clear too
blue 5 blue (shunting, shunting forbidden)
white 11 white (calling-on; for a shunting signal — shunting allowed)
red_invite 12 red + flashing white
two_yellow 20 two yellows
two_yellow_flash 21 two yellows, the upper one flashing
yellow_flash 22 flashing yellow
two_yellow_strip 40 two yellows + green strip
green_flash_yellow_strip 41 flashing green + yellow + strip
green_flash_strip 42 flashing green
two_yellow_flash_strip 45 two yellows, the upper one flashing + strip

The code is used by event 82 (see Events).

An aspect missing from the config is replaced along this chain:

Missing Used instead
green_clear green
two_yellow_flash two_yellow
two_yellow yellow
yellow_flash green
two_yellow_strip, green_flash_yellow_strip two_yellow
two_yellow_flash_strip two_yellow_flash
green_flash_strip yellow_flash
red_invite, white, blue red

If nothing is found, the signal is dark.

Examples

A three-lens dwarf train signal: yellow on top, red in the middle, green at the bottom. For "two yellows" the bottom lens is lit yellow, for calling-on the top lens is lit white:

lens.y=0 0.004 1.287 yellow
lens.r=0 0.004 1.038 red
lens.g=0 0.004 0.791 green

aspect.off=
aspect.red=r
aspect.yellow=y
aspect.yellow_flash=y*
aspect.two_yellow=y g:yellow
aspect.green=g
aspect.white=y:white
aspect.red_invite=r y:white*

plate=-0.1 -0.03 0.25 0.25 0 0

Flag variants of the mast exit signal (data\global\signals\signal_exit.ini): with flag P the red light is lower, with G the top lens is added in green:

aspect.red[P]=r_p
aspect.green[G]=g y1:green

Ready configs for all the game's signals are in data\global\signals\ — a good starting point. Only configs of models whose lenses sit differently from the shared model remain next to route models.

A separate model for one main signal

The game picks a main signal model by its type in svetofor1.dat / svetofor2.dat: ab_line — signal_line (named 1 or 2 — signal_pred), ab_entr — signal_enter, ab_exit and ab_rout — signal_exit. To give one particular signal another model (a head on an overhead line portal, a bracket, etc.), add the objects.ref record name as the fifth field:

53  ab_exit Ч3  P   signal_exit_portal
87  ab_entr ЧА      signal_enter_portal

Fields are separated by tabs; without a flag its field stays empty (two tabs in a row). The model, plate, lights and offset come from the signal_exit_portal record and its config (signal_exit_portal.ini next to the model or in data\global\signals\), while the logic follows the type and flag as before. If there is no such record, the game uses the model for the type and writes an error to the log.

In the Route Editor this is the Model column of the Signals tab: an unknown record is shown as an error.

Shunting signals with train lenses

sig_k5m, sig_m3m, sig_m5m have both shunting (white, blue) and train lenses. By default the game shows only shunting aspects on them. They show a train proceed aspect when it is set explicitly: by event 82 with a code (e.g. НМ2*20) or by the multiplayer server. The config describes all lenses.

Editing

Configs are edited in the Route Editor, Objects Library tab: select the signal record, the Signal config section in the right panel.

  • Shows where the config comes from: next to the model, shared from data\global\signals (editing it changes the signal on every route), or none.
  • Create config — make the record's own config: empty or as a copy of an existing one. The file goes where the game looks for it: next to the model for a route record, into data\global\signals for a shared record.
  • If a route record shows a shared config, the first edit asks: Local copy — the edit goes into the record's own copy next to the model and changes the signal on this route only; Shared — edit the shared config, the signal changes on every route.
  • The text is edited as is. Every edit is checked right away by the same rules the game uses; errors are shown with line numbers.
  • Preview: aspect (Aspect), flag (Flag) and caption (Caption). The model shows the signal as in the game: lights in the lenses, flashing ones blink, a plate with the caption, the strip, the indicator. Unlit lenses are marked with a ring and their name.
  • Saved together with the tab (Ctrl+S); the previous file goes to the backup.
  • Renaming a record, Move files... and installing a record from another route carry its config along.

In the game the configs are reloaded with F5 (together with the locomotive config), without a restart. The screen shows how many files were read and how many had errors; the errors with line numbers go to the error log.