Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

poseball synchronize

Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
06-22-2009 05:51
Hi

I have 3 poseballs on a gun that are linked there have a winding animation

3 avatars sit on the poseballs and have a default pose in the ball

then i give a command secret channel or message linked and they all start winding together in sync then when the gun is loaded they all stop and the gun fires then a comand is given again
either manually or by the script

so i want the 3 identical animations to all sync when given a command

thats it really is it possible to turn the scripts on and off or do something simple like switch the animations by a command to make this happen

as they are sat on the balls then this has to betaken into account so a dance ball script wouldnt work

sorry completely lost :)
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
i think this is the problem...
06-22-2009 13:39
When you start the animations, what happens is that the animation data is sent to each person's viewer. Then the animation is played on the viewer.

The problem is that you cannot know how much time it takes to send the data. Therefore, the three avatars might or might not start at the same time.

The second time, it might be better, because the animation data has already been sent, and only the 'start' message needs to be sent, but even that is hard to predict.

You have to design your animation and the script with this in mind. One thing you might try is to start the animation, wait long enough for it to get everywhere, and then stop and start the animation again.
_____________________
So many monkeys, so little Shakespeare.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
06-22-2009 18:22
I'm confident that Lee is correct.

What many synchronizers do is change to an alternate animation and then change back, in such a way that all scripts doing the change do it at the same time (more or less).

In other words, for a linked set, one script calls llMessageLinked() to send a message to them all (including itself), and on receipt of this message, starts the animation.

As Lee says, this doesn't work the first time the anim is played, because the anims are sent to the client independently, and finish at different times, and the anim starts (visibly) when it's upload finishes.

So the first time, they're always unsynchronized. No real help for that. (I don't think there's an LL call to preload an animation -- correct me if I'm wrong!)

After that, they need to get resynchronized, either when the user does something to request it, or periodically, or both.

To resynchronize, you either
* start a different animation, then restart the original one, or
* stop the animation, WAIT for a tiny bit (i.e., llSleep()), and start it again

In either case, the restarting of the original one is what should happen at the same time in all scripts (as close as feasible), using a method like the llMessageLinked() mentioned above.

HTH
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
06-23-2009 01:11
thanks for your help i know what you mean and that has been very helpful

does anyone have any snippets they are prepared to share that i can drop into my poseball to experiment with that can do this?