path_track

Modified

12-Jul-2023

Entity used to define a path for func_tracktrain. To make it works, create a set of a path_tracks entity, and in each path_track's "Next Stop Target" specify a name of next path_track to go to from this path_track. If last path_track targeting first path_track, the path movement is looped.

Keyvalues


OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Name targetname : Set name of path_track so other entities can trigger it to enable or disable it or branch path. Depending on trigger use-type: 'On'- enable this path, 'Off'- disable this path, 'Toggle'- toggle this path. If "Branch Path" is specified: every time this path_track is disabled the one specified in branch path is used. Can be kill-targeted.

Pitch Yaw Roll (X Y Z) angles : Where Z means Y and Y means Z, that is, when you're thinking Hammer-grid. (Hammer uses Z for height and Y for depth, while every other sane 3D-application does this the other way round; nonetheless this keyvalue description has the letters in the conventional order) This, technically, is a 3D-vector containing Euler-angles to describe either the entity's rotation or direction of effect. E.g. a func_door_rotating will use this as its initial rotation, while a trigger_push will keep its original alignment and use this for the direction of its push-effect instead. Euler-angles are a hierarchical system to determine an object's orientation in 3D-space. A yaw-value of 0 would mean the entity would face east. (right in top-down view) 90 would mean it would face north. (up in top-down-view) After yaw, pitch is applied. Think aiming up/down with your character in first person. At last, the roll-value is applied. Think your character falling over sideways in first person. Some entities, mostly point entities, do not use the angles keyvalue for any purpose.

Next stop target target : Name of the next path_track to go after entity reach this path_track. Can be kill-targeted, any object heading this path_track will move toward map center coordinates.

Fire On Pass message : Entity to trigger when track train reach this path_track. It won't trigger when train just stops at this point. Trigger use-type is 'Toggle'.

Branch Path altpath : The name of alternative path_track to go. If path_track is triggered, it's change it's next stop target to the name of "Branch Path" path_track. If no "Branch Path" specified, and this path_track is triggered, the train stops at this point instead of going further, and vice-versa- if "Next stop Target" isn't specified, but the "Branch Path" is, the train will treat this point as a dead end, but after triggering this path_track the train will take path_track name specified in a "Branch Path" as a new target.

Fire on dead end netname : Entity to trigger when func_tracktrain reaches this path_track as a last path_track in a chain. This may happen in few cases:

  • There is no next stop target specified.
  • Next stop target has been disabled and train reaches this point.
  • Train is travelling from point "A" (this path_track) to point "B" (next path_track), and path_track "B" has been disabled when train was on it's way to point "B" (between "A" and "B"). The train won't reach point "B", and this path_track (point "A") is considered as a dead end, so the trigger is fired.

New Train Speed newspeed : Overrides train speed after reaching this point. Affects both controllable and non-controllable trains.

New Maximum Speed maxspeed : Sets train speed once to this value if it's moving faster than that.

New Train Speed (Legacy) speed : Overrides train speed after reaching this point. Legacy, works only for non-controllable trains.

Flags


  • 1 : Disabled : Start disabled. Trigger path to enable it. Branch Path cannot be used with this flag, even with selected Branch Reverse.

  • 2 : Fire once : Entity triggers it's "Fire on Pass" target once.

  • 4 : Branch Reverse : Swap the branch path and next target on start.

  • 8 : Disable train : When selected, disables func_tracktrain controlling when reaching this point.

If branch path is not defined, and the track was triggered (with Disabled flag not selected) the train won't reach this point- it will stop at the last enabled path_track.

When deactivating path (by killing it, disabling or branch switching with missing Branch Path) the train won't travel to that point, so it will end it's route at previous path_track (which is now considered dead end)