This entity creates an object that can move between multiple
path_corners
. Not just used for trains; in fact, the func_train is more commonly seen in elevators, platforms, laser targets etc. For a moving object that can be controlled by the player (such as the train in On A Rail), see
func_tracktrain
.
Attributes
- Name (targetname) - Property used to identify entities.
- Render FX (renderfx) - Gives objects special render effects. Think of it as modifying whatever the Render Mode puts out. The options are as follows:
- 0 = Normal
- 1 = Slow Pulse
- 2 = Fast Pulse
- 3 = Slow Wide Pulse
- 4 = Fast Wide Pulse
- 5 = Slow Fade Away
- 6 = Fast Fade Away
- 7 = Slow Become Solid
- 8 = Fast Become Solid
- 9 = Slow Strobe
- 10 = Fast Strobe
- 11 = Faster Strobe
- 12 = Slow Flicker
- 13 = Fast Flicker
- 14 = Constant Glow
- 15 = Distort
- 16 = Hologram (Distort and Fade)
- Render Mode (rendermode) - Controls the type of rendering that is used for an object. Options are:
- 0 = Normal
- 1 = Color
- 2 = Texture
- 3 = Glow
- 4 = Solid
- 5 = Additive
- Move Sound (movesnd) - The sound that is played when the platform moves. Options are:
- 0 = No Sound (
common/null.wav
)
- 1 = big elev 1 (
plats/bigmove1.wav
)
- 2 = big elev 2 (
plats/bigmove2.wav
)
- 3 = tech elev 1 (
plats/elevmove1.wav
)
- 4 = tech elev 2 (
plats/elevmove2.wav
)
- 5 = tech elev 3 (
plats/elevmove3.wav
)
- 6 = freight elev 1 (
plats/freightmove1.wav
)
- 7 = freight elev 2 (
plats/freightmove2.wav
)
- 8 = heavy elev (
plats/heavymove1.wav
)
- 9 = rack elev (
plats/rackmove1.wav
)
- 10 = rail elev (
plats/railmove1.wav
)
- 11 = squeek elev (
plats/squeekmove1.wav
)
- 12 = odd elev 1 (
plats/talkmove1.wav
)
- 13 = odd elev 2 (
plats/talkmove2.wav
)
- Stop Sound (stopsnd) - The sound that is played after the platform stops moving. Options are:
- 0 = no sound (
common/null.wav
)
- 1 = big elev stop 1 (
plats/bigstop1.wav
)
- 2 = big elev stop 2 (
plats/bigstop2.wav
)
- 3 = freight elev stop (
plats/freightstop1.wav
)
- 4 = heavy elev stop (
plats/heavystop2.wav
)
- 5 = rack stop (
plats/rackstop1.wav
)
- 6 = rail stop (
plats/railstop1.wav
)
- 7 = squeek stop (
plats/squeekstop1.wav
)
- 8 = quick stop (
plats/talkstop1.wav
)
- Global Entity Name (globalname)
- FX Amount (renderamt)
- FX Color (rendercolor)
- ZHLT Lightflags (zhlt_lightflags)
- Light Origin Target (light_origin) - Overrides the position from which the train will receive its lighting when the map compiles. Useful if the train doesn't have the correct lighting in-game. This can be used with an info_target.
- First stop Target (target) - The name of the path_corner that the func_train should start at. If not set, the func_train will be at (0 0 0).
- Speed (speed) - The speed the func_train will move at in units/second.
- Angular velocity (avelocity) - Sets up axial rotation. Format: Y Z X.
- Damage on crush (dmg) - If the player is caught between the func_train and a solid brush, this is the amount of damage he will sustain.
- Contents (skin)
- Sound Volume (volume) - Range: 0.0 - 1.0
- Minimum Light Level (_minlight) - The minimum light level the train will have, even if its initial position in the editor is in a purely dark room. This is a very aggressive value, so even a value of 0.02 will make the train relatively bright.
Flags
Notes
- After spawning, the func_train moves instantly to its First Stop Target
path_corner
. So the entity can be created in another area (and therefore lighting can be controlled), but it will always appear in the right place to the player.
- For making moving targets for things like
env_beams
, an origin brush is all that is required. Otherwise, set Render Mode to Texture and Render Amount to 0, and enable the Not Solid flag.
- A func_train doesn't turn to face its heading in any way. Use a
func_tracktrain
instead.
-
Use BOUNDINGBOX brush to set center of pathing
The positioning of a func_train along the path is independent of the origin brush; it is instead centered on the bounding box, which defaults to the center of a cuboid that can fit the entire brush geometry of the entity. You can force a custom bounding box using a brush with the "BOUNDINGBOX" texture; this brush need not encompass the entire entity, but the func_train is guaranteed to be positioned at the center of this brush.
path_corners
control various aspects of a func_train; it can change its speed, make it wait for a set time, teleport a func_train to its position immediately, or stop the func_train requiring re-triggering.
- A
trigger_changetarget
can be used to change the current destination of a func_train. Useful when switching between different tracks, or when you need more control over a func_train. This can be used to create multi-level elevators, for example.
- Changing the target of a func_train while it's moving will only take effect after the func_train has reached its current destination. A train can also be forced to start moving to a new destination immediately by quickly triggering it twice (so it'll stop and restart).
- Angular velocity (avelocity) is applied to a func_train only when it's active and moving. Unlike Angles' Pitch Yaw Roll, angular velocity is only applied axially. The func_train rotates around its origin while keeping the offset from the pathing center to the origin constant. There is no way to alter this value mid-game, path_corner included.
- Setting Pitch Yaw Roll (angles) rotates the entity by the given amount on spawn. This allows for angular velocity to be applied off-axis to a limited extent.
See Also