Jump to content
You are about to reply to a thread that has been inactive for 2351 days.

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

Recommended Posts

Hey all, 

I have a pose vendor script that I am trying to modify to my needs. I have everything working as I want, with the exception of the permissions needed to run the animations correctly. At the moment, when the script is reset and I stand my main avatar on the pose stand everything is working as intended. If I again reset the script, but place my alt avatar on the stand, my alt just sits - no error messages. The controls to switch the animations in the stand works as intended, but no animation is played, just a default sit. Upon standing, I get the "Script trying to stop animations but PERMISSION_TRIGGER_ANIMATION permission not set" error. If I place my main avatar back onto the pose stand without resetting the script, everything works again - as well as placing my alt onto the stand, everything works. So it seems as the permissions are being granted to my main avatar, and the stand holds those permissions until the script is reset. Somewhere along the line, the script is not granting permissions to others. If someone is able to help me with this and help me understand why its not working correctly, I'd greatly appreciate it. I have a very basic understanding of scripting, but can usually work my way through problems with the help of the wiki and forum searches. This one has me stumped though.

 

I'll include a snippet of the code where I am trying to request the permissions to animate below.

changed(integer change)
    {
        if(change == CHANGED_LINK)
        {
            avatar = llAvatarOnSitTarget();
            if(avatar != NULL_KEY)
            {
                llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
                start();
            }
            else
            {
                if (llGetPermissionsKey() != NULL_KEY) 
                {
                    llStopAnimation(curranim);
                    anim_on = FALSE;
                    default1();
                }
            }
        }
    }
    
    run_time_permissions(integer perm)
    {
        if(perm == PERMISSION_TRIGGER_ANIMATION)
        {
            llStopAnimation("sit");
            llStartAnimation(curranim);
            anim_on = TRUE;
        }
    }

 

Below are the code for the start() and default1() states. I don't know if the info in them are necessary to solve the problem, but since the above code directs to them, maybe something in there is the cause of the problem?

start()
{
    llSetClickAction(CLICK_ACTION_TOUCH);
    total=llGetInventoryNumber(INVENTORY_ANIMATION);
    vendorname = llGetObjectName();
    counter=0;
    lastanim = curranim;
    curranim = llGetInventoryName(INVENTORY_ANIMATION,    0);
    if (price > 0)
    {
        hovertext();
    }
}
default1()
{
    GreetingText();
    llSetClickAction(CLICK_ACTION_SIT);
    llSetTimerEvent(time);
}

I don't want to post the whole script here, so if more info is needed, I would be glad to share through in world messaging.

 

Thanks!

Link to comment
Share on other sites

6 hours ago, LuckyJunior Serrari said:

Below are the code for the start() and default1() states.

But these are subroutines, not states, right? so calling them shouldn't keep events from reaching the run_time_permissions handler, unless there's something else going on outside the posted script parts.

And on that subject, I'm a little worried about what the timer() event is doing. It's started in default1() which happens when the sitter stands, although I'm not sure what it could do to cause that permissions error with stopping animations. But there's clearly much more code involved with switching animations on touch (which evidently isn't working), so... this guessing is probably futile.

Link to comment
Share on other sites

@LuckyJunior Serrari Since the integer passed to the changed and run_time_permissions events is a bitfield representing all the changes/permissions at the time the event was triggered you should always use & (bitwise AND) rather than == when trying to determine what changes have occurred/permissions have been granted.

Edited by Fluffy Sharkfin
  • Like 2
Link to comment
Share on other sites

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