Gamepad. How do i ?

Get help using Construct 2

Post » Tue Mar 18, 2014 9:36 am

I'm working on a game where i need to connect an Xbox controller in order to perform an action, IE. i want to work around having to press a button.
However, it appears i need to press a button before it recognizes that "Has Gamepads" is active the first time i start the game.
Does anyone know a workaround for this ?

(( one idéa i had was simulating a button press on start of layout, but there are apparently no gamepad actions. ))

Thanks in advance!
B
5
S
1
Posts: 6
Reputation: 466

Post » Tue Mar 18, 2014 9:58 am

i have the same question
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Tue Mar 18, 2014 10:16 am

I hope I'm wrong but I don't think there is a way.

On your opening screen you could request the player to press a button to continue which would activate the joypad - after all it's quite common to see a "Press (a) to continue"
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Tue Mar 18, 2014 10:54 am

Browsers require that you press a button on the gamepad before it is recognised. This is for privacy reasons, so ad networks or malicious parties can't track you by using your available controllers as part of a fingerprint to identify you. If you never touch the controller it acts like it is not there.

I can't imagine why this would be a problem though. Just have a message on startup like "Press a gamepad button to use gamepad controls".
Scirra Founder
B
399
S
236
G
89
Posts: 24,530
Reputation: 195,402

Post » Tue Mar 18, 2014 11:15 am

A core mechanic in the i'm working on is the controller. I want to be able to transform the character when the controller is disconnected. This part works just fine.
In order for the player to get into the mechanics of the game i want him/her to start the game with only connecting it, since that's how it works throughout the rest of the game.
B
5
S
1
Posts: 6
Reputation: 466

Post » Tue Mar 18, 2014 1:45 pm

Honestly most player wouldn't be bothered with disconnecting and reconnecting their controller. I have mine plugged into the back of my computer and it's staying there. This means if I have to rely on that gimmick I won't be playing your game.

A better option would be pressing a button to disable/enable controller input, and then based on what state it is, treat it like you already do for disconnects/reconnects. This can be a button you press on the keyboard/controller to switch between the states.

This way the controller stays plugged in, you get your intended mechanic, and you don't have to have an issue with how the browser handles controllers.

You can still provide the option for them to disconnect/reconnect if they wanted to use that, but it being a requirement is detrimental to player interaction
B
21
S
8
G
6
Posts: 346
Reputation: 4,891


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests