Gamepad object & zero-index button press

0 favourites
  • 4 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • I have an SNES USB gamepad - I bought it for the Mega Man X Street Fighter game (FREE - check it out...just Google it). Sometime later I discovered I'm not just yet willing to spend more money for an XBox 360 gamepad (which I hear is ideal for using with C2). I also favor Google Chrome for my browser, but I'm not clear yet based on the forum posts as to whether or not that's the best option. Anyway..! Onto my main problem.

    I've checked the manual and searched through the tutorials and forums, but I cannot find a clear answer.

    In the Events sheet, I'm trying to set up basic control movement - left, right, jump, etc. I've created a gamepad object named SNES_USB (snazzy name, eh?). It brings up the parameters window and prompts me to enter two values: the "zero-based index of the gamepad to test", and the button.

    I leave the gamepad zero-index value at zero and the button as Button A - I don't change anything. Then I add the action to simulate a platform jump. All the other preliminaries for a basic platform game are set - I tested it with the keyboard object and it worked fine.

    My main confusion is how to recognize what buttons on the USB gamepad have what zero-index values so C2 will do the correct action per button. Frankly, this is one aspect I'm just totally lost on.

    UPDATE: I missed this in the manual - I was using the downloaded version during my initial search. I did find something about raw values for non-Xbox 360 controllers. Can someone help me with that as well? How do I obtain raw values?

    PS - please be patient with me if I ask a TON more questions to any gracious replies. I just want to make sure that I'm SURE I'm understanding this. THANKS!

  • Put a text object in the layout and on a button press, set it to the gamepad's last button expression. This will tell you the index of every button on the controller. You can select a button from the dropdown list, but I don't know how the buttons map if it's not an XBox 360 style controller...

    (BTW the zero-based index of the gamepad is so you can use multiple gamepads in one game, e.g. for two player)

  • Ashley - THANK YOU! Once again, you're awesome.

    I'll test the mapping with text you instructed to me and I'll get back to you if I still need help.

    I THINK I get the zero-based index... So, say I have two USB controllers plugged in, and index numbers 1-10, for example, correlate to controller 1, numbers 2-20 would be controller 2...yes?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley - Ooookay... So, I tried to add an Event or Action to set the text object to display the LastButton value. I'm not sure what all I'm doing right or wrong at this point, but I am not seeing how I can bring up the GamePad object's button value. What instructions can I input to the Event sheet, por favor?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)