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

From Valve Developer Community
Jump to navigation Jump to search
m (CSGO param - TeamNum input now supports a 'teamnum_dont_put_nofgd' value)
(doc page migration. SetTeam / TeamNum inputs are yet to be migrated. Template changes: DispatchEffects removed note now is hidden if base is active; Fixed AS keyvalues being represented as Portal2 param (latter not fully removed);resorted some keys)
Line 1: Line 1:
<noinclude>{{lang|Template:I_BaseEntity}}
<includeonly>{{minititle|Base}}
__NOTOC__
This template is our holder for all [[inputs]] assigned through {{ent|CBaseEntity}}. The template has a very specific syntax that you must follow to apply properly, because new games have added new features throughout the years. See [[Help:Templates]] for more info on named parameters.
'''No parameters:''' display inputs for ALL games.
<pre>{{I BaseEntity}}</pre>
'''Base:''' display inputs that have only existed since whatever game added the class (most have existed since HL2, the first Source game).
<pre>{{I BaseEntity|base=1}}</pre>
'''Game as a parameter:''' display the inputs that <code>base</code> displays, AND inputs that were added to the class, by the specified game. You can specify as many games as needed. You must specify ALL the games you want to include (e.g. <code>l4d2</code> will not automatically include <code>l4d</code> inputs as well).
<pre>{{I BaseEntity|tf2=1}}</pre>
 
All parameters for this template:
*<code>base</code> - (Use if the entity was available before L4D2.)
*<code>l4d2</code>
*<code>portal2</code>
*<code>prel4d</code> - (DEPRECATED 9/28/18: This parameter existed to hide DispatchEffect for games (ones before l4d) that did not have it. There's many cases of similar inputs and keyvalues that aren't in absolutely everything, and making similar parameters for all of those simply isn't worth the trouble, especially considering having to comb through every existing use of those templates. Parameter is totally removed from code and affects nothing.)
*<code>tf2</code> - Alter<code>SetTeam</code>input to show TF2 specific information. Use<code>tf2=setteam_dont_put_nofgd</code>to remove the {{Not in FGD}} tag.
{{note|If you want to edit something on this template, please make sure you edit it in both places. ''Per-game'' inputs are duplicated, for complex technical reasons.}}
For full documentation on this family of templates, see [[FGD Template Prototype]]. Still confused on something? '''Ask for help''' before editing this template.
{{note|Some <code>CBaseEntity</code> inputs are not covered here. See the talk page.}}
[[Category:Input Templates|Global]]
----
{{I BaseEntity}}
</noinclude><!--
--><includeonly>{{minititle|Base}}
{{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>.}}
{{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>.}}
Line 31: Line 8:
{{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}}
{{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}}
{{IO|FireUser1|to=FireUser4|Fire the <code>OnUser</code> outputs; see [[User Inputs and Outputs]].}}
{{IO|FireUser1|to=FireUser4|Fire the <code>OnUser</code> outputs; see [[User Inputs and Outputs]].}}
{{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. 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|AddContext|Adds to the entity's list of [[Response System|response contexts]]. Format is <code><key>:<value></code>.|param=string}}
{{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|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}}<!--
{{IO|ClearContext|Removes all contexts from this entity's list.|param=string}}
-->{{#if:{{{l4d2|}}}|<!--
<!-- IF: 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|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|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}}
<!--
  ++ Game Specifics ++
-->
<!-- 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|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:{{{portal2|}}}|<!--
| }}<!-- IF: AS -->{{#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:{{{l4d2|}}}||{{#if:{{{portal2|}}}||{{#if:{{{base|}}}||<!--
| }}<!-- IF: NOT BASE, L4D2 and AS -->{{#if:{{{l4d2|}}}||{{#if:{{{as|}}}{{{portal2|}}}||{{#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}}}}
{{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}}
Line 52: Line 35:
-->}}}}}}
-->}}}}}}
<!--
<!--
   ++ SetTeam (along with 'TeamNum' in CS:GO) related things go here ++
   ++ SetTeam related things go here ++
 
There isn't a better way to do those switch cases, is there
-->
-->
<!-- IF: TF2 == 'setteam_dont_put_nofgd' -->{{#switch: {{{tf2|}}} | setteam_dont_put_nofgd =
<!-- 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 }}
| <!-- ELSE IF: TF2 == 1 --> 1 =
{{IO|SetTeam|Reassign the team of this entity as the team using this number.
{{IO|SetTeam|Reassign the team of this entity as the team using this number.
:*0: None
:*0: None
Line 69: Line 43:
:*2: Red {{tf2}}
:*2: Red {{tf2}}
:*3: Blue {{tf2}}
:*3: Blue {{tf2}}
|param=choices|nofgd=1 }}
|param=choices|nofgd=1}}
| }} <!-- IF: CSS, ELSE IF: L4D, ELSE IF: L4D2 --> {{#if:{{{css|}}}||{{#if:{{{l4d|}}}||{{#if:{{{l4d2|}}}|
|<!-- ELSE IF: ANY[CSS, L4D, L4D2] -->{{#if:{{{css|}}}||{{#if:{{{l4d|}}}||{{#if:{{{l4d2|}}}|
{{IO|SetTeam|Doesn't do anything in {{l4ds}}.
{{IO|SetTeam|Doesn't do anything in {{l4ds}} or {{css}}.|deprecated=1|nofgd=1}}
{{confirm|Works in {{css}}?}}
{{IO|TeamNum|Doesn't do anything in {{l4ds}} or {{css}}.|deprecated=1|nofgd=1}}
<!--
|<!-- ELSE IF: CSGO -->{{#if:{{{csgo|}}}|
:*0: None
{{IO|SetTeam|Only<code>TeamNum</code>works in {{csgo}}.|deprecated=1}}
:*1: Spectator
:*2: Survivors {{l4ds}}, Counter-Terrorist {{css}}
:*3: Infected {{l4ds}} Terrorist {{css}}
-->
|deprecated=1|nofgd=1 }}
| }}}}}} <!-- IF: CSGO --> {{#if:{{{csgo|}}}|
<!-- IF: CSGO == 'teamnum_dont_put_nofgd' --> {{#switch:{{{csgo|}}} | teamnum_dont_put_nofgd =
{{IO|SetTeam|Only<code>TeamNum</code>works in {{csgo}}.|deprecated=1}}| <!-- ELSE IF: CSGO == 1 --> 1 =
{{IO|SetTeam|Only<code>TeamNum</code>works in {{csgo}}.|deprecated=1|nofgd=1}}
}}
<!-- SCOPE 1 END -->
{{IO|TeamNum|Reassign the team of this entity as the team using this number.
{{IO|TeamNum|Reassign the team of this entity as the team using this number.
:*0: None
:*0: None
Line 91: Line 54:
:*2: Terrorists {{csgo}}
:*2: Terrorists {{csgo}}
:*3: Counter-Terrorists {{csgo}}
:*3: Counter-Terrorists {{csgo}}
|param=choices|only={{csgo}}|nofgd=1 }}
param=choices|nofgd=1}}
| }}</includeonly>
| }}}}}}}}}}</includeonly>
<noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage, not here -->
</noinclude>

Revision as of 12:12, 27 April 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