SOLVED: Wii nunchuck twist register

Wiimote tutorials, configurations and GPC scripts (FPS like in Nintendo Wii/WiiU).

Moderator: OFC-Giorgio

SOLVED: Wii nunchuck twist register

Postby jackson » Sun Sep 06, 2015 10:26 pm

Hey guys I am having a bit of a problem trying to get the nunchuck to properly register and not have phantom button problems.
here is the basic of what i am trying to do

Code: Select all
   if((get_val(WII_ACCNY)) > 20) {
        set_val(PS4_UP, 100);
    }
    if((get_val(WII_ACCNY)) < -8) {
        set_val(PS4_DOWN, 100);
    }
    if((get_val(WII_ACCNX)) > 20) {
        set_val(PS4_LEFT, 100);
    }
    if((get_val(WII_ACCNX)) < -20) {
        set_val(PS4_RIGHT, 100);
    }



which works fine all alone but when i try to stick it into my script it doesn't register,I tried to do a remap of WII_ACCNY,ACCNX to the ps4 up down left right but I don't know how to do it correctly cause it always activates the buttons

I tried to add the must hit (C) and then the twist but that causes phantom buttons

Code: Select all
  if((get_val(WII_C)) && (get_val(WII_ACCNY)) > 20) {
        set_val(PS4_UP, 100);
    }
    if((get_val(WII_C)) && (get_val(WII_ACCNY)) < 2) {
        set_val(PS4_DOWN, 100);
    }
    if((get_val(WII_C)) && (get_val(WII_ACCNX)) > 20) {
        set_val(PS4_LEFT, 100);
    }
    if((get_val(WII_C)) && (get_val(WII_ACCNX)) < -20) {
        set_val(PS4_RIGHT, 100);
    }


here is my full script which i am sure I missing/messing or just not seeing the obvious. I am I putting the twist in the wrong area?with the wrong header or wrong } { ( ) ; or just dont have the proper script above to make the below work.
Thanks again for all you guys do with titan one and the help which again is fricking awesome!!

Code: Select all
unmap ALL_REMAPS;

    remap WII_HOME  -> PS4_PS;
    remap WII_MINUS -> PS4_CROSS;
    remap WII_PLUS  -> PS4_SQUARE;
    remap WII_ONE   -> PS4_TOUCH;
    remap WII_C     -> PS4_CIRCLE;
    remap WII_Z     -> PS4_L2;
    remap WII_TWO   -> PS4_OPTIONS;
    remap WII_NX    -> PS4_LX;
    remap WII_NY    -> PS4_LY;
    remap WII_UP    -> PS4_L1;
    remap WII_DOWN  -> PS4_R3;
    remap WII_LEFT  -> PS4_R1;
    remap WII_RIGHT -> PS4_TRIANGLE;
    remap WII_B     -> PS4_R2;
    remap WII_A     -> PS4_L3;
    remap WII_ACCX  -> PS4_ACCX;
    remap WII_ACCY  -> PS4_ACCY;
    remap WII_ACCZ  -> PS4_ACCZ;
    remap WII_IRX   -> PS4_RX;
    remap WII_IRY   -> PS4_RY;

int last_ps4_auth_timeout;
    main {
        sensitivity(WII_NX, NOT_USE, 155);
        sensitivity(WII_NY, NOT_USE, 145);

        if(wiir_offscreen()) {
            set_val(WII_IRX, 0);
            set_val(WII_IRY, 0);
        }

        if(get_val(WII_Z)) {
            sensitivity(WII_IRX, NOT_USE, 150);
            sensitivity(WII_IRY, NOT_USE, 140);
        }
        set_val(WII_IRX, inv(get_val(28)));
        sensitivity(WII_IRX, NOT_USE, 150);
        sensitivity(WII_IRY, NOT_USE, 140);
        deadzone(WII_IRX, WII_IRY,DZ_CIRCLE, 3);
       
      if((get_val(WII_ACCNY)) > 20) {
        set_val(PS4_UP, 100);
    }
    if((get_val(WII_ACCNY)) < -8) {
        set_val(PS4_DOWN, 100);
    }
    if((get_val(WII_ACCNX)) > 20) {
        set_val(PS4_LEFT, 100);
    }
    if((get_val(WII_ACCNX)) < -20) {
        set_val(PS4_RIGHT, 100);
    }
   


    // Rumble the controller if the PS4 auth timeout gets below 5.
    if(ps4_authtimeout() < 5) {
        if(last_ps4_auth_timeout != ps4_authtimeout()) {
            last_ps4_auth_timeout = ps4_authtimeout();
            combo_restart(AuthRumbleFeedback);
        }
    }
    // Press OPTIONS + PS to force reconnection and reset auth timeout.
    if(get_val(PS4_OPTIONS) && event_press(PS4_PS)) {
        output_reconnection();
    }
}
 
combo AuthRumbleFeedback {
    set_rumble(RUMBLE_A, 100);
    set_rumble(RUMBLE_B, 100);
    wait(200);
    reset_rumble();
}
User avatar
jackson
Master Sergeant
Master Sergeant
 
Posts: 33
Joined: Sun Nov 23, 2014 1:13 am

Re: Wii nunchuck twist register

Postby J2Kbr » Sun Sep 20, 2015 9:02 pm

The problem is that your don't have the PS4 d-pad (up, down, left right) mapped to any input of the wiimote.

By executing unmap ALL_REMAPS; all mappings are deleted. So you must remap all the buttons you want the console to register.

You can use WII_RT, WII_ZR, WII_ACCNX, WII_ACCNY for that.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Wii nunchuck twist register

Postby jackson » Mon Sep 21, 2015 6:00 pm

Cool but how do you map something that has a variable so its not on constantly and only when I twist that far? or can I only map one button to WII_AACNX and one to WII_ACCNY no matter what the > or < is? The remap the ACCNY or ACCNX like: WII_ACCNY >20 -> PS4_UP(script style ) I believe is on constantly or just gives me and error when I check it
User avatar
jackson
Master Sergeant
Master Sergeant
 
Posts: 33
Joined: Sun Nov 23, 2014 1:13 am

Re: Wii nunchuck twist register

Postby J2Kbr » Tue Sep 22, 2015 10:05 am

I did the changes in your script. I couldn't test though (don't have a wiimote here). Hopefully it is working.

Code: Select all
unmap ALL_REMAPS;

remap WII_HOME  -> PS4_PS;
remap WII_MINUS -> PS4_CROSS;
remap WII_PLUS  -> PS4_SQUARE;
remap WII_ONE   -> PS4_TOUCH;
remap WII_C     -> PS4_CIRCLE;
remap WII_Z     -> PS4_L2;
remap WII_TWO   -> PS4_OPTIONS;
remap WII_NX    -> PS4_LX;
remap WII_NY    -> PS4_LY;
remap WII_UP    -> PS4_L1;
remap WII_DOWN  -> PS4_R3;
remap WII_LEFT  -> PS4_R1;
remap WII_RIGHT -> PS4_TRIANGLE;
remap WII_B     -> PS4_R2;
remap WII_A     -> PS4_L3;
remap WII_ACCX  -> PS4_ACCX;
remap WII_ACCY  -> PS4_ACCY;
remap WII_ACCZ  -> PS4_ACCZ;
remap WII_IRX   -> PS4_RX;
remap WII_IRY   -> PS4_RY;

remap WII_ACCNX -> 25;
remap WII_ACCNY -> 26;
remap WII_ACCNZ -> 27;

remap WII_RT    -> PS4_UP;
remap WII_ZR    -> PS4_DOWN;
remap WII_X     -> PS4_LEFT;
remap WII_Y     -> PS4_RIGHT;


int last_ps4_auth_timeout;
main {
    sensitivity(WII_NX, NOT_USE, 155);
    sensitivity(WII_NY, NOT_USE, 145);

    if(wiir_offscreen()) {
        set_val(WII_IRX, 0);
        set_val(WII_IRY, 0);
    }

    if(get_val(WII_Z)) {
        sensitivity(WII_IRX, NOT_USE, 150);
        sensitivity(WII_IRY, NOT_USE, 140);
    }
    set_val(WII_IRX, inv(get_val(28)));
    sensitivity(WII_IRX, NOT_USE, 150);
    sensitivity(WII_IRY, NOT_USE, 140);
    deadzone(WII_IRX, WII_IRY,DZ_CIRCLE, 3);
   
if((get_val(WII_ACCNY)) > 20) {
    set_val(WII_RT, 100);
}
if((get_val(WII_ACCNY)) < -8) {
    set_val(WII_ZR, 100);
}
if((get_val(WII_ACCNX)) > 20) {
    set_val(WII_X, 100);
}
if((get_val(WII_ACCNX)) < -20) {
    set_val(WII_Y, 100);
}

// Rumble the controller if the PS4 auth timeout gets below 5.
if(ps4_authtimeout() < 5) {
    if(last_ps4_auth_timeout != ps4_authtimeout()) {
        last_ps4_auth_timeout = ps4_authtimeout();
        combo_restart(AuthRumbleFeedback);
    }
}
// Press OPTIONS + PS to force reconnection and reset auth timeout.
if(get_val(PS4_OPTIONS) && event_press(PS4_PS)) {
    output_reconnection();
}
}

combo AuthRumbleFeedback {
set_rumble(RUMBLE_A, 100);
set_rumble(RUMBLE_B, 100);
wait(200);
reset_rumble();
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Wii nunchuck twist register

Postby OFC-Giorgio » Tue Nov 17, 2015 8:48 am

I updated the cod script so it supports both alpha (shaking nunchuc for reload) and bravo (with twisting for tactical grenades) settings.

See gtuner library for the new version http://www.consoletuner.com/gpclib/?s=906
User avatar
OFC-Giorgio
Lieutenant
Lieutenant
 
Posts: 344
Joined: Mon Sep 15, 2014 4:26 pm

Re: SOLVED: Wii nunchuck twist register

Postby jackson » Sat Nov 21, 2015 3:49 pm

Yeah thanks, I finally had a week to test it.some reason tho it had some phantom button again so I switched a few around that are being pressed it and it seams to work pretty good thanks. But for some reason after a few minutes it will freeze my nunchuck WII_NX-WII_NY, PS4_LX-PS4_LY and in the game it pushing me in that direction I have to unplug the nunchuck a few times to make it unlock.its never done the locking up before but looking at my other codes on build and run its started to do that too? is it something with my nunchuck?i noticed the off brand used to hold the same numbers as the nintendo ones but now the offbrand WII_ ACC_NX and ACC_NY values differ but both nunchucks lock up after a few minutes? or do I have include a DEFINE up left right down of nunchuck now? which I see some other differences in OFC-Giorgio code but I can't really follow whats going on in that page compared to the one I am using.
User avatar
jackson
Master Sergeant
Master Sergeant
 
Posts: 33
Joined: Sun Nov 23, 2014 1:13 am

Re: SOLVED: Wii nunchuck twist register

Postby OFC-Giorgio » Sat Nov 21, 2015 5:24 pm

You could post your script here or (together) alter mine to support your wishes.

The locking up the nunchuc I had only once on the PS4 with the battlefield4 wiimote script. Sometimes it helps to unplug/replug the nunchuc (as I did in all the cods once in a while on the wii and wiiu too).

Double check the hardware via Gtuner monitor to see if the nunchuc is not faulty or flaky. I had a nunchuc where the gyro was broken (the rest did still work) and before watching it in Gtuner I was wasting a lot of time by thinking there's a mistake in my alpha script instead of the hardware.
User avatar
OFC-Giorgio
Lieutenant
Lieutenant
 
Posts: 344
Joined: Mon Sep 15, 2014 4:26 pm

Re: SOLVED: Wii nunchuck twist register

Postby jackson » Fri Dec 04, 2015 4:23 pm

yeah thanks man.I bought another oem Nintendo one to see if it fixes it. I have been doing that pulling the nunchuck plug. Some reason the nunchuck has slight -2(down)to the resting (0) keeps twitching
and it makes the choice of class or anything that has a down option impossible to chose from. sometimes its perfect no problems at all and is awesome. yeah my complex had some rodent eating my internet cables so I have been jonesing to get back on since I posted last. I will send the code I am using as soon as I am back up fingers crossed they said today.
Hey Giorgio are you on the ps4? and the reconnection authentication till backing you out for a second to ask to hit x to connect? after you see what code I am using I'LL have a few question but you might know what is wrong before I even ask.
thanks again.99percent just like J2Kbr has redone above in this post. is there kinda of a turn accelerator when I hit the edges of game play? and I am have a run problem that sometimes it seems like a half step run cause looking at the animation,that could be cause of the twitching also. one thing to is when I do the blaze run on black ops 3 special extra fast run it pushing me back words for a second or two. But anyways I will send that asap tonight and try yours.THANKS AGAIN.
User avatar
jackson
Master Sergeant
Master Sergeant
 
Posts: 33
Joined: Sun Nov 23, 2014 1:13 am

Re: SOLVED: Wii nunchuck twist register

Postby jackson » Fri Dec 04, 2015 10:46 pm

Code: Select all
unmap ALL_REMAPS;

    remap WII_HOME  -> PS4_PS;
    remap WII_MINUS -> PS4_CROSS;
    remap WII_PLUS  -> PS4_SQUARE;
    remap WII_ONE   -> PS4_RIGHT;
    remap WII_C     -> PS4_CIRCLE;
    remap WII_Z     -> PS4_L2;
    remap WII_TWO   -> PS4_OPTIONS;
    remap WII_NX    -> PS4_LX;
    remap WII_NY    -> PS4_LY;
    remap WII_UP    -> PS4_L1;
    remap WII_DOWN  -> PS4_R3;
    remap WII_LEFT  -> PS4_R1;
    remap WII_RIGHT -> PS4_TRIANGLE;
    remap WII_B     -> PS4_R2;
    remap WII_A     -> PS4_L3;
    remap WII_ACCX  -> PS4_ACCX;
    remap WII_ACCY  -> PS4_ACCY;
    remap WII_ACCZ  -> PS4_ACCZ;
    remap WII_IRX   -> PS4_RX;
    remap WII_IRY   -> PS4_RY;

    remap WII_ACCNX -> 25;
    remap WII_ACCNY -> 26;
    remap WII_ACCNZ -> 27;

    remap WII_RT    -> PS4_UP;
    remap WII_ZR    -> PS4_DOWN;
    remap WII_X     -> PS4_TOUCH;
    remap WII_Y     -> PS4_LEFT;


    int last_ps4_auth_timeout;
    main {
        sensitivity(WII_NX, NOT_USE, 155);
        sensitivity(WII_NY, NOT_USE, 145);

        if(wiir_offscreen()) {
            set_val(WII_IRX, 0);
            set_val(WII_IRY, 0);
        }

        if(get_val(WII_Z)) {
            sensitivity(WII_IRX, NOT_USE, 150);
            sensitivity(WII_IRY, NOT_USE, 140);
        }
        set_val(WII_IRX, inv(get_val(28)));
        sensitivity(WII_IRX, NOT_USE, 150);
        sensitivity(WII_IRY, NOT_USE, 140);
        deadzone(WII_IRX, WII_IRY,DZ_CIRCLE, 5);
       
    if((get_val(WII_ACCNY)) > 22) {
        set_val(WII_RT, 100);
    }
    if((get_val(WII_ACCNY)) < -20) {
        set_val(WII_ZR, 100);
    }
    if((get_val(WII_ACCNX)) > 22) {
        set_val(WII_X, 100);
    }
    if((get_val(WII_ACCNX)) < -30) {
        set_val(WII_Y, 100);
    }

    // Rumble the controller if the PS4 auth timeout gets below 5.
    if(ps4_authtimeout() < 5) {
        if(last_ps4_auth_timeout != ps4_authtimeout()) {
            last_ps4_auth_timeout = ps4_authtimeout();
            combo_restart(AuthRumbleFeedback);
        }
    }
    // Press OPTIONS + PS to force reconnection and reset auth timeout.
    if(get_val(PS4_OPTIONS) && event_press(PS4_PS)) {
        output_reconnection();
    }
    }

    combo AuthRumbleFeedback {
    set_rumble(RUMBLE_A, 100);
    set_rumble(RUMBLE_B, 100);
    wait(200);
    reset_rumble();
    }
User avatar
jackson
Master Sergeant
Master Sergeant
 
Posts: 33
Joined: Sun Nov 23, 2014 1:13 am

Re: SOLVED: Wii nunchuck twist register

Postby jackson » Sun Dec 06, 2015 8:51 pm

For some reason not sure if it was from the last update most likely not but the original nunchuck has the glitch..WII_NY if i hold up (-100 move forward)as I have monitor on it will glitch to (+100 push me back or annoying phantom down) a few times for a split second barley see it.but the aftermarket nunchuck is perfect but is has different rest values on the, WII_ACCNY WII_ACCNX tho no biggie but 4 of my nintendo ones are doing that glitch now and both my aftermarket ones dont glitch like that Ive used the same code for AW and that wasn't an issue...maybe I never noticed it cause I was always complaining about AW tho
User avatar
jackson
Master Sergeant
Master Sergeant
 
Posts: 33
Joined: Sun Nov 23, 2014 1:13 am


Return to Wiimote, Nunchuk and Sensorbar

Who is online

Users browsing this forum: No registered users and 54 guests