Jump to content

Priority 6 hold animation, keeps getting overridden.


Agent242
 Share

Recommended Posts

Hi
I made a keychain with a hold animation and a acript to play the animation. The animation is priority 6, but still it seems to get overridden all the time (finger poses change with AO, animation stops after sitting on furniture, etc.)

Is there any way to ensure that the pose stays in place as long as the object is held. I assumed priority 6 would do it. The pose has an ease in/ease out animation, so not sure if restarting it on a timer would be such a good idea.

would love some help.

Here is the script I am using:
 

string animation_name = "hold";

default
{
    // Whenever this object is attached or detached...
    attach(key id)
    {
        if (id)
        {   // If it was just attached, request permission to animate.
            llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
        }
        else
        {   // It's being detached...
            if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)
            {   // If we have permission to animate, stop the animation.
                llStopAnimation(animation_name);
            }
        }
    }

    // Whenever permissions change...
    run_time_permissions(integer permissions)
    {
        if (permissions & PERMISSION_TRIGGER_ANIMATION)
        {   // If permission to animate was granted, start the animation.
            llStartAnimation(animation_name);
        }
    }
}


 

Link to comment
Share on other sites

 

12 minutes ago, Wulfie Reanimator said:

If another animation with the same (or higher) priority is played, the new animation will override the others.

Starting/restarting is something to try, but animations greater than priority 6 also exist.

It seems to keep working when I sit on a chair for instance, but then when I stand up, it stops working. It doesn't seem to me that any animation would be played when getting off the furniture. Is it because the act of standing from the furniture withdraws all permissions?

Link to comment
Share on other sites

Okay, so I solved it somewhat, by starting a 5 second timer event that resets the script every 5 secs, it keeps the pose without easing in if already playing and otherwise it starts the pose again. 

Is this an awful practice that will cause sim lag, or is it acceptable for a script?

Link to comment
Share on other sites

1 minute ago, Agent242 said:

Okay, so I solved it somewhat, by starting a 5 second timer event that resets the script every 5 secs, it keeps the pose without easing in if already playing and otherwise it starts the pose again. 

Is this an awful practice that will cause sim lag, or is it acceptable for a script?

Instead of resetting the script, you can simply call llStopAnimation and llStartAnimation in the timer event. Resetting the script is technically a bit overkill, but nothing major.

Link to comment
Share on other sites

13 minutes ago, Wulfie Reanimator said:

Instead of resetting the script, you can simply call llStopAnimation and llStartAnimation in the timer event. Resetting the script is technically a bit overkill, but nothing major.

Will do that instead. Thank you so much!

Link to comment
Share on other sites

Btw. there are ways to create prio 5 & 6 animations but according to my observations and test they will be handled as prio4 animations.

Any other prio 4 animation will override any 5&6 animation. prio 3 and less will not do it.

The real problem is that no one cares about the right priorities. Try to find an AO which animations are set to prio2...good luck. 

 

 

 

Link to comment
Share on other sites

Uploading a .bvh doesn't seem to retain the priority 6 on the bones even if the animation was created as such and the animation asset itself claims to be "priority 6", you'd have to use something that can create the internal binary .anim format instead.

Some of my findings in another thread some time ago.

 

  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...