Playmaker Forum

PlayMaker News => General Discussion => Topic started by: megmaltese on September 07, 2018, 03:46:11 PM

Title: How would you remap keyboard shortcuts for game controls using Playmaker?[SOLVED
Post by: megmaltese on September 07, 2018, 03:46:11 PM
As per title: I would like to give my users option to remap control keys on PC keyboard.
What is the most efficient way to do it?
Title: Re: How would you remap keyboard shortcuts for game controls using Playmaker?
Post by: krmko on September 08, 2018, 01:13:51 AM
Use Rewired, don't waste time on that :)
Title: Re: How would you remap keyboard shortcuts for game controls using Playmaker?
Post by: megmaltese on September 08, 2018, 11:43:22 AM
Uhm maybe I haven't been clear.
How do I do to replace the keys I'm reading in Playmaker actions with something user-defined?
I want to do an interface where the player chooses to replace the forward button W with in example E.
If I am hard coding this in a Playmaker action, I won't be able to reassign it later on.
So, how does this work?
Title: Re: How would you remap keyboard shortcuts for game controls using Playmaker?
Post by: jeanfabre on September 10, 2018, 12:09:30 AM
Hi,

 I concur with Krmlko, you should use a proper asset to remap your input. Rewired, being the goto solution, also there are others ( check that they do support PlayMaker though)

 However is you want to do it in pure PlayMaker:

- you either modify the actions that takes Input ( duplicate the actions, so that PlayMaker update don't erase your mods on the next update)

- without any code, you will need to listen to the inut in a dedicated FSM, which then will know about the mapping and send a PlayMaker event or set a global variable, with the mapped input. ALL other fsms will need to check that global variable or listen to that event in order to get the mapped input they want. You can't use GetAxis, or Any Input based actions since they don't have mapping support built in.


I strongly recommend not to go to far with this, Input Mapping is very complex as soon as you start to want to provide some UI to let the player choose, it's best to leave that to complex assets like rewired.


Bye,

 Jean
Title: Re: How would you remap keyboard shortcuts for game controls using Playmaker?
Post by: megmaltese on September 10, 2018, 12:19:34 AM
OK Jean, thank you... then I'll leave without configuration for the beginning, and add it later on with a plugin.
Title: Re: How would you remap keyboard shortcuts for game controls using Playmaker?
Post by: djaydino on September 10, 2018, 05:50:15 AM
Hi.
You can check out one of my older videos :


And you can test it on the Tetris game (http://www.jinxtergames.com/web-games/) on my website.
Title: Re: How would you remap keyboard shortcuts for game controls using Playmaker?
Post by: megmaltese on January 04, 2019, 12:33:56 PM
Hey! Thank you!