Search Unity

Rewired - Advanced Input for Unity

Discussion in 'Assets and Asset Store' started by guavaman, Sep 25, 2014.

  1. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    It was 25% off, so $33.75.
     
  2. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
  3. HittmanA

    HittmanA

    Joined:
    Jul 27, 2016
    Posts:
    45
    An RPG. I thought of maybe adding an advanced warning system that alerts you if you have critical health and may receive a fatal blow.
     
  4. FlaxenFlash

    FlaxenFlash

    Joined:
    Oct 15, 2015
    Posts:
    28
    Windows 10 Pro 64 bit
    Unity 5.4.2f2
    I presume my rewired version is 1.0.0.112, that's the top entry in the included release notes
    I don't have the shifter addon
    I haven't intentionally remapped anything, but it downloaded a bunch of profiles itself. I have the default one active at the moment but I have previously had other ones activated. To my knowledge they are just for buttons though, not axis remapping.


    Accelerator pedal goes from "Z = 65535 (1)" when at rest to "Z = -65535 (-1)" when fully pressed
    Brake pedal goes from "Rotation Z = 65535 (1)" when at rest to "Rotation Z = -65535 (-1)" when fully pressed
    Clutch pedal goes from "Y = 65535 (1)" when at rest to "Y = -65535 (-1)" when fully pressed
     
  5. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Does your game have local multi-player also?

    A RPG seems like the best place for such a system. We always end up running around with 1% health and not even notice it until it is too late.

    Actually I was thinking of Atari's arcade game Gauntlet had such a feature. I thought it had a voice that said something like "red elf is about to die" when you get low on health.
     
    Last edited: Mar 15, 2017
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Thanks for sending that info! If it's not too much trouble, could you do the same for three more configurations?:

    Switch to the shared axis mode in the Logitech software and do it again in Raw Input.
    Do it again in Direct Input (change the setting in the Rewired Input Manager under Windows) in both axis modes.

    No problem if you can't. Thanks again!
     
  7. FlaxenFlash

    FlaxenFlash

    Joined:
    Oct 15, 2015
    Posts:
    28
    Raw Input:
    Combined:
    Accelerator pedal goes from "Z = 257 (0.0039)" when at rest to "Z = -65535 (-1)" when fully pressed
    Brake pedal goes from "Z = 257 (0.0039)" when at rest to "Z = 65535 (1)" when fully pressed
    Clutch pedal goes from "Y = 65535 (1)" when at rest to "Y = -65535 (-1)" when fully pressed
    Direct Input:
    Separate:
    Accelerator pedal goes from "Y = 65535 (1)" when at rest to "Y = -65535 (-1)" when fully pressed
    Brake pedal goes from "Rotation Z = 65535 (1)" when at rest to "Rotation Z = -65535 (-1)" when fully pressed
    Clutch pedal goes from "Slider0 = 65535 (1)" when at rest to "Slider0 = -65535 (-1)" when fully pressed

    Combined:
    Accelerator pedal goes from "Y = 0 (0)" when at rest to "Y = -65535 (-1)" when fully pressed
    Brake pedal goes from "Y = 0 (0)" when at rest to "Y = 65535 (1)" when fully pressed
    Clutch pedal goes from "Slider0 = 65535 (1)" when at rest to "Slider0 = -65535 (-1)" when fully pressed​
     
    guavaman likes this.
  8. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    @FlaxenFlash Thank you! This will prove useful. I'll see if I can discover anything about the issue and make changes to the definition if it makes sense too.
     
  9. HittmanA

    HittmanA

    Joined:
    Jul 27, 2016
    Posts:
    45
    No local multi-player as of yet, although it is still in the early stages of development so I may add that to. And yes, when I play RPGs usually I have low health most of the time xD .
     
  10. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey @guavaman,

    Are you still able to only retrieve actions in play mode?

    I currently have the code ReInput.mapping.Actions that I want to retrieve actions in editor mode and it only returns info in Play mode, but I don't know if this is updated or there is another way to do this in Editor mode.

    Thanks,
    jrDev
     
  11. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Rewired does not run in the editor. It is initialized on Awake and all ReInput objects are setup at that time. The documentation on Input Manager explains how Rewired's de-centralized input configuration works:

    What are you trying to do in the editor?

    There are multiple ways to do this:
    1. Export Actions to Constants: http://guavaman.com/projects/rewired/docs/HowTos.html#exporting-constants
    2. Related, Use property drawers for Actions: http://guavaman.com/projects/rewired/docs/HowTos.html#actionid-property-drawer
    3. Like Control Mapper does, store a link to the Rewired Input Manager by adding a public variable of type Rewired.InputManager and drag the object into that field. In the script, reference the variable.UserData to get access to undocumented editor methods.
     
  12. FlaxenFlash

    FlaxenFlash

    Joined:
    Oct 15, 2015
    Posts:
    28
    @guavaman No worries, let me know if you need any more tests done!
     
    guavaman likes this.
  13. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    This is probably what I needed! I currently have a quick workaround for my asset GAC, which a button forces the game to into play mode, retrieve the actions and exit play mode automatically. I'll test this way and get back to you.

    Thanks,
    jrDev
     
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Ahh, I didn't catch that you were the GAC dev. Yes, a link to the Rewired Input Manager is the best way to handle this for an asset to be distributed. You can make your editor script auto-link it by searching the scene for the current manager with Object.FindObjectOfType<Rewired.InputManager>(); and store that. I put a button in the inspector to allow the user auto-find it whenever they want also.
     
    Last edited: Mar 18, 2017
  15. SkyTech6

    SkyTech6

    Joined:
    Jul 14, 2015
    Posts:
    151
    @guavaman any idea if you'll be adding Nintendo Switch support to Rewired? :3
     
  16. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    I don't think I can say due to an NDA... ;)
     
    TeagansDad and SkyTech6 like this.
  17. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Oh OK Thank you very much
     
  18. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Oh yes it is good that CH products stuff still sell well though I think they should have different designs but I like that the quality of their joystcks are excellent. Something that Saitek could learn from and that cut from 2 years to 90 days seems to me to be very suspect no matter which country its in , I find that Saitek has become pretty foolish in its marketing strategy, sad really because Thrustmaster really has I think upped its game.

    I mean the stupid decision by Saitek to have only two choices of Rudder control instead of 3 is foolish and then to add bad quality on top of that and its a wonder they are still about , I guess big money is a savior as well as hype , meanwhile Thrustmaster quality is excellent I only have on Thrustmaster H.O.T.A.S which is not too good and I got this imported OF EBAY to replace my other Afterburner 1, It was a Thrustmaster After Burner original Silver 1st stick and the buttons on it don't work very well anymore , My Thrusmaster Afterburner 2 works fine as does my Feedback Afterburner and T.Flight H.O.T.AS X I will have to get another Afteburner 1 which works properly and all of them are very true in their centre where as my Saitek X36 usb Well I have had 2 sticks and I have had one that I had to take the EPROM out as that was required as the stick after a while will not work unless you take the EPROM chip out and that is completely dead and the second on I bought well I have to say both had a bit of joystick drift ( couldn't believe that USB Joysticks had joystick drift thats how good the Thrustmaster sticks are)

    OK the Saitek X45 I have is very good but I got to say the Thrustmaster USB sticks are excellent and to me seem tto be of better quality than Saitek but Saitek charges a lot of money for bad quality hardware, I used to see loads of problems for the X45 on the old Saitek Forum and it still inherited the 11- 13 sticky buttons that you got on the Saitek X36 USB You have to download drivers to make sure that problem doesn't happen , never had that problem with my Thrustmasters, I haven't yet tested my T.Flight HOTAS X on Windows 7 but I am sure it will work fine.

    I thought you get voices in SPace and Flight Sims as well I think Elite: Dangerous and Star Citizen can do this even Battlezone 98 R.T.S and Battlezone 2 R.T.S but owuld be nice to have that include in the Joystick Drivers as well which could be included in all games
     
  19. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Seems to me that CH Products got their designs right the first time. If they did not get their design right the wouldn't continue to be able sell product and be constantly changing like Saitek and ThrustMaster. Even more so if the product is lasting more than 10 years customers are not purchasing new product regularly to increase sales.

    From CH Products website http://www.chproducts.com/13-28497-Markets.php

    >>>>>>>>>
    Trusted name in Flight Simulation for over 30 years
    CH Products has been manufacturing an expansive line of high-end USB avionic simulation controllers ideal for both general aviation, combat simulation and PC gaming since 1983. CH Products' joysticks, yokes, throttles, and rudder pedals continue to be recognized as the most durable flight simulation controllers on the market today. And with award-winning support and service, you can trust that your controllers will last well beyond their two year warranty.
    <<<<<<<<<

    Then you keep seeing comments on Amazon like the following.

    "CH Products still makes awesome joysticks that last forever. I bought this to replace a 20+-year-old gameport CH Flightstick, which still works. I connected this right away. Works under Linux and Windows 7. Got back to gaming immediately. Love it."

    "I'm a happy return customer to CH products. I have a flight yoke and pedals that have worked well for 17 years"

    That T.Flight HOTAS works fine on Windows 7/8.1, MAC and Linux in the testing I have done with mine. That is why I love Rewired it just works.

    The other problem for Saitek was Mad Catz (as parent company) was not doing very well so that hurts in the decisions that Saitek can make when if they wanted to have higher quality. It will be interesting to see if Logitech will be able rescue the Saitek brand in the long term.

    ThrustMaster has done very well and I think their racing wheels have given them a very good revenue stream to help them build out the rest of their product line. For a while when it came to consoles (PS4 and XBOX ONE) the only racing wheels available came from ThrustMaster. Logitech recently came out with wheels to support those consoles but seems a bit late in the game. Mad Catz tried to get into the racing wheel arena but it did poorly.

    For example the ThrustMaster T500RS racing wheel for PS3/PC is around $599 in the US. The higher end racing wheels for the newer consoles are $400 each and then entry level racing wheels are $200 each. Logitech is around $400 price point and no entry level wheel. ThrustMaster also has several of accessories for their racing wheels so that makes repeat sales easier too.

    Never played those space sims (Elite or Star Citizen) just watched many videos of those games. X-plane 10 has a voice for ATC and the infamous phrase is "You're off course".

    Voices and joystick drivers. Sounds interesting. Are you talking for input purposes?

    Something like VA (voice attack) in combination with the various voice packs for Elite and Star Citizen?
     
    Last edited: Mar 19, 2017
  20. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    What do I need to do to make my PS4 controller analog stick behave just like the D-Pad?

    I've assigned the two axes and then did this:
    Code (CSharp):
    1.         moveVector.x = player.GetAxisRaw("Move Horizontal");
    2.         moveVector.y = player.GetAxisRaw("Move Vertical");
    3. rb2d.MovePosition(rb2d.position + moveVector * currentSpeed * Time.deltaTime);
    The D-Pad works fine, but the analog stick is giving me float values like 0.1 and 0.5, which leads to the character moving in directions I don't want him to.
    Basically I also just want to get 0, 1 and -1 from the analog stick.
     
  21. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Yeah but the stick looks he same and they need to vary the design . They could it build it the same underpinnings as that has lasted for over 30 years but change and vary the outer casings . Seeing as the underpinnings are proven to be more reliable than Saitek and a lot of other joystick manufacturers so making new variations on the theme won't hurt the company as long as the keep the quality up I think they could take a leaf out of Thrustmaster 's leaf and make a good budget H.O.T.A.S setup

    And yeah it would be set up for different games not just Elite : Dangerous and Star Citizen
     
  22. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    You can do this in many ways. Here are two possibilities.

    Code (csharp):
    1. // Method 1
    2. Vector2 analog = player.GetAxis2D("Move Horizontal", "Move Vertical");
    3. Vector2 digital = new Vector2(
    4.     (Mathf.Abs(analog.x) > 0.01f ? 1.0f : 0f) * Mathf.Sign(analog.x),
    5.     (Mathf.Abs(analog.y) > 0.01f ? 1.0f : 0f) * Mathf.Sign(analog.y)
    6. );
    7.  
    8. // Method 2
    9. Vector2 digital = new Vector2(
    10.     player.GetButton("Move Horizontal") ? 1.0f : (player.GetNegativeButton("Move Horizontal") ? -1.0f : 0f),
    11.     player.GetButton("Move Vertical") ? 1.0f : (player.GetNegativeButton("Move Vertical") ? -1.0f : 0f),
    12. );
     
  23. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Some CH customers have asked for new designs but I have not seen anything new. I recall CH had forum post about what users would like to see in a new design.

    Most CH users are more interested in function rather than how it looks. If someone wants a F-16 Fighter jet type of control the CH FighterStick is very similar. It is probably only missing pinky switch. If you look at the ThrustMaster Cougar which was the F-16 replica (F-16 Block 52) you will see how looks almost exactly the same as CH FighterStick.

    http://www.thrustmaster.com/products/hotas-cougar

    If you look at F-16 picture here you can see the real thing.

    https://en.wikipedia.org/wiki/Side-stick#/media/File:F16_ohjaamo.jpg

    If someone is concerned about how the device looks they have plenty of others options with Saitek and ThrustMaster.

    CH Products has a different design goal in making products that last a long time. CH Products are part of the APEM group and their markets are defined here:

    http://www.apem.com/9-29214-Markets.php

    Since their main markets are material handling, agriculture, security, communications, aerospace/defense and industrial equipment they look at things differently then those companies who are just consumer driven.

    They have profiles that you define in CH Product's Control Manager software for each game. This is similar to ThrustMaster's (Thrustmaster Advanced pRogramming Graphical EdiTor) software and Saitek's profile tool.
     
  24. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    356
    Oh, I thought I needed to change some settings in the Input Manager. Thank you.
     
  25. LaytonDrake

    LaytonDrake

    Joined:
    May 11, 2016
    Posts:
    10
    Hey,

    I recently purchased Rewired (great product by the way) and was wondering if you could help me will something. I would like to know how to make a "press any button to join" script. I know you have a tutorial on your website but I find it a little hard to understand. Would it be possible if you could upload a sample script so that I could figure out what I have to do?

    Thanks :)
     
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Examples of implementations including code is already on the page of the documentation you referenced.
     
  27. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    This is the exact same code used in the example under Method 1 except the category has been changed from UI to Default since there is no UI and a singleton has been set up so the GamePlayer script can access it easier. GamePlayer is nothing but the same code from Eight Players example with a tiny change to make it get its Player from the PressStartToJoinPlayerSelector script.
     

    Attached Files:

  28. LaytonDrake

    LaytonDrake

    Joined:
    May 11, 2016
    Posts:
    10
    Oops, sorry. I was looking at method 2 and didn't see any code below it, but I think I can reach the same results if I change method 1 a bit.

    Thanks for your help!;)
     
  29. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    The concept of Method 2 is completely different from Method 1.

    Code (csharp):
    1. // Disable Joystick Auto-Assignment in the Rewired Input Manager
    2. // so no joysticks are assigned to any Players at the start of the game.
    3. // Once assignment is complete, enable joystick auto-assignment
    4.  
    5.  
    6. public class PressAnyButtonToJoin : MonoBehaviour {
    7.  
    8.         void Update() {
    9.             if(!ReInput.isReady) return;
    10.             AssignJoysticksToPlayers();
    11.         }
    12.  
    13.         void AssignJoysticksToPlayers() {
    14.  
    15.             // Check all joysticks for a button press and assign it tp
    16.             // the first Player foudn without a joystick
    17.             IList<Joystick> joysticks = ReInput.controllers.Joysticks;
    18.             for(int i = 0; i < joysticks.Count; i++) {
    19.  
    20.                 Joystick joystick = joysticks[i];
    21.                 if(ReInput.controllers.IsControllerAssigned(joystick.type, joystick.id)) continue; // joystick is already assigned to a Player
    22.  
    23.                 // Chec if a button was pressed on the joystick
    24.                 if(joystick.GetAnyButtonDown()) {
    25.  
    26.                     // Find the next Player without a Joystick
    27.                     Player player = FindPlayerWithoutJoystick();
    28.                     if(player == null) return; // no free joysticks
    29.  
    30.                     // Assign the joystick to this Player
    31.                     player.controllers.AddController(joystick, false);
    32.                 }
    33.             }
    34.  
    35.             // If all players have joysticks, enable joystick auto-assignment
    36.             // so controllers are re-assigned correctly when a joystick is disconnected
    37.             // and re-connected and disable this script
    38.             if(DoAllPlayersHaveJoysticks()) {
    39.                 ReInput.configuration.autoAssignJoysticks = true;
    40.                 this.enabled = false; // disable this script
    41.             }
    42.         }
    43.  
    44.         private Player FindPlayerWithoutJoystick() {
    45.             IList<Player> players = ReInput.players.Players;
    46.             for(int i = 0; i < players.Count; i++) {
    47.                 if(players[i].controllers.joystickCount > 0) continue;
    48.                 return players[i];
    49.             }
    50.             return null;
    51.         }
    52.  
    53.         private bool DoAllPlayersHaveJoysticks() {
    54.             return FindPlayerWithoutJoystick() == null;
    55.         }
    56.  
    57.     }
     
  30. LaytonDrake

    LaytonDrake

    Joined:
    May 11, 2016
    Posts:
    10
    Thanks for your help guavaman, Rewired is great by the way and has saved me a lot of time.:D

    One final question, do I have to credit you in my game for using Rewired or is it free to use without giving crediting to anyone (I couldn't find anything about this on your website)?

    Thanks again, you've been a big help.:)
     
    Last edited: Mar 21, 2017
  31. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Thanks! I'm glad you find it useful.

    The EULA for all asset store products is defined by Unity here. As an asset store publisher, I am not allowed to set my own terms of any sort on the product. Credit is appreciated but not required.

    Here's a full example of Method 2:
     

    Attached Files:

  32. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Hi, had a couple of questions about the Layout feature.

    I want to have one or more alternate layouts for joysticks, so I tried the LoadMap thing and I think I have it working properly. I made a little wrapper:

    Code (csharp):
    1. public void SetJoystickLayout(string joystickLayoutName)
    2.     {
    3.         Rewired.Player player = ReInput.players.GetPlayer(0);
    4.  
    5.         // Load joysticks maps in each joystick in the "Default" category and given layout and set it to be enabled on start
    6.         player.controllers.maps.ClearMaps(ControllerType.Joystick, false);
    7.         foreach (Joystick joystick in player.controllers.Joysticks)
    8.         {
    9.             player.controllers.maps.LoadMap(ControllerType.Joystick, joystick.id, "Default", joystickLayoutName, true);
    10.         }
    11.     }
    At first I did not call ClearMaps and got some unexpected behavior. After the default layout was already loaded, I did the loop to load the maps for an alternate layout. The default has pitch/yaw on the left thumbstick and throttle/roll on the right. The alternate layout has the sticks reversed for those. When I loaded the alternate, both sticks had the functions of the default *and* the alternate. So, both Y axes controlled pitch *and* throttle, for instance.

    So my questions are:

    1) Is LoadMap supposed to act like an "additive" load like that?
    2) Is simply clearing the maps first like I'm doing the appropriate way to do it?
     
  33. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Yes and yes.

    From the LoadMap method's documentation:

    Loading a map will only replace the existing if the Category Id and Layout Id are the same. You are allowed to have as many Controller Maps with the same Category Id as you want as long as the Layout Id is different. You can also have as many Controller Maps in a particular Layout Id loaded as you want as long as they're all in different Categories.
     
  34. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    OK, thanks!

    In my case, I've got 42 elements mapped to the Dual Analog Gamepad template (and another specific to a DS4) under one category and only four are actually different between the layouts. Sounds like I'd be better off creating "base" layouts with the common mappings, then loading like Type A, Type B, etc layouts on top of that, that each just have those four elements.
     
  35. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    That sounds like a good idea. It may not be possible/convenient for all scenarios and it would complicate controller remapping, but it could work.
     
  36. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192
    Where can I find the strings for each Action label in the Control Mapper, so I can translate them into other languages at startup? My game needs to support multiple languages.

    I'm able to do this by modifying the LanguageData.cs script to change the strings at startup, and it's working great.

    I just can't find where to do the same for the Action text that is displayed on the Control Mapper. Please help.
     
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Control Mapper cannot control the names of the Actions. Those are drawn from the Rewired Input Manager. Control Mapper's language system only goes so far as to the text generated by Control Mapper, not the Action names, or the controller Names, or the controller element names, or Action Category Names, or Controller Map Category names, or Input Behavior names, etc. Having languages for those would require a larger integrated language system for Rewired that covers all aspects which does not exist at the present time.
     
  38. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192
    I'm using the I2 Localization system, which allows any text objects to be converted to other languages easily. I modified the Rewired language script to use I2 instead.

    I don't need to change the actual Action names or anything like that. All I need to do is intercept the text that is displayed in the GUI, so I can convert it.

    Basically, I just need to know what scripts and lines are creating the text objects that are displayed in the GUI at runtime for Actions, so I can convert them. Something is telling the scripts "here are the Action strings, display them as text objects in the UI." I just can't figure out what that something is.

    I know how to convert the strings to other languages, I just can't find where Rewired is passing these strings to create the UI. Can you help me find where those strings are passed to the text objects?

    Does that help clarify what I need to find?

    PS- I hope none of that sounded rude. I'm just trying to be more clear in my explanations.
     
    Last edited: Mar 23, 2017
  39. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Thanks for the explanation. There are a number of places it shows up. Without exhaustively searching the source code (this was written about 2 years ago and I have to search through the source code as well), these are the two most obvious places I found:

    ControlMapper.cs:
    Line 1630
    Line 647

    One is for the list of Actions on the side and the other is for the Action name as it appears in the window when mapping an element. I don't believe there are any other places where the Action name appears.
     
  40. BlueSunsetGames

    BlueSunsetGames

    Joined:
    Nov 19, 2016
    Posts:
    3
    Hello Guavaman!

    First - thanks for rewired, such a usefull tool. I have a question to some scenario.

    I have implemented method 1 of "press start to join game". Iw works really good for gamepads.

    But when I have situation that my 1st player plays on keyboard and second one would use the joypad.

    As method 1 say I have joy auto assignment on, so controller is assigning to player 1. How to override that and lets say, if player one hit enter to join game with keyboard, then the gamepad will be assigned to next free player?

    Any quick tips?

    Thanks
     
  41. HakJak

    HakJak

    Joined:
    Dec 2, 2014
    Posts:
    192
    Thank you for your help! I was able to make some simple modifications and get localization to work out great! :D
     
    guavaman likes this.
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Thanks! Glad you like it.

    The Keyboard is not treated as Joysticks are by Rewired. It does not do any kind of Joystick Auto-Assignment with the Keyboard nor does it even consider whether a Player has a Keyboard Map before it assigns a Joystick. You have to manage this if you want to treat Keyboard control as if it's a Joystick. The only option that was created to help with this is excluding a Player from Joystick auto-assignment. Otherwise, it's a matter of managing what Keyboard Maps are loaded/enabled in the Player.

    Once you assign the Keyboard to a Player by loading/enabling the Controller Maps in that player, set the flag to exclude it from Joystick Auto-Assignment.

    FYI, the next update to Rewired will add the ability to assign/unassign the Keyboard to Players like the Mouse with a hasKeyboard property.
     
    Last edited: Mar 25, 2017
  43. BlueSunsetGames

    BlueSunsetGames

    Joined:
    Nov 19, 2016
    Posts:
    3
    - that is great news. :)

    Thanks for the tip - why haven't I thought of it earlier :) Thanks a lot.
     
  44. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    92
    Hi,guavaman!
    I have a question with G27 and unity input ,I used float SteeringAngle = Input.GetAxis("SteeringAngle"); in update
    function.First I got (0-1) in the debug console,but When I clicked clear or waited for about 20 seconds then I got 0!!!What is the problem?
    The Setting is Type:Joystick
    Axis:3rd axis

    Best Regards!
     
  45. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Click in the game window. When you click anywhere else in the editor when using Unity input, Unity clears all input values and does not send any new values until you click back into the game window. This is how Unity input has always worked.
     
  46. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    92
    This is how Unity input has always worked!Thanks!
     
  47. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Here is a good overview of the CH Product joystick line. And based on the author's comments he does make several references to the real F-16 controls so that sounds like the model that CH was following when they designed their products. Here is one such quote (which was in the CH CombatStick joystick review section) which I found interesting ... ...


    >>>>
    This is not totally unrealistic; left-handed USAF F-16 pilots have to make this compromise also. (As a matter of fact ALL US fighter pilots have to adapt to right-hand stick, left-hand throttle configuration!) The actual “handle” is somewhat larger than other joysticks. This means that folks with small hands/short fingers will find themselves “stretching” to reach some of the buttons. That can be a blessing in disguise, as it will sometimes prevent the inadvertent actuation of an unwanted command. Again, this is not totally unrealistic; I can remember “stretching” to properly actuate some buttons on the real F-16
    <<<<


    http://www.simhq.com/_technology2/technology_014a.html#top
     
  48. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    368
    Has it occurred to you two that you're flooding this thread with your own conversation that's off topic from support of Rewired?
     
  49. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Sorry if seems to be off topic to you. But the main goal is to discuss flight controllers that work with Rewired. Part of that of that discussion includes quality of the controllers themselves. The other part of that discussion is mapping when parts of the controllers have the same function (e.g. rudder pedals - stick rotate/rocker/pedals). Flight Controllers is my favorite part of Rewired and it is easy to have some thread drift. Thanks again for keeping us on topic.
     
  50. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,632
    Technically, this thread is a thread about Rewired on the Asset Store, but it isn't a support thread per se even though that makes up 99% of what is posted here. I much prefer support be handled through the website form because it allows me to ask critical questions and provide links to common solutions before providing support that this thread does not.

    I've actually been pleased to see @longroadhwy and @Vampyr_Engel's conversation about flight controllers in this thread. Controller support is a big part of Rewired and it's great to have some feedback/conversation/discussion about the controllers it supports and/or doesn't support. I rarely get feedback from customers about anything unless they have a problem which makes it even hard to know whether people are even using certain parts of the system. I don't even know probably >95% of the games that are being made with Rewired since the Unity Asset Store doesn't allow us to access any kind of information about who buys our assets. I don't know how many customers use the flight controllers, racing controllers, light guns, etc. At the very least, conversation like this can help me know what some people are interested in.