Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

having trouble detecting when someone unsits from a chair.

Chri5 Somme
:)
Join date: 18 Nov 2005
Posts: 204
03-30-2006 00:38
Hey im having trouble detected when people stand up off of my chairs that im making for my bar. I want it to say a good bye message when tehy stand up but when ever i use the "changed" call, it doesn't work. Does anyone have any suggestions or different ways to detect if someone stands up from an object.
Paul Churchill
Pie are squared
Join date: 8 Sep 2005
Posts: 53
CHANGED_LINK fires ok
03-30-2006 02:07
a quick check in-world shows that the changed event is fired with CHANGED_LINK (0x20) as the parameter on avatar sit and unsit.

try

CODE
changed(integer changed)
{

llOwnerSay( (string) change);

}


sit and unsit gives you 32 (==0x20)

are you trapping the sit event ?
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-30-2006 02:15
Try

(a) setting a sit target with llSitTarget so you can use llAvatarOnSitTarget()

(b) checking the value of llAvatarOnSitTarget() on the change event

e.g.

CODE

state_entry()
{
llSitTarget(<-0.4, 0.0, 0.3>, ZERO_ROTATION);
}

changed(integer change)
{
if ((change & CHANGED_LINK) && llAvatarOnSitTarget() == NULL_KEY) {
llWhisper(0, "Goodbye!");
}
}