Difference between revisions of "AddOutput"

From Valve Developer Community
Jump to: navigation, search
(Created page with '{{wrongtitle|title=AddOutput}} ==Sample== This is a basic sample to show how to use the '''AddOutput''' input. <pre> { "classname" "tf_logic_auto" . . . "OnMapSpawn" "team_round…')
 
m
 
(32 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{{wrongtitle|title=AddOutput}}
+
{{lang|AddOutput}}
==Sample==
+
The AddOutput output in [[Hammer]] uses the syntax : <code><key> <value></code> '''or''' <output name> <target name>:<input name>:<parameter>:<delay>:<max times to fire (-1 = infinity, 1 = once only)> to be used in the parameters field of the [[output]]
This is a basic sample to show how to use the '''AddOutput''' input.
 
  
<pre>
+
{{Warning|Don't use quotation characters (") in the ''Text Message'' field (not even <code>\"</code> characters). It will cause fatal errors with opening and/or compiling your map and may need to be fixed by manually editing the [[VMF]] in a text editor. Instead, use use detailed quotes (i.e. <code>&ldquo;</code> and <code>&rdquo;</code>).}}
{
+
 
"classname" "tf_logic_auto"
+
Syntax example with parameters: OutputName TargetName:Color:255 255 255:0:-1
.
+
 
.
+
Syntax example with NO parameters: OutputName TargetName:Open::0:-1
.
+
 
"OnMapSpawn" "team_round_timer_red,AddOutput,OnFinished game_round_win:RoundWin::0:-1,0,-1"
+
{{note|Syntax is different in Source 2. Syntax example with NO parameters in Source 2: OutputName>TargetName>InputName>Parameter>Delay>MaxTimesToFire}}
}
+
 
</pre>
+
It is worth noting that if you have no parameters, then put nothing between the two colons or ">."
 +
 
 +
Max times to fire can work with values other than 1 or -1.
 +
 
 +
1 = fire once, 2 = fire twice, [...] , -1 = fire infinite times {{todo|People sometimes report this not working. It might not work in some games or when done through hammer vs ent_fire.}}
 +
 
 +
==Examples==
 +
:Format: <code><key> <value></code>
 +
{
 +
"classname" "prop_physics"
 +
"targetname" "prop01"
 +
.
 +
.
 +
.
 +
'''"OnHealthChange" "!self,AddOutput,targetname prop9001"'''
 +
}
 +
This changes the target name of the prop. In this case, it is changing it's own name, so !self == prop01.
 +
 
 +
:Format: <code><output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, 1 means once and -1 means infinite></code>
 +
{
 +
"classname" "tf_logic_auto"
 +
.
 +
.
 +
.
 +
'''"OnMapSpawn" "team_round_timer_red,AddOutput,OnFinished game_round_win:RoundWin::0:-1,0,-1"'''
 +
}
 +
This adds an output to an entity with the targetname "team_round_timer_red".
 +
----
 +
 
 +
;Trigger_Multiple
 +
:Name: ''Ghost''
 +
 
 +
 
 +
;Outputs
 +
:My Output Named: ''OnEndTouch''
 +
:Targets entities named: ''!activator''
 +
:Via this input: ''Alpha''
 +
:With a parameter override of: ''255''
 +
:After a delay in seconds: ''0.10''
 +
 
 +
 
 +
:My Output Named: ''OnStartTouch''
 +
:Targets entities named: ''!activator''
 +
:Via this input: ''AddOutput''
 +
:With a parameter override of: ''rendermode 1''
 +
:After a delay in seconds: ''0.00''
 +
 
 +
 
 +
:My Output Named: ''OnStartTouch''
 +
:Targets entities named: ''!activator''
 +
:Via this input: ''Alpha''
 +
:With a parameter override of: ''120''
 +
:After a delay in seconds: ''0.00''
 +
 
 +
 
 +
Results in translucent player when standing in the trigger_multiple (OnStartTouch) and visible again when not in the trigger_multiple (OnEndTouch).
 +
 
 +
==See Alsо==
 +
*[https://www.youtube.com/watch?v=Ri8r7lUEB0w&feature=youtu.be|briefly about the AddOutput]
 +
[[Category:IO System]]

Latest revision as of 01:12, 15 May 2021

English Русский

The AddOutput output in Hammer uses the syntax : <key> <value> or <output name> <target name>:<input name>:<parameter>:<delay>:<max times to fire (-1 = infinity, 1 = once only)> to be used in the parameters field of the output

Warning.png Warning: Don't use quotation characters (") in the Text Message field (not even \" characters). It will cause fatal errors with opening and/or compiling your map and may need to be fixed by manually editing the VMF in a text editor. Instead, use use detailed quotes (i.e. and ).

Syntax example with parameters: OutputName TargetName:Color:255 255 255:0:-1

Syntax example with NO parameters: OutputName TargetName:Open::0:-1

Note.png Note: Syntax is different in Source 2. Syntax example with NO parameters in Source 2: OutputName>TargetName>InputName>Parameter>Delay>MaxTimesToFire

It is worth noting that if you have no parameters, then put nothing between the two colons or ">."

Max times to fire can work with values other than 1 or -1.

1 = fire once, 2 = fire twice, [...] , -1 = fire infinite times To do: People sometimes report this not working. It might not work in some games or when done through hammer vs ent_fire.

Examples

Format: <key> <value>
{
"classname" "prop_physics"
"targetname" "prop01"
.
.
.
"OnHealthChange" "!self,AddOutput,targetname prop9001"
} 

This changes the target name of the prop. In this case, it is changing it's own name, so !self == prop01.

Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, 1 means once and -1 means infinite>
{
"classname" "tf_logic_auto"
.
.
.
"OnMapSpawn" "team_round_timer_red,AddOutput,OnFinished game_round_win:RoundWin::0:-1,0,-1"
}

This adds an output to an entity with the targetname "team_round_timer_red".


Trigger_Multiple
Name: Ghost


Outputs
My Output Named: OnEndTouch
Targets entities named: !activator
Via this input: Alpha
With a parameter override of: 255
After a delay in seconds: 0.10


My Output Named: OnStartTouch
Targets entities named: !activator
Via this input: AddOutput
With a parameter override of: rendermode 1
After a delay in seconds: 0.00


My Output Named: OnStartTouch
Targets entities named: !activator
Via this input: Alpha
With a parameter override of: 120
After a delay in seconds: 0.00


Results in translucent player when standing in the trigger_multiple (OnStartTouch) and visible again when not in the trigger_multiple (OnEndTouch).

See Alsо