More advanced input map

Discussion in 'Utilities and programming' started by metalmuncher, Aug 30, 2013.

  1. metalmuncher

    metalmuncher
    Expand Collapse

    Joined:
    Aug 6, 2012
    Messages:
    257
    I just finished up a more advanced and functional inputmap for my wireless x360 controller. It has broadly the same layout, however the right bumper is now a "modifier" button (like shift or ctrl on a keyboard) which changes the behaviour of some buttons. I'm posting it here in the hope that some of the code will be useful for someone making their own input map, NOT so that people can ask how to install this map.

    Some of the changes:
    >Start - toggle shifter mode
    >Left bumper - "Modifier" button
    >Modifier + Dpad - Lights controls
    >B - momentary parking brake, Modifier + B - Toggle Parking brake
    >Y - Camera Look back
    >Modifier + X/Y - Gamepad Zoom.

    Feel free to ask questions on how this code works, but this is for people who already know the basics of making an input map and want more advanced behaviours.
     

    Attached Files:

    • Agree Agree x 1
  2. JackBegley

    JackBegley
    Expand Collapse

    Joined:
    Aug 3, 2013
    Messages:
    23
    The modifier button isn't working for me. Known problem?
     
  3. metalmuncher

    metalmuncher
    Expand Collapse

    Joined:
    Aug 6, 2012
    Messages:
    257
    Since that functionality was the main purpose of this code, and you are the only person I know who has tried the map apart from me, not a known problem. D: If you want to check where the problem might lie, uncomment the echo lines in the modOn/modOff functions. Then each time you press and release the right bumper there should be a line in the console saying that the modifier button is on/off. If that shows up but the other stuff still isn't working, then its likely a problem with the code. If that doesn't show up, its more likely to be a problem loading the map (filenames, syntax errors)
     
  4. loanstar744

    loanstar744
    Expand Collapse

    Joined:
    Aug 7, 2012
    Messages:
    14
    Jack's problem is that his Xbox 360 controller is probably wired, different GUID means different inputmap. Mine is wired and has a different GUID as well as a different inputmap, {d61ca365-5af4-4486-998b-9db4734c6ca3} is my GUID and there is no specified inputmap for my GUID but there is an inputmap that comes up with the same device name: "Controller (XBOX 360 For Windows)" but still has a different GUID and switching out the GUID and name with your input map yields no success.

    But yeah, that's why your inputmap doesn't work for him. Though I'd like to find out why swapping out your inputmap into the inputmap that the game uses for my wired 360 controller doesn't fix the problem.

    EDIT: I fixed it, made all the Xbox 360 default inputmaps with your inputmap since their button mapping has no difference between different versions of Xbox 360 controllers, just different GUID's.

    Added an attachment for all supported official Xbox 360 controller versions. I can take it down by request of MetalMuncher if he so inclines me to or feels the need to attach them to his original post.
     

    Attached Files:

    #4 loanstar744, Sep 27, 2013
    Last edited: Sep 27, 2013
  5. epicinstincts

    epicinstincts
    Expand Collapse

    Joined:
    Dec 16, 2013
    Messages:
    1
    Re: More advanced input map/cant map slowmo xbox controller....

    Hey guys, epicinstincts here. I've been ripping cars to shreds on beam for about a month now and hands down, amazing game. My PROBLEM is, the rockcandy Xbox controller mapping i found on here has a rather static layout. How can i spice it up a bit, i wanna put the activate slow-mo, and resume normal speed mapping from the keyboard, on the controller. I have attempted to do so myself with my knowledge of binding codes and whatnot but the game doesn't seem to recognize anything i do. When i hit the ~ key in-game to see what alt + Down, up, left, etc does it states in red "BEAMNG|setsimulationSpeed=10 or whatever its at. But when i open my mapping of the controller and try to put that as button a or anything else and then try in game, it says command not found. Little confused and need some help please, and thank you.

    PS. this is my first post ever so sorry if i did it wrong, I am a fast learner though, let me know guys, thanks.

    Ill attach my current controller mapping.

    // Product Name: Controller (Xbox 360 Wireless Receiver for Windows)
    // GUID: {011F0E6F-0000-0000-0000-504944564944}
    // axes: 5^Y^X^U^R^Z

    // 15% deadzone for the camera things
    $gp_deadzone = "-0.15 0.15";


    // camera
    moveMap.bind(%device, thumbrx, "D", $gp_deadzone, gamepadYaw);
    moveMap.bind(%device, thumbry, "D", $gp_deadzone, gamepadPitch);


    // movement : deadzones and such are in lua for these
    moveMap.bind(%device, thumblx, "D", $gp_deadzone, steer_direct);


    moveMap.bind(%device, triggerl, "D", $gp_deadzone, brake);
    moveMap.bind(%device, triggerr, "D", $gp_deadzone, accelerate);


    moveMap.bind(%device, btn_l, clutch );
    moveMap.bind(%device, btn_a, shiftUp);
    moveMap.bind(%device, btn_x, shiftDown);


    moveMap.bindCmd(%device, dpadd, "beamNGResetPhysics();", "");
    moveMap.bindCmd(%device, dpadr, "beamNGTogglePhysics();", "");
    moveMap.bind(%device, btn_r, parkingbrake_toggle);
    moveMap.bindCmd(%device, lpov, "beamNGSwitchVehicle();", "");
    moveMap.bindCmd(%device, btn_y, "gamepadZoom(-0.1);", "gamepadZoom(0);");
    moveMap.bindCmd(%device, btn_b, "gamepadZoom(0.1);", "gamepadZoom(0);");
    moveMap.bindCmd(%device, btn_rt, "beamNGResetCamera();", "");


    moveMap.bindCmd(%device, btn_back, "beamNGCameraToggle();", "");
    //moveMap.bind(%device, btn_back, beamNGControl);
    //moveMap.bind(%device, btn_x, toggleFirstPerson);
     

    Attached Files:

  6. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,780
    I might consider using this input map but for now I will stick with what I have and that should be good enough for me..
     
  7. simplechamp

    simplechamp
    Expand Collapse

    Joined:
    Jan 18, 2014
    Messages:
    1
    Re: More advanced input map/cant map slowmo xbox controller....

    Here is how I did mine. I used the L and R bumpers because I don't use parking brake or clutch. You can set the slow-mo speed to whatever you want, I chose 20 (default is 6). This setup will act like ALT UP and ALT DOWN from the keyboard. This is the code, copy to your inputmap as shown in attached image (make sure to delete the lines currently using btn_r and btn_l for clutch and park brake too):

    %mm.bindVLuaCmd(%device, btn_r, "bullettime.set(100)", "");
    %mm.bindVLuaCmd(%device, btn_l, "bullettime.set(20)", "");

    If you wanted to have a little more control and adjust in steps (like the keyboard ALT LEFT and ALT RIGHT) use this code. You can also adjust the steps to be finer or coarser by changing the default +20 and -20 to different values.

    %mm.bindVLuaCmd(%device, btn_r, "bullettime.set('+20')", "");
    %mm.bindVLuaCmd(%device, btn_l, "bullettime.set('-20')", "");

    Keep in mind again, this method with remove clutch and parking brake. It's a quick and dirty fix, and works fine for me because I never use them. Your mileage may vary. You might want to play around with the code and metalmunchers button modifier mapping to be able to have slow-mo on the controller without losing any other functions.
     

    Attached Files:

    • slomo_mapping.JPG
    #7 simplechamp, Jan 20, 2014
    Last edited: Jan 20, 2014
  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