help!
okay, i'm scripting a game... its a greased pig game. when the player hits the pig, he has a chance of missing, and something disasterous/hilarious happening. such as being kicked up in the air and falling down into the mud. i want it to be kinda like falling in sl, where you cant move for 2 seconds while the 'pick yourself up' animation plays.
okay, so...
i pick some flavor text (text), an animation to play that is in the pig (anim), how much push to push (push), and how long to freeze the avatar (time).
forget push for a second, cuz its working on me, and i know all about push vs no push land and the owner and yadda yadda.
the animations are not playing, and the controls are not freezing. keep in mind, that this is for tinies, so they have a robust ao going on as well.
when a capture attempt is failed, this routine happens:
MissPiggy()
{
llSay(0, text);
if(time > 0)
{
llTakeControls(controls, 0, 0);
//--this is dead, i think, except other controls
llSetTimerEvent(time*3);
}
if(anim != "")
llStartAnimation(anim); //--this should go on who it has perms for
if(push >1)
llPushObject(player, <0.0, 0.0, push*2>, ZERO_VECTOR, FALSE);
PickMiss(); //--this is the routine picking another miss scenario.
}
now according to the wiki, this take controls 0, 0 should capture all the controls and not let them affect the avatar. ie: freeze them in place. if i'm running while this goes on, i seem to still keep running. so, not good.
(controls, by the way, are all the keyboard control arrows, etc.)
the anim sometimes plays, but usually not. i suspect the ao is taking over and playing the running animation -- which it shouldnt, because i froze its controls, and the avatar should be immobile.
the timer event releases -- or rater, just returns to passing controls
timer()
{
llSetTimerEvent(0.0);
llTakeControls(controls, 0, 1);
//--should pass all controls with no intercepts
//--or should it just release controls!?
}
this seems to be fine, though i dont know the difference between this and releasing controls. i suspect that since i want to capture the controls a lot, i shouldnt release them in between. maybe that's an erroneous thought.
also... could it be that the control forward being held down slips past the take controls? it just stays down to move me? that is not good.
should i freeze the avatar in another manner? ie: by sticking them to the ground? might work better. :/
is there anything flaky with freezing controls