This entity is used to display messages on-screen. It is used instead of
env_message
because it doesn't need to a file full of message strings to be distributed with the map.
game_text
affects only the
activator by default unless "All Players" flag is checked.
Attributes
- Name (targetname) - Property used to identify entities.
- Target (target) - When an entity is activated, it triggers the entity with the name specified by Target.
- Master (master) - The name of a
multisource
(or game_team_master
) entity. A master must usually be active in order for the entity to work. Thus they act almost like an on/off switch, in their simplest form, and like an AND gate in the case of the multisource.
- Message Text (message) - The text to be displayed.
- X (x) - X position of text (across screen). (0 - 1.0 = left to right, -1 = center)
- Y (y) - Y position of text (up/down screen). (0 - 1.0 = top to bottom, -1 = center)
- Text Effect (effect) - Effect to apply to the text (0 = Fade In/Out, 1 = Credits, 2 = Scan Out).
- Color1 (color) - The main colour.
- Color2 (color2) - The highlight colour.
- Fade in Time (or character scan time) (fadein) - Time taken to fade in each character.
- Fade Out Time (fadeout) - Time taken to fade out message.
- Hold Time (holdtime) - Length of time to hold message on screen after fading in.
- Scan time (scan effect only) (fxtime) - The amount of time the highlight lags behind the leading edge of the text.
- Text Channel (channel) - Any of four channels can be used by this entity. If while one channel is being used another entity on the same channel is triggered, the old text will be cleared from the screen.
Flags
- All Players (1) - Show the text to all players. If not set, only the player who activated the game_text will see the message.
Notes
- Line breaks can be added with by inserting a
\n
where you want a new line to be.
- message text longer than 79 (or 127?) characters in a single line will make the game crash, instead, use line break before it exceeds. Also make sure the entire message doesn't exceed 1024 characters (engine limit for entity values.)
- X, y, effect, color, color2, fadein, fadeout and fxtime are the same as those found in titles.txt.
- game_text has problems displaying text in any character set outside of the ASCII range.
- Do not use an automatic trigger like
trigger_auto
to activate this entity if "All Players" flag is disabled, otherwise the game will crash. This is because these entities have no valid activator.
- The easiest way to get a text-based message at the start of your level (in place of gametitle from
worldspawn
), like the Black Mesa one from HL, is to add a trigger_auto
to the level and set it's target to the name of your game_text. Do not forget to check "All Players" flag. You might have to add a delay to the trigger, depending on whether you fade the screen in or not, but either way when the game starts your text will be displayed.
- You can use any of the special entity names as the name of this entity. For example, a
game_text
named game_playerjoin
displays its text to any player who join a multiplayer game, at any time into the game.
- For some reason, Valve saw fit to remove this entity from Team Fortress Classic. (maybe it wasn't added to that game in the first place.)
Decided to test for myself.
Vanilla Half-Life's text engine seem to be broken for anything that's not ASCII. It consumes single-byte character sets (presumably ANSI/Windows-1252/system locale) but the text rendering is consuming UTF-8. This results in the broken text consistent with the table in this page: https://www.i18nqa.com/debug/utf8-debug.html
Haven't looked at the other SDKs or engines (candidates include Updated/Unified/Featureful/Xash-fwgs/Pathos) on how they handle text. Hopefully better than the unrecoverable mess vanilla is in right now.
ALSO, JACK will purposefully mangle non-ASCII texts. You'd need to edit the .map directly and feed it to the compilers yourself.
2024-06-29
apparently HLCSG also needs
-notextconvert
argument. sauce: singularmurderertarget
attribute does not work. This entity can't trigger anything else.