Skip to content
You're reading the docs for Railroader 0.6 (the MoW Update), currently available on the Experimental branch.

Components

Components add features to definitions — visual details, interactive controls, sounds, lights, and more. They are listed in a definition’s components, keyed by component id.

All components share these fields:

FieldTypeDefaultDescription
kindstring—Discriminator that selects the component type
namestring—Component name (used for identification)
transformTransformidentityPosition, rotation, and scale
parentTransformReferencenullParent transform in the model hierarchy
enabledbooltrueWhether the component is active
FieldTypeDefaultDescription
positionfloat[3][0, 0, 0]Position offset [x, y, z]
rotationfloat[4][0, 0, 0, 1]Rotation quaternion [x, y, z, w]
scalefloat[3][1, 1, 1]Scale multiplier [x, y, z]

A component’s id is its name within the definition it belongs to, and it is what the Definition Editor labels the component with in its list. Set it in the Id field at the top of the component inspector; the editor starts you with one derived from the component’s name and rejects a rename that collides with another component in the same definition.

Ids are how a style rule names one specific component ("Decal#left-number-board") and how a Relay script looks one up, so an id can only include the same characters as a style class — see Names Within a Definition.

{
"kind": "Car",
"components": [
{
"kind": "Ladder",
"height": 4.0,
"name": "Ladder",
"transform": {
"position": [1.3, 0.0, 6.5],
"rotation": [0.0, 0.0, 0.0, 1.0],
"scale": [1.0, 1.0, 1.0]
},
"parent": null,
"enabled": true
}
]
}

Each component is available on certain definition types:

AvailabilityDefinitions
CarCar definitions only (Car, SteamLocomotive, DieselLocomotive, etc.)
PropProp definitions only
TruckTruck definitions only (wheel trucks/bogies attached to a car)
AnyCar, prop, and truck definitions
KindAvailabilityDescription
AggregateLoadModelCarAnimated aggregate load visual (coal, gravel)
AimConstraintCarRotates a transform to aim at another (experimental)
BellCarLocomotive bell
ChuffCarSteam exhaust chuff effect
ClassLightCarClassification light
CompressorCarAir compressor
CylinderCockCarSteam cylinder cock effect
DecalCarText decal (road numbers, data, etc.)
DetailModelCar, PropAdditional detail model
DieselExhaustCarDiesel exhaust smoke
DynamoCarElectrical generator
FireboxEffectCarFirebox glow effect
GaugeCarCab gauge instrument
HeadlightCarHeadlight
HornCarDiesel horn
LadderAnyClimbable ladder
LightFixtureAnySwitchable light fixture
LoadAnimationCarAnimation triggered by load state
LoadModelCarLoad-dependent detail model
LoadModelVolumeCarBounding volume for load models
LoadTargetCarInteraction target for loading/unloading
RectangleMapMaskPropRectangular terrain mask
CircleMapMaskPropCircular terrain mask
MarkerLightCarMarker / tail light
PrefabControlCarBuilt-in prefab control (brake stand, etc.)
PropertyAnimationCarAnimation posed by a car property (reverser, throttle)
RadialControlCarRotary cab control
RendererGroupCar, Truck, PropMaterial / style assignment for renderers
ScriptAnyRelay script attachment
SeatAnyOccupiable seat
ToggleAnimationAnyToggle-activated animation
ToggleControlCarToggle cab control
WhistleCarSteam whistle