How to map a Wii Mote to the PC

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

Moderator: OFC-Giorgio

How to map a Wii Mote to the PC

Postby nima64 » Tue Mar 10, 2015 4:28 am

I was looking for a good script that can map a Wii Mote to the pc. For example I use glovepie and I have this script:

// Here I set the nunchuk so it corresponts with my direction keys.
e = 1.1 > Wiimote1.Nunchuk.JoyX > 0.6
q = -1.1 < Wiimote1.Nunchuk.JoyX < -0.6
s = 1.1 > Wiimote1.Nunchuk.JoyY > 0.6
w = -1.1 < Wiimote1.Nunchuk.JoyY < -0.6

// Nunchuck
numlock = Wiimote.Nunchuk.CButton
space = Wiimote.Nunchuk.ZButton

This is just to simply make it so I can play star wars and move the character forward, back, left, right along with a mouse. I'd love more complicated functions like using the motion controls on the pc but at a minimum I want to see how to do the above glovepie script to make it work on Gtuner. I tried the Call of Duty scripts but they do nothing as it seems like they are made for PS3?
User avatar
nima64
Private First Class
Private First Class
 
Posts: 2
Joined: Tue Mar 10, 2015 3:10 am

Re: How to map a Wii Mote to the PC

Postby J2Kbr » Tue Mar 10, 2015 1:28 pm

I'm not familiar with glove pie scripting ... what this exactly do?

Code: Select all
e = 1.1 > Wiimote1.Nunchuk.JoyX > 0.6


key e is activate when JoyX is between 0.6 and 1.1 ?
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: How to map a Wii Mote to the PC

Postby nima64 » Tue Mar 10, 2015 5:08 pm

So basically it says if I move the Wii Mote Nunchuck joystick up (between 0.6 to 1.1 gradations) then it is equal to hitting the E key. So it moves the character forward. I'm basically trying to emulate or mimic keyboard keys with my wii mote nunchuck joystick.
User avatar
nima64
Private First Class
Private First Class
 
Posts: 2
Joined: Tue Mar 10, 2015 3:10 am

Re: How to map a Wii Mote to the PC

Postby J2Kbr » Thu Mar 12, 2015 1:19 pm

The closest we can get using GPC script is this:

Code: Select all
define WIIIR_DEADZONE = 30;

main {
    // Wiimote pointing up
    if(get_val(WII_IRY) <= -WIIIR_DEADZONE) {
        set_val(PS4_UP, 100);
    }
    // Wiimote pointing down
    else if(get_val(WII_IRY) >= WIIIR_DEADZONE) {
        set_val(PS4_DOWN, 100);
    }
    // Wiimote pointing left
    if(get_val(WII_IRX) <= -WIIIR_DEADZONE) {
        set_val(PS4_LEFT, 100);
    }
    // Wiimote pointing right
    else if(get_val(WII_IRX) >= WIIIR_DEADZONE) {
        set_val(PS4_RIGHT, 100);
    }
}


Side note: With Titan One we can't map the Wiimote inputs to keyboard and/or mouse as Glovepie does. We can only map to a gamepad entries. That is why the script above uses PS4_LEFT, PS4_UP, etc, instead of keyboard key.
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: How to map a Wii Mote to the PC

Postby Robsterman02 » Mon Jan 30, 2017 4:46 pm

I found that if i map IR to register movement beyond the sensor it would make my directional inputs greater and more sensitive that if you.were to get IR offscreen then it would continue with RX And RY and make it so that when I turn the Wii controller the camera starts spinning in any direction i choose instead of stopping dead in its tracks
User avatar
Robsterman02
First Sergeant
First Sergeant
 
Posts: 46
Joined: Mon Sep 05, 2016 12:34 am

Re: How to map a Wii Mote to the PC

Postby Robsterman02 » Wed May 17, 2017 7:17 pm

This would be critical if you want character movement 100% in any direction otherwise it will stop when reaching off the sensor.
Just add if(get ir_offscreen) then set up the movement on that too
User avatar
Robsterman02
First Sergeant
First Sergeant
 
Posts: 46
Joined: Mon Sep 05, 2016 12:34 am


Return to Wiimote, Nunchuk and Sensorbar

Who is online

Users browsing this forum: No registered users and 36 guests