Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Attachments that detect stand up

Ryder Spearmann
Early Adopter
Join date: 1 May 2006
Posts: 216
10-20-2007 14:25
Imagine a napkin, worn, on a sitting avatar.

How can the napkin detect when the avatar stands, so that it can detach or kill itself?

Thanks so much!
revochen Mayne
...says
Join date: 14 Nov 2006
Posts: 198
10-20-2007 15:47
Hi Ryder

i would suggest something like:

if(llGetAnimation(your_key)!="sit";) // or your own custom sit animation
{
llDetachFromAvatar();
}

at a running timer event should work.
i dont know any other way as the change event cant detect
when an avatar unsits or its animation has changed.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
10-20-2007 16:00
llGetAnimation actually works differently from llGetAnimationList in that it returns an avatar's "basic state" rather than the currently playing animation. So, llGetAnimation(id) == "Sitting" should work even if the default sit animation has been stopped, and a new one started. (According to the wiki page that is what the function returns - it is not "sit" or "sit_generic" or whatever.)
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names