Gamepad config for TGEA
by Ebonixs · in Torque Game Engine · 12/07/2008 (11:23 am) · 3 replies
Hi TGEA Members,
On my startum in the world of TGEA, my first goal is to control the orc with my XBox 360 controller. So far, I've gotten the character to jump using:
moveMap.bind(gamepad, btn_a, jump);
Here's my question... btn_a is equivalent to the button A on the Xbox 360 (so is btn_b, btn_x, and btn_y). What can I use for LB, RB, RT, LT, xaxis, yaxis, zaxis, etc? I been working on this for a while and I think I'm about ready to diagnose myself with coding block. Please help...
On my startum in the world of TGEA, my first goal is to control the orc with my XBox 360 controller. So far, I've gotten the character to jump using:
moveMap.bind(gamepad, btn_a, jump);
Here's my question... btn_a is equivalent to the button A on the Xbox 360 (so is btn_b, btn_x, and btn_y). What can I use for LB, RB, RT, LT, xaxis, yaxis, zaxis, etc? I been working on this for a while and I think I'm about ready to diagnose myself with coding block. Please help...
About the author
I am new to the gamining industry and presently, I am more experienced in interface Design and music production.
#2
12/07/2008 (4:50 pm)
I don't mean to be overly simple minded,but for the sake of understanding... If I were to say that I would like the orc to move forward with the DPAD. Do I enter the following script? moveMap.bind( gamepad, dpapu, moveforward); ? I've already got the Orc to jump using the same method except I replaced the "dpapu" to "btn_a" and "moveforward" to "jump"
#3
But it looks like you are using DirectInput - so you would bind like this instead.
moveMap.bind( joystick, upov, "moveforward" );
moveMap.bind( joystick, dpov, "movebackward" );
moveMap.bind( joystick, lpov, "moveleft" );
moveMap.bind( joystick, rpov, "moveright" );
12/09/2008 (10:20 pm)
I think I've gotten you confused. My apologies - I somehow assumed you were using XInput because of your 360 controller.But it looks like you are using DirectInput - so you would bind like this instead.
moveMap.bind( joystick, upov, "moveforward" );
moveMap.bind( joystick, dpov, "movebackward" );
moveMap.bind( joystick, lpov, "moveleft" );
moveMap.bind( joystick, rpov, "moveright" );
Associate Jaimi McEntire
King of Flapjacks
{ "connect", SI_BUTTON, XI_CONNECT },
// L & R Thumbsticks:
{ "thumblx", SI_AXIS, XI_THUMBLX },
{ "thumbly", SI_AXIS, XI_THUMBLY },
{ "thumbrx", SI_AXIS, XI_THUMBRX },
{ "thumbry", SI_AXIS, XI_THUMBRY },
// L & R Triggers:
{ "triggerl", SI_AXIS, XI_LEFT_TRIGGER },
{ "triggerr", SI_AXIS, XI_RIGHT_TRIGGER },
// DPAD Buttons:
{ "dpadu", SI_BUTTON, SI_UPOV },
{ "dpadd", SI_BUTTON, SI_DPOV },
{ "dpadl", SI_BUTTON, SI_LPOV },
{ "dpadr", SI_BUTTON, SI_RPOV },
// START & BACK Buttons:
{ "btn_start", SI_BUTTON, XI_START },
{ "btn_back", SI_BUTTON, XI_BACK },
// L & R Thumbstick Buttons:
{ "btn_lt", SI_BUTTON, XI_LEFT_THUMB },
{ "btn_rt", SI_BUTTON, XI_RIGHT_THUMB },
// L & R Shoulder Buttons:
{ "btn_l", SI_BUTTON, XI_LEFT_SHOULDER },
{ "btn_r", SI_BUTTON, XI_RIGHT_SHOULDER },
// Primary buttons:
{ "btn_a", SI_BUTTON, XI_A },
{ "btn_b", SI_BUTTON, XI_B },
{ "btn_x", SI_BUTTON, XI_X },
{ "btn_y", SI_BUTTON, XI_Y },