Controls container
From TrainzOnline
The controls container is a top-level config.txt file entry used by controlset assets.
Contents |
Supported Tags
The controls container is a list of control subcontainers with no standalone tags. Each control subcontainer uses the following format.
name-token "" desc-token "" event "" default-keys "" context "" reassignable 1 trigger-on-up 0 trigger-on-down 1 trigger-on-held 1 trigger-mode-analog 0
name-token
- Type: text
- Desc: The name of a string table entry with the user visible name of the control in it. This string table entry will be used in the Trainz user interface to refer to the control. It should be very short.
desc-token
- Type: text
- Desc: The name of a string table entry with the user visible description of the control in it. This string table entry will be used in the Trainz user interface to give detail to the user about the control. It should be fairly short. Optional.
event
- Type: string
- Desc: The name of the event to trigger when the control is triggered. A script message of the format ("ControlSet", <event>) will be posted to any linked library or interior asset (library/interior assets can specify a control set using the "controlset" tag). If the 'trigger-on-up' tag is set to true 'Message.minor' will be set to "<event>-up" when the key is released.
default-keys
- Type: string
- Desc: A comma separated list of the default key binds to map to this control. If multiple keys are required for a single bind, separate them with a space, e.g. "shift n".
- Note: Trainz will only automatically map default key bindings for builtin content. Nonetheless, it is recommended that content creators use this field to provide "suggested" default bindings where appropriate.
context
- Type: context-list (game-context.txt)
- Desc: A semicolon separated list of contexts under which the control should be active, as follows:
- menu - Key will activate in any of the in-game menu screens (e.g. the Routes menu)
- railyard - Key will activate in Railyard
- surveyor - Key will activate in Surveyor, regardless of active tools
- surveyor-topology - Key will activate in Surveyor while in topology editing mode
- surveyor-paint - Key will activate in Surveyor while in terrain painting mode
- surveyor-objects - Key will activate in Surveyor while in scenery edit modes (object placement, or scenery spline placement)
- surveyor-track - Key will activate in Surveyor while in track edit modes (track placement, trackside object placement, or trackmark placement)
- surveyor-tools - Key will activate in Surveyor while in tool edit mode (cameras, rulers, copy, paste, etc)
- surveyor-layers - Key will activate in Surveyor while in layers edit mode
- surveyor-trains - Key will activate in Surveyor while in train/consist edit mode
- driver - Key will activate while in Driver, regardless of control mode
- driver-dcc - Key will activate while in Driver, while in DCC control mode
- driver-cab - Key will activate while in Driver, while in Cab control mode with a diesel/electric loco
- driver-cab-steam - Key will activate while in Driver, while in Cab control mode with a steam loco
reassignable
- Type: bool
- Desc: Whether the control supports player reassignment in the options menus.
trigger-on-up
- Type: bool
- Desc: Whether the control event should trigger on key up.
trigger-on-down
- Type: bool
- Desc: Whether the control event should trigger on key down.
trigger-on-held
- Type: bool
- Desc: Whether the control event should repeatedly trigger while a key remains held.
trigger-mode-analog
- Type: bool
- Desc: Sets the control as being for 'analog' use. For example, a throttle lever control, which has non-boolean input values. Requires a minimum trainz-build of 4.6.
Example controls container
See controlset.