nata
New vMember
Posts: 7
|
Post by nata on Jun 21, 2019 18:58:14 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 Hi Buds, You can use Rewired Input Wrapper script above then rewrite the Inventory script like openInventory,submit,horizontal & vertical from generic to RewiredInputWrapper and define Your UI Action in Rewired input manager RewiredStandaloneInputModule .
|
|
|
Post by tryharder on Aug 22, 2019 9:00:19 GMT
Hello, I've also recently integrated to Rewired, I used the wrapper idea and it all worked perfectly for me (I've not done Inventory yet), the only thing that was slightly more complicated was the 'Action' event in shooter, where you need to extend out all the button timer logic to the wrapper as you are replacing the Generic calls. But I can confirm it is all do-able in the current template versions
|
|
|
Post by fluidimages on Sept 8, 2019 17:31:35 GMT
Team, I have completed by rewired integration with using just default integration (no wrapper). This allows you to upgrade (IMO) much easier). I have a MFI controller, touch controller, and of course keyboard/mouse. This implementation does not even require the mobile input.
The only question I have... am researching now, but if someone knows: How can I show (or where do I show) what input type is triggered.. I need to change the input type to joystick manually - when rewired is triggered that is. any ideas of how this is triggered? I am guessing: vInput.instance.onChangeInputType somewhere in vINput?
(I can post some samples, if anyone needs them)
|
|
|
Post by fluidimages on Sept 8, 2019 18:04:09 GMT
I think this should do it:
Modify the beginning of isJoystickInput in vInput.
private bool isJoystickInput() { //Rewired Integration Player p = ReInput.players.GetPlayer(0); if (p.GetAxis("LeftAnalogHorizontal") != 0.0f || p.GetAxis("LeftAnalogVertical") != 0.0f || p.GetAxis("RightAnalogHorizontal") != 0.0f || p.GetAxis("RightAnalogVertical") != 0.0f || p.GetAxis("LT") != 0.0f || p.GetAxis("RT") != 0.0f || p.GetAxis("D-Pad Horizontal") != 0.0f || p.GetAxis("D-Pad Vertical") != 0.0f) { return true; } //END Rewired Integration STB
|
|
|
Post by fluidimages on Sept 8, 2019 18:05:28 GMT
ugh - for some reason that did not work on the iPad - anyone have any ideas? (it did work in the editor)
|
|
|
Post by hitpp2bob on Mar 19, 2020 8:26:47 GMT
Example Link failure, Can you provide the latest Example, thanks
|
|
|
Post by zaeffy on Jun 22, 2020 16:42:59 GMT
Example Link failure, Can you provide the latest Example, thanks Same question here, can you please provide the latest link to example? Thank you
|
|
|
Post by nickyg on Jul 24, 2020 16:39:06 GMT
:::FIXED::: Problem: After installing the Rewired Unity Input Override script, I was able to get everything to work on both mouse-keyboard and my Ps4 controller. The only thing that wouldn't work was my left and right mouse clicks. I spent a few hours experimenting to see what the problem was but I'm clueless as to what it could be. I am able to shoot and aim with my controller but nothing happens when I left or right click. I know my mouse is working because the Rewired debugger is receiving my inputs but the game isn't for some reason. What could I be doing wrong? Solution: Reqired changes Mouse0 to MouseButton0, you must go into the vThirdPersonController and change the Melee Inputs and Shooter Inputs to change Weak Attack, Ain Input, etc to MouseButton1 or MouseButton0 to match the changed that the Rewired Unity Input Override Script makes.
It's simple to get the power of Rewired into Invector, just takes getting over this snap.
|
|
|
Post by haywire on Jan 14, 2021 16:42:49 GMT
I've updated the Rewired wrapper to instead use Rewired IDs. Ints are faster than processing strings and it has the added benefit of being able to see and map your Rewired actions in the inspector. Much more fun than a long list of random unity input values. RewiredInputWrapper.cs V2.1 using System.Collections; using System.Collections.Generic; using UnityEngine; using Rewired;
[System.Serializable] public class RewiredInputWrapper { [SerializeField] private int actionID; public bool useInput = true; [HideInInspector] public bool inButtomTimer;
public RewiredInputWrapper(int _actionID) { //this.actionName = actionName; this.actionID = _actionID; }
public bool GetButton() { if (!ReInput.isReady || actionID < 0) return false;
return ReInput.players.GetPlayer(0).GetButton(actionID); }
public bool GetButtonDown() { if (!ReInput.isReady || actionID < 0) return false;
return ReInput.players.GetPlayer(0).GetButtonDown(actionID); }
public bool GetButtonUp() { if (!ReInput.isReady || actionID < 0) return false;
return ReInput.players.GetPlayer(0).GetButtonUp(actionID); }
public float GetAxis() { if (!ReInput.isReady || actionID < 0) return 0.0f;
return ReInput.players.GetPlayer(0).GetAxis(actionID); }
public float GetAxisRaw() { if (!ReInput.isReady || actionID < 0) return 0.0f;
return ReInput.players.GetPlayer(0).GetAxisRaw(actionID); } public bool GetHoldButtonDown() { if (!ReInput.isReady || actionID < 0) return false;
return ReInput.players.GetPlayer(0).GetButtonLongPress(actionID); }
public bool GetDoubleButtonDown(float inputTime = 1.0f) { if (!ReInput.isReady || actionID < 0) return false;
return ReInput.players.GetPlayer(0).GetButtonDoublePressDown(actionID, inputTime); } public bool GetButtonTimer(ref float currentTimer, ref bool upAfterPressed, float inputTime = 2) { if (!ReInput.isReady || actionID < 0) return false; bool timer = ReInput.players.GetPlayer(0).GetButtonTimedPressUp(actionID, inputTime); inButtomTimer = !timer; return timer; } }
Here's how I'm mapping them in vShooterMeleeInput.cs using Rewired;
...
/*public GenericInput aimInput = new GenericInput("Mouse1", false, "LT", true, "LT", false); public GenericInput shotInput = new GenericInput("Mouse0", false, "RT", true, "RT", false); public GenericInput secundaryShotInput = new GenericInput("Mouse2", false, "X", true, "X", false); public GenericInput reloadInput = new GenericInput("R", "LB", "LB"); public GenericInput switchCameraSideInput = new GenericInput("Tab", "RightStickClick", "RightStickClick"); public GenericInput scopeViewInput = new GenericInput("Z", "RB", "RB");*/ [ActionIdProperty(typeof(RewiredConsts.Action))] public int _aimInput; [ActionIdProperty(typeof(RewiredConsts.Action))] public int _shotInput; [ActionIdProperty(typeof(RewiredConsts.Action))] public int _secundaryShotInput; [ActionIdProperty(typeof(RewiredConsts.Action))] public int _reloadInput; [ActionIdProperty(typeof(RewiredConsts.Action))] public int _switchCameraSideInput; [ActionIdProperty(typeof(RewiredConsts.Action))] public int _scopeViewInput; public RewiredInputWrapper aimInput { get {return new RewiredInputWrapper(_aimInput);} } public RewiredInputWrapper shotInput { get {return new RewiredInputWrapper(_shotInput);} } public RewiredInputWrapper secundaryShotInput { get {return new RewiredInputWrapper(_secundaryShotInput);} } public RewiredInputWrapper reloadInput { get {return new RewiredInputWrapper(_reloadInput);} } public RewiredInputWrapper switchCameraSideInput { get {return new RewiredInputWrapper(_switchCameraSideInput);} } public RewiredInputWrapper scopeViewInput { get {return new RewiredInputWrapper(_scopeViewInput);} } Note: Be sure to export your Rewired constants inthe Rewired Editor > Tools > Export (bottom left) You can replace those Genericinputs in the same way in any of the scripts that use it (they're scattered all over) I'll put together a list of all the files I changed. Thanks dcmonkey for the original! update 1: added useInput bool to the wrapper (always true) update 2: added mappings for button timers (item pickups etc)
|
|
wrg
Junior vMember
Posts: 32
|
Post by wrg on Mar 7, 2021 23:08:23 GMT
Hi,
Great work everyone but to help out can anyone provide the FULL scritps modified so I can (and many others) can look over how they are done and reference then with there own projects please or provide an exmple project that we can all learn from.
I think there would be any greatful designers out there if anyone can provide these.
I know it sounds lazy, but I promse its not for us noobs who are just trying to get our games made, many designers wouldnt get any were with out sites like this and the people who contribute to them.
Stay Safe
Regards
WRG
|
|
|
Post by marcel on Jun 17, 2022 3:26:05 GMT
A year has passed, where are the files for rewired integration?
|
|
|
Post by Yort_Draeb on Jul 1, 2022 4:24:27 GMT
A year has passed, where are the files for rewired integration? ....
|
|
|
Post by icronos on Nov 7, 2022 2:29:34 GMT
:::FIXED::: Problem: After installing the Rewired Unity Input Override script, I was able to get everything to work on both mouse-keyboard and my Ps4 controller. The only thing that wouldn't work was my left and right mouse clicks. I spent a few hours experimenting to see what the problem was but I'm clueless as to what it could be. I am able to shoot and aim with my controller but nothing happens when I left or right click. I know my mouse is working because the Rewired debugger is receiving my inputs but the game isn't for some reason. What could I be doing wrong? Solution: Reqired changes Mouse0 to MouseButton0, you must go into the vThirdPersonController and change the Melee Inputs and Shooter Inputs to change Weak Attack, Ain Input, etc to MouseButton1 or MouseButton0 to match the changed that the Rewired Unity Input Override Script makes. It's simple to get the power of Rewired into Invector, just takes getting over this snap. This is the best solution by far without causing any unintended behaviour. Thank you!
|
|
|
Post by electrolyte on Nov 29, 2022 12:54:02 GMT
Hi there,
I've just brought Rewired with the goal to integrate on quite an established game.
I've been reading the threads on this board, and other references on the web - however I'm having a bit of a hard time firstly understanding how this might work and how to do it.
First is it officially supported? On the rewired docs site Investor isn't listed.
Would anyone be able to explain to me, as you would to a small child, how to get Rewired working with the shooter controller? Mainly steps in setting up and using the wrapper as outlined here.
Greatly thankful J
#### UPDATE ####
Just spent a few more hours with it and have managed to get everything working. I ended up using the Unity Input override option (which rewired comes with) which simply mimics the old input system. All you have to do is set up the names of Actions as per Invectors expected inputs - so in the end and with a bit more patience from myside it was actually quite simple!
|
|
|
Post by fabervi on May 17, 2023 15:04:47 GMT
Given the time that this place has passed, there should be an integration already included in the package... Is it possible that there is nothing official yet? Is this asset still supported or not?
|
|