Remapping Motion Controls?

Wiimote Tutorials, Configurations and GPC Scripts (mimicking FPS like in nintendo wii/wiiu).

Moderator: OFC-Giorgio

Remapping Motion Controls?

Postby Mizumi » Sat Mar 02, 2019 1:03 am

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);
Last edited by Mizumi on Sat Mar 02, 2019 1:31 am, edited 1 time in total.
User avatar
Mizumi
Private First Class
Private First Class
 
Posts: 2
Joined: Sat Mar 02, 2019 12:56 am

Re: Remapping Motion Control

Postby UK_Wildcats_Fans » Sat Mar 02, 2019 1:26 am

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)
User avatar
UK_Wildcats_Fans
Brigadier General
Brigadier General
 
Posts: 2107
Joined: Thu Jan 08, 2015 6:53 pm
Location: San Diego, California USA

Re: Remapping Motion Control

Postby Mizumi » Sat Mar 02, 2019 1:33 am

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.
User avatar
Mizumi
Private First Class
Private First Class
 
Posts: 2
Joined: Sat Mar 02, 2019 12:56 am

Re: Remapping Motion Controls?

Postby UK_Wildcats_Fans » Sat Mar 02, 2019 2:16 pm

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".
User avatar
UK_Wildcats_Fans
Brigadier General
Brigadier General
 
Posts: 2107
Joined: Thu Jan 08, 2015 6:53 pm
Location: San Diego, California USA


Return to Wiimote, Nunchuk, Classic Controller & Sensorbar

Who is online

Users browsing this forum: No registered users and 16 guests