Generic Keyvalues, Inputs and Outputs/Inputs: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (resorted some keys again)
(ordered every input by abcd, removed weird 'SetTeam' content; Optimized #if usage)
Line 1: Line 1:
<includeonly>{{minititle|Base}}
<includeonly>{{lang|Template:I_BaseEntity}}
{{IO|[[AddOutput]]|Evaluates a keyvalue/output on this entity. <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}}
<!--
  ++ Base ++
-->
{{minititle|Base}}
{{IO|AddContext|Adds to the entity's list of [[Response System|response contexts]]. Format is <code><key>:<value></code>.|param=string}}
{{IO|[[AddOutput]]|Assigns a new keyvalue/output on this entity. For keyvalues, some rely on extra necessary code to be ran and won't work if its simply just changed through this input. There is a strict format that must be followed:{{ExpandBox|<syntaxhighlight lang="PowerShell">
// Format of changing KeyValues: "AddOutput [key] [value]"
//// Raw text:
"OnUser1" "!self,AddOutput,targetname new_name"
 
// Format of adding an Output: "AddOutput {targetname}:{inputname}:{parameter}:{delay}:{max times to fire, -1 means infinite}"
//// Raw text:
"OnUser1" "!self:SetParent:!activator:0.0:-1"
// Arguments can be left blank, but the empty blank should still be contained.
//// Raw text:
"OnUser1" "!self:ClearParent::0.0:-1"
</syntaxhighlight>| Syntax<nowiki>:</nowiki>}} | param=string }}
{{IO|ClearContext|Removes all contexts from this entity's list.|param=string}}
{{IO|ClearParent|Removes this entity from the the movement hierarchy, leaving it free to move independently.}}
{{IO|FireUser1|to=FireUser4|Fires the respective<code>OnUser</code>outputs; see [[User Inputs and Outputs]].}}
{{IO|Kill|Removes this entity and any entities parented to it from the world.}}
{{IO|Kill|Removes this entity and any entities parented to it from the world.}}
{{IO|KillHierarchy|Functions the same as <code>Kill</code>, although this entity and any entities parented to it are killed on the same frame, being marginally faster than<code>Kill</code>input.}}
{{IO|KillHierarchy|Functions the same as <code>Kill</code>, although this entity and any entities parented to it are killed on the same frame, being marginally faster than<code>Kill</code>input.}}
{{IO|RemoveContext|Remove a context from this entity's list. The name should match the key of an existing context.}}
{{IO|SetParent|Move with this entity. See [[Entity Hierarchy (parenting)]].|param=string}}
{{IO|SetParent|Move with this entity. See [[Entity Hierarchy (parenting)]].|param=string}}
{{IO|SetParentAttachment|Change this entity to attach to a specific [[attachment]] point on its parent. The entity will teleport so that the position of its root [[bone]] matches that of the attachment.  Entities must be parented before being sent this input.|param=string}}
{{IO|SetParentAttachment|Change this entity to attach to a specific [[attachment]] point on its parent. The entity will teleport so that the position of its root [[bone]] matches that of the attachment.  Entities must be parented before being sent this input.|param=string}}
{{IO|SetParentAttachmentMaintainOffset|As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.|param=string}}
{{IO|SetParentAttachmentMaintainOffset|As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.|param=string}}
{{IO|ClearParent|Removes this entity from the the movement hierarchy, leaving it free to move independently.}}
{{IO|Use|Same as a player invoking [[+use]]; no effect in most cases.|nofgd=1}}
{{IO|FireUser1|to=FireUser4|Fire the <code>OnUser</code> outputs; see [[User Inputs and Outputs]].}}
{{IO|AddContext|Adds to the entity's list of [[Response System|response contexts]]. Format is <code><key>:<value></code>.|param=string}}
{{IO|RemoveContext|Remove a context from this entity's list. The name should match the key of an existing context.|param=string}}
{{IO|ClearContext|Removes all contexts from this entity's list.|param=string}}
<!-- IF: BASE -->{{#if:{{{base|}}}|
{{IO|DispatchEffect|Dispatches a special effect from the entity's origin. |param=string|nofgd=1}}
|{{IO|DispatchEffect|Dispatches a special effect from the entity's origin. Removed and replaced entirely by the [[particle]] system since {{l4d}}.|param=string|removed={{l4d}}|nofgd=1}}
}}
{{IO|DispatchResponse|Dispatches a response to the entity. See [[Response]] and [[Concept]].|param=string|nofgd=1}}
{{IO|DispatchResponse|Dispatches a response to the entity. See [[Response]] and [[Concept]].|param=string|nofgd=1}}
{{IO|Use|Same as a player invoking [[+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}}
{{IO|DispatchEffect|Dispatches a special effect from the entity's origin; see also [[List of Client Effects]]. Replaced by the [[particle]] system since {{l4d}}.|param=string|removed={{l4d}}|nofgd=1}}
<!--
<!--
   ++ Game Specifics ++
   ++ Game Specifics ++
-->
-->
<!-- We want to use as less #if blocks as possible to prevent too many imaginary line breaks -->
<!-- IF: L4D2 -->{{#if:{{{l4d2|}}}|
<!-- IF: L4D2 -->{{#if:{{{l4d2|}}}|
{{IO|RunScriptFile|Execute a [[VScript]] file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.|param=script|since={{l4d2}}}}
{{IO|RunScriptFile|Execute a [[VScript]] file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.|param=script|since={{l4d2}}}}
{{IO|RunScriptCode|Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. {{bug|In {{l4d2}}, the code is executed in the script scope of the entity that fires the output, ''not'' the one receiving the input.}} {{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}}}}
{{IO|RunScriptCode|Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. {{bug|In {{l4d2}}, the code is executed in the script scope of the entity that fires the output, ''not'' the one receiving the input.}} {{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}}}}
{{IO|CallScriptFunction|Execute a VScript function in the scope of the receiving entity.|param=string|since={{l4d2}}|nofgd=1}}
{{IO|CallScriptFunction|Execute a VScript function in the scope of the receiving entity.|param=string|since={{l4d2}}|nofgd=1}}
| }}<!-- IF: AS -->{{#if:{{{as|}}}{{{portal2|}}}|
<!-- {{portal2|}}} is for legacy support -->
| <!-- ELSE IF: AS / P2 --> {{#if:{{{as|}}}{{{portal2|}}}|
{{IO|SetLocalOrigin|param=coordinates|since={{as}}|nofgd=1|Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.}}
{{IO|SetLocalOrigin|param=coordinates|since={{as}}|nofgd=1|Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.}}
{{IO|SetLocalAngles|param=angles|since={{as}}|nofgd=1|Set this entity's angles.}}
{{IO|SetLocalAngles|param=angles|since={{as}}|nofgd=1|Set this entity's angles.}}
| }}<!-- IF: NOT BASE, L4D2 and AS -->{{#if:{{{l4d2|}}}||{{#if:{{{as|}}}{{{portal2|}}}||{{#if:{{{base|}}}||
| <!-- ELSE IF: NOT BASE -->{{#if:{{{base|}}}||
{{IO|RunScriptFile|Execute a [[VScript]] file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.|param=script|since={{l4d2}}}}
{{IO|RunScriptFile|Execute a [[VScript]] file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.|param=script|since={{l4d2}}}}
{{IO|RunScriptCode|Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. {{bug| In {{l4d2}}, the code is executed in the script scope of the entity that fires the output, ''not'' the one receiving the input.}} {{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}}}}
{{IO|RunScriptCode|Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console. {{bug| In {{l4d2}}, the code is executed in the script scope of the entity that fires the output, ''not'' the one receiving the input.}} {{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}}}}
Line 34: Line 48:
{{IO|SetLocalAngles|param=angles|since={{as}}|nofgd=1|Set this entity's angles.}}<!--
{{IO|SetLocalAngles|param=angles|since={{as}}|nofgd=1|Set this entity's angles.}}<!--
-->}}}}}}
-->}}}}}}
<!--
</includeonly>
  ++ SetTeam related things go here ++
-->
<!-- IF: TF2 -->{{#if:{{{tf2|}}}|
{{IO|SetTeam|Reassign the team of this entity as the team using this number.
:*0: None
:*1: Spectator
:*2: Red {{tf2}}
:*3: Blue {{tf2}}
|param=choices|nofgd=1}}
|<!-- ELSE IF: ANY[CSS, L4D, L4D2] -->{{#if:{{{css|}}}||{{#if:{{{l4d|}}}||{{#if:{{{l4d2|}}}|
{{IO|SetTeam|Doesn't do anything in {{l4ds}} or {{css}}.|deprecated=1|nofgd=1}}
{{IO|TeamNum|Doesn't do anything in {{l4ds}} or {{css}}.|deprecated=1|nofgd=1}}
|<!-- ELSE IF: CSGO -->{{#if:{{{csgo|}}}|
{{IO|SetTeam|Only<code>TeamNum</code>works in {{csgo}}.|deprecated=1}}
{{IO|TeamNum|Reassign the team of this entity as the team using this number.
:*0: None
:*1: Spectator
:*2: Terrorists {{csgo}}
:*3: Counter-Terrorists {{csgo}}
param=choices|nofgd=1}}
| }}}}}}}}}}</includeonly>
<noinclude>
<noinclude>
{{I_BaseEntity|base=1}}
{{documentation}}
{{documentation}}
<!-- Add categories to the /doc subpage, not here -->
<!-- Add categories to the /doc subpage, not here -->
</noinclude>
</noinclude>

Revision as of 03:44, 20 August 2021


English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Icon-translate.png Available doc translations
Info.png
The Generic Keyvalues, Inputs and Outputs/Inputs/doc documentation page does not exist.
English documentation will be displayed instead, which you can translate using Google Translate (or similar software). If there is nothing after this message, most likely the documentation does not exist even in English.
Generic Keyvalues, Inputs and Outputs/Inputs/doc