Func traincontrols: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
 (Used KV/I/O BaseEntity templates. Template:in code -> Template:code class. Added back button.)  | 
				SirYodaJedi (talk | contribs)  No edit summary  | 
				||
| (10 intermediate revisions by 6 users not shown) | |||
| Line 1: | Line 1: | ||
{{  | {{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.}}  | |||
When {{ent|+use}}  | :{{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   | {{KV Targetname}}  | ||
{{KV   | {{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 ==  | ||
{{  | * {{ent|func_tracktrain}}  | ||
Latest revision as of 07:08, 16 December 2024
| CFuncTrainControls | 
func_traincontrols  is a   brush entity  available in all 
 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:If this entity is not present, 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.
KeyValues
- Name (targetname) <string>[ Edit ]
 - The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. 
parentnameortarget).
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
 
Important:The parentnameneeds to be set to the same train as this in order to function.