Jump to content

Avatar Velocity (Forced to run at certain velocity?)


Finn Amore
 Share

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

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

Recommended Posts

To anyone with familiarity with the server's handling of running / walking functions... HAELP!

I've been playing around with a rather simple script to make a large gigantic avatar move faster without interfering with an AO.

To do this, I am simply using llSetForce however llApplyImpulse causes this same confusing effect which is;

After a certain speed, my avatar's walk is automatically forced to a run without having double-tapped or engaged Always Run. Why? And more importantly... Can I stop it from doing that?

Here's my (horrible) little testing script to help me make sure this is happening and I'm not just losing my mind. Typically 161 (or higher) of force, forces me into a run;
[ WARNING - I'm aware this is terrible, but it's honest and just a proof of concept. Nothing more. ]

default
{
    state_entry()
    {
        if (llGetAttached() != 0) llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
    }
    
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TAKE_CONTROLS) llTakeControls( CONTROL_FWD , TRUE, TRUE);        
    }
      
    control(key id, integer held, integer change)
    {
        if (held == TRUE)
        {
            llSetForce(<161,0,0>, TRUE);
            llSetText((string)llVecMag(llGetVel())+"\n"+llGetAnimation(llGetOwner()), <1,0,0>, 1.0);
        }
        else
        {
            llSetForce(<0,0,0>, TRUE);
            llSetText((string)llVecMag(llGetVel())+"\n"+llGetAnimation(llGetOwner()), <1,1,1>, 1.0);
        }
    }
    
    moving_start() { llSetTimerEvent(0); }
    moving_end() { llSetTimerEvent(1); }
    
    timer() { llSetText((string)llVecMag(llGetVel())+"\n"+llGetAnimation(llGetOwner()), <1,1,1>, 1.0); }
}
Edited by RiderDavis
I'm a derp
Link to comment
Share on other sites

1 hour ago, RiderDavis said:

After a certain speed, my avatar's walk is automatically forced to a run without having double-tapped or engaged Always Run. Why? And more importantly... Can I stop it from doing that?

If you're just using the physics system (applying forces), no. Avatar animations are based on the avatar's state and velocity, not user-input.

An avatar would also play a running animation while standing still on a platform that is moving up, because the avatar is moving and on the ground.

To prevent this effect, you would have to override animations by manually calling llStartAnimation and writing an AO using on that function, not llSetAnimationOverride.

Edited by Wulfie Reanimator
Link to comment
Share on other sites

2 hours ago, Wulfie Reanimator said:

An avatar would also play a running animation while standing still on a platform that is moving up, because the avatar is moving and on the ground.

Avatar behavior on moving platforms is smarter than that. Get on one of the trams in New Babbage and just stand. You'll move with the tram, with no walk animation. Until the next sim crossing; then you fall off the tram, going through the wall.

Elevators and escalators in SL generally work. My moving sidewalks carry avatars fine without triggering a walk animation.

Link to comment
Share on other sites

3 hours ago, animats said:

Avatar behavior on moving platforms is smarter than that. Get on one of the trams in New Babbage and just stand. You'll move with the tram, with no walk animation. Until the next sim crossing; then you fall off the tram, going through the wall.

Elevators and escalators in SL generally work. My moving sidewalks carry avatars fine without triggering a walk animation.

I'm gonna have to disagree with you there. Try rezzing a cube, make it physical, and drag it against your avatar (this is an easy way to make your avatar "run"). Or look at this KFM platform.

Granted, if the KFM platform is thick enough (along the direction of movement), or it's moving slow enough, the avatar stops walking in place. That platform is 2x2x0.2 and anything at or above 0.4 meters per second on it will cause an avatar to walk. Same applies if the platform was narrow (0.2x2x2) and moving sideways.

The tram in New Babbage is much slower but it still manages to reset my stand animation every couple seconds because my avatar gets bumped by physics and changes state from standing to moving. This is pretty basic character-controller stuff to me.

Edited by Wulfie Reanimator
Link to comment
Share on other sites

7 hours ago, Wulfie Reanimator said:

Granted, if the KFM platform is thick enough (along the direction of movement...

Ah. Collision detection is falling through because the movement in one frame time is more than half the thickness.

Link to comment
Share on other sites

On 7/24/2019 at 11:07 PM, Wulfie Reanimator said:

Avatar animations are based on the avatar's state and velocity, not user-input

On 7/24/2019 at 11:07 PM, Wulfie Reanimator said:

you would have to override animations by manually

Well....... Darn.

Thank you kindly for the rather knowledgable and helpful reply, and have a super weekend! 👍

CASE CLOSED

Link to comment
Share on other sites

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