A while back I tried to add a zoom feature for my mod http://www.nexusmods.com/skyrim/mods/55475/?. This was basically the code:
;Zoom Vars;------------Float ZoomAmountBool PressedOnceZoom = False Int ZoomHotkey = 24; Initial value O "Out"Bool ZoomHotkeyEnable = False; zoom hotkey initially disabled;this was the actual function for zoomFunction ZoomIn() ZoomAmount = Utility.GetINIFloat("fDefaultWorldFOV:Display") as Float Debug.ToggleMenus() ;Utility.Wait(0.5) Game.ShowFirstPersonGeometry(false) Utility.SetINIFloat("fDefaultWorldFOV:Display", 12) ;Utility.Wait(0.05) Input.TapKey(Input.GetMappedKey("Tween Menu")) ;Utility.WaitMenuMode(0.3) Input.TapKey(Input.GetMappedKey("Tween Menu")) ;Utility.Wait(0.05) PressedOnceZoom = true ;Utility.Wait(0.05) Debug.ToggleMenus() EndFunctionFunction ZoomBackOut() Debug.ToggleMenus() ;Utility.Wait(0.05) Game.ShowFirstPersonGeometry() Utility.SetINIFloat("fDefaultWorldFOV:Display", ZoomAmount) ;Utility.Wait(0.05) Input.TapKey(Input.GetMappedKey("Tween Menu")) ;Utility.WaitMenuMode(0.3) Input.TapKey(Input.GetMappedKey("Tween Menu")) ;Utility.Wait(0.05) PressedOnceZoom = False ;Utility.Wait(0.05) Debug.ToggleMenus() EndFunction
I commented those lines out after some testing. But it essentially worked like so:
Pause, zoom. - zooming in
Pause, open inventory menu, zoom out - zooming out
I actually originally looked at the code in Mofakin's mod Hotkey Mod for this. But I got rid of the feature because it was pretty jerky and not a smooth zoom at all.
Does anyone know what a smoother zoom function might require, or why the other one as so jerky (and I did try commenting out the Input.TapKey sections and it remained as jerky):