playMaker

Author Topic: How would you remap keyboard shortcuts for game controls using Playmaker?  (Read 312 times)

megmaltese

  • Sr. Member
  • ****
  • Posts: 300
    • View Profile
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?

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 847
    • View Profile
    • Fat Pug Studio
Re: How would you remap keyboard shortcuts for game controls using Playmaker?
« Reply #1 on: September 08, 2018, 01:13:51 AM »
Use Rewired, don't waste time on that :)

megmaltese

  • Sr. Member
  • ****
  • Posts: 300
    • View Profile
Re: How would you remap keyboard shortcuts for game controls using Playmaker?
« Reply #2 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13635
  • Official Playmaker Support
    • View Profile
Re: How would you remap keyboard shortcuts for game controls using Playmaker?
« Reply #3 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

megmaltese

  • Sr. Member
  • ****
  • Posts: 300
    • View Profile
Re: How would you remap keyboard shortcuts for game controls using Playmaker?
« Reply #4 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.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3664
    • View Profile
    • jinxtergames
Re: How would you remap keyboard shortcuts for game controls using Playmaker?
« Reply #5 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 on my website.