How do they do this - Pausing animations & keep anims in synch
|
|
Ynot Fenua
Registered User
Join date: 11 Oct 2006
Posts: 18
|
08-30-2007 07:51
I would like to try to recreate an effect i have seen on a number of dance balls in world. Where the Balls are paired - then the first agent to use the ball stands still in some sort of frozen dance like pose until the 2nd ball is also used - at which point the two avatars dance in unison - so - how do they do that ? My ideas where :
1) Some sort of static pose - consisting of the first frame of the dance gets triggered first, and then the 2nd full animation gets triggered when the 2nd ball gets occupied.
2) the script starts the animation but pauses it somehow.
but from the scripting wiki it looks like #2 above is not possible - now way to pause.
Also once two animations are going how do you keep them in synch - the only way i can see it to stop them (using linked messages to synchronise) and then restart them.
\Any other thoughts gratefully received.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
08-30-2007 08:29
They most likely have 2 animations...first is a pose animation that is the first frame of the dance that triggers on sit, and then when the 2nd person sits, it just starts the real dance animation.
|
|
Alora Perse
Registered User
Join date: 22 Dec 2005
Posts: 34
|
09-03-2007 19:55
scriptarded here..how do you do that? With lets say five 30 second anims in each ball. How do you get them to start only if there is someone on each ball, to play the anims in the right order, and stay synced? And the avs keep returning to the prim when the anim changes tot he next one insted of playing the next one from where the last one placed them. Help?
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
09-04-2007 00:04
You are on the right track with #1 above.
That's basically how they work; they use a static pose animation, then a higher-priority motion animation. It works sort of like this:
1) First person stands on one of the balls. 2) The script in that ball starts the pose animation and messages the other ball that it is occupied. 3) Second person stands on the other ball. 4) The script in the second ball messages the first ball that it is occupied and starts the moving animation. 5) The first ball receives the message, and starts its counterpart moving animation. 6) When either person stands up from the ball, the moving animation is stopped (as well as the pose animation, if it was played) and the ball which was vacated sends a message to the other ball to inform it of that fact. 7) The other ball receives that message, stops the moving animation, and starts its pose animation, if it wasn't already started.
You don't have to play with the animation priorities if you don't want to, instead stopping /starting the pose animation manually; priorities make it a bit smoother, I think. Also, you can insert delays to compensate for message reception and processing time to try and keep the dancers in synch.
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
09-04-2007 04:27
To answer your other question regarding how to have multiple dance animations.
Let's say you wanted the dance animations to change on touch. You would simply have the list of dances in the script, and each time the person touches it would move to the next one in the list. It would message the other prim to let it know to also go to the next dance anim. Could even just message a more specific message to make sure they both are at the same dance anim.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
09-04-2007 04:43
From: Alora Perse scriptarded here..how do you do that? With lets say five 30 second anims in each ball. How do you get them to start only if there is someone on each ball, to play the anims in the right order, and stay synced? This is actually simpler than it all sounds. First, most poseballs don't bother to automatically re-synch after the sequence has started for all the avatars involved; they usually do resync on command, however, which starts everything afresh, as if all the avatars just sat again. Now, playing multiple animations in a smooth series is very probabilistic at best, even if there's only one avatar involved; that's because the anims are playing on the client, and the server is the one running the timer for starting the next anim in the series, so the "smoothness" is subject to both the vagaries of the sim timers and the indeterminate delays in messaging the client; generally, one shaves a few milliseconds off the actual animation duration and hopes for the best. (Just to make it all uglier: the first time an animation is played on a viewer it has to be downloaded, so there's a *big* indeterminate delay there, which will differ from one viewer to the next; hence the necessity of some resync command.) From: Alora Perse And the avs keep returning to the prim when the anim changes tot he next one insted of playing the next one from where the last one placed them. Ah, well, an animation never moves the agent's location in the sim at all; it only displaces the avatar's appearance in the viewer. So, no matter where it looks like the avatar has danced off to, the next animation will always be rooted at the same spot as all the others. (If one *wants* to displace the agent, there's llSitTarget() and llSetLinkPrimitiveParams()--but if done while an animation is playing, the avatar is moved both by the animation and by the scripted displacement of the agent's location. I've spent hours trying to make all that seem invisible for an otherwise beautiful B&B dive animation that needs an agent location at the diving board--which, untweaked, drops the agent into the pool directly under the dive point, several meters from where the avatar's "dive" left him off; my results are, uh, not entirely satisfying.  )
|
|
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
|
09-04-2007 05:16
From: Qie Niangao I've spent hours trying to make all that seem invisible for an otherwise beautiful B&B dive animation that needs an agent location at the diving board--which, untweaked, drops the agent into the pool directly under the dive point, several meters from where the avatar's "dive" left him off; my results are, uh, not entirely satisfying.  ) I would assume you're doing this by offsetting the sit target and having the 'dive' animation start at a height comparable to the distance between the water and the board? I'm not sure how smooth you could do that transition as I would think that even firing the animation immediately from the changed event there might be the occassional *blink* as the avatar appears to jump from where you want them to end up at, to the board where the anim starts, but I would think this should work to have them end up where you want though. If it is being done by altering the sit target and the sit target is just not lined up, I would try first seeing where the anim should ideally have you end up (when the animation is lined up right where you want it), and just adjust the sit target until you end up there. Then offset the animation by the same amount as the sit target was. If that isn't possible - like if we're talking about an anim that you're using and not one you made - it would get more complicated, which it sounds like you're trying to move the avatar after the animation ends, or at some point during the animation, to the spot you want them to end up at.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
09-04-2007 06:20
From: Tiarnalalon Sismondi If that isn't possible - like if we're talking about an anim that you're using and not one you made - it would get more complicated, which it sounds like you're trying to move the avatar after the animation ends, or at some point during the animation, to the spot you want them to end up at. Right, that's exactly the problem: it's a very nice Craig Altman anim, with the unfortunate side-effect upon standing of pulling the avatar back to the location of the agent--which is plummeting into the pool under the diving board, given any plausible-looking llSitTarget. So the best I've come up with is to timer-wait till the animation has completed, then momentarily llSetPos the sat-upon prim to correspond to the apparent location of the avatar (pushing him even further from the diving board for an instant), then unseating him, which pulls him back where he was at the end of the dive; then pull the prim back to the starting point. For some reason, llSetPos of the prim seemed to be smoother than an llSetLinkPrimitiveParams of the avatar alone, although that may have been superstitious; it's not a very satisfactory solution either way. At one point I even tried doing physics on the agent after he stands, to push him back where the animation appeared to leave him; that looked about as ungraceful as it sounds. I suppose the only "right" way to get around this would be to create another, "swim back" animation that plays after the dive is complete, starting at the same avatar offset from agent location, and "swimming" him back to directly under that location--but that's far too ambitious for my pathetic animating skills.
|