|
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
|
09-22-2008 09:57
heyas;
okay, this is the exit routine for a script of mine that controls the avatar's controls and trigger animtions. the controls/animations work great, but i keep getting 'trying to stop animations, but permissions not set' when it exits.
if(stopanim != "") { if((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) llStopAnimation(stopanim); llSleep(0.5); } llReleaseControls(); llResetScript();
did i write this wrong, somehow? im TRYING to tell it to STOP trying to stop the animation if the permissions aren't set. (which they should be, unless the script is getting to the release controls/reset before its getting to the stop animation bit. hence, the sleep.)
its driving me nuts. i need to stop the animations i put on and release the controls/permissions. (btw, are those the same thing?) thanks!
_____________________
Why Johnny Can't Rotate: http://forums.secondlife.com/showthread.php?t=94705
|
|
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
|
09-22-2008 17:32
Use a little more braces... Maybe the compiler got confused. if (stopanim != ""  { if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { llStopAnimation(stopanim); } } llReleaseControls(); llSleep(0.5); llResetScript(); And there is no relation in between controls and anims.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
09-23-2008 05:32
Can that have been the problem? If the compiler is that easily misled, should definitely file a jira... but I'm guessing something else is going on here, although I'm not sure what.
I don't think it should be necessary to put in the llSleep() -- the script is going to execute sequentially. But I suppose it's just conceivable that there could be a different race condition, where the script loses permissions between the time they're checked and the time they're actually used... which I've never seen, but could almost imagine when something is being detached. (Is this "exit routine" triggered by an attach() event at detachment time? Or something else?)
I'd much prefer to think that there's another llStopAnimation() hiding somewhere in the script.
(Oh, and right: controls and permissions are two different things: a script can llReleaseControls() and later llTakeControls(), having retained PERMISSION_TAKE_CONTROLS in the interim.)
|
|
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
|
09-25-2008 09:51
heyas;
adding an llSleep(5.0) after the stop animation call did the trick.
why? heck if i know. cuz it takes longer than the script resetting to stop the animation??
i dunno, animations are whacky these days :/
|