Jump to content
Sign in to follow this  
mr.g-c

Query set Viewdistance

Recommended Posts

Hi i want to make a viewdistance manipulator/overrider...

I wonder if there is no scripting-code to query the actual set viewdistance either by init.sqf from a mission or by armas one?

Who can help me with this?

Regards, Christian

Share this post


Link to post
Share on other sites

Addons to make it work acceptable?

Share this post


Link to post
Share on other sites
Addons to make it work acceptable?

Sure, why not...

So there is no default scripting-command to query the set viewdistance, right?

Regards, Christian

Share this post


Link to post
Share on other sites

The idea is a bit crazy, yet it should work. wink_o.gif

1) The addon has a helicopter that has ULTRA superior viewing

capabilities.

2) Now in the mission can create that helicopter for the check in

different distances to a dummy object. First like 10.000 meters.

You do a check with knowsAbout or nearTargets, if the chooper

is able to identify the dummy object.

If not, he cannot see it due to viewdistance restrictions.

Now put him 1000 m closer and repeat.

Repeat until he can see the unit.

=> You have the viewdistance.

biggrin_o.gif

Share this post


Link to post
Share on other sites
So there is no default scripting-command to query the set viewdistance, right?

Unfortunately, that's correct. There is no command for that.

Generally you would simply set a default, then track that value on the client.

Here's some code I gave to someone recently to simply demonstrate it.

Quote:

Not tested, but this should work and is the easiest solution using player action menu.

init.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Client_ViewDistance = 2000;

setViewDistance Client_ViewDistance;

player addAction ["View dist +", "setViewDist.sqf", [500], -1, false, true, ""];

player addAction ["View dist -", "setViewDist.sqf", [-500], -1, false, true, ""];

setViewDist.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (isNil "Client_ViewDistance") then {Client_ViewDistance = 1000};

_vd = (_this select 3) select 0; // if called via Action Menu

Client_ViewDistance = Client_ViewDistance+_vd;

if (Client_ViewDistance < 500) then {Client_ViewDistance = 500};

if (Client_ViewDistance > 10000) then {Client_ViewDistance = 10000};

setViewDistance Client_ViewDistance;

If you want fancy stuff, you'll need dialogs:

th_Configuration.jpgImage

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×