Func tracktrain: Difference between revisions
Jump to navigation
Jump to search
Note:Unless the
Bug:Due to poor coding, the
Bug:Trains stop short at a distance from their targets, regardless of speed. The higher the speed, the larger will be the distance it stops away from the path. At low speeds, this is negligible. [todo tested in ?]
Warning:The trains should not be parented. Instead, logic_measure_movement should be used to replicate the parenting, as it will not cause crashes or mismatches.
In code, it is represented by the
(obviously a bug. objects dont appear to skip in real life just cause they move fast.) |
No edit summary |
||
Line 1: | Line 1: | ||
{{base brush|func_tracktrain}} It functions as a moving platform that the player can ride. It follows a path of [[path_track]] entities. | {{base brush|func_tracktrain}} It functions as a moving platform that the player can ride. It follows a path of [[path_track]] entities. | ||
{{note|Unless the | {{note|Unless the <code>Fixed Orientation</code> flag is set, build your train so that the front of the train is facing down the X axis. (This means that the front of the train is visible in the front view, etc..) When it spawns it will automatically rotate to face the next <code>path_track</code> on the path.}} | ||
{{bug| | {{bug|Due to poor coding, the <code>Reverse</code> and <code>StartBackward</code> may not function correctly if the <code>New Train Speed</code> property in the involved {{ent|path_track}} entities is set to 0. The train may fail to reverse, jamming in place or moving in the wrong direction. To solve this issue, some or all of the <code>path_tracks</code> must have their <code>New Train Speed</code> variable set to a non-zero value.}} | ||
{{warning| | {{bug|Trains stop short at a distance from their targets, regardless of speed. The higher the speed, the larger will be the distance it stops away from the path. At low speeds, this is negligible.}} | ||
{{warning|The trains should not be parented. Instead, [[logic_measure_movement]] should be used to replicate the parenting, as it will not cause crashes or mismatches.}} | |||
{{Code class|[https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/server/trains.cpp#L1246 CFuncTrackTrain]|[https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/server/trains.cpp trains.cpp]}} | {{Code class|[https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/server/trains.cpp#L1246 CFuncTrackTrain]|[https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/server/trains.cpp trains.cpp]}} | ||
Line 18: | Line 18: | ||
== Inputs == | == Inputs == | ||
{{I BaseTrain}} | {{I BaseTrain}} | ||
== Outputs == | == Outputs == | ||
{{O BaseTrain}} | {{O BaseTrain}} |
Revision as of 16:44, 8 February 2019
Template:Base brush It functions as a moving platform that the player can ride. It follows a path of path_track entities.

Fixed Orientation
flag is set, build your train so that the front of the train is facing down the X axis. (This means that the front of the train is visible in the front view, etc..) When it spawns it will automatically rotate to face the next path_track
on the path.
Reverse
and StartBackward
may not function correctly if the New Train Speed
property in the involved path_track entities is set to 0. The train may fail to reverse, jamming in place or moving in the wrong direction. To solve this issue, some or all of the path_tracks
must have their New Train Speed
variable set to a non-zero value. [todo tested in ?]


CFuncTrackTrain
class, defined in thetrains.cpp
file.
Keyvalues
Distance between wheels is the distance in Hammer Units between the front axle and rear axle of your train. The rear axle moves the train and stays on the track. The front axle turns as it approaches path_tracks and does not stay on the track.