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
(Also added flags section and outputs section (to confirm that there aren't any).)
No edit summary
 
(23 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{wrongtitle|title=func_traincontrols}}
{{subpage|[[Trains]]}}
{{CD|CFuncTrainControls|file1=trains.cpp}}
{{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.
:{{Note|If this entity is not present, {{ent|func_tracktrain}} can, by default, be controlled if the player is standing on them.}}
:{{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.}}


==Entity Description==
== KeyValues ==
When used by the player, this entity overrides the player's controls to let them drive a train.  
{{KV Targetname}}
{{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.}}


==Availability==
== See Also ==
{{in game|brush}} {{game-base}}
* {{ent|func_tracktrain}}
{{in code|class=???|file=???}}
 
==Keyvalues==
*{{kv parentname}}
*{{kv global}}
*'''target'''
:<target_destination> The target train to control when the player uses these controls.
 
==Flags==
None.
 
==Inputs==
(This entity doesn't normally have a targetname. You'll need to add it manually.)
*{{i parentname}}
 
==Outputs==
None.
 
[[Category:Entities]][[Category:Brush Entities]]

Latest revision as of 08:08, 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:If this entity is not present, func_tracktrain can, by default, be controlled if the player is standing on them.
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