Page 1 of 1

Remapping Motion Controls?

PostPosted: Sat Mar 02, 2019 1:03 am
by Mizumi
So, im trying to get the motion control of the Wii Remote to match that of the right stick on a PS4 controller for Smash Ultimate. Back in Brawl, you could use "Shake Smash" where you shake the controller, for example, up, and it counts as hitting up on the right stick. I have it semi-working, however both up and downwards count as hitting up on the right stick. Also, while Left and Right work fine with just little shakes to the side, Up and Down need really exaggerated shakes for it to register. I dont know much for programming, but tried it out anyway, which results in these issues.

This is what I have specifically for the motion control.

Code: Select all
 
    if (get_val(WII_ACCX) <= -1) {set_val(PS4_RX,  100)
    if (get_val(WII_ACCX) >=  1) {set_val(PS4_RX, -100);
    if (get_val(WII_ACCY) <= -1) {set_val(PS4_RY,  100)
    if (get_val(WII_ACCY) >=  1) {set_val(PS4_RY, -100)
    if (get_val(WII_ACCX) == 1) {set_val(PS4_RX,  0);
    if (get_val(WII_ACCY) == 1) {set_val(PS4_RY,  0);

Re: Remapping Motion Control

PostPosted: Sat Mar 02, 2019 1:26 am
by UK_Wildcats_Fans
Here are the values for the PS4 sticks, the forwards and backwards are reversed to how most people think about it. The directions are assuming that you are holding the PS4 controller in your hands at the time.

Stick FWD = -100 (negative value)
Stick BACK = 100
Stick RIGHT = 100
Stick LEFT = -100 (negative value)

Re: Remapping Motion Control

PostPosted: Sat Mar 02, 2019 1:33 am
by Mizumi
UK_Wildcats_Fans wrote:Here are the values for the PS4 sticks, the forwards and backwards are reversed to how most people think about it. The directions are assuming that you are holding the PS4 controller in your hands at the time.

Stick FWD = -100 (negative value)
Stick BACK = 100
Stick RIGHT = 100
Stick LEFT = -100 (negative value)


yeah, after messing around with the values i got it. however it doesnt explain why downwards motion is registered as upwards.

Re: Remapping Motion Controls?

PostPosted: Sat Mar 02, 2019 2:16 pm
by UK_Wildcats_Fans
I am not familiar with the Wii and Titan. Maybe this will help.

OFC-Giorgio wrote:The nunchuck gyro movement is indicated by WII_ACCNX, WII_ACCNY and WII_ACCNZ.

The wiimote gyro movement is indicated by WII_ACCX, WII_ACCY and WII_ACCZ.
I only used WII_ACCX with values greater than 20 to detect the twisting of the wiimote:
if(get_val(WII_PLUS) && get_val(WII_ACCX) > 20)

To detect the shaking of the nunchuk one has to find out which of the WII_ACCNX, WII_ACCNY and WII_ACCNZ can be used and with what values. Maybe we should store these value between a few rounds (of the main loop) to determine e.g. that the nunchuk z value is first 0 (start), next 30 (up) and finally 0 (down again) to qualify as a "shake".