Jump to content

Animations and Permissions help


Ralph Honi
 Share

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

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

Recommended Posts

I have a HUD with several buttons on it to start some animations.  The buttons communicate to a main animation "handler" script living the root prim of the HUD.  The following script for that "handler" works fine for my avatar.  What the problem is ... it does not work for other Avatars.   I figure it has to do with Run_Time_Permission so I am attempting to come up with a script to incorporate the Run Time and that is where I am stumbling.  Any help would be appreciated!  I have shortened the scripts for demonstration purposes.

This Script works fine on my Avatar only;

key avatar;
string anim;

default
{
    state_entry()
    {
        avatar = llGetOwner();
        llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
    }
    
    link_message(integer sender_num, integer num, string str, key id)
    { 
        if(str == "forward")
        {
            llStartAnimation("forward");
            anim = "forward";
        }
                
        else if(str == "right")
        {
            llStartAnimation("right turn");
            anim = "right turn";
        }
            
        if(str == "stop_anim" || str == "clear")
        {
            llStopAnimation((string) anim);
        }
    }
}

 Here is what I am trying with no success;


key avatar;
string anim;

default
{
    state_entry()
    {
        avatar = llGetOwner();
        llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
    }
    
    link_message(integer sender_num, integer num, string str, key id)
    { 
        if(str == "forward")
        {
            anim = "forward";
        }
                
        else if(str == "right")
        {
            anim = "right turn";
        }
    }
            
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
            llStartAnimation((string) anim);
    }   
}

 

Link to comment
Share on other sites

It's a common problem: The permission is being asked on state_entry which only gets triggered when you reset your script or compile it (since you have no other state than default). So the HUD won't get permission of the new avatar because it never requests them. Since it is a HUD, do the opermission requesting in the attach event.

Link to comment
Share on other sites

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