Aw say

From ActiveWiki
Jump to: navigation, search

Minimum requirements
Added in version 2.1
SDKbuild 13

int aw_say (char *message)


Speaks a message to all the neighbors.


None (returns immediately)


Triggers AW_EVENT_CHAT in all the neighbors that subscribe to the event.

The message will appear as "[bot name]: message" in the chat log of a browser. Either in normal black or bold black text. Console messages can be used to display messages in other colors or without the bot's name preceding the message.

When not in global mode, bots can determine if an avatar is within hearing range by subscribing to avatar_add and avatar_delete events. Any avatar for which an avatar_add event has been triggered but not an avatar_delete will be able to both hear and be heard by the bot (provided that it is subscribing to chat events).

Global mode bots should use console messages instead, as they have no reliable way of telling if an avatar is within hearing range or not.

The chat event will usually be triggered for any avatars within a 400 x 400 x 400 meter cube around the bot. This is commonly referred to as "hearing range". It is possible to change the volume of this cube by adding neighbor_range=<centimeters> to the [misc] section in the worlds.ini file of a world server. The default value being 20000 centimeters (or 200 meters) as the half the length of all edges on the cube.

If there are more than 50 avatars within hearing range of the bot, then it will usually only trigger chat events for the 50 closest. It is possible to change this limit by adding neighbor_limit=<avatars> to the [misc] section in the worlds.ini file of a world server. The default value being 50 avatars as the limit.

Public speakers are exempt from the neighbor limit and will both hear and be heard by all avatars within hearing range. The chat type would be set to AW_CHAT_BROADCAST which makes the message show up with bold text in browsers.



Argument attributes


Return values

The connection to the world is down.
It would exceed the maximum number of messages per second (defined by AW_MAX_MESSAGES_PER_SECOND in Aw.h).

Returned attributes



aw_say ("Howdy :)");

See also