Jump to content

Can we set priorities (animation) inside a script?


Galatheus
 Share

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

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

Recommended Posts

Hi again script experts. I have an animation with a priority that seems below (on upload) most AOs on sl. Problem is, this is the only animation I found that I need for this project. I'm stuck.

When I activate the animation with the script it doesn't play over my AO and I have tried it with different ones. Is there a way to set this anim's priority to 4 with scripting?

Link to comment
Share on other sites

Thanks for all the response, I guess all I can do now is to tell users to turn off their AO first. Not the result I'm looking for. 

But that said, I saw some functions in the LSL Portal such as llSetAnimationOverride. Can I somehow use this instead to override whatever animation is currently playing on an avatar?

Link to comment
Share on other sites

2 hours ago, Galatheus said:

Thanks for all the response, I guess all I can do now is to tell users to turn off their AO first. Not the result I'm looking for. 

But that said, I saw some functions in the LSL Portal such as llSetAnimationOverride. Can I somehow use this instead to override whatever animation is currently playing on an avatar?

Not without potentially breaking the user's AO.

Link to comment
Share on other sites

llSetAnimationOverride is used to permanently (well almost permanently) alter the default animation which plays for a given avatar state - like walking, running, flying, etc. It was designed to be a more efficient replacement to the traditional AOs which were very resource heavy with their constant polling of the avatar's state. The changes made by llSetAnimationOverride will survive through everything - even removing the script that started it. The only thing that stops the override is calling llResetAnimationOverride or relogging.

Using llSetAnimationOverride to overcome an existing AO can potentially be dangerous as Wulfie states. If the AO itself uses the override function, you are effectively replacing their default animations - as each animation state may only have one override defined at a time. Even if your project resets its override, that won't restore the AO's override. Best case scenario the AO will likely need to be reset to re-apply its own override.

Regardless of which AO method an avatar uses, the priority of the animation is still in effect. In other words, if you are currently playing a high priority animation and want to start a lower one (which affects the same joints), you'll need to stop the higher priority before the other will be seen

Edited by Fenix Eldritch
Link to comment
Share on other sites

This reminds me of a function I thought of for my own furniture based application.

Sometimes, guests' scripted "Sitting" AO interferes with the priority animations I'm using in my furniture.

This is why I thought about filing a request for the function, llStopOverrideAnimation(<insert locomotion here>) which uses PERMISSION_TRIGGER_ANIMATIONS.

This will stop whatever animation is used for the input locomotion state IF that state is currently present.

This means it won't break AO's, because once the user's locomotion changes to a different state, then back again, the AO animation will play once again.

I was initially only going to request it for sitting, but left the input open for any locomotion in case there are other applications.

Thoughts?

Link to comment
Share on other sites

Does stopping the basic built-in default sit, as in llStopAnimation ("sit") – which used to be a standard practice when animating an avatar that's sat on something – extend to stopping the overridden default sit animation set by llSetAnimationOverride?

Edited by KT Kingsley
Link to comment
Share on other sites

1 minute ago, KT Kingsley said:

Also, I wonder if the OP might work around their problem by using llGetAnimationList and looping through that and stopping all the animations it contains except for the one they want to use?

That's a standard approach, but of course it doesn't work if the anim you need to stop is a higher priority anim being restarted by your AO.

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, KT Kingsley said:

Does stopping the basic built-in default sit, as in llStopAnimation ("sit") – which used to be a standard practice when animating an avatar that's sat on something – extend to stopping the overridden default sit animation set by llSetAnimationOverride?

Yes, using llStopAnimation on the internal animations will also stop whatever animation has replaced it.

It doesn't work in reverse though. If you start an internal animation, the replaced animation won't play.

P.S. I tested this with "sitting on ground" and... please don't control that feature via scripts. It's... buggy.

default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(), 0x8010);
    }

    run_time_permissions(integer perm)
    {
        if(perm)
        {
            llSetAnimationOverride("Sitting on Ground", "Club Penguin Dance");
        }
    }

    touch_start(integer n)
    {
        llStopAnimation("sit_ground_constrained");
        // llStartAnimation("sit_ground_constrained");
    }
}

 

Edited by Wulfie Reanimator
  • Thanks 1
Link to comment
Share on other sites

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