How do I get DualAction or Gamepad Support?
by Steven Peterson · in Torque Game Engine · 10/17/2005 (1:00 pm) · 3 replies
I'm trying to add "gamepad" support for my game. To clariy i'm using the Logitech "DualAction" which is a PS2 style controller. I'm mostly concerned with windows support.
I'm working with the start.fps but my game will eventually be played in a 3rd person style similar to "Grand Theft Auto" or "Prince Of Persia" (the new ones). So the controlls will be:
- Left analog stick (or D-pad) = Move Up, down, left, right
- Right analog = control 3rd person camera
- Other Buttons = do stuff
I read pretty much everything I could find in docs, resources and forums about 'joysticks', 'gamepads,' 'DualAction' etc. and still don't have a clear idea what the process is.
I added resources:
- http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3963
- http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6904
The joystick is deffinitly working in windows. When I get to torque there is no response from it.
My two problems are:
A) it doesn't work at all
B) I *THINK* I've read everything, but still have little-to-no understanding on where to begin, or what has to happen to make this work.
Any clear instructions, roadmap, explanation, or other advice is greatly appreciated. It seems other people have gotten this down, at least for FPS controls. (I know I'll have to do SOME programming, no biggie), but I can't find the complete process clearly documented anywhere.
thanks - yet -again,
Raven
I'm working with the start.fps but my game will eventually be played in a 3rd person style similar to "Grand Theft Auto" or "Prince Of Persia" (the new ones). So the controlls will be:
- Left analog stick (or D-pad) = Move Up, down, left, right
- Right analog = control 3rd person camera
- Other Buttons = do stuff
I read pretty much everything I could find in docs, resources and forums about 'joysticks', 'gamepads,' 'DualAction' etc. and still don't have a clear idea what the process is.
I added resources:
- http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3963
- http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6904
The joystick is deffinitly working in windows. When I get to torque there is no response from it.
My two problems are:
A) it doesn't work at all
B) I *THINK* I've read everything, but still have little-to-no understanding on where to begin, or what has to happen to make this work.
Any clear instructions, roadmap, explanation, or other advice is greatly appreciated. It seems other people have gotten this down, at least for FPS controls. (I know I'll have to do SOME programming, no biggie), but I can't find the complete process clearly documented anywhere.
thanks - yet -again,
Raven
#2
FYI:
I've only used this controller with a couple NES and Sega emulators, but I've never gotten good results from the D-pad. I've always ended up binding the left joystick. It seems to work fine, if a little hyper-sensitive on the windows-game-controller calibration-test screen. But not in games.
Barring yet-to-be-seen evidence to the contrary, i've concluded it's a bad D-pad design.... :-(
Awesom! I'm going to try this right now, and post back later tonight with results. Good instructions. So if i understand this right - nothing needs to go in "config.cs" as other resources led me to believe?
This should be a huge help - I'll let you know how it goes.
Thanks,
Raven
10/17/2005 (3:30 pm)
Quote: now i get unsatisfactory results from the D-Pad... if i press down... and roll my finger to left or right... it will not detect it. i have to press the button, then let off before i can press another one... it's weird.
FYI:
I've only used this controller with a couple NES and Sega emulators, but I've never gotten good results from the D-pad. I've always ended up binding the left joystick. It seems to work fine, if a little hyper-sensitive on the windows-game-controller calibration-test screen. But not in games.
Barring yet-to-be-seen evidence to the contrary, i've concluded it's a bad D-pad design.... :-(
Quote:Crazy thing is you don't need any resources to get that gamepad working. I have the exact same controller.
Awesom! I'm going to try this right now, and post back later tonight with results. Good instructions. So if i understand this right - nothing needs to go in "config.cs" as other resources led me to believe?
This should be a huge help - I'll let you know how it goes.
Thanks,
Raven
#3
This worked really well, thanks! Much simpler than others would have one believe, lol. I got it working with a couple extra bells and whistles.
multiple-3rd-person views
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5471
Advanced 3rd Person player controls
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5474
I added these to what you gave me in that order and everything worked really well! Now I've got my "Grand-Theft-Auto" style view and controls all working nearly perfectly! :-)
regards all,
Raven
10/19/2005 (7:37 am)
Ramen,This worked really well, thanks! Much simpler than others would have one believe, lol. I got it working with a couple extra bells and whistles.
multiple-3rd-person views
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5471
Advanced 3rd Person player controls
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5474
I added these to what you gave me in that order and everything worked really well! Now I've got my "Grand-Theft-Auto" style view and controls all working nearly perfectly! :-)
regards all,
Raven
Torque Owner Cinder Games
that goes in client/prefs.cs
now you gotta "guess" what the names of the buttons and what not are. but i got them here for ya.. no no real guessing for the most part
in client/default.binds
here's one of my functions to handle one of them
function joymovex(%val) { if ($pref::Input::Deadzone < %val | - $pref::Input::Deadzone > %val){ $mvRightAction = %val * $pref::Input::Sensitivity; } else{ $mvRightAction = 0; } }those are the functions i'm using. pretty strait foward except for the axis's them are the tricky ones.
now i get unsatisfactory results from the D-Pad... if i press down... and roll my finger to left or right... it will not detect it. i have to press the button, then let off before i can press another one... it's weird.