Jump to content

turning rotation while flying?


Ellie Oddenfen
 Share

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

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

Recommended Posts

so, without an AO on i noticed that the default animation set there seems to be a "banking" or turning effect when changing directions while flying, as you can see in this gif https://gyazo.com/7b276c9b482caf9123fbfeb3c5a5cf43

however, i don't think this is an actual animation as i can't find it in documentation anywhere. how do i preserve this behavior in an AO? it looks a lot more natural that way

Link to comment
Share on other sites

3 hours ago, Ellie Oddenfen said:

how do i preserve this behavior in an AO? it looks a lot more natural that way

I think you don't - I still do it with AO's on - must be a viewer setting.

PS: Maybe your AO has an upright flight animation where the banking cannot be seen as good. Try some other AOs then.

Edited by Fionalein
Link to comment
Share on other sites

My bet is that it is related to the AO and/or flying animation.  I use the built-in Firestorm AO and mine does not do that banking during a turn.  I tried a bunch of other AOs that I have in inventory and some had me banking during the fly turns and others did not.  I don't know enough about animations to make any better guesses on why/how.

Link to comment
Share on other sites

most AOs use a combination of: http://wiki.secondlife.com/wiki/LlTakeControls and: http://wiki.secondlife.com/wiki/LlGetAgentInfo

some example lsl pcode which shows the basics of animation banking in the control event

control(key id, integer level, integer edge)
{
   integer keydown = level & edge;
   integer keypress = level & ~edge;
   integer keyup = ~level & edge;

   integer agent_info = llGetAgentInfo(id);

   if (agent_info & AGENT_FLYING)
   {
       if (keydown)
       {
          if (edge & CONTROL_ROT_LEFT)
              ...play left bank animation...
          else if ((edge & CONTROL_ROT_RIGHT)
              ...play right bank animation...
       }
       else if (keyup)
       {
          if (edge & CONTROL_ROT_LEFT)
              ...stop left bank animation...
          else if (edge & CONTROL_ROT_RIGHT)
              ...stop right bank animation...
       }
       else if (keypress)
       {
          ... other flying move animations ...
       }
   }
}

 

Link to comment
Share on other sites

On 9/28/2018 at 9:03 PM, ellestones said:

most AOs use a combination of: http://wiki.secondlife.com/wiki/LlTakeControls and: http://wiki.secondlife.com/wiki/LlGetAgentInfo

some example lsl pcode which shows the basics of animation banking in the control event


control(key id, integer level, integer edge)
{
   integer keydown = level & edge;
   integer keypress = level & ~edge;
   integer keyup = ~level & edge;

   integer agent_info = llGetAgentInfo(id);

   if (agent_info & AGENT_FLYING)
   {
       if (keydown)
       {
          if (edge & CONTROL_ROT_LEFT)
              ...play left bank animation...
          else if ((edge & CONTROL_ROT_RIGHT)
              ...play right bank animation...
       }
       else if (keyup)
       {
          if (edge & CONTROL_ROT_LEFT)
              ...stop left bank animation...
          else if (edge & CONTROL_ROT_RIGHT)
              ...stop right bank animation...
       }
       else if (keypress)
       {
          ... other flying move animations ...
       }
   }
}

 

thank you! that's what i was looking for

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I'm trying to add this code to the control event of my AO in order to stop the default banking effect and substituting for my own banking animations (the default one makes my mesh avi to turn around strangely)... no success on stop banking effect or substituting it with another banking animation.....

This is my control event...

    control( key _id, integer _level, integer _edge )
    {
        if ( _edge )
        {
            if ( llGetAnimation(Owner) == "Walking" )
            {
                if ( _level & _edge & ( CONTROL_BACK | CONTROL_FWD ) )
                {
                    if ( haveWalkingAnim )
                    {
                        llStopAnimation( "walk" );
                        llStopAnimation( "female_walk" );
                    }
                }
            }

            checkAndOverride();
            }
        }

 

I even changed the "id, edge and level" for "_id, _edge, _level" as it is on the AO's code. Could someone help me....?

Link to comment
Share on other sites

in pcode your script says

on (keydown or keyup)
{
     if (the current animation is the default Linden walking animation) then
     {
        if (keydown or keyup is either back or foward) then
        {
           if (there is a provided walking animation available) then
           {
              stop the default Linden walking animation
           }
        }
        play the available provided walking animation  
     }
}

am a little unsure what you mean by not working. While the script could be tidied up a little bit, as wrote does what the pcode says

 

might be best to post your script in the LSL Scripting forum. So that other scripters can offer their thoughts 

 

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...