Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
01-30-2007 07:09
I am trying to override the typing animation with another one. After a search of the forum, I found that the best way to do this seems to be with llGetAgentInfo. Using that function, it seems to catch when the typing *begins*, but then does not return a value again. So I cannot tell when typing *ends*. I have used a couple of code snippets found on the forum and modified for my use . . . both produce the same result. The new animation begins, then abruptly ends. I can modify slightly by setting a new timer event for, say 3 seconds, and the new animation goes that long. But the next time the timer fires, it ends and does not begin again, though I continue typing. Any suggestions? timer() { if( ( llGetAgentInfo( Owner ) & AGENT_TYPING ) && !OwnerTyping ) { OwnerTyping = TRUE ; llStopAnimation( "type" ) ; llStartAnimation( Animation1 ) ; } else if( !( llGetAgentInfo( Owner ) & AGENT_TYPING ) && OwnerTyping ) { OwnerTyping = FALSE ; llStopAnimation( Animation1 ) ; } }
timer() { integer info = llGetAgentInfo(Owner); // New line to only save the status needed instead of everything info = AGENT_TYPING & info; if (Lastinfo != info) { llStopAnimation("type"); llStartAnimation(Animation1); } Lastinfo = info; }
Thanks, Baron H.
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
01-30-2007 10:58
This exposes a really kludgy part of the way SL works. It turns out that the AGENT_TYPING flag is in direct one-to-one correspondence to whether or not the default SL typing animation is playing on the avatar at the time. So when you discover that the avatar is typing, the first thing you do is to stop the typing animation... which makes llGetAgentInfo() report that the agent isn't typing anymore from then on.
Isn't that a pain? The only solution is to make your typing animation have a higher priority than the default animation, and make sure it overrides all of the parts of your body that the default animation animates.
There are other cases where stopping/starting animations has a direct effect on the actual behavior of an avatar. For example, if you stop the "prejump" animation at the right moment, your avatar will never get off the ground.
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
01-30-2007 11:20
Ah, so the way to deal with it is to not STOP the animation, but just allow it to "run" while my animation hijacks all the same joints?
Baron
EDIT: I tried that, and it worked great! Thanks so much!
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
01-31-2007 09:45
Yup, that's the way to do it. That unfortunately means that you HAVE to animate the arms in some way.
|