Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Single Prim, Multiple Avatar Sit?

Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
05-15-2008 09:27
This is something that has been running through my head for awhile.

Can multiple avatars sit on a single prim using different animations and sit targets?

My thinking is that it's not one prim one avatar. Rather, one script one avatar. Have a master script use link messages to communicate with various sit scripts in the same prim, then each child script will seat the various avatars.

Does this sound plausible or workable?
Renee Roundfield
Registered User
Join date: 10 Mar 2006
Posts: 278
05-15-2008 09:31
It's one sit target per prim.
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
05-15-2008 09:32
Thanks for verifying. Looks like I'm going to have to do things the long way.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
05-15-2008 10:15
Yes. It is completely doable. You just can't rely on llAvatarOnSitTarget() alone. Once an avatar is seated, you can move the sit target and a new avatar can sit down; and/or you can move the avatar with llSetLinkPrimitiveParams() and a new avatar can sit down. To allow a new avatar to sit down, the sit target and the bounding box of already sitting avatars cannot intersect (or must be a certain distance apart, or something like that--needs further testing).

The trick is that it isn't trivial to figure out whether the original avatar is still sitting. To do that you have to iterate over the link numbers (on a 'changed' event) from one to llGetNumberOfPrims() and use llGetLinkKey() to test if the key is an avatar (or one of the avatars you know to have sat down).