This article's documentation is for anything that uses the Source engine. Click here for more information.

Func traincontrols: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (reads better)
(More info via testing and srcents. Remove note about tanktrain since not sure it's actually true and not testing it again since it's a deprecated ent anyway)
Line 3: Line 3:
{{this is a|brush entity|name=func_traincontrols}}
{{this is a|brush entity|name=func_traincontrols}}
When the {{ent|player}} presses {{ent|+use}} on it, this entity gives control over the movement of a train using the player's movement keys.
When the {{ent|player}} presses {{ent|+use}} on it, this entity gives control over the movement of a train using the player's movement keys.
:{{Note|Player needs to be standing on this brush in order to take control of it. Model collision can interfere with this.}}
:{{Note|{{ent|func_tracktrain}} can be controlled by default if the player is standing on them, making this entity potentially superfluous.}}
:{{Note|When used with a [[func_tracktrain]] the brush entities have to be touching one another, however on a [[func_tanktrain]] they do not.}}
:{{Note|The player's origin must be inside this brush and standing on the train brush in order to take control of it. Model collision can interfere with this.}}


== KeyValues ==
== KeyValues ==
{{KV Targetname}}
{{KV Targetname}}
{{KV|Train Name|target_destination|intn=target|The target {{ent|func_tracktrain}} to control when the player uses these controls}}
{{KV|Train Name|target_destination|intn=target|The target {{ent|func_tracktrain}} to control when the player uses these controls}}
:{{Important|The <code>[[Entity_Hierarchy_(parenting)#Parentname|parentname]]</code> needs to be set to the same train as this in order to function.}}


== See Also ==
== See Also ==
* {{ent|func_tracktrain}}
* {{ent|func_tracktrain}}

Revision as of 06:12, 16 December 2024

C++ Class hierarchy
CFuncTrainControls
CBaseEntity
C++ trains.cpp

func_traincontrols is a brush entity available in all Source Source games. When the player presses +use on it, this entity gives control over the movement of a train using the player's movement keys.

Note.pngNote:func_tracktrain can be controlled by default if the player is standing on them, making this entity potentially superfluous.
Note.pngNote:The player's origin must be inside this brush and standing on the train brush in order to take control of it. Model collision can interfere with this.

KeyValues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Train Name (target) <targetname>
The target func_tracktrain to control when the player uses these controls
Icon-Important.pngImportant:The parentname needs to be set to the same train as this in order to function.

See Also