Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Pose script lockup?

Moonshine Herbst
none
Join date: 19 Jun 2004
Posts: 483
08-06-2005 08:11
Im having a problem with most pose scripts, both in furniture I buy and when i put in a pose script myself.

The problem is this: Whenever the AV that sits gets disconnected unexpectedly, it seems like the script hangs up with the former AVs key or something.
I get this: Unable to find specified agent to request permissions.
And in most of the furniture, the sit script is not working.
And the weird thing is that it doesnt even help to reset the script or recompile it. But I can drag a new copy...

This happens both when AVs gets disconnected for being idle and if the server crashes. How can i get around this problem? I want it to detect when someone leaves unexpectedly and be ready for a new AV. Or whatever solution that solves the problem.

Here is the pose script i use myself, snagged from this very forum:
CODE
// FlipperPA's auto-transparent minimum lag pose thingy.

// STEP 1: Drop your pose into an object inventory with this script (only 1)
// STEP 2: Simply enter the text you wish to hover about the pose object below

string DISPLAY_TEXT = "Sit";

// STEP 3: Hit "SAVE" below. If you change the pose, you can reset the script to re-read the pose

/////////////////////// DO NOT CHANGE BELOW ////////////////////////
string ANIMATION;
integer is_sitting;

default
{
state_entry()
{
ANIMATION = llGetInventoryName(INVENTORY_ANIMATION, 0);
is_sitting = 0;
llSitTarget(<0,0,.1>,ZERO_ROTATION);
llSetTexture("5748decc-f629-461c-9a36-a35a221fe21f",ALL_SIDES);
llSetText(DISPLAY_TEXT,<1,1,1>,1);
}

changed(integer change)
{
if(change & CHANGED_LINK)
{
key av = llAvatarOnSitTarget();

if(av != NULL_KEY)
{
llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION);
}
else
{
if((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && is_sitting)
{
is_sitting = 0;
llStopAnimation(ANIMATION);
llSetText(DISPLAY_TEXT,<1,1,1>,1);
llSetTexture("5748decc-f629-461c-9a36-a35a221fe21f",ALL_SIDES);
}
}

}
ANIMATION = llGetInventoryName(INVENTORY_ANIMATION, 0);
}

run_time_permissions(integer perm)
{
if(perm & PERMISSION_TRIGGER_ANIMATION)
{
is_sitting = 1;
llStopAnimation("sit_generic");
llStopAnimation("sit");
llStartAnimation(ANIMATION);
llSetTexture("f54a0c32-3cd1-d49a-5b4f-7b792bebc204",ALL_SIDES);
llSetText("",<1,1,1>,1);
}
}

on_rez(integer start_param)
{
llResetScript();
}
}

Any ideas?
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-06-2005 09:03
you could use a timer to peridicly check on the agent.

CODE

string text;
string animation;

//Copyright 2005 Strife Onizuka
//Feel free to use, distribute and modify.

default
{
state_entry()
{
llSetAlpha(1.0, ALL_SIDES);
llSetText(text,<1,1,1>,1);
if(animation == "")
animation = llGetInventoryName(INVENTORY_ANIMATION, 0);
llSitTarget(<0,0,.1>,ZERO_ROTATION);
}
timer()
{
if(llAvatarOnSitTarget() == NULL_KEY)
{
llSetText(text,<1.0,1.0,1.0>,1.0);
llSetAlpha(1.0, ALL_SIDES);
llSetTimerEvent(0.0);
}
}
changed(integer a)
{
if(a & CHANGED_LINK)
{
key new = llAvatarOnSitTarget();
a = (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION);
if(new != NULL_KEY)
{
if(!a)
llRequestPermissions(new, PERMISSION_TRIGGER_ANIMATION);
}
else if(a)
{
llSetAlpha(1.0, ALL_SIDES);
llSetText(text,<1.0,1.0,1.0>,1.0);
llSetTimerEvent(0.0);
if(llGetAgentSize(new = llGetPermissionsKey()) != ZERO_VECTOR)
{
llStopAnimation(animation);
llRequestPermissions(new,0); //how you release permissions, doesn't show a popup
}
}
}
}
run_time_permissions(integer a)
{
if(a & PERMISSION_TRIGGER_ANIMATION)
{
llSetTimerEvent(5.0);
llStopAnimation("sit");
llStartAnimation(animation);
llSetAlpha(0.0, ALL_SIDES);
llSetText("",<1.0,1.0,1.0>,1.0);
}
}
}


And thats how you make it not use a global variable to track the status.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Moonshine Herbst
none
Join date: 19 Jun 2004
Posts: 483
08-06-2005 09:15
Thanks a lot! I'll test how it works and report back.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
08-06-2005 09:16
Just ran the script and forgot to put a floating text in the state entry. I've updated the script and it runs. It should handle AWOL users in stride.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey