How to convert GetPlayerInput FORWARD/SIDEMOVE into float?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
How to convert GetPlayerInput FORWARD/SIDEMOVE into float?
I don't understand the number that's being returned from GetPlayerInput(-1, INPUT_FORWARDMOVE) (or SIDEMOVE)... all I want is to convert this value so that 1.0 (or -1.0) means that full movement is being applied. With the keyboard, this value should always be +/-1.0, while with an analog stick, any value up to a maximum of +/-1.0.
Re: How to convert GetPlayerInput FORWARD/SIDEMOVE into floa
Meh, found the answer to my own question. Leaving this thread up for future reference.
My solution was wrong.
My solution was wrong.
Re: How to convert GetPlayerInput FORWARD/SIDEMOVE into floa
Actually, I haven't correctly figured it out. I'm still looking for a solution. I want to convert the player's input into a float value, where 1.0 is the maximum.
Re: How to convert GetPlayerInput FORWARD/SIDEMOVE into floa
Just make a quick investigation about this. The number 12800 is obtained by GetPlayerInput directly. That's the base concept even the number is not correct. Ther are two different values for side move, 12800 from mouse strafing and 10240 from movement keys. The attachment can be run directly to see the result.
- Attachments
-
NashMove.pk3- (1.05 KiB) Downloaded 34 times
Re: How to convert GetPlayerInput FORWARD/SIDEMOVE into floa
Thanks carlcyber! Makes me wonder why is it that strafing seems to be "slower" than forwardmove... :S
-
Blzut3
-

- Posts: 3215
- Joined: Wed Nov 24, 2004 12:59 pm
- Operating System Version (Optional): Kubuntu
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Contact:
Re: How to convert GetPlayerInput FORWARD/SIDEMOVE into floa
Strafing is slower. That how SR-50 works. (By using multiple strafe keys you are able to max out the axis, but it can also be achieve through a mouse or joystick axis without disabling turn.)Nash wrote:Makes me wonder why is it that strafing seems to be "slower" than forwardmove... :S
Re: How to convert GetPlayerInput FORWARD/SIDEMOVE into floa
Ah, I see. Thanks for the clarification.