Regarding Joysticks and running...

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Regarding Joysticks and running...

Postby R4L » Sun Feb 03, 2019 10:44 am

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
R4L
Ordinary Vanity
 
Joined: 03 Mar 2017
Discord: R4L#4655
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: Regarding Joysticks and running...

Postby Matt » Mon Feb 04, 2019 12:26 am

"if(player.cmd.forwardmove>6400)" should approximate it
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests