Diesel Railcar Simulator

Diesel Railcar Simulator

Not enough ratings
Animation and sound variables
By Lapioware
List of variables for animating trains
   
Award
Favorite
Favorited
Unfavorite
Variables for model node animations
  • Get("air brake cylinder") : Deprecated, please use "pistonpressure" instead

  • Get("air brake reservoir") : Deprecated, please use "reservoirpressure" instead

  • Get("aws-button0") : returns 1 if AWS button is being held down in given panel (0 - 1), otherwise returns 0

  • Get("aws-sunflower0") : returns 1 if AWS sunflower indicator is visible in given panel (0 - 1), otherwise returns 0

  • Get("axlespeed0") : speed of given axle in metres per second, including possible slipping and locking. This value is always non-negative. Indexing starts from zero.

  • Get("axlespeed0 signed") : speed of given axle in metres per second, including possible slipping and locking. This value is negative when the axle is revolving backwards. Indexing starts from zero.

  • Get("brake-pipe") : Deprecated, please use "pipepressure" instead

  • Get("bus(name)") : data value of given bus

  • Get("buzzer0") : returns 1 if buzzer button is being held down in given panel (0 - 1), otherwise returns 0

  • Get("door0") : open-ness of given door between 0 (closed) and 1 (fully open). Indexing starts from zero.

  • Get("handbrake0") : handbrake setting (normalised between 0 and 1) in given panel (0 - 3)

  • Get("highhorn0")) : returns 1 when high horn is being sounded (in panel 0 - 3), otherwise 0

  • Get("horn0")) : returns 1 when any horn is being sounded (in panel 0 - 3), otherwise 0

  • Get("is at booked stop left") : returns 1 when the vehicle is at a booked stop, and the stop direction is to the left when looking towards the front of the vehicle, and 0 otherwise.

  • Get("is at booked stop right") : returns 1 when the vehicle is at a booked stop, and the stop direction is to the right when looking towards the front of the vehicle, and 0 otherwise.

  • Get("load") : load of the vehicle as a number between 0 (empty) and 1 (full)

  • Get("loading-or-unloading") : returns 1 when the vehicle is loading or unloading passengers or cargo, otherwise 0

  • Get("locobrake0") : loco brake setting (normalised between 0 and 1) in given panel (0 - 3)

  • Get("lowhorn0") : returns 1 when the low horn is being sounded (in panel 0 - 3), otherwise 0

  • Get("panel-active0") : returns 1 if given panel (0 - 1) is active, otherwise returns 0

  • Get("pipepressure(name)") : pressure (Pascals) of the pipe identified by name

  • Get("pipepressurechange(name)") : change in pressure (Pascals) during the last 50 milliseconds of the pipe indentified by name

  • Get("pistonpressure0") : Deprecated, please use "pistonpressure(name)" instead

  • Get("pistonpressure(name)") : pressure (Pascals) of the piston identified by name

  • Get("power0") : power/throttle setting (normalised between 0 and 1) in given panel (0 - 3)

  • Get("reservoir") : Deprecated, please use "reservoirpressure" instead

  • Get("reservoirpressure0") : Deprecated, please use "reservoirpressure(name)" instead

  • Get("reservoirpressure(name)") : pressure (Pascals) of the reservoir identified by name

  • Get("reverser0") : returns reverser setting (-1, 0, 1) in given panel (0 - 1)

  • Get("rnd") : returns a random number between 0 and 1

  • Get("seconds since midnight") : returns fractional seconds since midnight in game time

  • Get("shifter0") : shifter setting in panel 0 or 1

  • Get("speed") : true speed of the vehicle in metres per second. This value is always non-negative. For speedometer readings consider using axlespeed instead for more realistic behaviour

  • Get("speed signed") : true speed of the vehicle in metres per second. This value is negative when the vehicle is running rear first. For speedometer readings consider using axlespeed instead for more realistic behaviour

  • Get("starter-left0") : returns 1 if left starter button is being held down in given panel (0 - 1), otherwise returns 0

  • Get("starter-right0") : returns 1 if right starter button is being held down in given panel (0 - 1), otherwise returns 0

  • Get("tacho0") : engine RPM (normalised between 0 [stopped] and 1 [max RPM]) in panel 0 or 1

  • Get("throttle0") : throttle notch in given panel (0 - 3). Note that the "power" variable might be easier to use

  • Get("trainbrake0") : train brake setting (normalised between 0 and 1) in given panel (0 - 3)

  • Get("vehiclernd") : returns a constant vehicle-specific random number between 0 and 1
Sound variables
Volume and pitch of various train sounds can be controlled with a C# expression. Below is a list of variables that can be accessed during the simulation. The documentation is still incomplete and work-in-progress.

Most variables work only when tied to a certain physics component. Variables that are not applicable for specific use always return zero.

To access a variable in a C# expression, type get.[VariableName], for example get.Volume. The first word in the list below is the type of the value returned. Decimal means either float or double.

decimal get.Volume (returns the previous volume)
decimal get.Pitch (returns the previous pitch)
decimal get.VehicleRnd (returns a constant vehicle-specific random number between 0 and 1)
decimal get.SoundRnd (returns a constant sound/component-specific random number between 0 and 1)
decimal get.Rnd (returns a random number between 0 and 1)
integer get.RndInt (returns a random number between int.MinValue and int.MaxValue)

integer get.IsActive

decimal get.Speed
decimal get.Rpm
decimal get.IdleRpm
decimal get.MaxRpm
integer get.Notch
integer get.OldNotch
integer get.Notches
decimal get.Torque
decimal get.Force
decimal get.ExhaustRate
decimal get.ExhaustThickness
integer get.Starter

integer get.Gear
integer get.OldGear
integer get.GearEngaged
decimal get.RpmDifference

integer get.Horn
integer get.Buzzer
integer get.AwsAudibleWarning

integer get.IsApplied
integer get.IsRunning
decimal get.EnergyMovementHack
decimal get.EnergyDelta
decimal get.Pressure
decimal get.PressureDifference
decimal get.PressureChange

integer get.Reverser
integer get.OldReverser

integer get.RailType
Sound names
A list of sounds by name (without any .wav or other extension), included in the built-in library;

116-door1
116-door2
116-door3
116-door4
116-hiss1
116-hiss2
116-low-horn-loop
117-door1
117-door2
117-door3
117-door4
117-engine-power2
117-gear-thump
117-gear-whine-loop-int2
117-hiss1
117-hiss2
117-hiss3
119-door1
119-door2
119-door3
119-door4
119-door-move
119-engine-max
119-high-horn-loop
119-hiss1
119-hiss2
119-rasp
120-hiss
air discharge long 01
air discharge long 02
air discharge loop 01
air discharge medium 01
air discharge short 01
air discharge short 02
air discharge short 03
air discharge short 04
air discharge short 05
air discharge short 06
air discharge short 07
air discharge short 08
air discharge short 09
air discharge short 10
air discharge short 11
air discharge short 12
air hum loop 01
air suction loop 01
air suction loop 02
air suction loop 03
air suction short 01
air suction short 02
air suction short 03
air within pipe hollow loop 01
air within pipe hollow loop 02
air within pipe loop 01
air within pipe loop 02
air within pipe loop 03
air within pipe loop 04
bell 01
bell 02
bell 03
bell 04
brake rub loop 01
brake rumble loop 01
brake squeal loop 01
buzzer loop 01
cab door rattle loop 01
compressor loop 01
compressor loop 02
compressor loop 03
compressor loop 04
coupling 01
door lock 01
door lock 02
door lock 03
door lock 04
door lock 05
door lock 06
door lock 07
door lock 08
engine1 25pc 01
engine1 75pc 01
engine1 full 01
engine1 full 02
engine1 idling 01
engine1 idling 02
engine2 75pc 01
engine2 full 01
engine2 idling 01
engine3 25pc 01
engine3 25pc 02
engine3 idling 01
exhaust loop 01
exhaust loop 02
exhaust loop 03
exhaust loop 04
forest ambient loop 01
fuse box rattle loop 01
fuse box rattle loop 02
fuse box rattle loop 03
fuse box rattle loop 04
gate squeak medium 01
gate squeak medium 02
gate squeak medium 03
gate squeak medium 04
gate squeak medium 05
gate squeak medium 06
gear_grind_single
gearbox_grind
guard whistle 01
guard whistle 02
guard whistle 03
guard whistle 04
guard whistle 05
guard whistle 06
hinge squeak medium 01
hinge squeak medium 02
hinge squeak medium 03
hinge squeak medium 04
hinge squeak medium 05
hinge squeak medium 06
hinge squeak short 01
hinge squeak short 02
horn loop 01
horn loop 02
horn loop 03
horn loop 04
horn loop 05
horn loop 06
horn loop 07
horn loop 08
horn start 07
horn start 08
joint medium 01
joint medium 02
joint medium 03
joint medium 04
joint medium 05
joint slow 01
joint slow 02
joint slow 03
joint slow 04
joint slow 05
joint slow 06
joint slow 07
joint slow 08
joint slow 09
joint slow 10
joint slow 11
joint slow 12
lever click 01
lever click 02
lever click 03
lever click 04
lever click 05
lever click 06
lever click 07
lever click 08
lever click 09
lever click 10
lever click 11
lever click 12
lever click 13
lever click 14
lever click 15
lever click 16
lever click 17
lever click 18
lever click 19
lever clunk 01
lever clunk 02
lever clunk 03
lever clunk 04
lever clunk 05
lever clunk 06
light switch off 01
light switch off 02
light switch off 03
light switch off 04
light switch off 05
light switch off 06
light switch off 07
light switch off 08
light switch on 01
light switch on 02
light switch on 03
light switch on 04
light switch on 05
light switch on 06
light switch on 07
light switch on 08
metal sheet rattle loop 01
metal sheet rattle loop 02
metal sheet rattle loop 03
nut squeak 01
nut squeak 02
nut squeak 03
nut squeak 04
nut squeak 05
nut squeak 06
nut squeak 07
nut squeak 08
nut stress 01
nut stress 02
nut stress 03
nut stress 04
nut stress 05
nut stress 06
nut stress 07
nut stress 08
nut stress 09
nut stress 10
nut stress 11
people ambient loop 01
ratchet medium 01
ratchet medium 02
ratchet medium 03
ratchet medium 04
ratchet medium 05
ratchet short 01
starter loop 01
starter loop 02
starter once 01
starter once 02
town ambient loop 01
turbo loop 01
turbo loop 02
turnout joint slow 01
turnout joint slow 02
turnout joint slow 03
turnout joint slow 04
turnout joint slow 05
turnout slow loop 01
wheels fast loop 01
wheels flat slow loop 01
wheels slow loop 01
window 01 rattle loop 01
window 01 rattle loop 02
window 01 rattle loop 03
window 02 rattle loop 01
window 02 rattle loop 02
window 02 rattle loop 03
window 03 rattle loop 01
wooden rattle 01 loop 01
wooden rattle 01 loop 02
wooden rattle 01 medium 01
wooden rattle 01 medium 02
wooden rattle 01 medium 03
wooden rattle 01 medium 04
wooden rattle 02 loop 01
wooden rattle 02 loop 02
wooden rattle 02 medium 01
wooden rattle 02 medium 02
wooden rattle 02 medium 03
wooden rattle 02 short 01
wooden rattle 03 loop 01
wooden rattle 03 loop 02
wooden rattle 03 loop 03
wooden rattle 03 medium 01
wooden rattle 03 medium 02
wooden rattle 03 short 01
3 Comments
Lapioware  [author] 17 Apr, 2024 @ 5:34am 
Added documentation for animation variables "rnd", "seconds since midnight" and "vehiclernd"
Lapioware  [author] 23 Jan, 2024 @ 10:15am 
Updated to add documentation on sound variables and names
Lapioware  [author] 24 Nov, 2021 @ 10:15pm 
Guide updated with two new variables: get("pistonpressure(name)") and get("reservoirpressure(name)")