Jump to content

Vehicle scripting: Avatar placed in "always run" mode when dismounting.


Andrea Curtis
 Share

You are about to reply to a thread that has been inactive for 3321 days.

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

Recommended Posts

I have built and scripted a submarine, and mostly it works fine, but I have a niggling bug that I can't figure out. When I stop the sub and unsit from it, sometimes my avatar is in "always run" mode, as if I had pressed Cmd-R or double-tapped up-arrow. I can clear the problem by pressing Cmd-R twice, but it is annoying.

Testing seems to suggest that my avi is remembering keypresses issued to the submarine. I think my problem must be that somehow I am not clearing the sub controls properly, but I issue llReleaseControls() when the the submarines "engine" stops, and if the avi unsits without stoping the engine too.

Can someone point me in the right direction, please?

 

Link to comment
Share on other sites

If your avis always supposed to stand up as part of the shut-down process, you can try deliberately stopping all animations just before she stands.  Something like this .....

listen (integer channel, string name, key id, string msg){    if (msg == "Shutdown")    // From a dialog, maybe?    {        Shut_off_engines();   /// Whatever you do to turn off the engines.......        llReleaseControls();        list temp = llGetAnimationList(llAvatarOnSitTarget());        integer i = (temp !=[]);        while(i)        {            --i;            llStopAnimation(llList2String(temp,i));        }        llUnSit(llAvatarOnSitTarget();    }}

 You'll still have a problem if your av stands up without going through the sequence, but this should kill all anims so that your AO can start fresh once you're standing.

 ETA:  It just occurred to me that you could also be running "striding", actually)  because you're interacting with a physical object.  See if it helps to put llSetStatus(STATUS_PHYSICS,FALSE) in that shutdown sequence.  

Link to comment
Share on other sites

Thanks for the reply, Rolig,

I do issue an llStopAnimation on avatar standing. And my "stop engine" sequence does set physics off. That's not really the problem. My avi does not animate after standing, or while "tangled up" in the vehicle. Instead, when I press the up arrow key to walk forward after dismounting, my avi runs instead of walking.

Further testing seems to confirm that this problem only arises if I have "double-tapped" the up arrow key while in vehicle mode. It's as if those keypresses (which would normally activate running) "bleed through" from vehicle mode to avatar-walking-about mode.

As a work-around I'm going to try turning off "double-tap" running.

Link to comment
Share on other sites

I noticed lately that the avatar tries to run when unsit from a transportation device (only sometimes). Since I use a similar code like Rolig posted above, that stops after a fraction of a second.

So I don't know where that comes from (SL, viewer, AO, viewer-AO?), but I kill all animations on sit and unsit and that clears all weird effects.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3321 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...