Template:I Targetname: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added a warning about strings in function parameters)
(Category and templates)
Line 1: Line 1:
{{ScrollBox|title=Targetname|
{{ScrollBox|title=Targetname|
; <code>AddOutput <[[string]]></code>
{{IO|Kill|Removes this entity from the world.}}
: Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
{{IO|KillHierarchy|Removes this entity and all its children from the world.}}
:Format: <code><key> <value></code>
{{IO|AddOutput|Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.<br/>Format: <code><key> <value></code><br/>Format: <code><output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite></code>|param=string}}
:Format: <code><output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite></code>
{{IO|FireUser1|to=FireUser4|Fire the <code>OnUser</code> outputs; see [[User Inputs and Outputs]].}}
; <code>FireUser1</code> <span style<nowiki>=</nowiki>"font-weight:normal;">to</span> <code>FireUser4</code>
{{IO|Use|Same as a player invoking [[Use|+use]]; may not do anything. Can also be invoked by creating an output that does not specify an input.<br /> This input is not included in Valve's [[FGD]]s.|nofgd=1}}
: Fire the <code>OnUser</code> outputs; see [[User Inputs and Outputs]].
{{IO|RunScriptFile|Execute a game script file from disk.|param=script|since=L4D2}}
; <code>Kill</code>
{{IO|RunScriptCode|Execute a string of script source code. {{warning|Never try to pass string parameters to a script function with this input. It will corrupt the [[VMF]] structure because of the nested quotation marks, which then must be removed manually with a text editor.}}|param=string|since=L4D2}}
: Removes this entity from the world.
}}<noinclude>[[Category:FGD Templates|T]]</noinclude>
; <code>KillHierarchy</code>
: Removes this entity and all its [[Entity Hierarchy (parenting)|children]] from the world.
; {{l4d2 add|<code>RunScriptFile <[[string]]></code>}}
: Execute a [[VScript|game script]] from disk.
; {{l4d2 add|<code>RunScriptCode <[[string]]></code>}}
: Execute a string of script source code.
: {{warning|Never try to pass string parameters to a script function with this input. It will corrupt the [[VMF]] structure because of the nested quotation marks, which then must be removed manually with a text editor.}}
; <code>Use</code> {{Not in FGD}}
: Same as a player invoking [[Use|+use]]; may not do anything. Can also be invoked by creating an output that does not specify an input.
: This input is not included in Valve's [[FGD]]s.
}}

Revision as of 21:34, 7 June 2011

Targetname:
Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile <script> (in all games since Left 4 Dead 2)
Execute a game script file from disk.
RunScriptCode <string> (in all games since Left 4 Dead 2)
Execute a string of script source code.
Warning.pngWarning:Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.