Hi guys,
Just started using Rewired. I want to use Xbox and PlayStation controllers in my Windows game, I have set up a Dual Analogue Gamepad map using Rewired Editor.
I have defined all the keyboard and mouse commands in FSM's on my character previously. Can I, and which actions can I use (Rewired integration is done and relevant actions are available), to hook up those commands to that Rewired joystick map? Or is it done otherwise?
The very first thing you should do is read the
documentation. This documentation applies whether or not your're using PlayMaker. You need to understand the concepts about setting up your input configuration first. Even after that, all the documentation still applies. PlayMaker's Actions are nothing more than wrappers around the equivalent Rewired functions. For example, in code, to get input for "Move Horizontal", you type:
player.GetAxis("MoveHorizontal");
In PlayMaker, you use the RewiredPlayerGetAxis Action and set the value of the Action you want to "MoveHorizontal".
They are functionally equivalent. Nearly the entire Rewired API is the same way.
Getting input is covered here:
http://guavaman.com/projects/rewired/docs/HowTos.html#get-inputRewired will provide you the raw input values you need (button presses, axis values, etc.), but it will not apply these input values to your character / cursor / whatever object you're moving. That would be beyond the scope of the system. Any PlayMaker Actions that exist to move characters, etc. that can read an external variable (Vector2, float, boolean, etc.) will work with Rewired because you just store the resulting action's value as a variable and have your other PM Action read that variable. There are also events on some of the Actions like RewiredPlayerGetButtonDown where you can use the Is True event to then branch to some other PM Action.