AddOutput

From Valve Developer Community
Revision as of 06:50, 4 April 2025 by SirYodaJedi (talk | contribs)
Jump to navigation Jump to search

Limitations

  • It's not possible to add an output with this that uses AddContext input because AddContext also uses ':' in its syntax.
  • Colons (:) are automatically converted to commas when parsed by AddOutput. As such, standard colons are unavailable to be used by values set by AddOutput, which mainly impacts entities such as game_text which let the mapper set some custom text.
  • Since AddOutput uses a space in its syntax, outputs and keyvalues which have spaces cannot be modified. Fortunately, this is unlikely to ever be an issue, as no vanilla entities use spaces.

Firing AddOutput via ent_fire

Because AddOutput uses space in its syntax it's required to enclose the ent_fire parameter in quotes.

To add output:

ent_fire <entity name> addoutput "<OutputName> <target>:<input>:<parameter_override>:<delay>:<refires>"

To change keyvalue:

ent_fire <entity name> addoutput "<key> <value>"

Examples

Format: <key> <value>
{
"classname" "trigger_once"
.
.
.
'OnStartTouch" "game_text,AddOutput,message There is a fire ahead. Go the other way!,0,1
'OnStartTouch" "game_text,Display,,0.02,1
} 

This changes the text of a game_text and then displays it. This is useful as to prevent having an unneccesary amount of game_text which counts as edict

Format: <output> <targetname>:<input>:<parameter>:<delay>:<refire>
{
"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о