playMaker

Author Topic: Using Playmaker with Rewired  (Read 8013 times)

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Using Playmaker with Rewired
« on: October 22, 2017, 09:12:46 PM »
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?  :)


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Playmaker with Rewired
« Reply #1 on: October 23, 2017, 02:59:11 AM »
Hi,

 Rewired doesn't come with a demo scene using PlayMaker actions?

 Bye,

Jean

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: Using Playmaker with Rewired
« Reply #2 on: October 23, 2017, 08:23:21 PM »
Hi jeanfabre,

No it doesn't come with a scene using PlayMaker actions. Their online documentation http://guavaman.com/projects/rewired/docs/Documentation.html only refers to Playmaker regards installing the PlayMaker Integration Pack, which I did.

So I really don't know how to use them with Rewired.

Charles

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Playmaker with Rewired
« Reply #3 on: October 24, 2017, 03:26:06 AM »
Hi,

 unfortunatly, I don't own Rewired. I'll get in touch with the author to see what we can do to create a sample.

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Playmaker with Rewired
« Reply #4 on: October 24, 2017, 03:28:39 AM »
Hi,

 they have a trial, I'll see if I can provide a sample and help you on this. Should be possible now.

 Bye,

 Jean

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: Using Playmaker with Rewired
« Reply #5 on: October 24, 2017, 05:26:44 PM »
Thank you jeanfabre.  ;D

I appreciate you doing this. And it will be good for others who want to use Rewired and Playmaker together.

Regards Charles

LogLady

  • Full Member
  • ***
  • Posts: 150
Re: Using Playmaker with Rewired
« Reply #6 on: October 24, 2017, 06:07:56 PM »
Hi!

Have you tried using "Rewired Get Player Button"?

After creating your actions inside the Rewired Input Editor, use the "Rewired Get Player Button" action and set it to "every frame" and use and event when the desired button is pressed (or axis used). Inside the next event do what you want and set the "Rewired Get Player Button" action to listen to when you release the button and got to the previous state to listen again for the desired key press.

Hope this helps!

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: Using Playmaker with Rewired
« Reply #7 on: October 27, 2017, 04:39:08 AM »
Hi LogLady

Ahh well, no. I figure I probably need to complete the setup on Rewired for the keyboard and mouse commands first, not just the gamepad. I will try your suggestions soon.

LogLady

  • Full Member
  • ***
  • Posts: 150
Re: Using Playmaker with Rewired
« Reply #8 on: October 27, 2017, 05:05:04 PM »
Hi unearthly

There is no need to configure the keyboard or mouse first. If your game only uses a gamepad, you just need to configure it.

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: Using Playmaker with Rewired
« Reply #9 on: November 07, 2017, 06:59:36 PM »
Hi guys

Rewired requires a script to be written and attached to the character controller and I can't write code, so it doesn't help me (another paid asset into the trash). I am using the SmartFPController asset anyway, it has basic movement built-in for both  Xbox gamepad and K&M.

I have used PlayMaker to do the keyboard and mouse commands for firing and loading a gun and using a melee weapon, all which work fine.

So what would be the best approach to set up Xbox 360 gamepad inputs (and maybe later PlayStation 4) and link these into my PlayMaker scripts for the keyboard and mouse commands?

I have looked at the Unity Input Manager but can't figure out how to use it with PlayMaker. Besides it lists 404 inputs (perhaps because of the SmartFPController?) which match what gamepad buttons I have no idea.



Regards Charles

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Playmaker with Rewired
« Reply #10 on: November 08, 2017, 03:18:40 AM »
Hi,

 I think you are getting very confused.

 rewired will work fine for your playMaker inputs as you are describing them. Why not using it for this? Setting up Unity Input manually for supported various gamePads is litteraly impossible by hand hence why so many publishers provides framework around this lack of built in Input proper support.

Bye,

 Jean

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: Using Playmaker with Rewired
« Reply #11 on: November 08, 2017, 05:20:20 PM »
Hi jeanfabre

Yes, I am getting confused.   :-\

Have other things to do now, but I will get back to working with Rewired and PlayMaker in a little while. Probably take a few more posts for me to understand how to use them together. I do appreciate your help.

Regards Charles

LogLady

  • Full Member
  • ***
  • Posts: 150
Re: Using Playmaker with Rewired
« Reply #12 on: November 09, 2017, 08:59:39 PM »
You CAN use Playmaker and Rewired to do what you are planning even if you use an unknown/non-listed gamepad (I'm using one and Rewired gives basic support for it you just need to configure). I know that it is really confusing to understand how to use Rewired but I am pretty sure that you can find almost all help you need using the help files. Some vital information are spread across the sections of the help file. Take some time to try to make what you want and look for answers in the help file. If you can't figure it out ask here or directly to the developer. I can asure you that you will regret if you this asset away. :D

Guavaman

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Using Playmaker with Rewired
« Reply #13 on: November 17, 2017, 09:21:56 PM »
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-input

Rewired 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.
« Last Edit: November 17, 2017, 09:29:34 PM by Guavaman »

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: Using Playmaker with Rewired
« Reply #14 on: February 09, 2018, 02:12:35 PM »
@Guavaman

But still, a basic scene as an example using some basic actions would be the best.

Actually, is the first professional package supporting playmaker that I have that dont include scenes.

In my case, I could map buttons and axes for my character movement. I couldnt map right stick to control my mouselook camera (using right stick to map literally the mouse, that moves the camera)