GlovePIE:FPS Ultimate
From WiiLi
Alright, this is the ultimate FPS control script. It works much better than anything else I've seen. The instructions are in the script below.
Huge thanks to Carl Kenner for GlovePIE, AWESOME work. Make sure you support his efforts by donating!!
feel free to modify this and post specific controls for specific games here at wiili.org, just make sure you give me (funkamatic) a little credit.
/*
Ultimate FPS controller
first off, if you ever run in to trouble, head to:
http://wiili.org/
EXPLINATION:
The wiimote controls like a mouse except if it leaves the bounding-
box. There is a "bounding box" that when the Wiimote IR points to
the left or right it will start to auto-turn. This is analog so the
further you go out of the box, the faster you turn. It will also
rumble to feedback that you are turning. Otherwise, it just controls
like a mouse. I experimented for weeks with this thing and it's the
best.
To put it simply, it controls like a mouse until you leave the
bounds, then it acts like a joystick and mouse put together, giving
you the pixel-perfect (well, close) accuracy while still being able
to make analog turns.
Requires sensor bar
Requires PPjoy with X & Y axis )don't need BUTTONS OR POV)
your game has to be able to customize the controls including the
joystick. The only game that I own that does not work is Hexen II.
You could modify the program to accomodat it by swallowing and
other techniques.
Please be aware that after you start the program, make sure the
wiimote is pointing away from the sensor bar until you get in the
game.
Also, sometime the Nunchuck is not recognized as plugged in, so
I added a little feature that when you push the A and B buttons
at the same time, the wiimote leds will flash if the nunchuk
wasn't recognized. Just unplug the nunchuck and replug it back
in until they don't flash anymore.
GETTING STARTED:
Make sure that you have PPJoy installed and running analog0 and
analog1. Then get in to you game simply map the buttons as shown
below or if the game recognizes button presses just press the
button on the wiimote/nunchuck that you want. Cake. Keep in mind
that a hearty swing from the wiimote outputs "W" and nunchuck "N"
so they can be mapped. The W is rather inconveinient while
trying to aim, so don't make it anything critical (if anything
at all).
Don't forget to also set your games sensativity in the sensativity
settings below.
for the bounding box size I use 3 for DooM/Heretic/HeXeN and 5
for Halo PC. Mess with them till your comfortable.
Wiimote button mapping:
d-pad: up = U
down = D
left = L
right = R
a = A
b = B
minus = M
plus = P
one = One
two = Two
swing = W
Nunchuck:
c = C
z = Z
swing: N
control stick x = PPJoy1.Analog0
control stick y = PPJoy1.Analog1 */
// user settings for sensativity:
var.box = 3 //change size of bounding box: 1 - 10.
//basically how far you have to go before you start
//to auto turn
var.boxs1 = 40 //changes sensativity when outside box 10 - 100
//10 (very slow), 100 (very fast)
//That should be it! ENJOY!
// varible modifiers
var.boxs = var.boxs1 * 10
var.box1 = var.box / 10
var.m1 = (var.m * -1) + 11
var.m2 = (1 - (1 / var.m1)) / 2
// leds based on battery life 25/ 50/ 75/ 100%
var.batt = (wiimote.Battery / 2 + 4)
if var.batt < 25
var.Leds = 1
endif
if var.batt < 50 and > 24
var.Leds = 3
endif
if var.batt < 75 and > 49
var.Leds = 7
endif
if var.batt > 74
var.Leds = 15
endif
Wiimote.leds = var.leds
//Wiimote IR and bouding box
var.dot1x = wiimote.dot1x
var.dot1y = wiimote.dot1y
var.wpx = ((Wiimote.PointerX) - .5) * 2
var.wpy = ((Wiimote.PointerY) - .5) * 2
if wiimote.PointerVisible but not var.PointerBump then
if var.wpx > var.box1 or < -var.box1
var.cnt = var.cnt + 1
if var.cnt < 2
var.joyx = wiimote.PointerX
endif
var.joyx1 = wiimote.pointerx - var.joyx
var.r = 1 //for rumble
else
var.cnt = 0
var.r = 0 //for rumble
var.joyx = 0
var.joyx1 = 0
endif
var.joyx2 = var.joyx2 + var.joyx1
mouse.DirectInputX = (((var.dot1x - (var.joyx2 * var.boxs))* -1) + 500)/ 2
mouse.DirectInputY = ((var.dot1y) - 200)
endif
//rumble when outside of bounding box
if var.r = 1
Wiimote.Rumble = TRUE
wait 1ms
Wiimote.Rumble = FALSE
wait 40ms
else
Wiimote.Rumble = FALSE
endif
// Wiimote buttons
key.A = Wiimote.A
key.B = Wiimote.B
key.M = Wiimote.Minus
key.P = Wiimote.Plus
key.L = Wiimote.Left
key.U = Wiimote.Up
key.R = Wiimote.Right
key.D = Wiimote.Down
key.One = Wiimote.One
key.Two = Wiimote.Two
key.Escape = Wiimote.Home
// Nunchuck buttons
key.C = Wiimote.Nunchuk.CButton
key.Z = Wiimote.Nunchuk.ZButton
// Nunchuk Analog stick
PPJoy1.Analog0 = MapRange(Wiimote.Nunchuk.JoyX, -1,1, -1,1)
PPJoy1.Analog1 = MapRange(Wiimote.Nunchuk.JoyY, -1,1, -1,1)
// Wiimote swing:
if (wiimote.RelAccX > 35 or < -35) or (wiimote.RelAccY > 35 or < -35) or (wiimote.RelAccZ > 35 or < -35)
key.W = true
else
key.W = false
var.swing = 0
endif
//Nunchuck swing:
if (wiimote.Nunchuk.RawAccX > 25 or < -25) or (wiimote.Nunchuk.RawAccY > 25 or < -25) or (wiimote.Nunchuk.RawAcc > 25 or < -25)
key.N = true
else
key.N = false
endif
//press a & b to see if nunchuk is connected correctly, leds flash if not
if wiimote.a && wiimote.b = true
if wiimote.HasNunchuk = false
wiimote.Leds = 0
endif
endif

