Search Unity

Multiplayer game on one system using two mouse.

Discussion in 'Scripting' started by cmyd, May 7, 2019.

  1. cmyd

    cmyd

    Joined:
    Oct 29, 2017
    Posts:
    98
    So I'm trying to make a make like alien armageddon, So the problems is, I can't get separate output from two mouse, I bought myself Multi-Input API, it worked, now I could use two or mice, the problem is I'm not going to use mouse I'm going to EMS TOP GUN 3, these toys don't work with Multi Input API, So I'm kinda lost, I don't know what to do, what other ways I could try? any help will be appreciated.
     
  2. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    Sounds like you have to write your own driver or at least modify the one to react like a mouse output. But thats far away from "usual" scripting for me :D
     
  3. cmyd

    cmyd

    Joined:
    Oct 29, 2017
    Posts:
    98
    There are other option, I don't what they're but I've seen games that work perfectly fine.
     
  4. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    How is your top gun handled in Unity? You should be able to get at least the device and try to register it and then check against the other device. Maybe without multi input api
     
  5. cmyd

    cmyd

    Joined:
    Oct 29, 2017
    Posts:
    98
    So the gun has 4 sensors, they're placed at each corner of the screen, then there's a dongle device which is attached to computer and last the gun, the gun needs to be calibrated before it can be used, Once calibrated it controls the cursor, Now it works fine in unity, but I needed two gun and that means I need two cursors, so I purchased an API from the asset store 'Multi-Input', i used two mouse for the test, It let me separate the input coming from each device, So i knew which mouse was sending the input and based on it I took actions, But the problem arose when I tested this API on the gun, if I play the game in window mode the gun will move the cursor outside of the game but not in the game,

    One thing that i noticed was the API tells what inputs is the device sending, In case of mouse It listed mouse left, mouse right, middle, X,Y etc etc all the inputs that belongs to the mouse device, But in case of the gun, it just returns mouse left.
     
  6. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    Hard to say without knowing all the API stuff from the guns. But if you use two guns, do you need to dongles and 4 more sensors for each gun? Or "should" they work with one quad of sensors?
     
  7. cmyd

    cmyd

    Joined:
    Oct 29, 2017
    Posts:
    98
    Guns and the dongle has 2 mode 'Channel 1, Channel 2', For 2 players I need 2 guns, 2 dongle and one set of sensor,
    this is the api i'm using for 2 palyers(https://assetstore.unity.com/packages/tools/input-management/multi-input-59967).
    this is gun (https://www.play-asia.com/ems-topgun-iii/13/704e7s).
     
  8. If you're able, you can try to check out the new input system. In theory it should support anything which comes through official input channels in the OS, so if your device is not some kind of really esoteric tool which needs its own communication, then you probably can read the data and find out what's what. Be prepared you will need to tweak a lot with these and on the top of it, the new input system is still in preview, so you won't ship a real game with it any time soon.
    I highly doubt that you can use these through the standard "old" input system.
     
  9. cmyd

    cmyd

    Joined:
    Oct 29, 2017
    Posts:
    98
    Well I imported InputSystem 0.2.1 but it had some errors So I re-imported 0.2.0, if I'm not wrong It's been in preview for some years now, Anyway I haven't used asset like this, It will take a month or two for me to understand.
     
  10. cmyd

    cmyd

    Joined:
    Oct 29, 2017
    Posts:
    98
    Ok, So I used the inputSystem added two new actions both were set to button and I used left mouse button, Now how do I know which mouse is sending the input?