Jump to content

Full perm typing animation question.


Magnus McGettigan
 Share

You are about to reply to a thread that has been inactive for 378 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

16 minutes ago, Magnus McGettigan said:

Would you know of any typing scripts that stop looped sounds?  I have a few but they wont stop the animations or sounds.

Sounds are never 'inherently' looped like animations can be. If you want just a single go when you start typing, something like:

integer isTyping;
integer doAnimation;
float ANIM_LENGTH = 5.0;
string ANIM = "myAnimation";
string SOUND = "mySound";
default()
{   state_entry()
    {   llSetTimerEvent(0.2);
    }
    timer()
    {   integer typing = llGetAgentInfo( llGetOwner() ) & AGENT_TYPING;
        if(typing!=isTyping)
        {   isTyping=typing;
            llResetTime();
            if(typing)
            {   llPlaySound(SOUND,isTyping);
            }else
            {   llStopSound(); // wiki suggests this might not do anything for sounds not started with llLoopSound.
            }
            doAnimation=isTyping;
            llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
        }else if( isTyping && doAnimation && (llGetTime()>ANIM_LENGTH) )
        {   llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
         	doAnimation = FALSE;
        }
    }
    run_time_permissions(inteegr perm)
    {   if(perm&PERMISSION_TRIGGER_ANIMATION)
        {   if(doAnimation)
            {   llStartAnimation(ANIM);
            }else
            {   llStopAnimation(ANIM);
            }
        }
    }
}

(untested) might work.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 378 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...