Training annotation: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(-added class hierarchy, cleanup)
 
(16 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{tf2 point|training_annotation}}
{{LanguageBar}}
{{CD|CTrainingAnnotation|nolink=1|file1=entity_training_annotations.cpp}}
{{this is a|point entity|name=training_annotation|game=Team Fortress 2}}


==Entity description==
An in-world location-specific information bubble that displays for all players.
An in-world location-specific information bubble.
 
{{note|[[VScript]] offers a more powerful version of this entity, that allows per-player filtering and showing special effects. Use the [[Team_Fortress_2/Scripting/Script_Functions#Globals|SendGlobalGameEvent]] function with the [https://wiki.alliedmods.net/Team_Fortress_2_Events#show_annotation show_annotation] event.}}


==Keyvalues==
==Keyvalues==
{{KV Targetname}}
{{KV Targetname}}
{{KV|Lifetime|float|intn=lifetime|How long should the annotation be shown in seconds. {{{lifetime add|}}}}}
{{KV|Displayed text|string|intn=display_text|The text to be displayed in the annotation popup.}}
{{KV|Lifetime|float|intn=lifetime|How long you want the annotation popup to stick around.  If set to 0, it will default to the value in code (1 sec).  If it set to -1, it will last forever.}}
{{Note|The fade-in effect when an annotation is shown does not work unless lifetime is set to -1}}
{{Note|The fade-in effect when an annotation is shown does not work unless lifetime is set to -1}}
==Inputs==
{{KV|Vertical offset|float|intn=offset|The vertical offset.}}
{{I Targetname}}
{{IO|Show|Shows the annotation bubble.}}
{{IO|Hide|Hides the annotation bubble.}}
{{Note|Hide does not work if [https://developer.valvesoftware.com/wiki/Tf_logic_training_mode tf_logic_training_mode] is not present.  Use the lifetime keyvalue if you want to use this entity outside of training mode.}}


==Outputs==
== Inputs ==
{{O Targetname}}
{{I|Show|Shows the annotation bubble.}}{{bug*|Showing an annotation will print an error to console mentioning a missing sound file, the file path cannot be modified.}}
{{I|Hide|Hides the annotation bubble.}}{{Warning|Hide does not work in multiplayer! Use the lifetime keyvalue if you want to use this entity outside of training mode.}}

Latest revision as of 15:05, 25 September 2024

English (en)Translate (Translate)
C++ Class hierarchy
CTrainingAnnotation
CPointEntity
CBaseEntity
C++ entity_training_annotations.cpp

training_annotation is a point entity available in Team Fortress 2 Team Fortress 2.

An in-world location-specific information bubble that displays for all players.

Note.pngNote:VScript offers a more powerful version of this entity, that allows per-player filtering and showing special effects. Use the SendGlobalGameEvent function with the show_annotation event.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Displayed text (display_text) <string>
The text to be displayed in the annotation popup.
Lifetime (lifetime) <float>
How long you want the annotation popup to stick around. If set to 0, it will default to the value in code (1 sec). If it set to -1, it will last forever.
Note.pngNote:The fade-in effect when an annotation is shown does not work unless lifetime is set to -1
Vertical offset (offset) <float>
The vertical offset.

Inputs

Show
Shows the annotation bubble.
Icon-Bug.pngBug*:Showing an annotation will print an error to console mentioning a missing sound file, the file path cannot be modified.
Hide
Hides the annotation bubble.
Warning.pngWarning:Hide does not work in multiplayer! Use the lifetime keyvalue if you want to use this entity outside of training mode.