Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: jeanfabre on October 24, 2013, 03:39:24 AM

Title: GetNextJoystickName
Post by: jeanfabre on October 24, 2013, 03:39:24 AM
Hi,

 Following a request, Please find a custom action to iterate through each joysticks currently plugged.

 Warning. On Mac I know joyscticks are truly plug and play and the list automatically adjust as you plug and remove joyscticks, but on Windows I can recall it's not that well integrated, and you may have to plug your joysctick before starting the game ( at least I can recall some odd behaviors).

You'll find also attached the test scene to go with that action.

bye,

 Jean
Title: Re: GetNextJoystickName
Post by: MABManZ on October 25, 2013, 10:05:47 PM
Thanks Jean!

To my understanding Unity will change the Joystick list as Gamepads are added and removed. I'll let you know if I run into any problems
Title: Re: GetNextJoystickName
Post by: MABManZ on November 26, 2013, 09:17:15 AM
Sorry to bring this up again but I'm having a hell of a time trying to get this action to do what I want :-[

I'm simply trying to assign a string variable from a requested Joystick Name (does not even need to detect if it's connected) and the loop structure here is kinda confusing me. The example you provided does not do this, but instead combines each JoystickName to a single string, and not separate variables.

I tried to set up an fsm that would manually count loops and assign the string variable, but the internal loop in the action seems to be causing problems.
Title: Re: GetNextJoystickName
Post by: jeanfabre on November 28, 2013, 04:41:53 AM
Hi,

 I am not sure what you are trying to do, can you explain your goal?

bye,

 Jean
Title: Re: GetNextJoystickName
Post by: MABManZ on November 30, 2013, 10:29:21 AM
I want to be able to save Joystick names for each device as separate string variables.

Something like:

Joystick: INT
Store As: String

So if I request Joystick 0 it would return the device name "Xbox Controller" as the string and store it.
Title: Re: GetNextJoystickName
Post by: jeanfabre on December 02, 2013, 02:02:24 AM
Hi,

Ok, I see.  Try the action attached to this post.

 Bye,

 Jean
Title: Re: GetNextJoystickName
Post by: MABManZ on December 06, 2013, 08:35:14 AM
Wow Jean this is great, thank you so much!