Raen Lu
Registered User
Join date: 30 Aug 2006
Posts: 4
|
09-15-2006 02:36
Ok, I'm currently trying to create a typing AO, but I encountered a problem I can't solve. I need to determine wether or not the avatar is currently typing. The first input I received was to use the function "llGetAnimation". But this function can only see animations like stand, sit, walk, turn left/right, jump, fly, and so on. Typing, however, is started by the function "llStartAnimation" and "llGetAnimation" does not see animations started by this function. The typical AO attachments I found only covered animations detectable by "llGetAnimation". If anyone knows how to do this (I know it's possible, I've seen it before), please share your wisdom with me.
|
Merik Drebin
Registered User
Join date: 22 Feb 2006
Posts: 4
|
Not really the thread for this...but:
09-15-2006 15:20
This thread is for animators that make the character animation files, the scripting assistance thread is Scripting Tips below this one under the Content Creation forums - but here's some information to help.  For a typing AO, what you want is a timer event that will check to see what the avatar is doing, if they are typing then play this animation instead of the default one. Since you're playing an animation, you also need permissions - this is a pretty common way of doing it: key gID;
default { attach(key id) //on attach - get animation permissions { gID = id if (id != NULL_KEY) { llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } } run_time_permissions(integer perm)// we have permission so start the timer { if (perm & PERMISSION_TRIGGER_ANIMATION) { llSetTimerEvent(0.5); } } timer() //on the timer event - if we're typing play our animation instead of the default { if (llGetAgentInfo(gID) && AVATAR_TYPING) { llStartAnimation("YourAnimationNameHere"); } } }
If your animation runs long or is looped you'll want to put an else in the timer to end the animation - otherwise this should work... or so I believe - I'm not in world or able to test the code at the moment - but it's pretty basic. ~M
|
Raen Lu
Registered User
Join date: 30 Aug 2006
Posts: 4
|
09-17-2006 13:35
Sorry about the wrong thread, I thought it would be correct since it's about an animation.
Thank you for your help, with that I was able to figure out. It is, btw, AGENT_TYPING, not AVATAR_TYPING.
|
Raen Lu
Registered User
Join date: 30 Aug 2006
Posts: 4
|
09-17-2006 14:13
Sorry about the wrong thread, I thought it would be right since this is about replacing an animation.
Anyway, that script isn't working. Actually the way the script is now (btw, it's AGENT_TYPING, not AVATAR_TYPING), the avatar is doing the animation all the time, not only when typing. As soon as I attach the AO, the avatar starts doing the new animation.
|