View Single Post
  #6  
Old 04-21-2011, 08:51 AM
MadBlaster MadBlaster is offline
Approved Member
 
Join Date: Oct 2010
Posts: 666
Default

This might work for you OP. Glovepie script just wrote for myself today. Allows you to zoom FOV style with your hat at 90 degrees, and snap back to FOV 90 with hat at 270 degrees. You need to measure your monitor height in mickeys and substitute your numbers for what I have in there. You do this with the debug command in Glovepie (i.e., debug=mouse.DirectInputY). Using your up/ down arrow keys, starting at the top and scrollling down to the bottom...note the difference in mickeys and put that number in the script in place of what I have. See my notes for rest. It's a bit clunky but it does the job.

*GLOBAL
var.mcx=640/2 //game resolutions
var.mcy=480/2//game resolutions

if var.mcy=480/2 then //changes zoom variable when game resolution changes
var.mckmstr=480
elseif var.mcy=600/2 then
var.mckmstr=600
elseif var.mcy=768/2 then
var.mckmstr=768
elseif var.mcy=864/2 then
var.mckmstr=864
endif

*ZOOM [HotKey viewset]
if (joystick1.pov1=90.00 and var.a=0) then
key.PageDown=true //FOV to 90
key.PageDown=false
mouse.cursorposx=var.mcx //initilze cursor, var.mcx and var.mcy equal to game resolution divided by 2 so that mouse cursor is centered.
mouse.cursorposy=var.mcy
mouse.cursorposy=0 //intialize mickey count
var.mick=mouse.DirectInputY //initialize mickey count
var.a=1 //start action
endif
if (joystick1.pov1=90.00 and var.a=1) or (joystick1.pov1=90.00 and var.a=2) then //action
key.Alt=true //"hold to adjust field of view" mapped to Alt-Z
key.Z=true
mouse.DirectInputY=mouse.DirectInputY+20 //cursor moves -y direction, sensitivity set here
endif
if (abs(mouse.DirectInputY)-abs(var.mick) > var.mckmstr) and var.a=1 then //first stage ends
key.Delete=true //opens the door to further zoom
key.Delete=false
mouse.cursorposx=var.mcx //initilze cursor, var.mcx and var.mcy equal to game resolution divided by 2 so that mouse cursor is centered.
mouse.cursorposy=var.mcy
mouse.cursorposy=0 //initialize mickey count
var.mick=mouse.DirectInputY //initialize mickey count
var.a=2 //kick back to action
endif
if (abs(mouse.DirectInputY)-abs(var.mick) > var.mckmstr) and var.a=2 then //second stage ends
var.a=3
key.Alt=false //job done, turn off now
key.Z=false
endif
if released(joystick1.pov1=90.00) then
var.a=0 //reinitialize variables to do it again
var.mick=0
mouse.DirectInputY=0
key.Alt=false
key.Z=false
mouse.cursorposx=var.mcx //initilze cursor, var.mcx and var.mcy equal to game resolution divided by 2 so that mouse cursor is centered.
mouse.cursorposy=var.mcy
endif
if (joystick1.pov1=270.00) then //snap back to FOV 90
key.PageDown=true
key.PageDown=false
endif

Last edited by MadBlaster; 04-24-2011 at 11:29 PM. Reason: updated for a bug and improved for when you want to change resolutions, change the global variables
Reply With Quote