How do I increase the dead zone for gamepad joystick?

Get help using Construct 2

Post » Fri Aug 07, 2015 9:31 am

Yo people,

I want to increase the dead zone on the gamepad joystick.

I have my joystick set up in degrees of a circle also, not the -100 to 100 values for each axis. I'm using this to get my angles: (angle(0,0,Gamepad.Axis(0,0),Gamepad.Axis(0,1))%360+360)%360

And I get joystick inputs by things like: x>0, x<100 perform action .......etc

As it stands now, the tiniest movement of the joystick registers an input. I want it to only register if the joystick is pressed fully up against the edge, or at least 90% of the way. Any help would be much appreciated, thanks
B
12
S
1
Posts: 42
Reputation: 584

Post » Fri Aug 07, 2015 4:38 pm

You might be able to apply the joystick input value to an instance variable and base conditions on that instance variable.

i.e :

every tick set value of instance variable to the according axis for "joystick input"

if value equals "90% of the way" set action

- or -

[y >= instance variable perform action]
set value of instance variable to match the axis value of the gamepad when pressed fully up "90% of the way".
B
6
S
2
Posts: 151
Reputation: 1,366

Post » Fri Aug 07, 2015 4:44 pm

gregorysforster wrote:
And I get joystick inputs by things like: x>0, x<100 perform action .......etc


Just change that 0 in all of your events to whatever value you want. 80, 90, whatever. It might help to make it reference a variable then you can just keep adjusting the variable to increase/decrease your deadzone.

So if X>80,X<100 and if X<-80,X>-100 etc. but swap 80 out for a variable so you can change it later really easily.
B
103
S
38
G
19
Posts: 962
Reputation: 17,986

Post » Sun Aug 09, 2015 1:37 am

@eyezwidee
I think I understand what you're saying. I'll give it a shot. Thanks

@C-7
for x>0,x<100 those are degrees of the circle. (My fault, bad example using 0 and 100 for the values) For example, if the joystick is between 0 degrees and 100 degrees then set action.
B
12
S
1
Posts: 42
Reputation: 584

Post » Sun Aug 09, 2015 3:58 am

Use both then. Still keep track of your degrees and just add the dead zone conditions simultaneously. That way, it only triggers at the edges of the circle pad, but when it does, you keep track of the degrees.
B
103
S
38
G
19
Posts: 962
Reputation: 17,986

Post » Mon Aug 10, 2015 11:26 am

@C-7

I understand the theory. Have it measure the degrees, and only trigger if it outside of my desired dead zone.

How would I add the dead zone conditions?
B
12
S
1
Posts: 42
Reputation: 584


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], ivanski1983 and 12 guests