Results 1 to 8 of 8

Topic: Limit Stick Movement?

  1. #1
    SILVER IV

    User Info Menu

    Limit Stick Movement?

    Hello, first time posting here on the forums, but not the first time reading through here. (Very useful just look through a bunch of posts to figure stuff out)

    I am looking for a script to limit the output of the XB1 left and right stick on the X axis so it will only be active up to a certain amount. So basically if I hold the stick let's say all the way to the left so that the input is a full -100 it will only output maybe like -50, or -75, same with holding the stick in the other direction, and also not only on the aiming stick but the stick for moving.

    I also need it to transfer to Wiimote and Nunchuck, because while I am on Xbox, I use Wiimote and Nunchuck for my shooters.

    Just looking for help if possible, I can mess around with the settings for my liking, I just don't know how to get the initial script out there. Thanks for any help in the future!

  2. #2
    The GPC Godfather



    User Info Menu

    Re: Limit Stick Movement?

    Quote Originally Posted by CmoIsDaNam3 View Post
    Hello, first time posting here on the forums, but not the first time reading through here. (Very useful just look through a bunch of posts to figure stuff out)

    I am looking for a script to limit the output of the XB1 left and right stick on the X axis so it will only be active up to a certain amount. So basically if I hold the stick let's say all the way to the left so that the input is a full -100 it will only output maybe like -50, or -75, same with holding the stick in the other direction, and also not only on the aiming stick but the stick for moving.

    I also need it to transfer to Wiimote and Nunchuck, because while I am on Xbox, I use Wiimote and Nunchuck for my shooters.

    Just looking for help if possible, I can mess around with the settings for my liking, I just don't know how to get the initial script out there. Thanks for any help in the future!
    Don't know anything about Wiimote and Nunchucks, but this will limit the output for LX and RX. Set the variables at the top to max output.


  3. The Following User Says Thank You to Batts For This Useful Post:


  4. #3
    SILVER IV

    User Info Menu

    Re: Limit Stick Movement?

    Doesn't seem to work when I build and run it, it still goes over my set limits which for me I set from your code to be 20 and 40 for X and Y respectively.

    I'll post my entire Wiimote script in a second, maybe I did something wrong here already and I'm just not smart enough to know what.

  5. #4
    SILVER IV

    User Info Menu

    Re: Limit Stick Movement?

    Here is my script for the Wiimote controls.

    //// 2019-02-20 17:38:49
    // Script generated by MAX Mapper Plugin
    //----------------------------------------
    remap WII_TWO -> XB1_MENU // Game pause menu
    remap WII_TWO -> XB1_XBOX // Xbox Home Menu
    remap WII_HOME -> XB1_VIEW; // Scoreboard
    remap WII_ONE -> XB1_RIGHT; // Activate scorestreak






    remap WII_UP -> XB1_LB; // Tatical grenade
    remap WII_LEFT -> XB1_RB; // Lethal grenade
    remap WII_DOWN -> XB1_RT; // Fire gun
    remap WII_A -> XB1_RS; // Crouch & prone


    remap WII_B -> XB1_LT; // Aim down sight
    remap WII_LT -> XB1_LS; // Sprint & hold breath
    remap WII_IRX -> XB1_RX; // Aiming
    remap WII_IRY -> XB1_RY; // Aiming


    unmap XB1_UP;
    unmap XB1_DOWN;


    remap WII_RIGHT -> XB1_Y; // Swap weapons
    remap WII_PLUS -> XB1_B;
    remap WII_ZL -> XB1_A;
    remap WII_MINUS -> XB1_X;






    define delay = 100;
    define ZOOM = WII_B;
    define SENS_ZOOM_INCREASE = 0;
    define X_AXIS = WII_IRX;
    define Y_AXIS = WII_IRY;


    int timer;


    int max_rx = 20;
    int max_lx = 40;


    main {


    if(abs(get_val(XB1_LX)) > max_lx) {
    if(get_val(XB1_LX) < 0)
    set_val(XB1_LX, inv(max_lx));
    else
    set_val(XB1_LX, max_lx);

    }
    if(abs(get_val(XB1_RX)) > max_rx) {
    if(get_val(XB1_RX) < 0)
    set_val(XB1_RX, inv(max_rx));
    else
    set_val(XB1_RX, max_rx);

    }





    if(get_val(ZOOM)) {
    timer = timer + get_rtime();
    if(timer >= delay ){
    sensitivity(X_AXIS, NOT_USE, 100 + SENS_ZOOM_INCREASE );
    deadzone(Y_AXIS, X_AXIS, DZ_CIRCLE, 5);
    stickize(WII_IRX, WII_IRY, 135);
    sensitivity(Y_AXIS, NOT_USE, 100 + SENS_ZOOM_INCREASE );
    }
    }else{
    timer =0;
    }



    sensitivity(WII_IRX, 100, 100);
    deadzone(WII_IRX, WII_IRY, DZ_CIRCLE, 15);
    stickize(WII_IRX, WII_IRY, 95)
    sensitivity(WII_IRY, 100, 100
    );

    deadzone(WII_LX, WII_LY, DZ_CIRCLE, 0);
    sensitivity(WII_LX, NOT_USE, 200);
    sensitivity(WII_LY, NOT_USE, 200);

    set_val(WII_IRX, inv(get_val(WII_IRX)));


    }

  6. #5
    The GPC Godfather



    User Info Menu

    Re: Limit Stick Movement?

    Quote Originally Posted by CmoIsDaNam3 View Post
    Here is my script for the Wiimote controls.
    I think the order you have it in....deadzone() is overwriting the limited values. Try putting the code I gave you last.

  7. #6
    SILVER IV

    User Info Menu

    Re: Limit Stick Movement?

    Still isn't working at all. Maybe I need to get rid of some of the code?

  8. #7
    The GPC Godfather



    User Info Menu

    Re: Limit Stick Movement?

    Quote Originally Posted by CmoIsDaNam3 View Post
    Still isn't working at all. Maybe I need to get rid of some of the code?
    The code by itself works. Again I have no experience with the Wii stuff. I would start with the code alone. Then start adding same parts back in and test. See at what point it stops working.

  9. #8
    SILVER IV

    User Info Menu

    Re: Limit Stick Movement?

    So I tried removing the code for the timer and the other stuff and just left the main sensitivity aiming part of the code and the one with the Nunchuck stick movement, and interestingly enough it works in the build and run section of the code and when applied to the Wii controls, (I assume this is because I have it mapped to the Wii controls in the remap section above the main section) however all that seems to happen is that it slows down the speed of aiming and nothing more. It doesn't limit the range of motion in the movement of aiming.


    I'll post the code I have here so you can maybe see for yourself, but overall this is def unexpected.

    - - - Updated - - -

    Here is the code I have now.

    //// 2019-02-20 17:38:49
    // Script generated by MAX Mapper Plugin
    //----------------------------------------
    remap WII_TWO -> XB1_MENU // Game pause menu
    remap WII_TWO -> XB1_XBOX // Xbox Home Menu
    remap WII_HOME -> XB1_VIEW; // Scoreboard
    remap WII_ONE -> XB1_RIGHT; // Activate scorestreak






    remap WII_UP -> XB1_LB; // Tatical grenade
    remap WII_LEFT -> XB1_RB; // Lethal grenade
    remap WII_DOWN -> XB1_RT; // Fire gun
    remap WII_A -> XB1_RS; // Crouch & prone


    remap WII_B -> XB1_LT; // Aim down sight
    remap WII_LT -> XB1_LS; // Sprint & hold breath
    remap WII_IRX -> XB1_RX; // Aiming
    remap WII_IRY -> XB1_RY; // Aiming


    unmap XB1_UP;
    unmap XB1_DOWN;


    remap WII_RIGHT -> XB1_Y; // Swap weapons
    remap WII_PLUS -> XB1_B;
    remap WII_ZL -> XB1_A;
    remap WII_MINUS -> XB1_X;








    int timer;






    int max_iry = 50




    main {



    sensitivity(WII_IRX, 100, 110);
    deadzone(WII_IRX, WII_IRY, DZ_CIRCLE, 15);
    stickize(WII_IRX, WII_IRY, 141)
    sensitivity(WII_IRY, 100, 145
    );





    deadzone(WII_LX, WII_LY, DZ_CIRCLE, 0);
    sensitivity(WII_LX, NOT_USE, 200);
    sensitivity(WII_LY, NOT_USE, 200);

    set_val(WII_IRX, inv(get_val(WII_IRX)));

    if(abs(get_val(WII_IRY)) > max_iry) {
    if(get_val(WII_IRY) < 0)
    set_val(WII_IRY,inv(max_iry));
    else
    set_val(WII_IRY, max_iry);
    }
    }

Tags for this Topic

Posting Permissions

  • You may not post new topics
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •