Game Development Community

Using Gamepads or controllers

by johndavismit · in Torque Game Builder · 12/05/2009 (5:24 pm) · 4 replies

Right now I'm trying to get a gamepad or controller working with my mac version of TGB. I'm currently experimenting with some of the behavior examples that come with TGB, and I've noticed that there are some control options that can be changed in the behavior shooter. Specifically, I noticed that there are some joystick options. When I try using those options to control the ship with a controller, I can't get it to work. What do I need to do to get controller support into one of these games? is there a tutorial somewhere?

About the author

Recent Threads


#1
12/05/2009 (5:43 pm)
This is some code I'm using under Windows, hope it helps.

if(isJoystickDetected())
{
   $gotJoystick = true;
   echo("Joystick / Gamepad detected");

   $enableDirectInput = true;
   activateDirectInput();
   enableJoystick();
}
#2
12/05/2009 (7:04 pm)
Gamepad input isn't supported on the Mac version of TGB. It can be added (I think there's even a resource here for it) if you have a Pro license, which gives access to the C++ source code.
#3
12/05/2009 (9:33 pm)
So, basically what you're saying is that there is no way to create a game with gamepad support using the mac version of TGB without modifying the source code?
#4
12/06/2009 (1:32 pm)
Right, it's not a question of project settings or scripting tweaks. The engine support for it just isn't there in the Mac version, and it can't be added without the source code.