How do I add a controller to my game?

Get help using Construct 2

Post » Sun Jul 28, 2013 9:52 pm

Hello C2 community! I'm sorry guys, but I searched every tutorial and forum post on gameplay controls and found nothing relating to my current dilemma... I finally got my actor/sprite to sync in my platform game(Keyboard controlled at the moment), but now I want to add the ability to use a gamepad controller (ah la XBOX 360 controller)... I have a Logitech computer gaming controller I picked up at best buy a few years ago. My CPU recognizes the controller so I think I'm good on that end... I already added the gamepad icon to my project, so I'm just awaiting commands at this point... I hope it's nothing simple-like that I missed when going through the manual, but I doubt it... Any help would be most welcomed as I'm trying to make some real progress with this project... I know I'm in for a very long ride in trying to learn this program but I won't be detrude...
Image
B
35
S
17
G
9
Posts: 103
Reputation: 8,131

Post » Sun Jul 28, 2013 10:36 pm

Ok nvm... lol!!! I think I may have found something in the manual... But I'm still not certain my Logitech will work right... The manual raves about the XBOX 360 controller for windows so I may have to look into that if My controller fails to respond... Keep my fingers crossed...
Image
B
35
S
17
G
9
Posts: 103
Reputation: 8,131

Post » Sun Jul 28, 2013 10:39 pm

BTW... If anyone know if I can use my actually 360 console controller, please inform me before I go inquire at my local gamestop, or best buy store(s).... Again thanks!
Image
B
35
S
17
G
9
Posts: 103
Reputation: 8,131

Post » Sun Jul 28, 2013 11:22 pm

Ok does anyone know if I need to turn off Default controls to off in order to simulate with the gamepad controls instead?
Image
B
35
S
17
G
9
Posts: 103
Reputation: 8,131

Post » Sun Jul 28, 2013 11:50 pm

okay guys I just can't figure it out and I'm completely stumped... I don't want to do anything to mess up what I got going so I'm reaching out to you the community... If someone could upload a tutorial that specifically deals with integrating a gamepad controller into a platform game I would appreciate it... A vid would be nice, but I'll take anything at this point... again thanks for any help folks
Image
B
35
S
17
G
9
Posts: 103
Reputation: 8,131

Post » Mon Jul 29, 2013 10:21 pm

Ok, so since I'm talking to myself (no offense community members) I might as well share what I've learned: The gamepad seems to be recognized by my computer so on that end I'm good... Now surfing the internet early today, I found out that the browser you use with your project has a lot to do with the gamepad operating properly... Also plug-ins may be needed as well... So My guess is: Scirra did not forsee people wanting to implement gamepad controls into their project at the initial development of construct, and now they are try to work that feature in through updates and/or plug-in add-ons... Not really sure what the case is but It is a bit disappointing that it's way more difficult to sync in a gamepad as oppose to using the default keyboard... Hopefully implementing other "new" features won't be as difficult.
Image
B
35
S
17
G
9
Posts: 103
Reputation: 8,131

Post » Mon Jul 29, 2013 11:26 pm

Ok let's experiment here... Revisited a post from this site's forum (New chrome version support/Direct Input gamepads) And mostly the thought process was try all gaming controllers and praying for a high rate of success... Well I just plugged in my XBOX 360 into my cpu and behold... My computer recognized the controller and installed it... Very nice indeed, but we're only 25% complete on my goal... Still have to get Construct (and I'm sure Chrome as well) to recognize... Tried to look in chrome's settings for an option for the gamepad plug-in or whatever, but came across nada... Will continue to search online for some sort of information that can guide me from this point... Maybe I can get to birds by figuring out my Logitech controller gamepad issue as well...
Image
B
35
S
17
G
9
Posts: 103
Reputation: 8,131

Post » Sun Sep 22, 2013 7:49 pm

I'm also trying to get 360 controller support for my game..it currently only uses the keyboard... I thought I found a forum post somewhere that discussed a quick way of adding controller support.. after a quick search i did not find it... so I'm not sure how well it works..
B
97
S
32
G
16
Posts: 1,199
Reputation: 16,680

Post » Sun Sep 22, 2013 8:41 pm

Chrome support is default... it will work, you don't have to do anything.

As far as in-game support.. either use 'Simulate' or use the Gamepad events themselves.

start with this..

create a textbox..
add an event for the Gamepad.
use Gamepad 0 any button pressed
for the action use set text to "button pressed:" & Gamepad.LastButton(0)

0 is your first controller
1 is your second controller etc...

this will give you the value of what each of your button presses produce..
the analog sticks also have an axis parameter which you can check as well..jobel2013-09-22 20:42:48
B
97
S
32
G
16
Posts: 1,199
Reputation: 16,680

Post » Sun Sep 22, 2013 8:45 pm

Here's a simple file I made with working controller support. I have no special plugins or anything like that. Just the Chrome browser and a plugged in controller.

By the way, I'm using a PS3 controller with special drivers I downloaded that basically make the PC think it's an Xbox 360 controller. I only own a PS3, so that was my workaround.

Movement is with the D-Pad left and right and Jumping is set to the "A" button on a 360 controller.

I hope this helps.

https://dl.dropboxusercontent.com/u/98323832/Construct2/Controller%20Test.capx
B
10
S
1
Posts: 12
Reputation: 476

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 62 guests