Func tracktrain: Difference between revisions
Jump to navigation
Jump to search
Note:Unless the
Note:Tracktrains only update their movement direction 10 times per second. At higher speeds, this can result in them overshooting the track, especially with sharp turns. The older func_train entity is not affected by this issue, so it may be a suitable alternative for high-speed objects.
Bug:Due to poor coding, the
Bug:Trains stop short at a distance from their targets, regardless of speed. The higher the speed, the further away it will stop from the path_track. At low speeds, this is negligible. [todo tested in ?]
In code, it is represented by the
(This is an assert and therefore doesn't exist in public builds) |
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.) |
||
Line 1: | Line 1: | ||
{{distinguish|func_tanktrain}} | {{distinguish|func_tanktrain}} | ||
{{tabs|func tracktrain|goldsrc = 1|source = 1|main = source}} | {{tabs|func tracktrain|goldsrc = 1|source = 1|main = source}} | ||
{{this is a| | {{this is a|brush entity|name=func_tracktrain}} It functions as a moving platform that the player can ride. It follows a path of {{Ent|path_track}} entities. | ||
{{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.}} | {{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.}} |
Revision as of 17:01, 17 May 2024
Not to be confused with func_tanktrain.
func_tracktrain
is a brush entity available in all Source games. 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.