Jason Bentley
Member
Every tutorial or example I can possibly find to do with handling multiple gamepads have Async>System event code that creates objPlayer's.
Instead, how do I assign the pad_num slots to individual obj_Player1 and obj_Player2 without instance_creating them through the Async event?
What I'm trying to do is to use a variable like pad_num for a slot so Gamemaker Studio always detects the right slot for each obj_Player1 and obj_Player2. If I use gamepad_button_check(0, face1), of course that's going to work for player one, but for player two gamepad_button_check(1, face1) may not work if Player2's gamepad slot that was assigned wasn't "1".
So Ideally, how do I have obj_Player1 and obj_Player2 detect their own pad_num slots through the Async>System event, so gamepad_button_check(pad_num, face1) works for both obj_Player1 and obj_Player2 without doing code from tutorials that involve creating the obj_Player1 instances through it's Async>System event. My obj_Player1 and obj_Player2 are already placed inside the rooms already.
EDIT:
Basically how can I make 2 different global variables for slot numbers that are detected, so that no matter what type of gamepad is plugged in say it goes to slot 10, I can have a global.Slot2.
How do I have code like that, that can detect new gamepads and assign them to:
global.Slot1
global.Slot2
then I can gamepad_button_check(global.Slot2, gp_face1)?
Instead, how do I assign the pad_num slots to individual obj_Player1 and obj_Player2 without instance_creating them through the Async event?
What I'm trying to do is to use a variable like pad_num for a slot so Gamemaker Studio always detects the right slot for each obj_Player1 and obj_Player2. If I use gamepad_button_check(0, face1), of course that's going to work for player one, but for player two gamepad_button_check(1, face1) may not work if Player2's gamepad slot that was assigned wasn't "1".
So Ideally, how do I have obj_Player1 and obj_Player2 detect their own pad_num slots through the Async>System event, so gamepad_button_check(pad_num, face1) works for both obj_Player1 and obj_Player2 without doing code from tutorials that involve creating the obj_Player1 instances through it's Async>System event. My obj_Player1 and obj_Player2 are already placed inside the rooms already.
EDIT:
Basically how can I make 2 different global variables for slot numbers that are detected, so that no matter what type of gamepad is plugged in say it goes to slot 10, I can have a global.Slot2.
How do I have code like that, that can detect new gamepads and assign them to:
global.Slot1
global.Slot2
then I can gamepad_button_check(global.Slot2, gp_face1)?
Last edited: