Event called when an avatar enters the scene.
In order to receive this event, you must first announce your position by calling aw_state_change at least once.
Within the context of this event the following attributes are defined:
AW_AVATAR_SESSION
AW_AVATAR_NAME
AW_AVATAR_X
AW_AVATAR_Y
AW_AVATAR_Z
AW_AVATAR_YAW
AW_AVATAR_TYPE
AW_AVATAR_GESTURE
AW_AVATAR_VERSION
AW_AVATAR_CITIZEN
AW_AVATAR_PRIVILEGE
AW_AVATAR_PITCH
AW_AVATAR_STATE
The attributes AW_AVATAR_VERSION, AW_AVATAR_CITIZEN, and AW_AVATAR_PRIVILEGE are new in version 3.1 and require at least build 18 of the SDK and build 28 of the world server.
The attributes AW_AVATAR_PITCH and AW_AVATAR_STATE are new in version 3.4 and require at least build 29 of the SDK and build 48 of the world server.
/* say "Hello <name>" to every avatar that enters the scene */
void avatar_add (void)
{
char message[256];
sprintf (message, "Hello %s", aw_string (AW_AVATAR_NAME));
aw_say (message);
}
aw_event_set (AW_EVENT_AVATAR_ADD, avatar_add);
aw_state_change ();
for (;;)
if (aw_wait (1000))
break;
aw_state_change
AW_EVENT_AVATAR_CHANGE
AW_EVENT_AVATAR_DELETE
AW_EVENT_CHAT