Mario Kart 64 with a Wiimote on Computer
So instead of being a good student and doing my calculus homework this weekend, I learned how to hack a wiimote and wrote a script to play Mario Kart 64 on it. I plan on writing more scripts for other games/applications/uses soon. Some thoughts are a way to use the wiimote as a wireless controller for media functions on my computer (i.e controlling iTunes, internet T.V, ect).
Here is the video
Comments
[Edit] I just managed to get this to work myself with little difficulty. Did you really write the script? Because with GlovePIE, it includes a similar, Excite-Truck like control scheme for MK:64. There is also a script for controlling iTunes and Half-Life 2. Check out what is in there so as not to duplicate a game and waste your time.
Anyway, I've found what I'm going to be doing with my Sunday!
//This is the Analog MarioKart64 Script v1.0 for multiple players that does not use PPJoy by WaterIsPoison
//It has only been tested in project64
//Just configure the buttons for each player in the Options->Configure Controller Plugin... file
//I find it easy if you save your config so you don't have to keep redoing it
//It was modified from the Analog Racing Script 1.1 (No PPJoy required!) by Freeman Speaketh/US of Anarchy
//Feel free to modify and redistribute, but leave this here
//Debug and leds
debug = "Tilt 1 = " + wiimote1.smoothpitch + ", Digital 1 = " + var.digital1 + ", Tilt 2 = " + wiimote2.smoothpitch + ", Digital 2 = " +var.digital2 + ", Tilt 3 = " + wiimote2.smoothpitch + ", Digital 3 = " +var.digital2 + ", Tilt 4 = " + wiimote2.smoothpitch + ", Digital 4 = " +var.digital2
Wiimote1.led1 = 1
Wiimote2.led2 = 1
Wiimote3.led3 = 1
Wiimote4.led4 = 1
//Adjusts speed of steering (in percent)
var.speed = 150
//Adjusts minimum tilt to steer at all (in degrees)
var.min = 5
//Adjusts the most you want the wheel to turn (in degrees)
var.max = 180
//Single click the Home button to quit program, double click to exit GlovePIE (Works only with wiimote1)
if doubleclicked(Wiimote1.Home){
ExitPie
else if singleclicked(Wiimote1.Home)
ExitProgram
}
//Analog to Digital converter for Wiimote1
var.digital1 = 100 / var.speed * (100 - math.abs(math.maprange(Wiimote1.smoothpitch,-var.max,var.max,-100,100)))
//Analog to Digital converter for Wiimote2
var.digital2 = 100 / var.speed * (100 - math.abs(math.maprange(Wiimote2.smoothpitch,-var.max,var.max,-100,100)))
//Analog to Digital converter for Wiimote3
var.digital3 = 100 / var.speed * (100 - math.abs(math.maprange(Wiimote3.smoothpitch,-var.max,var.max,-100,100)))
//Analog to Digital converter for Wiimote4
var.digital4 = 100 / var.speed * (100 - math.abs(math.maprange(Wiimote4.smoothpitch,-var.max,var.max,-100,100)))
//This controls Wiimote1
if Wiimote1.smoothpitch > var.min{ //right
keyboard.Z = 1
wait 1 ms
keyboard.Z = 0
wait var.digital1 ms
else if Wiimote1.smoothpitch < - var.min //left
keyboard.X = 1
wait 1 ms
keyboard.X = 0
wait var.digital1 ms
}
//This controls Wiimote2
if Wiimote2.smoothpitch > var.min{ //right
keyboard.D = 1
wait 1 ms
keyboard.D = 0
wait var.digital2 ms
else if Wiimote2.smoothpitch < - var.min //left
keyboard.F = 1
wait 1 ms
keyboard.F = 0
wait var.digital2 ms
}
//This controls Wiimote3
if Wiimote3.smoothpitch > var.min { //right
keyboard.E = 1
wait 1 ms
keyboard.E = 0
wait var.digital3 ms
else if Wiimote3.smoothpitch < - var.min //left
keyboard.R = 1
wait 1 ms
keyboard.R = 0
wait var.digital3 ms
}
//This controls Wiimote4
if Wiimote4.smoothpitch > var.min{ //right
keyboard.2 = 1
wait 1 ms
keyboard.2 = 0
wait var.digital4 ms
else if Wiimote4.smoothpitch < - var.min //left
keyboard.3 = 1
wait 1 ms
keyboard.3 = 0
wait var.digital4 ms
}
//Accelerate and reverse and other buttons for Wiimote1
Keyboard.C = Wiimote1.Two//B Buton
Keyboard.V = Wiimote1.One//A Button
Keyboard.B = Wiimote1.Right//D-Pad up button
Keyboard.N = Wiimote1.Left//D-Pad down button
Keyboard.M = Wiimote1.A//Z button
Keyboard.A = Wiimote1.Up//L button
Keyboard.S = Wiimote1.Down//R button
Wiimote1.Rumble = Wiimote1.A //Rumbles when players presses Wiimote A button (uses item)
//Accelerate and reverse and other buttons for Wiimote2
Keyboard.G = Wiimote2.Two//B button
Keyboard.H = Wiimote2.One//A button
Keyboard.J = Wiimote2.Right//D-Pad up button
Keyboard.K = Wiimote2.Left//D-Pad down button
Keyboard.L = Wiimote2.A//Z button
Keyboard.Q = Wiimote2.Up//L button
Keyboard.W = Wiimote2.Down//R button
Wiimote2.Rumble = Wiimote2.A //Rumbles when players presses Wiimote A button (uses item)
//Accelerate and reverse and other buttons for Wiimote3
Keyboard.T = Wiimote2.Two//B button
Keyboard.Y = Wiimote2.One//A button
Keyboard.U = Wiimote2.Right//D-Pad up button
Keyboard.I = Wiimote2.Left//D-Pad down button
Keyboard.O = Wiimote2.A//Z button
Keyboard.P = Wiimote2.Up//L button
Keyboard.1 = Wiimote2.Down//R button
Wiimote3.Rumble = Wiimote2.A //Rumbles when players presses Wiimote A button (uses item)
//Accelerate and reverse and other buttons for Wiimote4
Keyboard.4 = Wiimote2.Two//B button
Keyboard.5 = Wiimote2.One//A button
Keyboard.6 = Wiimote2.Right//D-Pad up button
Keyboard.7 = Wiimote2.Left//D-Pad down button
Keyboard.8 = Wiimote2.A//Z button
Keyboard.9 = Wiimote2.Up//L button
Keyboard.0 = Wiimote2.Down//R button
Wiimote4.Rumble = Wiimote2.A //Rumbles when players presses Wiimote A button (uses item)