6 gamepad players problems

0 favourites
  • 8 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • Hello! I am trying to create a game for six players controlled by gamepads. I have 2 problems.

    1) I have 4 gamepads that works only with x360ce and 2 working without it. So I must have 6 player slots for them.

    2) How can I rule what gamepad which player will control in construct 2?

  • 2) I would ask each player to press a button on their gamepad before the game starts.

    "Player 1 press any button"

    Then wait for any button pressed on any of 6 gamepads. When a button is pressed say on gamepad #5, save this number in a variable Player1Gamepad or in array:

    PlayerGamepads.At(1) set to 5

    You can also make a reverse array for convenience - GamepadsToPlayer:

    GamepadToPlayer.At(5) set to 1

    PlayerGamepads[x] will give you gamepad number for player x.

    GamepadToPlayer[y] will give you player number for gamepad y.

  • As far as I know C2 only support a maximum of 4 gamepads? That is why my game uses four gamepads and two keyboard players.

  • It will be a spaceship game, so I don't know how to realise the 6th player p.s. 4 can play on gamepads, 1 with mouse and what about 6th? It can't rotate good without mouse or joystick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How can I control which player will be controled by which gamepad. I added player number variables.

  • How can I control which player will be controled by which gamepad. I added player number variables.

    See my first comment.

    Before the game starts, ask each player to press a button. Save gamepad number for each player in a variable/dictionary/array.

    When in the game a button is pressed on gamepad N, you will know which player pressed it.

  • dop2000 How do you save the gamepad number when there is no expression to get the gamepadID from a button press. I've always wanted that but sadly it's not possible.

    So you can't do a:

    on button A pressed

    ---playerNR = gamepadID --> jump

  • Anonnymitet

    Yeah, I don't understand why there is no expression to get gamepad number.

    I guess for events like "On key pressed" you'll have to create 4 identical events for each gamepad number. Then redirect them to a function, like this:

    On Gamepad 0 button A pressed -> Call Function ("Jump", 0)

    On Gamepad 1 button A pressed -> Call Function ("Jump", 1)

    For events like "Is button down" you can test all gamepads in a loop.

    By the way, "On gamepad .." events are not very reliable, they can miss buttons if several buttons are pressed simultaneously. Some time ago I made a little engine that only uses "Is.." events, see this post:

    It can be modified to support multiple gamepads.

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