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

Post and try out addons that are currently in development.

Post » Thu Oct 14, 2010 8:22 am

I agree that preset thing is the most tricky part.

First you create your preset with "Set control default component", then you activate the presets with "Init control default component device" with optional Joystick number to use, because as you have only one keyboard and one mouse, there may be not only one joystick.

After some thinking, I agree that it's a bit too complicated and I should rework that.

So, First, I will rename "Set control default component" to "Set control preset" and "Init control default component device" to "Set presets joystick"

Then, I will change the preset like this:
- call "Set control preset", will init control directly and if it's a joystick, it'll take the first one available.
- call "Set presets joystick" to set joystick to use for preset and to change the used joystick of previous presets.

What do you think?
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Thu Oct 14, 2010 10:38 pm

Thanks for the clarification, and that does sound a bit easier to understand.
I guess what I was missing was the set default.

One other question, once you've set up the arm control, can you use "InputSystem.GetControlConfigData" for the next layout?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Oct 15, 2010 7:55 am

GetControlconfigData primary goal is to have a string representation of configured controls that can be used, for example, to save the configuration on disk (see Input System3.cap). Then you use SetControlConfigData to set controls.

I didn't think of using this method to transfer controls data between two layouts, because I thought you'd rather have one InputSytem global to the application than one InputSystem for each Layout. So, it may and should work. If you try it, tell me if it's really working ;)
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Fri Oct 15, 2010 11:19 pm

I did the global thing and it works perfectly :)

The change you mention sounds much clearer, although I can use it as it is with this clarification (yay!)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Oct 15, 2010 11:31 pm

[quote="madster":3jlzh3k5]I did the global thing and it works perfectly :)

The change you mention sounds much clearer, although I can use it as it is with this clarification (yay!)[/quote:3jlzh3k5]

You should use last version, as actions' names have been modified in 0.91b.
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Mon Oct 18, 2010 5:27 pm

This is great! I saw this just now and have only tried the examples so far, but it works great.
Awesome work! :D
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Wed Oct 20, 2010 1:27 am

Is it possible to have multiple controllers control the same character? For example have the keyboard and joystick both control the player, so that a special option to switch schemes is unnecessary?
B
1
G
2
Posts: 7
Reputation: 639

Post » Wed Oct 20, 2010 7:37 am

No sorry, you have to manage that in your cap file.
In the plugin, one control is for one player and uses one device component (axis, button, pov, etc...).

But, when I was designing the plugin, I thought of having a primary and a secondary component for the same control. But I changed my mind, because, firstly I don't think it will be often used and secondly this can be managed in the game by using 2 controls for the same action.
B
3
S
1
G
2
Posts: 80
Reputation: 985

Post » Thu Oct 21, 2010 8:17 pm

Two questions:

1. How come your example will detect my joypad as input device #1 but in my project it detects it as #3, after keyboard and mouse? I've been looking at the code and there must be something I'm missing.

2. Is it really necessary to distinguish d-pad diagonals as seperate buttons? Is it not possible to just make it detect that I'm pressing left and up at once as seperate buttons? Otherwise it seems like a couple unnecessary events I'd need just for the joypad support and the current game engine.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Thu Oct 21, 2010 9:16 pm

1. Your Joystick is the 3rd device (after mouse & keyboard) and the first joystick. In my example I use GetJoystickName with joystick number as parameter.

2. POV is made of 8 diferent directions events sent by DirectX. For example NorthWest is a separate event and not North+West events together.

I hope it answered your questions.
B
3
S
1
G
2
Posts: 80
Reputation: 985

PreviousNext

Return to Work-in-progress addons

Who is online

Users browsing this forum: No registered users and 0 guests