Regarding Joysticks and running...

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
R4L
Global Moderator
Posts: 404
Joined: Fri Mar 03, 2017 9:53 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Regarding Joysticks and running...

Post by R4L »

Hey ya'll. Posted on the discord but figured I should drop a thread here just in case.

I'm experimenting with using a controller for Dreadnought because hey, Metroid Prime was played with a controller and I actually have users who wish to play Dreadnought the same way, so I've been trying to come up with a control scheme that works. I've been pretty successful, except with running. I've noticed that no matter what you map the run button to, you will actually never run. I read somewhere this is due to how the joysticks work, and I've noticed that depending on the sensitivity, you can run MUCH faster without even having a run button mapped.

This presents a problem for me, because there is a power up that won't activate unless you're holding Run and Forward, and this in turn stops the user from using a new function I've implemented in Dreadnought with a controller. I'm just curious if there is a simple solution to this, or if I have to create a workaround for it. I'd like the option to use a controller to be viable still.

As usual, any help is certainly appreciated! :)

EDIT: Ah, and of course I find my answer:
Note: Currently, joystick or mouse axes bound to movement will not set the corresponding button for the purposes of reading by this function. (E.g. moving forward by pressing forward on an analog joystick will not set the BT_FORWARD key.) However, pressing a keyboard key does set the axis inputs. Therefore, it is recommended that mod authors read the axes above whenever possible, instead of relying on [MOD]INPUT_[OLD]BUTTONS to read directional movement.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Regarding Joysticks and running...

Post by Matt »

"if(player.cmd.forwardmove>6400)" should approximate it
Post Reply

Return to “General”