• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

Can I register multi-button gamepad inputs?

S

SgtsPepper11

Guest
Hello! I've just come back to GameMaker 1.4 after a few months' hiatus brainstorming ideas for a new project. After finally coming up with something, I decided that I'd use gamepad inputs for all the controls in the game. However, my design requires that I register multiple inputs to do one action (i.e., the player needs to press both shoulder buttons to achieve the intended output). I'm still in the conceptual/debugging phases right now, so I figured I'd ask here as soon as I could. I've tried containing multiple gamepad_button_check_pressed functions in parentheses when setting up control variables, but that doesn't seem to work. Does anyone know of a way to do this with GML?? Thank you!
 
The answer is, of course, yes. The problem is accounting for human error. What you'll have to do is code it so that if either shoulder button is pressed, for the next few frames or so, check to see if the other shoulder button is pressed. If so, do the unique function, otherwise perform the original functions.
 
I

itameio

Guest
The answer is, of course, yes. The problem is accounting for human error. What you'll have to do is code it so that if either shoulder button is pressed, for the next few frames or so, check to see if the other shoulder button is pressed. If so, do the unique function, otherwise perform the original functions.
Yup, what BattleRifle BR55 said.
 
S

SgtsPepper11

Guest
The answer is, of course, yes. The problem is accounting for human error. What you'll have to do is code it so that if either shoulder button is pressed, for the next few frames or so, check to see if the other shoulder button is pressed. If so, do the unique function, otherwise perform the original functions.
Gooooootcha. I figured there had to be a way, and I had thought about that possibility. But now having that confirmed, I can start to develop some algorithms and timers and things to actually get that working. Thanks man!!
 
Top