I'm trying to dynamically modify from in-game the fMaxHeadTrackDistance game setting using latest MGE XE functions. I would appreciate if anyone with MWSE scripting experience could find possible bugs in the script below that is crashing for me (I think in the XSetGSfloat i1 x2 line), or any working example .esp using XSetGSfloat, XGetGSfloat commands
begin ab01gogHeadTrackDistScript; ab01goDest is a short globalshort statelong i1float x1float x2if ( MenuMode ) returnendifif ( state == 1 ) if ( ab01goDest <= 0 ) return endif set x2 to -1 XSetGSfloat i1 x2 set state to 2if ( ab01debug == 25 ) messagebox "XSetGSfloat %1 %2" i1 x2endif returnelseif ( state == 2 ) if ( ab01goDest > 0 ) return endif set x2 to x1 set state to 0 XSetGSfloat i1 x2if ( ab01debug == 25 ) messagebox "XSetGSfloat %1 %2" i1 x2endif stopscript ab01gogHeadTrackDistScript returnelseif ( state == 0 ) set i1 to 987 ; fMaxHeadTrackDistance ; setx x1 to XGetGS i1 set x1 to 300 set x2 to x1 set state to 1endifend