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

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(using strings)
Line 4: Line 4:
   ++ Base ++
   ++ Base ++


-->{{ScrollBox|title=Base|noscroll={{{noscroll|1}}}
-->{{ScrollBox|title={{I BaseEntity/strings|Base}}|noscroll={{{noscroll|1}}}
|{{IO|AddContext|Adds to the entity's list of [[Response System|response contexts]]. See [[Context|Context]].|param=string}}
|{{IO|AddContext|{{I BaseEntity/strings|AddContext}}|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:{{Expand|<syntaxhighlight lang="PowerShell">
{{IO|{{L|AddOutput}}|{{I BaseEntity/strings|AddOutputDesc}}|param=string}}
// Format of changing KeyValues: "AddOutput [key] [value]"
{{IO|ClearContext|{{I BaseEntity/strings|ClearContext}}}}
//// Raw text:
{{IO|ClearParent|{{I BaseEntity/strings|ClearParent}}}}
"OnUser1" "!self,AddOutput,targetname new_name"
{{IO|FireUser1|to=FireUser4|{{I BaseEntity/strings|FireUser1To4Desc}}}}
 
{{IO|Kill|{{I BaseEntity/strings|Kill}}}}
// Format of adding an Output: "AddOutput {targetname}:{inputname}:{parameter}:{delay}:{max times to fire, -1 means infinite}"
{{IO|KillHierarchy|{{I BaseEntity/strings|KillHierarchy}}}}
//// Raw text:
{{IO|RemoveContext|{{I BaseEntity/strings|RemoveContext}}|param=string}}
"OnUser1" "!self,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
{{IO|SetParent|{{I BaseEntity/strings|SetParent}}|param=string}}
// Arguments can be left blank, but the empty blank should still be contained.
{{IO|SetParentAttachment|{{I BaseEntity/strings|SetParentAttachment}}|param=string}}
//// Raw text:
{{IO|SetParentAttachmentMaintainOffset|{{I BaseEntity/strings|SetParentAttachmentMaintainOffset}}|param=string}}
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"
{{IO|Use|{{I BaseEntity/strings|Use}}|nofgd=1}}
</syntaxhighlight>| Syntax<nowiki>:</nowiki>}} | param=string }}
{{IO|SetTeam|{{I BaseEntity/strings|SetTeam}}|nofgd=1|param=integer}}
{{IO|ClearContext|Removes all contexts from this entity's list.}}
{{IO|TeamNum|{{I BaseEntity/strings|TeamNum}}|nofgd=1|param=integer}}
{{IO|ClearParent|Removes this entity from the the movement hierarchy, leaving it free to move independently.}}
{{IO|DispatchResponse|{{I BaseEntity/strings|DispatchResponse}}|param=string|nofgd=1}}
{{IO|FireUser1|to=FireUser4|Fires the respective<code>OnUser</code>outputs; see [[User Inputs and Outputs]].}}
{{IO|DispatchEffect|{{I BaseEntity/strings|DispatchEffect}}|param=string|removed={{l4d}}|nofgd=1}}
{{IO|[[Killtarget|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|RemoveContext|Remove a context from this entity's list. The name should match the key of an existing context.|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|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|[[Use]]|Same as a player invoking [[+use]]; no effect in most cases.|nofgd=1}}
{{IO|SetTeam|Changes this entity's team.|nofgd=1|param=integer}}
{{IO|TeamNum|This input changes value for <code>TeamNum</code> property.{{bug|Console command [[ent_info]] shows this input in any [[Source Engine]] game, but only in {{csgo|4}} (and games based on it) this input exists and works.}}|nofgd=1|param=integer}}
{{IO|DispatchResponse|Dispatches a response to the entity. See [[Response]] and [[Concept]].|param=string|nofgd=1}}<!--
-->{{#if: {{{as| {{{l4d2|}}} }}} | |{{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 ++
-->
<!-- 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|{{I BaseEntity/strings|RunScriptFile}}|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. {{Bugfix|In Hammer, using string arguments will corrupt the [[VMF]] file's structure, making the file unviewable for the next Hammer session.|Remove the string argument manually with a text editor.}}|param=string|since={{l4d2}}}}
{{IO|RunScriptCode|{{I BaseEntity/strings|RunScriptCode}}|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|{{I BaseEntity/strings|CallScriptFunction}}|param=string|since={{l4d2}}|nofgd=1}}
<!-- {{portal2|}}} was for legacy support -->
<!-- {{portal2|}}} was for legacy support -->
| <!-- ELSE IF: NOT BASE [AS / P2] -->{{#if:{{{base|}}}||
| <!-- ELSE IF: NOT BASE [AS / P2] -->{{#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}}|also={{tf2}}}}
{{IO|RunScriptFile|{{I BaseEntity/strings|RunScriptFile}}|param=script|since={{l4d2}}|also={{tf2}}}}
{{IO|RunScriptCode|param=string|since={{l4d2}}|also={{tf2}}|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 Hammer, using string arguments will corrupt the [[VMF]] file's structure, making the file unviewable for the next Hammer session.{{modernFix|Remove the string argument manually with a text editor.}}}}{{note|{{tf2}} Backtick characters ` are replaced with quotation marks at runtime, allowing quotation marks to be used when normally not possible.}}}}
{{IO|RunScriptCode|{{I BaseEntity/strings|RunScriptCode}}|param=string|since={{l4d2}}|also={{tf2}}}}
{{IO|CallScriptFunction|Calls a VScript function defined in the scope of the receiving entity.|param=string|since={{l4d2}}|also={{tf2}}|nofgd=1}}
{{IO|CallScriptFunction|{{I BaseEntity/strings|CallScriptFunctionOther}}|param=string|since={{l4d2}}|also={{tf2}}|nofgd=1}}
{{IO|TerminateScriptScope|Destroys the script scope of the receving entity.|only={{tf2}}|nofgd=1}}
{{IO|TerminateScriptScope|{{I BaseEntity/strings|TerminateScriptScope}}|only={{tf2}}|nofgd=1}}
{{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|{{I BaseEntity/strings|SetLocalOrigin}}|param=coordinates|since={{as}}|nofgd=1}}
{{IO|SetLocalAngles|param=angles|since={{as}}|nofgd=1|Set this entity's angles. }}}} }} }}</includeonly></onlyinclude>
{{IO|SetLocalAngles|{{I BaseEntity/strings|SetLocalAngles}}|param=angles|since={{as}}|nofgd=1}}
}}}}}}</includeonly></onlyinclude>
{{doc}}
{{doc}}
<!-- Add categories to the /doc subpage, not here -->
<!-- Add categories to the /doc subpage, not here -->

Revision as of 20:47, 13 August 2024

English (en)中文 (zh)Translate (Translate)
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