Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stop Animation

Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
02-18-2007 00:38
i have changed an existing script (see below) to stop animation and it works fine in most of the cases. But if i use the script while i am dancing on a dancefloor than the script
works for a few seconds (most of the time about 30 sec) then i start dancing again.
(i don't happens with all dancefloors)

I think the problem is that the some dancefloor keeps a list with Avi Keys and restart the
dance every XX seconds or change to a different dance every XX seconds.
my script works then only until they change/restart the dance.

Do someone now how to fix this?
i can read script but i am a newbie on scripting

//The orginal script was from Zalandria Zaius.
//and is changed bij Kaylan Draken

key stopme;
string Stand="stand";

default
{
state_entry()
{
llListen (0, "", llGetOwner(), "";);
}

listen(integer channel, string owner, key id, string message)
{

message = llToLower(message); //convert message to lowercase

if(message == "stop!";)
{
stopme = llGetOwner();
llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
}

}

run_time_permissions(integer a)
{
if (a & PERMISSION_TRIGGER_ANIMATION)
{
string null=(string)NULL_KEY;
list a=llGetAnimationList(stopme);
integer b;
for (b;b<llGetListLength(a);b++)
{
//llSay(0,llList2String(a,b));

//sometimes it gives you a null key
//it's a bug and very annoying. remove if statement when fixed.
if (llList2String(a,b)!= null )
{
if(llList2String(a,b) != "2408fe9e-df1d-1d7d-f4ff-1384fa7b350f";)
{
llStopAnimation(llList2String(a,b));
}
}
}

llUnSit(llGetOwner());

llSay(0, "Stop Animation";);

}

}
}
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-18-2007 03:09
Sounds like you are still being controlled by the dance floor and its updating its dancers list which still includes you.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-18-2007 03:53
This raises a thought... once an agent has granted permission to a script, is it possible for that agent to unilaterally revoke that permission?

Lets say I allow a PERMISSION_TRIGGER_ANIMATION to Object McNuisance... how do I revoke that permission? And how long does that permission persist... within a certain range, within a region, between log-ins?

Oh, and if the answer has horrible Griefing Potential please lets not discuss it here. :(
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
02-18-2007 04:14
thats the problem i have give a script permission to animate me, how can i
redraw that permission.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-18-2007 05:19
From: Kaylan Draken
thats the problem i have give a script permission to animate me, how can i
redraw that permission.



The usual method for dance balls / floors is to touch them again.
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
02-18-2007 05:28
i know but i want to make a script that stop all animations including the dancefloor ones
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-18-2007 08:41
From: Kaylan Draken
i know but i want to make a script that stop all animations including the dancefloor ones


Then I am afraid you dont understand the concept of permissions in SL.
The only way to stop something else that has permission to manipulate your AV is revoke the permissions.

Just stopping an animation doesnt stop the other object from having trigger animation rights.

The way a dance ball works is that when you click on then a script gets permissions and stores your key. Then as it cycles through each of its dance animations it will send an llStartAnimation which will cause your Av to dance. This will continue to happen until you cancel its rights to control you.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-18-2007 09:47
From: Newgate Ludd
This will continue to happen until you cancel its rights to control you.
...until You cancel its rights, or It cancels those rights for you?

What if the script doesn't have any logic to revoke the permissions and keeps them forever?

<dances off into eternity> :eek:
Serenarra Trilling
Registered User
Join date: 14 Oct 2006
Posts: 246
02-18-2007 12:24
A friend and I may have run into something like this recently.

We were furniture shopping, and saw a free popcorn vendor. We thought that was kind of cool, so we each grabbed one.

When we wore them (which was what they said to do), they rezzed on our butts. When we got done laughing, we both detached them, then the eating animation started. Nothing we did, including the useless "stop aninmation" in the menu, starting other animations, or even teleporting home, stopped the stupid anim. We both ended up having to log out and back in again before they would quit.

So some of them can get into an endless cycle kind of thing. This instance was sort of funny, but it could be kind of bad if a greifer figured out how to do that on purpose.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-18-2007 14:15
Its basically the same as tp'ing while sat on a pose ball, you exit before it can be turned off so are stuck in a sit position until you perform a stop all anims.

Although it does have greifing potential its limited, a script can only have trigger animation permissions for one AV at a time and I think its limited to within the same sim.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
02-18-2007 14:46
I did some experiments... it's actually kinda flakey.

I set up a timer to report if the permissions were still set, to start the sit animation, and request permissions if they were lost... and then moved away from the object until I crossed a sim boundary. The animation would immediately stop triggering at that point, although the permission persisted for about 30 seconds. Then it died too. Requests to regain permissions also appeared but only very, very, rarely (no real pattern). llInstantMessage was the only thing that worked fine. :)

The grid was lagging like mad so that might also be a factor.

Broadly though, the PERMISSION_TRIGGER_ANIMATION permission seems quite tenuous once you've left the sim.