func_tracktrain

A func_tracktrain is a train that players drive along a track of path_track entities from a
func_traincontrols on it, or that moves by itself at its Initial speed. It turns and
tilts with the track.
Attributes
The entity also has these common keys:
- Naming and triggering: Global Entity Name
- Appearance: Render FX, Render Mode, FX Amount and FX Color
- Compiler keys of brush entities: all of them
targetnameTriggering the entity starts or stops the train. See Common keys.
targetNames the first path_track, where the train starts.
soundsPicks the rail sound the train loops while it moves, which goes up in pitch as the train goes faster, and Custom move sound replaces it. With None and no custom move sound, the train plays no move, start or brake sound.
- None (0)
- Rail 1 (1)
- Rail 2 (2)
- Rail 3 (3)
- Rail 4 (4)
- Rail 6 (5)
- Rail 7 (6)
None (0)wheelsSets the distance between the front and the back wheels of the train, in units, and the train looks this far ahead on the track to turn and tilt along it.
If you leave this key empty or set 0, a moving train looks 100 units ahead, but where it starts, it isn't turned along the track.
50heightSets how high the origin of the train rides above the path_track points, in units.
If you leave this key empty, it is 0 and the origin rides on the path.
4startspeedSets the speed the train has when the map starts, in units per second, and 0 means it stands still.
0speedSets the top speed of the train, in units per second, and 0 means 100.
64dmgSets the damage dealt each frame to anything that blocks the train, and the speed the blocker is pushed away at. Riders aren't hurt, and 0 deals no damage.
0volumeSets how loud the sounds of the train are, from 1 for quiet up to 10 for full volume, and 0 means 10. For no sound, set Sound to None.
10bankSets how far the train leans into turns, in degrees.
0Sets how far the move, start and brake sounds carry.
- Small (-2) - Up to about 500 units away
- Medium (-1) - Up to about 800 units away
- Default (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, and the sounds are as loud far away as close by
Default (0)Sets a sound file played instead of the Sound choice, with the pitch set by the speed.
Flags
1No PitchThe train doesn't tilt up and down with the track, so it stays level
2No User ControlPlayers can't drive the train
4Forwards OnlyPlayers can only drive the train forward, not in reverse
8PassablePlayers and objects pass through the train
Notes
- Neither
trigger_changevaluenortrigger_copyvaluecan change how fast a train moves, because the train keeps its top speed from when the map loads, andtrain_setspeedis the entity that sets a train's speed. See Changing keys
See also
path_track- the points of a trackfunc_traincontrols- the place where a player drives the trainfunc_trackchange- moves the train to another trackfunc_train- a brush that moves along a path ofpath_cornerentities- func_tracktrain on TWHL - the Half-Life entity
Changes since 1.38
- You can use the new keys Sound radius, Custom move sound and Custom brake sound
