Jump to content
Sign in to follow this  
Grumpy Old Man

[SNIPPET] Increase viewdistance for aircraft and predefined vehicle classes

Recommended Posts

Hey folks,

 

with the rather new setFeatureType command it is now possible to render vehicles all the time up to terrain view distances (12km+).

This little snippet helps doing that, just put it into init.sqf:

_vehicles = ["B_MBT_01_arty_F","B_soldier_M_F"];//vehicle classes that should be visible
_loop = _vehicles spawn {
	params ["_vehicles"];
	while {true} do {
	
		{
		if (typeOf _x isKindof "Air" OR typeof _x in _vehicles) then {_x setFeatureType 2};
		} forEach (vehicles + allunits);

	sleep 10;
	};
};

Just wanted to share it.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites

Doesn't really matter from a performance point of view, since the params command happens only once in the init.sqf.

 

Cheers

Share this post


Link to post
Share on other sites

How would I make this a mission parameter?

Share this post


Link to post
Share on other sites
4 minutes ago, Jnr4817 said:

How would I make this a mission parameter?

I don't get the question.

You either run it or don't.

 

Cheers

Share this post


Link to post
Share on other sites

Never mind. I was confused as to what the function was doing. I thought it was setting the distance separately. I see now it is allowing the view of objects you set to  match your view distance.  I figured it out. Thanks for the code snippet. 

 

How to make dedicated or multiplayer compatible?

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  

×