game_text_tf
This article needs a screenshot to help visually convey the subject.
You can upload screenshots at Special:Upload. For help, see Help:Images.
You can upload screenshots at Special:Upload. For help, see Help:Images.
...
game_text_tf
is a point entity available in Team Fortress 2. Similar to game_text
, it is an entity that displays text on players' screens. The text is displayed in a colored box with an optional image texture next to it. This text can be defined directly in the Hammer editor. This entity is suitable for standalone maps, if they are not to be localized.
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, you can use two single quotes ('') or detailed quotes (“ and ”).
Warning:This entity will not display when using the TF2 minimal HUD. Use a
game_text
or an env_screenoverlay
entity if you have vital information to display.Keyvalues
- Message Text
(message)
<string> - Message to display onscreen.
- Icon
(icon)
<string> - HUD icon (from mod_textures.res) to display.
Some Default Icons
- whiteAdditive: Additive White
- plus_sign: "+"
- minus_sign: "−"
- dollar_sign: "$"
- health_icon: Health Icon
- timer_icon: Timer Icon
- shield: Shield
- number_0: "0"
- number_1: "1"
- number_2: "2"
- number_3: "3"
- number_4: "4"
- number_5: "5"
- number_6: "6"
- number_7: "7"
- number_8: "8"
- number_9: "9"
- Audience
(display_to_team)
<choices> - Filters which team(s) will see this message.
- 0 : Everyone
- 2 : Red Team Only
- 3 : Blue Team Only
- Background Panel Color
(background)
<choices> - Color of the text panel.
- 0 : Grey
- 2 : Red
- 3 : Blue
Base:
- Parent
(parentname)
<targetname> - Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (
parentname [targetname],[attachment]
)Tip:Entities transition to the next map with their parentsTip:phys_constraint
can be used as a workaround if parenting fails.
- Origin (X Y Z)
(origin)
<coordinates> - The position of this entity's center in the world. Rotating entities typically rotate around their origin.Note:Hammer does not move the entities accordingly only in the editor.
- Pitch Yaw Roll (X Y Z)
(angles)
<angle> - This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.Note:This works on brush entities, although Hammer doesn't show the new angles.
- Classname
(classname)
<string> !FGD - Determines the characteristics of the entity before it spawns. Tip:Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds!
- Spawnflags
(spawnflags)
<flags> !FGD - Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.
Inputs
Display
- Display the message text.
Base:
AddContext
<string>- Adds to the entity's list of response contexts. See Context.
AddOutput
<string>- 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:
// 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,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
// Arguments can be left blank, but the empty blank should still be contained.
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"
|
ClearContext
- Removes all contexts from this entity's list.
ClearParent
- Removes this entity from the the movement hierarchy, leaving it free to move independently.
FireUser1
toFireUser4
- Fires the respective
OnUser
outputs; see User Inputs and Outputs.
Kill
- Removes this entity and any entities parented to it from the world.
KillHierarchy
- Functions the same as
Kill
, although this entity and any entities parented to it are killed on the same frame, being marginally faster thanKill
input.
RemoveContext
<string>- Remove a context from this entity's list. The name should match the key of an existing context.
SetParent
<string>- Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment
<string>- 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.
SetParentAttachmentMaintainOffset
<string>- As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
Outputs
Base:
OnUser1
toOnUser4
- These outputs each fire in response to the firing of the like-numbered
FireUser1
toFireUser4
Input; see User Inputs and Outputs.