Dualshock 4 inputmap help

Discussion in 'Utilities and programming' started by crimsonskull, Feb 23, 2014.

  1. crimsonskull

    crimsonskull
    Expand Collapse

    Joined:
    Jan 1, 2013
    Messages:
    246
    i am currently trying to create an input map for the ds4 dual shock 4 controller.
    however, there is a massive problem with this thing not working ingame.
    the game will register the controller but not the inputs
    here's what the log says:
    Code:
    36.975664| - Product Name: Wireless Controller
    36.975709| - Product ID: 05C4
    36.975761| - Vendor ID: 054C
    36.975808| - GUID: {05C4054C-0000-0000-0000-504944564944}
    36.975882| - 21 objects: rzaxis (axis), zaxis (axis), yaxis (axis), xaxis (axis), button0 (button), button1 (button), button2 (button), button3 (button), button4 (button), button5 (button), button6 (button), button7 (button), button8 (button), button9 (button), button10 (button), button11 (button), button12 (button), button13 (button), ryaxis (axis), rxaxis (axis)
    36.975974|  - trying to load keyboard mapping: scripts/client/inputmaps/custom/keyboard.inputmap.cs - file not existing
    36.976064|  - trying to load mapping via VendorID/ProductID: scripts/client/inputmaps/custom/05c4054c.inputmap.cs - file not existing
    36.976154|  - trying to load mapping via name: scripts/client/inputmaps/custom/wirelesscontroller.inputmap.cs - file not existing
    36.980889|  - trying to load keyboard mapping: scripts/client/inputmaps/keyboard.inputmap.cs - SUCCESSFUL
    36.981602|ds4 inputmap loaded
    when i hit the button on the controller nothing happens, even though the buttons are mapped out. as shown here.
    Code:
    // Product Name: Wireless Controller// GUID: {05C4054C-0000-0000-0000-504944564944}
    // axes: 6^rz^z^y^x^ry^rx,
     
    //%device = "{05C4054C-0000-0000-0000-504944564944}-" @ %joyNum;  
    %device = "gamepad" @ %joyNum; 
     
    // 0 deadzone
    $gp_deadzone = "-0.5 0.5"; 
    
    
    // camera
    moveMap.bind(%device, zaxis, "D", $gp_deadzone, gamepadYaw);
    moveMap.bind(%device, rzaxis, "D", $gp_deadzone, gamepadPitch);
    // movement
    moveMap.bind(%device, xaxis, joy_steer_nl_dz);
    //moveMap.bind(%device, thumbly, "D", $gp_deadzone, gamePadMoveY); // using triggers instead
    
    
    moveMap.bind(%device, rxaxis, "D", $gp_deadzone, joy_brake);
    moveMap.bind(%device, ryaxis, "D", $gp_deadzone, joy_accelerate);
    
    
    moveMap.bindCmd(%device, button1, "beamNGResetPhysics();", "");
    moveMap.bindCmd(%device, button10, "beamNGTogglePhysics();", "");
    moveMap.bindCmd(%device, button6, "beamNGToggleParkingBrake();", "");
    moveMap.bindCmd(%device, button5, "beamNGSwitchVehicle();", "");
    moveMap.bindCmd(%device, button12, "beamNGResetCamera();", "");
    moveMap.bindCmd(%device, button4, "beamNGCameraToggle();", "");
    
    
    echo("ds4 inputmap loaded");
    it would be very helpful to not only me but many others who have a ds4 if someone could tell me what i am doing wrong.
    thanks.
     
  2. pulley999

    pulley999
    Expand Collapse

    Joined:
    Jan 21, 2013
    Messages:
    825
    Pretty sure moveMap.bind got changed to mm.bind, for one. The rest I'm not too sure about.

    EDIT: Yep. Try replacing all instances of "moveMap" with "mm".
     
  3. crimsonskull

    crimsonskull
    Expand Collapse

    Joined:
    Jan 1, 2013
    Messages:
    246
    i replaced all the movemaps with %mm and i still have no input to the game.
    everything i have written down should work in game, but it just doesn't work.
    it's like the devs blocked the ds4 on purpose.
    if that is true i don't know but i am still trying to figure this out.
     
  4. KarlRyker

    KarlRyker
    Expand Collapse

    Joined:
    Aug 24, 2013
    Messages:
    205
    What is the name of the file in the inputmaps folder?
     
  5. crimsonskull

    crimsonskull
    Expand Collapse

    Joined:
    Jan 1, 2013
    Messages:
    246
     
  6. simon48

    simon48
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    203
    "05C4054C.inputmap" or 05C4054C.inputmap.cs"? You need the ".cs" at the end.
     
  7. Masterjoc

    Masterjoc
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    297
    Out of interest, is ds4 controller supported already by pc/windows/any games ?
     
  8. pulley999

    pulley999
    Expand Collapse

    Joined:
    Jan 21, 2013
    Messages:
    825
    With 3rd party drivers, yes. I know you can change the RGB LED used by the PSEye to identify the controller any color you want, and I'm pretty sure they've repurposed the touchpad as a trackpad. (Very useful for BeamNG's entirely mouse based UI IMO.) Alas, I don't know anyone who owns a DS4. Crimson, have you tried emulating a 360 controller? (If that's even an option with the DS4 yet.)
     
  9. KarlRyker

    KarlRyker
    Expand Collapse

    Joined:
    Aug 24, 2013
    Messages:
    205
    Try to put the input map in the inputmaps folder, and not in the inputmaps/custom folder

    If that doesn't work try naming it "wirelesscontroller.inputmap"
     
  10. crimsonskull

    crimsonskull
    Expand Collapse

    Joined:
    Jan 1, 2013
    Messages:
    246
    i tried moving the file from custom back to the inputmaps folder. nothing happened.
    however when i renamed it to wireless controller the "ds4 inputmap loaded" echo was not present, telling me that lua is reading the scripts and recognizing it when the file is labelled "05C4054C.inputmap".
    but nothing still works. The game will not recognize any of the controllers inputs. not even the buttons.
    my suspicion slightly lies in the axis area. some of the axis are labelled rz, ry, rx, which is just the rotational axis.
    i did try to rename them to s and r but it still won't recognize any input.
    keep in mind i have made inputmaps for other controllers before and they have all worked. This raises my suspision for the fact that the developers have on purposely blocked the ds4 from being used on beamng.drive. 0_o.
    why they would do this, we may never know.

    - - - Updated - - -

    i have tried but it works with every other controller except the ds4. which is weird because i don't even need an x360 emulator for any game except beamng. and even when i try to use the emulator it still deos not work.
     
  11. simon48

    simon48
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    203
    The devs have not purposely blocked the DS4. Did you try my suggestion to add ".cs" to the end? You could try running the DS4 through an emulator just to make sure your computer is getting the inputs and the problem is on BeamNG's side.
     
  12. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    Last update was from before DS4 existed so it would have been an impossibility to block the DS4.
     
  13. logoster

    logoster
    Expand Collapse

    Joined:
    Sep 5, 2012
    Messages:
    2,083

    actually, you could buy the controller before the ps4 came out (dont understand why they would do that, considering its useless without the ps4)
     
  14. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    That was still after beamng updated and before anyone got a PC driver even remotely working.


    Which is a fair point. You do have the drivers installed and it does work in other software right?
     
  15. crimsonskull

    crimsonskull
    Expand Collapse

    Joined:
    Jan 1, 2013
    Messages:
    246
    yes i have tried the .cs extension. that was one of the first things i have tried. when i punched it in, lua didn't recognize the file.
    there is nothing wrong with the file extension. what is wrong is the coding which for some reason it cannot read. (with the exception of the "ds4 inputmap loaded" echo".
     
  16. KarlRyker

    KarlRyker
    Expand Collapse

    Joined:
    Aug 24, 2013
    Messages:
    205
    Okay when you go into the debug menu one of them will be for controls, and have 4 circles in the corner, if you use the axis' they should come up on the left, if they don't then BeamNG doesn't recongnize your controller
     
  17. crimsonskull

    crimsonskull
    Expand Collapse

    Joined:
    Jan 1, 2013
    Messages:
    246
    i have no input from the controller. but it did display the xbox 360 controller, mouse and keyboard.
    however. if beamng doesn't recognize my controller, how come it shows up in the torque3d log file as shown. (it evendisplays the echo)
    Code:
    36.626574|*** gamepad1 ***
    36.626621| (unbinding...)
    36.626678| - Product Name: Wireless Controller
    36.626723| - Product ID: 05C4
    36.626769| - Vendor ID: 054C
    36.626815| - GUID: {05C4054C-0000-0000-0000-504944564944}
    36.626887| - 21 objects: rzaxis (axis), zaxis (axis), yaxis (axis), xaxis (axis), button0 (button), button1 (button), button2 (button), button3 (button), button4 (button), button5 (button), button6 (button), button7 (button), button8 (button), button9 (button), button10 (button), button11 (button), button12 (button), button13 (button), ryaxis (axis), rxaxis (axis)
    36.626983|  - trying to load keyboard mapping: scripts/client/inputmaps/custom/keyboard.inputmap.cs - file not existing
    36.627558|ds4 inputmap loaded
    36.627611|  - trying to load mapping via VendorID/ProductID: scripts/client/inputmaps/custom/05c4054c.inputmap.cs - SUCCESSFUL
    36.627695|  - trying to load keyboard mapping: vehicles/pickup/inputmaps/keyboard.inputmap.cs - file not existing
    36.627780|  - trying to load mapping via VendorID/ProductID: vehicles/pickup/inputmaps/05c4054c.inputmap.cs - file not existing
    36.627860|  - trying to load mapping via name: vehicles/pickup/inputmaps/wirelesscontroller.inputmap.cs - file not existing
    36.627920| *** loading input map DONE *** 
     
  18. simon48

    simon48
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    203
    Again, make it work in something else like an emulator. This seems like you have driver problems.
     
  19. crimsonskull

    crimsonskull
    Expand Collapse

    Joined:
    Jan 1, 2013
    Messages:
    246
    i would but unfortunately the only emulator i can find is x360ce. which works really well with the controller but i can't get it working with the game.
     
  20. simon48

    simon48
    Expand Collapse

    Joined:
    Aug 8, 2013
    Messages:
    203
    In the emulator you can't remap a trigger to the "w" key just to make the car move?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice