Wiimote und Nunchuck

Evilboy's FPS Infrarot, Wiimote+Nunchuck GlovePIE Script 0.7


Mit diesem Script könnte Ihr First-Person-Shooter spielen. Das Script habe ich an Unreal Tournament 2004 getestet.

Steuerung:


Sourcecode:

/* 
Written  by Evilboy ( http://glovepie.sascha-grams.de )
Script:  Evilboys-FPS-IR-Script-V-0.7.PIE
Version: 0.7
*/

/* Variablen */
var.ResX = Screen.Width
var.ResY = Screen.Height

/* correct */
var.CorrectRes = 0.03
var.XCalibration = 1.6
var.YCalibration = 1.1
var.CenterX = Screen.Width/2
var.CenterY = Screen.Height/2

/* Mouse Buttons */
Mouse.LeftButton = Wiimote.B
Mouse.RightButton = Wiimote.A

/* Mouse Cursor */
var.CursorPosX = (((((Wiimote.dot1x*var.XCalibration)-1024)*-1)/1024)*(var.ResX*(var.CorrectRes+1.02)))-var.ResX*var.CorrectRes
var.CursorPosY = Wiimote.dot1y-var.CenterY
debug = (var.CursorPosX*0.01)+' '+var.CursorPosY*0.01


if var.CursorPosX > 20 then
Mouse.DirectInputX = Mouse.DirectInputX+(var.CursorPosX*0.005)
endif
if var.CursorPosX < -20 then
Mouse.DirectInputX = Mouse.DirectInputX+(var.CursorPosX*0.005)
endif
if var.CursorPosY > 20 then
Mouse.DirectInputY = Mouse.DirectInputY+(var.CursorPosY*0.005)
endif
if var.CursorPosY < -20 then
Mouse.DirectInputY = Mouse.DirectInputY+(var.CursorPosY*0.005)
endif

/* Nunchuck */
if Wiimote.HasNunChuck then
  Keyboard.A = (-1.0 < wiimote.Nunchuk.JoyX < -0.5)
  Keyboard.D = (0.5 < wiimote.Nunchuk.JoyX < 1.0)  
  Keyboard.W = (-1.0 < wiimote.Nunchuk.JoyY < -0.5)
  Keyboard.S = (0.5 < wiimote.Nunchuk.JoyY < 1.0 )
  Mouse.WheelDown = Wiimote.Nunchuk.ZButton
  Mouse.WheelUp = Wiimote.Nunchuk.CButton
  if Wiimote.Nunchuk.RawAccY < 0 then
    Keyboard.Space = 1
    Keyboard.Space = 0
  endif
endif
  

Download .PIE Datei (Rechtsklick, "Ziel speichern unter...")