|
Post by jime363 on Dec 11, 2017 7:52:15 GMT
Can you make a tutorial video of rewired integration.....
|
|
erik
New vMember
Suicide lol
Posts: 1
|
Post by erik on Dec 18, 2017 13:06:36 GMT
2 days passed. still trying to get the mobile shooter demo scene to work nice with rewired. can anyone please help?
|
|
|
Post by spheredcazual on Feb 20, 2018 7:01:34 GMT
Hi I tried the link below but lots of errors when using the script on your latest Basic controller, Do you have an updated version? Regards Mario (www.assetstore.unity3d.com/en/#!/content/21676)
Well how about another cool integration Steps: - Download and import the last version of the Template ( tested on basic 2.1a) - Download, import and install the Rewired last version ( tested on 1.0.0.112.U5) - Create a Rewired InputManager on your scene - Follow steps with images above- Replace or take a look into this vThirdPersonInput [ Example] Basically we replace every input call to a rewired input call. Original: if (jumpInput.GetButtonDown())Rewired: if (player.GetButtonDown("Jump"))
You will need to create new actions and assign the inputs at the Rewired EditorCreating New Actions: ( in this example we only setup the basic locomotion inputs, but it's the same process for the Melee or Shooter) Keyboard Mapping: Joystick Mapping:
And Mouse Mapping:
Don't forget to assign all the inputmappings into a Player: That's it, it's pretty easy to integrate this one so I think a video tutorial is not necessary.
|
|
dav
Full vMember
Posts: 56
|
Post by dav on Mar 31, 2018 19:20:11 GMT
I have finally change the code in the following files to get the Rewired integration. It works great but it's a lot of work as you have to change them on multiple places on every file. (Still same work to do on the inventory) vThirdPersonInput.cs vMeleeCombatInput.cs vSwimming.cs vFreeClimb.cs vInventory.cs
But I get the following errors: (5 or 6 consecutive times) (The game can play, so there are not fatal errors) "The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) playerId" Any idea how can I avoid them? I'm assigning the rewire player on every script on the update with this call:
// Codigo para Iniciar Rewired------------------------------------------------------------------------------------------------------------------------------------ if (!ReInput.isReady) return; // Exit if Rewired isn't ready. This would only happen during a script recompile in the editor. if (!initialized) Initialize(); // Reinitialize after a recompile in the editor
private void Initialize() { player = ReInput.players.GetPlayer(playerId); // Get the Rewired Player object for this player. initialized = true; }
|
|
|
Post by fluidimages on May 24, 2018 15:38:51 GMT
Dav,
I am having some difficulty integrating and updating vInventory.cs- can you share if you used the wrapper or what you did in inventory for the integration.
Sean
|
|
|
Post by fluidimages on May 30, 2018 0:39:31 GMT
I am getting closer!
I have nearly all the rewired items modified.. still a bit of work to do on inventory, but making progress.
The one area that I am having some difficulty with is Touch.. when I add touch controls- public class vShooterMeleeInput : vMeleeCombatInput causes the Rewired Touch controls not not be able to be touched (similar to the normal touch items for Invector).. Know what may cause this?
Sean
|
|
|
Post by Yort_Draeb on Sept 10, 2018 6:57:05 GMT
Yes, it is a pain. This isn't a complete solution, but I wrote a RewiredInputWrapper class that mimics the GenericInput class that wraps most of the input calls in TPC. using System.Collections; using System.Collections.Generic; using UnityEngine; using Rewired;
[System.Serializable] public class RewiredInputWrapper { [SerializeField] private string actionName;
public RewiredInputWrapper(string actionName) { this.actionName = actionName; }
public bool GetButton() { if (!ReInput.isReady) return false;
return ReInput.players.GetPlayer(0).GetButton(actionName); }
public bool GetButtonDown() { if (!ReInput.isReady) return false;
return ReInput.players.GetPlayer(0).GetButtonDown(actionName); }
public bool GetButtonUp() { if (!ReInput.isReady) return false;
return ReInput.players.GetPlayer(0).GetButtonUp(actionName); }
public float GetAxis() { if (!ReInput.isReady) return 0.0f;
return ReInput.players.GetPlayer(0).GetAxis(actionName); }
public float GetAxisRaw() { if (!ReInput.isReady) return 0.0f;
return ReInput.players.GetPlayer(0).GetAxisRaw(actionName); }
public bool GetDoubleButtonDown(float inputTime = 1.0f) { if (!ReInput.isReady) return false;
return ReInput.players.GetPlayer(0).GetButtonDoublePressDown(actionName, inputTime); } }
With this you can replace the GenericInput fields/initializers with corresponding RewireInputWrapper fields, and keep the needed script modifications to one location in each affected script rather than having to modify every "xxxInput.GetButton" call. For example, in vThirdPersonInput.cs you would change public GenericInput jumpInput = new GenericInput("Space", "X", "X"); to public RewiredInputWrapper jumpInput = new RewiredInputWrapper("Jump"); Of course you would still need to create all of the corresponding Actions and mappings in Rewired. Also, there are a number of places in TPC that still call the Unity input system directly. This guy wrote a really good wrapper and explained how to use. I'm not sure why you guys aren't using it. I have used it with no problem since he posted it. thanks again dcmonkey
|
|
|
Post by fluidimages on Sept 24, 2018 0:11:46 GMT
As mentioned, I used the wrapper, and it worked awesome - but the inventory does not seem to work properly.
Sean
|
|
|
Post by fluidimages on Sept 28, 2018 1:17:34 GMT
In order to share what I have learned..
Rewired integration is even easier - and you do not need the wrapper.
install/use rewired - add and use the rewired Unity input override adding a keyboard, mouse and joypad maps. If you want to use rewired mobile buttons - add a custom map and use the event input system.
if you want it all 9mobile) to really work well.. modify vInput.cs -
adding the below code (commenting the rest out - in the OnGUI function. This allows for the Input Device checking to be done by Rewired..
Works great! a few more minor tweaks in order to hide and show the controls when you are on a mobile - but it all came together!
Controller controller = player.controllers.GetLastActiveController(); if (controller != null) { switch (controller.type) { case ControllerType.Keyboard: // Do something for keyboard inputDevice = InputDevice.MouseKeyboard; if (hud != null) { hud.controllerInput = false; hud.ShowText("Control scheme changed to Keyboard/Mouse", 2f, 0.5f); } break; case ControllerType.Joystick: // Do something for joystick inputDevice = InputDevice.Joystick; if (hud != null) { hud.controllerInput = true; hud.ShowText("Control scheme changed to Controller", 2f, 0.5f); } break; case ControllerType.Mouse: // Do something for mouse inputDevice = InputDevice.MouseKeyboard; if (hud != null) { hud.controllerInput = false; hud.ShowText("Control scheme changed to Keyboard/Mouse", 2f, 0.5f); } break; case ControllerType.Custom: inputDevice = InputDevice.Joystick; if (hud != null) { hud.controllerInput = true; hud.ShowText("Control scheme changed to Controller", 2f, 0.5f); } break; } }
Sean
|
|
dav
Full vMember
Posts: 56
|
Post by dav on Sept 28, 2018 11:42:33 GMT
This looks promising and I have already make those changes but it doesn't work. You need to install use the rewired Unity input override? Right? I did also. And the actions in rewired I guess must be the some names than the inputs on Invector, is that allright? I have changes 2 o 3 action with the same names just to try but I don't get any response.... Any ideas? Maybe it's neccesary any step more?
I don't have experience with the rewired Unity input override, as I never used before....maybe it's neccesary to do something else?
Thanks! If this works its a great time saver!!!
PS: I already did the integration changing the code (lot of work as you have to go to lots of files, more if you have the addons) but every time I update Invector I lose all the code so I have to start over :(
|
|
|
Post by Rockwall on Sept 28, 2018 22:28:52 GMT
This looks promising and I have already make those changes but it doesn't work. You need to install use the rewired Unity input override? Right? I did also. And the actions in rewired I guess must be the some names than the inputs on Invector, is that allright? I have changes 2 o 3 action with the same names just to try but I don't get any response.... Any ideas? Maybe it's neccesary any step more? I don't have experience with the rewired Unity input override, as I never used before....maybe it's neccesary to do something else? Thanks! If this works its a great time saver!!! PS: I already did the integration changing the code (lot of work as you have to go to lots of files, more if you have the addons) but every time I update Invector I lose all the code so I have to start over :( If only this is easier to do. Unity input override works! All you got to do is install it (took me a while to figure out to). Cheers!
|
|
dav
Full vMember
Posts: 56
|
Post by dav on Sept 29, 2018 22:33:26 GMT
Done it !! Great, thanks very much for sharing this!!!
|
|
dav
Full vMember
Posts: 56
|
Post by dav on Sept 30, 2018 11:48:55 GMT
It works with the Shooter Melee Template and the 3 addons. The only issue (at least for me) is the inventory, that I can't navigate with the gamepad, did you have any issue with the inventory also? Thanks
|
|
|
Post by f1chris on Jan 10, 2019 22:50:50 GMT
i think Invector should remove Rewired Integration from their Asset Store description. It’s a false statement and misleading.
|
|
|
Post by Invector on Jan 22, 2019 16:17:45 GMT
i think Invector should remove Rewired Integration from their Asset Store description. It’s a false statement and misleading. Did you try the recent users post solution? the last time I've checked it was working
|
|