Jump to content
Graptik

Get Rid of Wire Fences?

Recommended Posts

Hello,

I am playing on the map X-Cam Taunus but there are thousands of wire fences all over the map that the AI cannot navigate around.

Is there a way to use the Eden Editor to remove or hide these fences?

I will be very grateful for any help.

Thanks!

Share this post


Link to post
Share on other sites
4 hours ago, Graptik said:

Hello,

I am playing on the map X-Cam Taunus but there are thousands of wire fences all over the map that the AI cannot navigate around.

Is there a way to use the Eden Editor to remove or hide these fences?

I will be very grateful for any help.

Thanks!

This is a neat little script you can add to you mission init that can remove all or an amount of certain map objects(fences included) 

 

Mainly used for map optimisaition but use it for fences value 100. The only thing is you shouldnt enter a value of 0 for any object,keep the rest at 5% like iv written here

 

// hide (delete) terrain objects for better map performance
// percentages for deletion
_rock_perc = 5;
_tree_perc = 5;
_bush_perc = 5;
_fence_perc = 100;
_wall_perc = 5;
_hide_perc = 5;

_rock_fac = round (100 / _rock_perc);
_tree_fac = round (100 / _tree_perc);
_bush_fac = round (100 / _bush_perc);
_fence_fac = round (100 / _fence_perc);
_wall_fac = round (100 / _wall_perc);
_hide_fac = round (100 / _hide_perc);

// get all specific terrain objects
// 3,513
_rocks = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["ROCK"], (worldSize * 1.41) , true, true];

// 101,960
_trees = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["TREE"], (worldSize * 1.41) , true, true];

// 288,461
_bushes = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["BUSH"], (worldSize * 1.41) , true, true];

// 11,189
_fences = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["FENCE"], (worldSize * 1.41) , true, true];

// 14,190
_walls = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["WALL"], (worldSize * 1.41) , true, true];

// 192,325
_hides = nearestTerrainObjects  [[worldSize/2, worldSize/2], ["HIDE"], (worldSize * 1.41) , true, true];

//delete given percentage of terrain objects (not randomly cause it will be done on each machine locally and should be the same)
{
 if((_forEachIndex + 1) % _rock_fac isEqualTo 0) then {_x hideObject true;};
} forEach _rocks;

{
 if((_forEachIndex + 1) % _tree_fac isEqualTo 0) then {_x hideObject true;};
} forEach _trees;

{
 if((_forEachIndex + 1) % _bush_fac isEqualTo 0) then {_x hideObject true;};
} forEach _bushes;

{
 if((_forEachIndex + 1) % _fence_fac isEqualTo 0) then {_x hideObject true;};
} forEach _fences;

{
 if((_forEachIndex + 1) % _wall_fac isEqualTo 0) then {_x hideObject true;};
} forEach _walls;

{
 if((_forEachIndex + 1) % _hide_fac isEqualTo 0) then {_x hideObject true;};
} forEach _hides;

"Hide" is refering to objects like power lines/poles..logs,trash cans and other misc stuff. a value of 5% shouldnt be noticed on that map you mention as it has alot of objects if i recall. I personally use this for livonia and Tanoa with mid range values.

 

 

However,the Eden editor is capable of hiding objects within a range you set vie the "hide terrain objects" module. Can specify trees,buildings etc. It may suit you better if your just looking to make a scenario in a certain area.

  • Like 1

Share this post


Link to post
Share on other sites

Some maps need another code for that.

I experienced that on Tobruk map, very nice WW2 map, plenty of wires.
So, here is a general (so far I tested on WW2, CUP, ARMA, Global mob, Western Sahara, SOG Prairie fire, CSLA DLCs... ) code for wires fences, barriers...

 

Anyway, this adapted code for hiding all the stuff at start, should work:

On all PC (initPlayerLocal.sqf)

{_x hideObject TRUE} count ((nearestObjects [[worldSize/2,worldSize/2],[],worldSize/1.4]) select {private _w = _x; ["wire","fence","hedgehog","barrier","jezek","bruno"] findIf {_x in toLowerANSI (getModelInfo _w #0) or _x in toLowerANSI str (inheritsFrom configOf _w)} >-1 });

 

NOTE: In my modules, I'm using it two different ways, different approaches than you :

- I'm creating hold action for players, enabling cut (toolkits) or blow (explosives) for penetrating the area.

- I'm blowing tires when car runs on razor wires (triggers spawned/despawned on the fly).

 

  • Like 2

Share this post


Link to post
Share on other sites
14 minutes ago, pierremgi said:

Some maps need another code for that.

I experienced that on Tobruk map, very nice WW2 map, plenty of wires.
So, here is a general (so far I tested on WW2, CUP, ARMA, Global mob, Western Sahara, SOG Prairie fire, CSLA DLCs... ) code for wires fences, barriers...

 

Anyway, this adapted code for hiding all the stuff at start, should work:

On all PC (initPlayerLocal.sqf)


{_x hideObject TRUE} count ((nearestObjects [[worldSize/2,worldSize/2],[],worldSize/1.4]) select {private _w = _x; ["wire","fence","hedgehog","barrier","jezek","bruno"] findIf {_x in toLowerANSI (getModelInfo _w #0) or _x in toLowerANSI str (inheritsFrom configOf _w)} >-1 });

 

NOTE: In my modules, I'm using it two different ways, different approaches than you :

- I'm creating hold action for players, enabling cut (toolkits) or blow (explosives) for penetrating the area.

- I'm blowing tires when car runs on razor wires (triggers spawned/despawned on the fly).

 

Sweet. Yeah iv only been playing Vanilla maps lately,i looked past the fact modders and even CDLC maps may contain "editor" objects made to be simple/part of terrain. . Im sure something like "wrecks" would be useful too. IE for the odd vehicle graveyards i remember seeing in Takistan...but then again,if you cant run Takistan....you got bigger problems

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

×