Results 1 to 4 of 4

Thread: getViewDistance

  1. #1
    Master Gunnery Sergeant
    Join Date
    Sep 10 2004
    Location
    Finland
    Posts
    1,287
    Is getting current viewdistance setting possible via scripting in OFP:R version 1.96?

    A way around this is to use setViewDistance and then the value is known, at least as long as the player doesn't change it from options menu.

    Does anyone know any methods to find out current viewdistance setting?

  2. #2
    if I recall, MP maps defaulted to 750 unless something else was set with setviewdistance, for sp and campaign it is dependant on your personal settings.
    Visit {USI} at {USI} home

  3. #3
    In FDF you can set autoviewdistance; the viewdistance of the weakest machine will be taken.

    Here's what the script looks like; it uses "benchmark"

    finmod\dta\scripts.pbo\eastborder\ autovd.sqs
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    ;
    ; Automatic viewdistance script v1.0 by Kegetys
    ;
    ; for FDFmod
    ;

    ;
    ; Sets viewdistance according to benchmark value of weakest client,
    ; from 900m &#40;benchmark 2000&#41; to 2000m &#40;benchmark 6500&#41;
    ;

    ? format&#91;&#34;%1&#34;, player&#93; == &#34;scalar bool array string 0xfcffffef&#34; &#58; exit

    _min = 410
    _max = 2000
    _maxb = 6500

    _b = benchmark

    FDF_AutoViewDistance = _max

    _mydist = &#40;_b/&#40;_maxb/&#40;_max-_min&#41;&#41;&#41;+_min
    ? _mydist &#60; 900 &#58; _mydist = 900
    ? _mydist &#62; 2000 &#58; _mydist = 2000

    #luup

    if &#40;FDF_AutoViewDistance &#62; _mydist&#41; then {FDF_AutoViewDistance = _mydist;publicvariable &#34;FDF_AutoViewDistance&#34;}
    ~0.0001

    ? time &#60; 5 &#58; goto &#34;luup&#34;

    setviewdistance FDF_AutoViewDistance
    [/QUOTE]

    Hope this helps you

  4. #4
    Master Gunnery Sergeant
    Join Date
    Sep 10 2004
    Location
    Finland
    Posts
    1,287
    Author of the Thread
    I was asking if anyone knows a method to get the viewdistance, not set.

    Thanks anyway

    At this time I wrote my script so that there is setViewDistance in the start so I get the value from there, but I&#39;d like to know if it is possible to avoid doing that because I&#39;d rather not touch the viewdistance setting, just ask what it happens to be.

    One more function for BIS to add into the scripting language.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •