Jump to content

walking speed


Bridgette Puddles
 Share

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

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

Recommended Posts

about to pull my hair out lol, so I have been trying to get this to work for 3 hours and it's not slowing my speed down. any idea what I'm doing wrong?

 

float IMPULSE = 5.6;
key id  = NULL_KEY;

default
{
    
    state_entry()
    {
        llSetForce(<0,0,0>, TRUE);
        id = llGetOwner();
        llRequestPermissions(id,PERMISSION_TAKE_CONTROLS);  
        
    }
    
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_TAKE_CONTROLS)
        {
            llTakeControls (CONTROL_FWD|CONTROL_BACK|CONTROL_LEFT|CONTROL_RIGHT|CONTROL_UP|CONTROL_DOWN,TRUE,TRUE);
        }
    }
    
    control(key id, integer level, integer edge)
    {
        if(level & CONTROL_FWD)
        {
            if(llGetAgentInfo(llGetOwner()) & AGENT_WALKING)  
            {
                llApplyImpulse(<IMPULSE.0,0,0>,TRUE);            
            }
        }
    }
}

 

Link to comment
Share on other sites

10 hours ago, Bridgette Puddles said:
llApplyImpulse(<IMPULSE.0,0,0>,TRUE);

This won't even compile. When you have a dot immediately after a variable, without a space, the compiler will interpret it as an acceessor operator. These are used to reference individual elements of specific variable types like the XYZ of a vector or the XYZS of a rotation. IMPULSE is a float, so that operator doesn't apply (nor does it make sense to try and access the "0 component". Remove the ".0" from both instances in your script.

Secondly, IMPULSE is a positive number. Applying that to your avatar will result in an increase in speed. If you want to reduce speed, use a negative number.

Lastly, llApplyImpulse implicitly targets the object the script is in, which has to be physical (or in the case of avatars, a worn attachment). If you want to apply the impulse to your avatar, you must be wearing the object as an attachment.

Edited by Fenix Eldritch
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Making the avatar walk at a specific speed is non-trivial if you want other nice things like being able to walk up stairs/tiny ledges, and not fly backwards when trying to go forwards while falling. I have a few different implementations in my "fine for personal use, but probably not good enough for a general-use product" bin of 95% finished products.

see:

 

Edited by Quistess Alpha
  • Thanks 1
Link to comment
Share on other sites

Thank you Quistess Alpha, With some cleaning and changing a few lines in your Movement and animation Override script I was able to slow down the av speed. Even worked better than I hoped it would, I no longer have to track the walk running end with the modding I did with it you are not able to use run/always run over riding the speed API.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 340 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...