Skip to main content

func_train

func_train icon
Brush entity

A func_train moves along a path of path_corner entities, from one to the next, and waits at each one as long as its Wait here says. The middle of the brush goes to each path_corner, and without a Name, the train starts by itself.

Attributes​

The entity also has these common keys:

KeyDescriptionDefault
Nametargetname

Triggering the entity starts or stops the train, and Obey Trigger Mode sets how. See Common keys.

Move Soundmovesnd

Sets the sound it plays while it moves, and if you set Custom move sound, it ignores this key.

The 14 choices
  • No Sound (0)
  • big elev 1 (1)
  • big elev 2 (2)
  • tech elev 1 (3)
  • tech elev 2 (4)
  • tech elev 3 (5)
  • freight elev 1 (6)
  • freight elev 2 (7)
  • heavy elev (8)
  • rack elev (9)
  • rail elev (10)
  • squeek elev (11)
  • odd elev 1 (12)
  • odd elev 2 (13)
Default No Sound (0)
Stop Soundstopsnd

Sets the sound it plays when it stops, and if you set Custom stop sound, it ignores this key.

The 9 choices
  • No Sound (0)
  • big elev stop1 (1)
  • big elev stop2 (2)
  • freight elev stop (3)
  • heavy elev stop (4)
  • rack stop (5)
  • rail stop (6)
  • squeek stop (7)
  • quick stop (8)
Default No Sound (0)
Sound Volumevolume

Sets how loud the move and stop sounds are, from 0.0 for silent up to 1.0 for full volume.

If you leave this key empty or set 0, it is 0.85.

Default 0.85
Fire On StartFeaturefulfireonstart

Names the entities to trigger each time the train sets off toward the next path_corner, at every corner.

Fire On Start use typeFeaturefulfireonstart_triggerstate

Sets the use type that the Fire On Start targets get.

  • Off (0)
  • On (1)
  • Toggle (2)
Default Off (0)
Fire On StopFeaturefulfireonstop

Names the entities to trigger each time the train stops: at a corner with a wait, at the end of the path, or when you stop it.

Fire On Stop use typeFeaturefulfireonstop_triggerstate

Sets the use type that the Fire On Stop targets get.

  • Off (0)
  • On (1)
  • Toggle (2)
Default Off (0)
Sound radiusFeaturefulsoundradius

Sets how far away players hear its move and stop sounds.

  • Small (-2) - Up to about 500 units away
  • Medium (-1) - Up to about 800 units away
  • Default (large) (0) - Up to about 1250 units away
  • Huge (1) - Up to about 2000 units away
  • Enormous (2) - Up to about 4000 units away
  • Play Everywhere (3) - Anywhere on the map, at full volume
Default Default (large) (0)
Custom move soundFeaturefulcustommovesnd

Sets a sound file that plays while it moves, instead of Move Sound.

Custom stop soundFeaturefulcustomstopsnd

Sets a sound file that plays when it stops, instead of Stop Sound.

First stop targettarget

Names the first path_corner, where the train starts when the map starts and moves on along the path from there.

Speedspeed

Sets how fast the train moves, in units per second, and 0 means 100. A path_corner with a New Train Speed changes it.

Default 64
Angular Velocityavelocity

Makes the train turn all the time, as three speeds in degrees per second for the turns around the Y, the Z (vertical) and the X axes.

Damage on crushdmg

Sets the damage dealt to anything that blocks the train, at most every half second.

If you leave this key empty or set 0, it is 2, unless the train has No default damage.

Default 0
Contentsskin

With Not solid, sets what the brush is filled with: -3 is water, -4 is slime, -5 is lava and 0 is a normal brush.

Default 0
Obey Trigger ModeFeaturefulSven Co-opm_iObeyTriggerMode

Sets how a trigger starts and stops the train.

  • No (0) - Every trigger starts or stops it, as in Half-Life
  • Yes (1) - On starts it, Off stops it and Toggle switches it, so On while it moves and Off while it stands still do nothing
Default No (0)
Move sound pitchFeaturefulsoundpitch

Sets the pitch of the move sound, where 100 is normal.

If you leave this key empty or set 0, the pitch is normal.

Default 0

Flags​

4Initially On

A train with a Name starts moving when the map starts. A train without a name always does

8Not solid

Players, monsters and shots pass through the train

64No default damageFeatureful

A Damage on crush of 0 deals no damage, instead of the default 2

Notes​

  • When a trigger stops the train, its move sound stops and its stop sound plays
  • From a path_corner with New Train rot. Speed, the train turns around its vertical axis while it moves

See also​

Changes since 1.38​

  • You can use the new keys Obey Trigger Mode, Fire On Start, Fire On Stop, Move sound pitch, Sound radius and the custom move and stop sounds, and the new flags Initially On and No default damage
  • A train that a trigger stops also stops its move sound. In SBO 1.38, the sound kept looping until the train moved again
  • Fixed the New Train rot. Speed key of path_corner being ignored. The game never read the key