Legacy GM How to get the gamepad slot ?

R

Rackover

Guest
Hi,

I read the documentation, but found nowhere the information I wanted.

I've got only one X360 controller plugged to windows. The drivers are installed and the pad is functionnal.

I want to check if that controller is plugged in game maker so I can use it later, but

gamepad_is_connected(1)

returns 0, despite the x360 appears to be "player one" (the only powered-on led is the "1" one).

gamepad_is_connected(0)

also returns 0, and the same applies for gamepad_is_connected(9999) or whatever.

Why isn't my gamepad detected ? How can I fix this ?
 
The "slot" number is 0 based. So gamepad_is_connected(0) would be for "player 1". So 1 would be for Player 2, 2 for Player 3, etc.

Not sure why gamepad_is_connected(0) would be returning false if indeed your gamepad is working properly. That is very strange.
 
B

Blaze

Guest
Is it an official Xbox 360 gamepad?

My Chinese game controllers are found as a joystick.
Try this:

Code:
if joystick_exists(1) || joystick_exists(2)
   {
   show_message("I'm a joystick")
   }
 
R

Rackover

Guest
Returns false. This is an official X360 gamepad i've been using for years. Strangely, all of this is working fine on another pc but not on this one.
 

Roderick

Member
I had a similar problem yesterday. Everything was working fine, I went for dinner, when I came back, the gamepad wouldn't work. I had to close everything, reboot my computer, and restart Game Maker. Gamepad worked fine after that.

Always remember the first rule of tech support:
 

NightFrost

Member
Returns 0
Interesting, because on windows it certainly shouldn't be zero, but instead the number of pad slots available. I'm not sure what it should be returning, on mine it reports 12, but that might be influenced by the SCP driver I'm using to connect PS DS3 controllers.
 
R

Rackover

Guest
Okay, the console was indicating a xinput1.3.dll "not found" error, so I guess the problem doesn't come from GM:S. Will investigate further.
 
Top