Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with animating muliple Avs

Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
09-04-2007 17:31
Hello Everyone,

I'm trying to learn the best way of animating multiple avs. for example I'd like to make a set of pose balls for couples. Animating a single av seems pretty straight forward.

Do I need to use a separate script to animate each person, or can I do it all from a single script?

If I use multiple scripts, how would i do that? I'm guessing just pass the users key to the second script and let it take over. Is this correct?

Any example, or links, pointers are greatly appreciated.

Thanks!
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
09-05-2007 00:56
A script can animate only one avatar at a time; note that llStartAnimation() does *not* take an agent UUID as an argument--it's gonna animate that avatar for which the script has most recently gotten permissions.

In poseballs, that's fine, because each ball will want a script to detect the CHANGED_LINK events for its specific sitter (along with setting llSitTarget, etc.). Generally, paired poseballs are linked, so they can use link_messages to tell each other what they're doing, e.g., to sync animations (another thread about that here somewhere, very recently). (It's not a total win for paired poseballs to be linked, though; on the plus side, they retain relative position and orientation when moved, but unfortunately they end up sharing the root prim's llSetSitText pie-menu string, no matter what you put in the child prim.)

In stuff like dance machines, the one-animated-avatar-per-script situation is handled by a whole bunch of little slave scripts in the dance machine prim, all controlled by a master script that farms-out dancers to the slave scripts, one avatar per script.
Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
09-05-2007 07:00
Thanks Qie that's very helpful! I would really like to hear more about your dance machine example. What's the best way to manage the slave scripts so that you know which ones are available and which ones are in use and would you just pass the users key via linked message.

Also. I have never used more than one script in an object before, is there a way to set one script as the "default script" or would this simply be the only script that would react to a sit, or touch, etc?
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
09-05-2007 07:27
I think everybody starts with the "Solop Server" source, available at , and tinkers. My tinkering eventually led me to start from scratch to build something more specialized--but also considerably less laggy for my application. I'm pretty sure that LearJeff Innis has been up to much the same mischief for more general use--see .

There's not really a "default" script in a prim--all of the scripts can be running and waiting for events, and processing them in parallel. But a very common design pattern is to have "slave" scripts that process only link_message events sent from a controller script; the Solop Server source is an example of that approach.
Dire Graves
Registered User
Join date: 3 Sep 2007
Posts: 51
09-05-2007 09:47
Thanks Qie, This should be plenty to get me started and I'm sure I'll come up with my own approach too. Appreciate your help!