[PLUGIN] Input System v0.96b (21/03/2011): Keyb+Mouse+Joy

Post and try out addons that are currently in development.

Post » Fri Mar 18, 2011 2:17 am

Hi again, Ive found another bug.

The bug appears to be with assigning the last button on a joy-pad.

Say you have a generic pad with 12 buttons and a Xbox360 pad with 10 buttons.

Set 14 buttons to be detected.

The last button (12 on the generic pad and 10 on the Xbox360 pad) will be assigned to the last button to be detected 14. When it should be 12 on the generic pad and 10 on the xbox360 pad.

If you use InputSystem.GetControlString the last button (12 on the generic pad and 10 on the xbox360 pad) will be assigned correctly to 12 and 10. However Button 14 will be used.



To test this open Input System example 2 and in (start of layout) for Button1 set the button to 18.

Run the program.

You will see that Button1 InputSystem.GetControlString('Button1) shows Joy Button 11 if you have 12 buttons on your controller when Button1 is really assigned to 18.

I hope I have explained this well, if you need more information let me know.
B
2
G
2
Posts: 8
Reputation: 741

Post » Fri Mar 18, 2011 8:31 am

Ok, I will look into it.
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Sat Mar 19, 2011 8:47 pm

I've tried what you said but I can't find the bug. Could you explain it in another way and share a cap file?
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Sun Mar 20, 2011 5:26 pm

Here is an example .cap file.

Edit the cap file controls / LastButtonOnController = the last detected button on your physical controller.

---------------------------------------------------------------------------------

The issue is with setting a button for a controller that is higher than the number of buttons on a physical controller.

My Xbox360 controller has 10 buttons that are detected.

LastButtonOnController = 10
Button_21 = 21

InputSystem.GetControlString("LastButtonOnController", 1) = Joy Button 09
InputSystem.GetControlString("Button_21", 1) = Joy Button 09

It should be

InputSystem.GetControlString("LastButtonOnController", 1) = Joy Button 09
InputSystem.GetControlString("Button_21", 1) = Joy Button 20

even if Joy Button 20 isn't on the Physical controller.

Hope I explained that ok :?
B
2
G
2
Posts: 8
Reputation: 741

Post » Sun Mar 20, 2011 7:39 pm

It's on purpose:

[quote="sglorz":3racyf74]Thank you, I've found and corrected the bug.

So now, if value is too big, it will take the biggest one (e.g. last button number).

New release 0.93b ready.[/quote:3racyf74]
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Sun Mar 20, 2011 8:21 pm

Thanks for the quick reply.

I think that becomes an issue though with games that have more than a few commands.

If i have a game with these commands:

Punch = Joy Button 00
Kick = Joy Button 01
Shoot = Joy Button 02
Jump = Joy Button 03
Shield = Joy Button 04
GameMenu = Joy Button 05

If a player uses a controller with 5 buttons then

Shield = Joy Button 04
GameMenu = Joy Button 04

If a player presses Joy Button 04 then both buttons execute.

If possible it would be nice to have a (Joy Button N/A) then the game can ignore buttons not on the controller, so that

Shield = Joy Button 04
GameMenu = Joy Button N/A

then the game won't execute GameMenu only the Shield.
B
2
G
2
Posts: 8
Reputation: 741

Post » Sun Mar 20, 2011 9:55 pm

Yes, I think you're right. I will update this.
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Mon Mar 21, 2011 7:59 pm

Behavior modified, a new version is available.
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Mon Mar 21, 2011 8:20 pm

Thanks, sglorz.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,841
Reputation: 48,283

Post » Tue Mar 22, 2011 9:58 pm

Thanks for the quick fix sglorz :)

Looks like the problem is fixed, if i spot anything else I'll let you know.

Great work as always!
B
2
G
2
Posts: 8
Reputation: 741

PreviousNext

Return to Work-in-progress addons

Who is online

Users browsing this forum: No registered users and 0 guests