CMessage (CS)

From AlliedModders Wiki
Revision as of 11:10, 18 May 2009 by Arkshine (talk | contribs) (Added CMessage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Basic Information

  • Classname: CMessage.
  • Description: This entity allows you to display preset text messages for the player.


Class Hierarchy


Entity Data

None.


Entity 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.
  • Message Name (message) - The name of the message (see note below)
  • path/filename.wav of WAV (messagesound)
  • Volume 0-10 (messagevolume)
  • Sound Radius (messageattenuation)
0 = Small Radius
1 = Medium Radius
2 = Large Radius
3 = Play Everywhere


Entity Flags

// Spawn flag
#define SF_MESSAGE_ONCE 0x0001  // Play Once   - Send to one client
#define SF_MESSAGE_ALL	0x0002	// All Clients - Send to all clients


Notes

  • This entity only allows the use of predefined text messages. These are found in the 'titles.txt' file.
  • This entity is only really useful for mods, where a custom 'titles.txt' file is distributed, either in the PAK, or in the mod's root folder. To see how to construct your own file, read through Valve's comments in their one. Use the game_text entity referenced below for easier messaging that doesn't require distribution of anything but the map itself.


HLSDK Reference