Jump to content

Uncuffed!?


Bem Beyaz
 Share

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

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

Recommended Posts

So I have these cuffs and, yes, it's an RLV thing and being cuffs, the wearer has to appear cuffed. In order to achieve the effect I run this laggy routine on a high priority overlay animation for shoulders, upper arms, forearms and hands:

 

    run_time_permissions(integer value)
    {
        if (value & PERMISSION_TRIGGER_ANIMATION)
        {
            animation = "Cuffed";
            llStartAnimation(animation);
            llSetTimerEvent(1);
        }
    }

Outside of run_time_permissions, how can I effectively test for animation permissions, say for instance in a global function?

By the way, do we have a more efficient method of scripting an animation override in LSL these days?

Link to comment
Share on other sites

You can always check to see whether permissions have been granted by asking llGetPermissions, as in

           if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) {// Do stuff}

Efficiency is more a matter of how you write your script than what functions are available, but the reasonably new function llSetAnimationOverride should help.  It is UNdone with llResetAnimationOverride.

  • Like 1
Link to comment
Share on other sites

Thanks for the heads-up on the new animation override functions, Rolig. I much prefer to use those in future.

However, following extensive tests I found that since the built-in AO is called with run_time_permissions it gets overridden by the animation in any object on which the captive is forced to sit. This can be useful on occasion but it is not always desirable

I have tried using my laggy little patch in a subsequent dialog:

 

    llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);    llStopAnimation(animation);    animation = "Cuffed";    llStartAnimation(animation);    llSetTimerEvent(1);

 

But that causes the animation to persist after the captive has the cuffs removed.

Is there any way that I can restart the AO elsewhere in my script using llSetAnimationOverride?

Link to comment
Share on other sites

Hmmmm... If your AO uses anims with a higher priority than whatever you are hoping to use in your scripted device, the AO will win.  llSetAnimationOverride will tell the object what to use in place of the system default animations for "sit", "fly", "stand" and so forth, so it's a good tool for making an AO.  If you already have one that it has to fight with, though, all bets are off.

Link to comment
Share on other sites

There's absolutely no problem between this minimal AO and the cuffed av's usual AO. The cuffed animation is set to the highest priority as it should be so it works well enough.

I'd just like to know whether or not it is possible to change the single animation on the fly -- calling the "Cuffed" animation as a string variable for instance so that it can be replaced where needed?

.

Link to comment
Share on other sites

You should be able to.  The last snippet that you posted handles the anims outside of the run_time_permissions event, which could be a problem.  If you always either request permissions or check permissions before you start or stop an animation, then you should be able to change the specific anim any time you need to. As in ....

touch_start(integer num){    if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)    {        llStopAnimation(gsCurrentAnim);        giNext = (++giNext)%(llGetListLength(glMyAnimationList));        gsCurrentAnim = llList2String(glMyAnimationList, giNext);        llStartAnimation(gsCurrentAnim);    }    else    {        llRequestPermissions(llDetectedKey(0),PERMISSION_TRIGGER_ANIMATION);    }}run_time_permissions(integer perm){    if (perm & PERMISSION_TRIGGER_ANIMATION)    {        llStopAnimation(gsCurrentAnim);        giNext = (++giNext)%(llGetListLength(glMyAnimationList));        gsCurrentAnim = llList2String(glMyAnimationList, giNext);        llStartAnimation(gsCurrentAnim);    } }

where you have declared the appropriate global variables gCurrentAnim and giNext and have loaded a global list glMyAnimations with available anim names. 

 

       

  • Like 1
Link to comment
Share on other sites

Thanks for that, Rolig.  I think your example in #7 is worth exploring in a rewrite of the classic Ziggy Puff/Franimation AO.

As it happens, I decided to use llSetAnimationOverride for the basic AO since it's light on lag and augment it with a simple llStartAnimation / llStopAnimation sub routine if required. The basic problem was that the AO was being overridden by poseball scripts and/or certain high priority animations so I wanted the option to recuff the captive if the poseball animation might be 'improved' with an overlay of cuffed arms. Obviously this would be something of a judgment call from one animation to another.

But it happened that the sub routine was causing the AO to stop altogether after the captive stood again.

I was confused to begin with until I realised (duh!) that I had to double up on the bitwise operators everywhere:

 

attach(key id){    if (id) llRequestPermissions(id, PERMISSION_OVERRIDE_ANIMATIONS | PERMISSION_TRIGGER_ANIMATION);    else if (llGetPermissions() & PERMISSION_OVERRIDE_ANIMATIONS | PERMISSION_TRIGGER_ANIMATION ) llResetAnimationOverride("ALL");}

I was completely stumped by this until I realised that both permissions were being revoked in the sub routine (llStopAnimation was dropping PERMISSION_OVERRIDE_ANIMATIONS as well as PERMISSION_TRIGGER_ANIMATION even though I was only calling the latter).

It appears to be working beautifully now and presumably it isn't hogging sim resources.

Thanks again, I really appreciate your suggestions on this problem.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3430 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...