Help with Spinning Movement

marievpyre

Member
I made a post before thinking I had a different problem and don't know how to delete it, so I'm making a new post. It seems that the game's code disables forward and backward movement while Spinning, but only if not also holding sideways movement. Is there a way to revert this design choice?
 
The game does not disable forwards movement. However, it DOES significantly gimp thrustfactor / acceleration so that gaining speed is essentially impossible. You can sort of circumvent it by copying the 3D Movement function in the source and removing restrictions on it.

Move:
addHook("PlayerThink", function(p)
    if (p.pflags & PF_SPINNING
        and not (p.pflags & PF_STARTDASH)
        and P_IsObjectOnGround(p.mo)) then
            local movepushforward = p.cmd.forwardmove * p.thrustfactor * p.acceleration
            local movepushangle = p.mo.angle
            p.mo.momx = $ + P_ReturnThrustX(p.mo, movepushangle, movepushforward)
            p.mo.momy = $ + P_ReturnThrustY(p.mo, movepushangle, movepushforward)
    end
end)

This does not consider analog or underwater or sideways movement so it PROBABLY shouldn't be used as-is, but it does let you move forward while spinning.


For reference, this is the part of the code that checks if the player is spinning.
 
How does acceleration change when Rolling, then? Because I tried changing ThrustFactor and forward movement was somehow still disabled.
 

Attachments

  • srb20004.gif
    srb20004.gif
    4.7 MB · Views: 16
Okay, THAT part I can't explain. I've tried playing with thrustfactor/acceleration as well and it did not affect forward speed at all. If someone more knowledgeable with the source comes up I'd love to hear it.
 
I found this bit of code that seems to cause it, but I don't think I can change the base game's movepushforward.
Lua:
        // Allow a bit of movement while spinning
        if ((player->pflags & (PF_SPINNING|PF_THOKKED)) == PF_SPINNING)
        {
            if (!(player->pflags & PF_STARTDASH))
                movepushforward = movepushforward/48;
            else
                movepushforward = 0;
        }
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top