Syntax[]
llShout(integer channel, string message);
Shouts the text specified as message on the specified channel.
Parameters
- integer channel
- any integer value, integer variable or chat channel constant
- string message
- any string value or string variable with maximal 1023 characters
Returns void
- This function doesn't return a result.
Constants
Those constants can be used as channels
constant | value | description |
---|---|---|
PUBLIC_CHANNEL | 0 | value of the public chat channel |
DEBUG_CHANNEL | 2147483647 | value of the debug channel |
Example
Shouts "Can you hear me shouting?" in the public chat when the object is touched:
default { touch_start(integer number) { llShout(PUBLIC_CHANNEL, "Can you hear me shouting?"); } }
Remarks
This function is used, to broadcast messages to avatars and objects on a specific channel.
Avatars can hear only messages send to the PUBLIC_CHANNEL or DEBUG_CHANNEL. Objects are able to hear messages send to any channel. For objects, to receive those messages, they have to llListen() to the channel the message is send.
The message can be heard only within an area that equals a sphere with a radius of 100 meters from the center of the prim, that contains the script.
To say a message on the public chat, the PUBLIC_CHANNEL constant or the number 0 has to be used as channel.
llSay(PUBLIC_CHANNEL, "You can read this on the public chat. ");
Like avatars, objects are able to send "/me" messages on PUBLIC_CHANNEL too.
llSay(0, "/me is shouting...");
To send a message to another object, any channel can be used. The PUBLIC_CHANNEL and DEBUG_CHANNEL should be avoided for inter-object communication. Any other channel is considered private and is fine to be used. A negative channel should be used, when it's not desired that users would be able to send such messages to this channel too.
llSay(-48827300, "Only objects can hear this.");
The DEBUG_CHANNEL exists, so that objects can send messages that will be displayed in the script warning/error window of the client, similar as script errors are displayed. It can be used to report errors or for debugging purposes.
llSay(DEBUG_CHANNEL, "Notice: This is a debugging message.");
Notes
Messages that are longer then 1023 bytes, are truncated to 1023 bytes.
The message is not broadcasted to scripts belonging to the same prim, that sends it. This is relevant when it comes to listen to messages, as that helps to prevent infinite recursion.
For positive channels, this is similar to an user typing "/### message" (where ### is a number) in the client, as example "/1 show". Negative channels can't be used in that way.
The possible chat channel range for scripts is from -2147483648 to 2147483647.
More Examples / Code Snippets
- Code Snippet - Methods to create and use an unique channel
Related Functions
- llWhisper() - Send a message up to a distance of 10m
- llSay() - Send a message up to a distance of 20m
- llRegionSay() - Send a message to the whole region
- llOwnerSay() - Sends a chat message only visible to the owner of an object
- llInstantMessage() - Sends a private chat message to a specific avatar
Related Events
- listen - Listens to messages on watched channels
Platforms
SecondLife (agni), Secondlife (aditi), OpenSimulator
See also[]
- llMessageLinked() - to be used for more efficient communication between the linked prims of an object.
- llEmail() - to be used for communicating directly with a specific object within the same or a different simulator, as also sending regular emails.
- llListen() - creates a listener to watch for messages on a specific channel
- llDialog() - creates a dialog, which broadcasts the text of the pressed button similar to llSay()
- Chat category
- Communication category
- Channels used by specific script libraries
- llShout - Function reference at SecondLife LSL Wiki
- llShout - Function reference at lslwiki.net