Jump to content
Jedi Phoenix

Jedi Academy GlovePIE script


amars464

Recommended Posts

So I was using your server so I could test out playing Jedi Academy against people using two Wii Remotes instead of a keyboard and mouse, and one of your members requested that I post how to do it on the forums here. So first you need to have a computer that can have devices connect to it via Bluetooth. If you have that, then you should be able to connect the wii remotes to your computer. After that's done, you need to download a program called GlovePIE. Once you have that, copy and paste this script into it:

//Lednerg's MotionMouseScript edited by MoreDread v0.1

if starting then
  // define deadzone, calibration and sensitivity
  var.calibrationGyro = [2.5, -1.5] // [Yaw, Pitch]
  var.deadzoneGyro = [5, 5] // [Yaw, Pitch]
  var.sensitivityGyro = [1, 1.10] // [Yaw, Pitch]; lower values result in slower movements, negative values will invert the corresponding mouse axis
endif

// hold B to move mouse with WiiMote
if (WiiMote.A) then
  var.Gyro = [0, 0]
  if (Abs(WiiMote.MotionPlus.YawSpeed + var.calibrationGyro[1]) > var.deadzoneGyro[1]) then var.Gyro[1] = RemoveUnits(WiiMote.MotionPlus.YawSpeed + var.calibrationGyro[1]) - (Sign(WiiMote.MotionPlus.YawSpeed) * var.deadzoneGyro[1])
  if (Abs(WiiMote.MotionPlus.PitchSpeed + var.calibrationGyro[2]) > var.deadzoneGyro[2]) then var.Gyro[2] = RemoveUnits(WiiMote.MotionPlus.PitchSpeed + var.calibrationGyro[2]) - (Sign(WiiMote.MotionPlus.PitchSpeed) * var.deadzoneGyro[2])
  Mouse.DirectInputX = Mouse.DirectInputX + (var.Gyro[1] * var.sensitivityGyro[1])
  Mouse.DirectInputY = Mouse.DirectInputY + (-1 * var.Gyro[2] * var.sensitivityGyro[2])
endif
Key.W = Wiimote2.Up
Key.S = Wiimote2.Down
Key.A = Wiimote2.Left
Key.D = Wiimote2.Right
Key.Space = Wiimote2.B
mouse.RightButton = Wiimote2.A
mouse.LeftButton = Wiimote1.B
Key.F = Wiimote2.Stabbing
Key.LeftBracket = Wiimote2.Minus
Key.RightBracket = Wiimote2.Plus
Key.K = Wiimote1.Home
Key.C = Wiimote1.Down
Mouse.MiddleButton = Wiimote1.Home
Mouse.WheelUp = Wiimote1.Plus
Mouse.WheelDown = Wiimote1.Minus

 

And that's it!

Some notes: This script requires Wii Remote #1 to have a Wii Motion Plus attached to it. When you hold down the A button on that remote it causes the Motion+ to act as the mouse. If you wish to do stuff using the IR sensor instead, there's tons of scripts out there for that, you just have to modify what buttons do what so it will work right.

I still need to do some tweaking and add in more gestures, so this is all mostly button pressing. When I work on it more, I'll post an update for you guys.

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...