Game Development Community

Problem using Joystick0

by Nicolai Dutka · in Torque Game Engine Advanced · 03/31/2009 (3:11 pm) · 1 replies

I have a game that has some code for Joystick0 as follows:

//Joystick0
moveMap.bind( joystick0, button6, turnLeft );
moveMap.bind( joystick0, button7, turnRight );
moveMap.bind( joystick0, button3, mouseFire );
moveMap.bind( joystick0, button2, altTrigger );
moveMap.bindCmd( joystick0, button0, "useObject();", "" );
moveMap.bindCmd( joystick0, button1, "useSpecial();", "" );
moveMap.bind( joystick0, xaxis, "D", "-0.23 0.23", gamePadMoveX );
moveMap.bind( joystick0, yaxis, "D", "-0.23 0.23", gamePadMoveY );
// End Joystick0

It works perfectly in Game 1, but when I copy/paste that code into a different game, Game 2, it doesn't work.

In Game 2, I can verify there is a joystick0 from my console.log:
Initializing platform...
Input Init:
   keyboard0 input device created.
   mouse0 input device created.
   joystick0 input device created.
   joystick1 input device created.
   DirectInput enabled.

Done

But when I get into the game, nothing at all happens... The controller does nothing, I get no error messages, nothing at all.. except this in my console.log:
- Loading card profiles...
      - Loaded card profile profile/D3D9.cs
      - No card profile profile/D3D9.GeForce8800GTX.cs exists
      - No card profile profile/D3D9.GeForce8800GTX.GeForce8800GTX.cs exists
      - No card profile profile/D3D9.GeForce8800GTX.GeForce8800GTX.71500117813.cs exists
Warning! You have a duplicate datablock name of GamepadButtonsGui. This can cause problems. You should rename one of them.

I searched through all my code and can't figure out what is causing that.

#1
03/31/2009 (5:15 pm)
Turned out to be a simple 'Prefs' change to enable using the joystick.