Vehicle constants

Scheduled maintenance pending. The forum will be closed at 4 o'clock a.m.
  • Vehicle constants offer the opportunity, additionally to repaints, car number and modules, to set up special properties of a vehicle. The player can choose the value of the constants when he creates his train and the map creator can set them up in his AI lists.

    1 Types

    Vehicle constants can be of the kinds Boolean, Integer, Float and String. Additionally, ordinal types can be defined. Those are internally integer constants, but are not used as numbers, but as names - for example "red", "yellow", "green" or "north", "east", "south", "west".

    2 Setup

    2.1 Script variables

    Every vehicle constant has to be linked to a script variable. Therefore, the script variable has to be declared in the public vars section. The type can be boolean, integer, single or string.

    Setting up vehicle constants

    The setup of vehicle constants can be accomplished in the object & vehicle tool, section "manufactor, description, ..." and the control "vehicle constants":



    With "Add", an unlimited amount constants can be created. Delete them with the proper button in the proper row.


    The "name" is the language ID of the constant-name, which is shown to the player (see https://www.lotus-simulator.de…zeug-hints/#1-Allgemeines ). "Linked variable" is the linked variable, that should be assigned the player-chosen value.


    On integer variables, a bigger text field is displayed besides the type. If the variable should be interpreted ordinal, the name strings can be entered here. Those are language IDs, as well!


    At the right, the minimum, maximum and default value can be set. Minimum and maximum for integer and float, only, of course.

    3 Additional initialize procedure

    To enable the script to react to the player-given values, LOTUS once calls the procedure InitializeAfterConstSet right after assigning the values to the variables.