Generic Keyvalues, Inputs and Outputs/Inputs: Difference between revisions
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]]| | <!-- | ||
++ 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| | {{IO|Use|Same as a player invoking [[+use]]; no effect in most cases.|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| | {{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.}} | ||
| | | <!-- 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> | |||
<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> |