env_message
Last edited 1 month ago2024-09-08 16:29:57 UTC
- Wiki
- View Page
-
The
env_message
entity allows you to display predefined text messages on the screen. The messages it can display are defined in the
titles.txt file.
Attributes
- Target (target) - When this entity is triggered, it will trigger the entity specified in Target.
- Name (targetname) - Name is a general attribute used to identify entities.
- Message Name (message) - This should specify the name of the message that will be displayed, as defined in the titles.txt file. Custom text can also be used.
- Sound Effect (messagesound) - This allows you to specify a sound that should play when the message is shown to the player. This accepts an input of the form
path/filename.wav
(starting from the sound
folder). (Example: ambience/drips.wav
).
- Volume 0-10 (messagevolume) - Sets the volume of the sound. Scales from 0 (completely silent) to 10 (maximum, default).
- Sound Radius (messageattenuation) - Sets how far away from the
env_message
entity the sound can be heard.
- Small Radius (0) - The sound will be at maximum volume within a roughly 256 unit radius, fading out completely at around 512 units away.
- Medium Radius (1) - The sound will be at maximum volume within a roughly 512 unit radius, fading out completely at around 768 units away.
- Large Radius (2) - The sound will be at maximum volume within a roughly 768 unit radius, fading out completely at around 1280 units away.
- Play Everywhere (3) - The sound will be heard throughout the entire map.
Flags
- Play Once (1) - If enabled, the
env_message
can only be triggered once.
- All Clients (2) - If enabled, the message will display for all players rather than only the player that caused the
env_message
to be triggered (aka the activator).
Notes
- The game tries to find a message text block in titles.txt matching the entity's Message Name. If it finds it, it will display that text block's text from that file, using the position/colour/effect settings as set in the file. If there is no matching text block, the game will just display the
message
input unedited, in a default position/colour/effect, so you can technically just type your message directly.
- This entity is functionally very similar to the
game_text
entity. Rather than being externally defined, with a game_text
entity the message and all of the parameters applied to it are all defined within the entity itself. The game_text
entity also lacks the ability to play a sound effect, but this can be supplemented by an ambient_generic
entity if required.
- Due to the titles.txt file being a generic file (not map specific), editing this file is not recommended unless you are creating a custom mod. You should use a
game_text
entity if you require custom messages outside of a custom mod, e.g. a custom multiplayer map.
- If sound effect is specified, the sound will play at the entity's position and audible to everyone.
- Be mindful of the activator chain when trying to trigger this entity in multiplayer to display message to a single player, since some entities are known to not pass along the reference correctly e.g.
trigger_relay
, in which case it may instead display the message to the first player on the index. This is not a problem in singleplayer as the first player is the only player.
- If creating a custom mod, whether to use
env_message
or game_text
is simply a matter of preference. If you intend to display many custom messages, using env_message
and using a custom titles.txt file may be preferable simply to keep all of the messages and their parameters in one place, and to allow defining one set of parameters for many messages. If using very few messages, game_text
may be simpler. Another advantage of using titles.txt over game_text
in the context of mods is that you can benefit from localization (easier to have your mod translated in French, German, Russian...)
See also
Comments
You must log in to post a comment.
You can login or register a new account.