| | | Forum Member
       
Group: Forum Members Last Login: 2/7/2010 11:57:49 PM Posts: 31, Visits: 36 |
| One problem I've noticed with the improved mouselook and general mouselook scripts Carl gave out is that general gaming lacks one thing: recentering. If your pitch goes out of line, the GlovePIE can't recognize it since it doesn't get feedback from the game. This is a major problem. Whenever you respawn, look around too fast, something moves, something moves you, or something moves where you're looking, your yaw goes out of line, a MAJOR problem that makes it much less realistic. The TRACKIR emulation part of the script allowed for recentering at user level, but anything else requires the mouse to change anything, with varying results.
However, I've found one excellent feedback mechanism: No game lets you look down more than, well, DOWN. Same for looking up.This script moves the mouse as far as it can down and up when the VR920's actual pitch is down or up.
Use is simple: Calibrate VR920 accelerometer (for crouch detection, no jump), run script, and look all the way up or all the way down. This will line up your pitch, do this every time you respawn, pitch gets misaligned, etc etc
Okay, also, finding that the magnorth thing doesn't really work.
I did add something new that's useful though. Previously trying to find out sensitivity values was just guess and check, but I found a way to do it.
To use the new feature, face a definate object(something like the edge of a pole, something vertically the same and definate), align your crosshair to that part, and press Ctrl+Shift+[.
Next, turn the VR920 clockwise until your crosshair again lines up with the exact same spot (if your sensitivity at that time is off, it won't be the same direction). Press Ctrl+Shift+].
The last value of the debug (bar on top) will be something like 948 per degree. That's a rounded to a whole number value for that game at whatever ingame settings you have. To add this make a new entrie in the sensitivity list with the window title as whatever the game is and the sensitivity as that value. Have fun!
pie.FrameRate = 60Hz
var.crouch = true //if you want crouching
if window.Handle <> var.OldHandle then
var.OldHandle = window.Handle
var.sensitivity = 900
var.s = window.title
var.smoothing = 2
if var.s = "kk" then
var.sensitivity = 450
Say "K Krieger"
else if var.s = "DOOM 3" then
var.sensitivity = 4600
Say "Doom 3, lowest sensitivity"
else if var.s = "Harry Potter and the Chamber of Secrets" then
var.sensitivity = 1500
Say "Harry Potter 2"
else if var.s="Tomb Raider: Anniversary Demo" or var.s="Tomb Raider: Anniversary" then
var.sensitivity = 1270
Say "Tomb Raider Anniversary, sensitivity 10"
else if var.s="Second Life" then
var.sensitivity = 900
Say "Second Life"
else if var.s="F.E.A.R." or var.s="F.E.A.R. Perseus Mandate Demo" then
var.sensitivity = 300
Say "Fear, default sensitivity"
else if var.s="RoboBlitz" then
var.sensitivity = 600
Say "Robo Blitz, default sensitivity"
else if var.s="Left 4 Dead"
var.sensitivity = 1200
Say "Left For Dead"
else if var.s="Portal"
var.sensitivity = 1200
Say "Portal"
else if var.s="Unreal Tournament 3"
var.sensitivity = 600
Say "Yoo Tee Three"
else if var.s="Synergy"
var.sensitivity = 1225
var.smoothing = 4
Say "Half Life Too, Sinergie Mod"
else if var.s="Reminder" then
var.OldHandle = 0 // RoboBlitz demo changes window title
else
//debugprint(var.s)
endif
end if
if (not mouse.CursorVisible) and (not FakeTrackIR.active) then
var.yaw = RemoveUnits(Smooth((VR920.ContinuousYaw), 2))/90*var.Sensitivity
var.pitch = RemoveUnits(VR920.Pitch)/90*var.Sensitivity
var.mx+=delta(var.yaw)
var.my-=delta(var.pitch)
if vr920.pitch <= -83 then fakemouse.directinputY = -2*var.sensitivity
if vr920.pitch >= 83 then fakemouse.directinputY = 2*var.sensitivity
fakemouse.DirectInputX = var.mx
fakemouse.DirectInputY = var.my
if var.crouch = true then
//begin crouchcode
//Make sure the VR920 accelerometer is calibrated.
//Stand up quickly or it will be detected wrong.
var.gs = |[vr920.gx,vr920.gy,vr920.gz]|
var.moving = smooth(abs(var.gs-1),2)>0.04
var.MoveUp = false
var.MoveDown = false
var.Crouching = false
var.Standing = false
var.Jumping = false
if (abs(smooth(vr920.RelAccY,16))>2.3) and var.moving but not var.samemove then
var.updown = true
if var.dir = 0 then
var.dir = sign(smooth(vr920.relaccy))
end if
end if
if released(var.moving) then
var.deltapitch = vr920.StrictPitch-var.oldpitch
if var.updown then
if abs(var.deltapitch) < 15 degrees then
if var.dir = 1 then
var.MoveUp = true
end if
if var.dir = -1 then
var.MoveDown = true
end if
var.samemove = true
end if
end if
var.updown = false
var.dir = 0
end if
if (not var.moving) and (var.samemove) then
wait 800ms
var.samemove=false
end if
if not var.moving then
var.oldpitch = vr920.strictpitch
end if
if var.MoveDown then
if not var.Crouched then var.Crouching = true
var.Crouched = true
end if
if var.MoveUp then
var.Standing = true
var.Crouched = false
end if
end if
if var.crouched = true
key.ctrl = true;
else if var.Standing = true
key.ctrl = false;
endif
else if FakeTrackIR.active then
var.Yaw = vr920.yaw - var.offset
if var.yaw <-180 then var.yaw+=360
if var.yaw >180 then var.yaw-=360
var.Yaw = smooth(var.Yaw,5)
var.LeanHeight = 1
var.NeckHeight = 0.3
var.EyeDist = 0.1
FakeTrackIR.x = sin(vr920.roll)*var.LeanHeight+sin(vr920.yaw)*var.EyeDist
FakeTrackIR.y = (cos(vr920.roll)-1)*var.LeanHeight/2+(cos(vr920.pitch)-1)*var.NeckHeight
FakeTrackIR.z = -sin(vr920.pitch)*var.NeckHeight+(cos(vr920.yaw)-1)*var.EyeDist
var.YawScale = 1
var.PitchScale = 1
var.RollScale = 1
var.PitchOffset = 0
if FakeTrackIR.ProfileID=332DH then
var.PitchOffset = 20 degrees
else if FakeTrackIR.ProfileID=3A35H or FakeTrackIR.ProfileID=3A38H or FakeTrackIR.ProfileID=3A39H then
// Arvoch Conflict, Evochron Alliance, and Evochron Renegade
var.YawScale = 2
var.PitchScale = 2
var.RollScale = 10
FakeTrackIR.z += -EnsureMapRange(vr920.pitch,-30 degrees,-10 degrees,-1m,0)
FakeTrackIR.y += EnsureMapRange(vr920.pitch,-30 degrees,-10 degrees,-1m,0)
FakeTrackIR.x += FakeTrackIR.z*EnsureMapRange(sin(var.yaw),-sin(20 degrees),sin(20 degrees),-1m,1m)
end if
FakeTrackIR.yaw = var.Yaw*var.YawScale
FakeTrackIR.pitch = vr920.Pitch*var.PitchScale +var.PitchOffset
FakeTrackIR.roll = -vr920.Roll*var.RollScale
// Uncomment the next line to enable voice command:
//if said('recenter') or Ctrl+R then var.offset = vr920.yaw
// status display
end if
Also, an added bonus, a L4D Wiimote script designed to work very well with this.
Press Home and +/- to switch mode, button 2 to voicechat, and swing up to jump.
While Survivor swing wiimote sideways to punch back infected.
While hunter hold A and punch forward to pounce.
While boomer press B to boom.
While smoker fire to grapple.
While tank press B to throw rocks, punch forward with Wiimote to punch.
pie.Framerate = 60Hz
//General
WASD = Wiimote.Dpad //Movement
if Wiimote.RelAccY > 20 then Key.Space = true else key.space = false //Jump
Key.C = Wiimote.Two //Voice chat
var.controlsetmax = 4
//Control switcher. Click Home to press flashlight, Press and press +/- to switch modes
if Wiimote.Home then
if (not Wiimote.Plus) and (not Wiimote.Minus) then
Key.F = true
Key.F = false
wait 250 ms //press F
else if var.controlset <=var.controlsetmax and Wiimote.Plus = true then
var.controlset++
var.say = true
wait 250 ms
else if var.controlset > var.controlsetmax and Wiimote.Plus = true then
var.controlset = 0 //loop to start
else if var.controlset >=0 and Wiimote.Minus = true then
var.controlset--
var.say = true
wait 250 ms
else if var.controlset < 0 and Wiimote.Minus = true then
var.controlset = var.controlsetmax //loop to end
endif
endif
//Control sets start
/*--------Human---------*/
if var.controlset = 0 then
Wiimote.led1 = true
Wiimote.led2 = true
Wiimote.led3 = true
Wiimote.led4 = true
if var.say = true then say("Survivor")
var.say = false
if Wiimote.RelAccX > 15 then RMB = true else RMB = false //push back infected
LMB = Wiimote.B //Fire
Key.E = Wiimote.A //Use
Key.R = Wiimote.one //Reload
if (not Wiimote.Home) and Wiimote.Plus then Mouse.Wheelup = true //up one weapon
if (not Wiimote.Home) and Wiimote.Minus then Mouse.Wheeldown = true //down one weapon
//Rumble effects
if Wiimote.B = true or Wiimote.RelAccX > 15 then
wiimote.Rumble = true
wait 100 ms
wiimote.rumble = false
endif
/*------------Hunter-------------*/
else if var.controlset = 1 then
Wiimote.Led1 = true
Wiimote.Led2 = false
Wiimote.Led3 = false
Wiimote.Led4 = false //set LEDs
if var.say = true then say("Hunter")
var.say = false
if Wiimote.RelAccZ > 15 and Wiimote.A = true then LMB = true else LMB = false
RMB = Wiimote.B
//rumble
if (Wiimote.RelAccZ > 15 and Wiimote.A = true)
Wiimote.Rumble = true
wait 250 ms
Wiimote.Rumble = false
else if Wiimote.B = true then
Wiimote.Rumble = true
wait 250 ms
Wiimote.Rumble = false
wait 500 ms
endif
/*------------Boomer------------*/
else if var.controlset = 2 then
Wiimote.Led1 = false
Wiimote.Led2 = true
Wiimote.Led3 = false
Wiimote.Led4 = false
if var.say = true then say("Boomer")
var.say = false
if Wiimote.RelAccX > 15 then RMB = true else RMB = false
LMB = Wiimote.B
//rumble
if Wiimote.B then
Wiimote.Rumble = true
wait 2000 ms
Wiimote.Rumble = false
else if Wiimote.RelAccX > 15
Wiimote.Rumble = true
wait 250 ms
Wiimote.Rumble = false
endif
/*--------------Smoker-------------*/
else if var.controlset = 3 then
Wiimote.Led1 = false
Wiimote.Led2 = false
Wiimote.Led3 = true
Wiimote.Led4 = false
if var.say = true then say("Smoker")
var.say = false
LMB = Wiimote.B
if Wiimote.RelAccX > 15 then RMB = true else RMB = false
if Wiimote.B = true then
Wiimote.Rumble = true
wait 500 ms
Wiimote.Rumble = false
else if Wiimote.RelAccX > 15 then
Wiimote.Rumble = true
wait 250 ms
Wiimote.Rumble = false
endif
/*------------Tank------------*/
else if var.controlset = 4 then
Wiimote.Led1 = false
Wiimote.Led2 = false
Wiimote.Led3 = false
Wiimote.Led4 = true
if var.say = true then say("Tank")
var.say = false
if wiimote.RelAccZ > 20 then LMB = true else LMB = false
RMB = Wiimote.B
if wiimote.RelAccZ > 20 then
Wiimote.Rumble = true
wait 300 ms
Wiimote.Rumble = false
else if Wiimote.B = true then
Wiimote.Rumble = true
wait 80 ms
Wiimote.Rumble = false
endif
endif
debug = "X: " + Wiimote.RelAccX + " Y: " + Wiimote.RelAccY + " Z: " + Wiimote.RelAccZ
-----------------------------------------------Problems with glovepie?-----------------------------------------------
Better calibration method
GlovePIE 0.3 not working? Fix here
Download GlovePIE 0.30
3d game drivers, if you need them- 30 day trial |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 1/5/2010 12:17:11 PM Posts: 8, Visits: 24 |
| This sounds great but when I run the script, nothing happens. I found my angle relative to magnetic north and entered that into the script. I also set var.magadjustment to =true. Then I run the script but when I move the Vuzix, my mouse does nothing.
This script is supposed to emulate the mouse, right? Or does it only work with the games listed.
www.sketchy-stories.com |
| | | | Forum Member
       
Group: Forum Members Last Login: 2/7/2010 11:57:49 PM Posts: 31, Visits: 36 |
| As said before, this is a modified script that carl sent out earlier. Seen the (not Mouse.Cursorvisible)? That means it only moves the mouse when the mouse is hidden, IE when you're in game. Sorry for not mentioning that.
Also note that it's two diffrent scripts. I couldn't find ways to highlight that fact.
And also the magnetic north thing isn't working... I think it's due to the fact that it's getting it's yaw variables from what is infact broken yaw in the first place... Although it does seem to work on one side, while on the -0 to -180 side failing completely. |
| | | | Forum Member
       
Group: Forum Members Last Login: 2/7/2010 11:57:49 PM Posts: 31, Visits: 36 |
| Oh BTW, this forum seems a little dead, so...
If you need/want to contact me you can reach me at
mailto:feilen1000@gmail.com
AIM:feilen1000@gmail.com
Yahoo:feilen1000
MSN:feilen1000@gmail.com
Also, message me if you want to do some VR gaming or want a custom basic controller script, I need some friends who also have a VR X3 |
| |
|
|