Jump to content
p_siddy

Removing Bushes and Trees

Recommended Posts

I've been trying to build a shooting range in a certain area but the bushes and trees are making it look pants. I've successfully used a Game logic with the object ID's and set damage 1, but that knocks the trees and bushes over and makes them look worse if anything.

 

I've tried hideobjectglobal but it didn't appear to work, but I think this is because I was using the Object ID's where on the wiki it doesn't really say what you should use and it doesn't give an example with object IDs.

 

 Anyone able to assist?

Share this post


Link to post
Share on other sites

The small shrubs can be hidden by uing clutter cutter objects, but the trees and the shrubs can't be deleted/hidden in any way. 

Share this post


Link to post
Share on other sites

Insert a game logic in the middle and put this in its init:

{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,[],50])

Clears all static objects within 50m.

 

You could filter just the trees and bushes with

{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,["tree","bush"],50])

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

The above isnt working. I may add this is on a CUP Terrains map, dont know if that changes things somewhat?

Share this post


Link to post
Share on other sites

The above isnt working. I may add this is on a CUP Terrains map, dont know if that changes things somewhat?

 

Works for me 

Share this post


Link to post
Share on other sites

I've tried what Greenfist and Dardo have suggested, still no joy.

 

I know the ID's are correct as I am able to set damage too them.

 

Cheers for the help so far.

Share this post


Link to post
Share on other sites

I've tried what Greenfist and Dardo have suggested, still no joy.

I know the ID's are correct as I am able to set damage too them.

Cheers for the help so far.

Uhm that's strange,what's the map are you working on? I'd like to personally test it

Share this post


Link to post
Share on other sites

Place a game logic near what you want to hide and put this in the init:

hideObject ([0,0,0] nearestObject 524235); 

But be aware that in the RPT you will get the following:

 1:19:30 Performance warning: Very large search for 524235 (>300 m)
 1:19:30 Performance warning: Search for 524235: b_ficusc2d_f.p3d was very large (16290 m)

UPDATE:

 

Place a game logic near what you want to hide and put this in the init: for this example I named it "logic_hide1"

{((getpos logic_hide1) nearestObject _x) hideObject true;} forEach [524211,524212,524213,524214,524235,525830];

This eliminates the RPT Performance warning.

Share this post


Link to post
Share on other sites

Apparently hideObjectGlobal doesn't work in the current 1.54 single player, but it does in the development branch.

So use hideObject instead.

Share this post


Link to post
Share on other sites

Remove all fallen trees in area

 
Note: fallen trees are not dead and do not trigger with !alive treeobject.
 
A simple solution to clear all fallen trees (damage == 1) in an area 500 units in example below - is to drop a logic down and on it's init put :
trees = nearestTerrainObjects [this, ["TREE". "SMALL TREE" "BUSH"], 500];  
Then run a trigger, cond = true
{if (damage _x ==1) then {hideobject _x}} foreach trees; 
To remove all trees in area 40 units in diameter near logic called logic1:
{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [logic1,["TREE", "SMALL TREE", "BUSH"],40]);
  • Like 3

Share this post


Link to post
Share on other sites

 

Remove all fallen trees in area

 
Note: fallen trees are not dead and do not trigger with !alive treeobject.
 
A simple solution to clear all fallen trees (damage == 1) in an area 500 units in example below - is to drop a logic down and on it's init put :
trees = nearestTerrainObjects [this, ["TREE". "SMALL TREE" "BUSH"], 500];  
Then run a trigger, cond = true
{if (damage _x ==1) then {hideobject _x}} foreach trees; 
To remove all trees in area 40 units in diameter near logic called logic1:
{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [logic1,["TREE", "SMALL TREE", "BUSH"],40]);

 

["TREE". "SMALL TREE" "BUSH"] <--- not a valid array

Share this post


Link to post
Share on other sites

hideObject is very tricky in MP, if that's your case, be sure to use hideObjectGlobal and only from the server.

Share this post


Link to post
Share on other sites

Yep sorry the array should read 

["TREE","SMALL TREE","BUSH"]
trees = nearestTerrainObjects [this, ["TREE","SMALL TREE","BUSH"], 500];  

 

Share this post


Link to post
Share on other sites

interesting point Larrow brought up in another thread:

if you want to find out a building classname for use in the object array

in the debug console you can type in a watch field:

typeOf cursorTarget;

thought this might be interesting while were on the line of removing terrain objects.

 

  • Like 3

Share this post


Link to post
Share on other sites

I wanted to remove foliage in a heavy forested area, but I also wanted to do it with more control than just a single logic, so I came up with a way to use area markers to visually identify areas I wanted to defoliate.  Since this thread helped a lot, I wanted to share back how I modified the idea. 

 

https://gist.github.com/coldnebo/ec1ff71a42fffa91def88e8aba2b66b2

 

Spoiler

/* 

  clearcut script to clear foliage from markers in Arma3 on Tanoa.

  1. place this script in a Game Logic init
  2. place one area marker (ELLIPSE/circle) named "cutter" and size it a=b in the EDEN editor
  3. copy that marker to create as many clean-cut areas as you want

  on startup, this script will automatically find any trees, small rocks fallen logs
  within those markers and hide them.

*/

// grab all cutter markers
cutters = [];
{ if (str(_x) find 'cutter' >= 0) then {cutters pushBack _x} else {}; } foreach allMapMarkers;

// collect all foliage terrain objects
hideTObjs = [];
{
  _pos = markerPos( _x );
  _size = markerSize( _x ) select 0;

  // these are the main classes of folliage
  { hideTObjs pushBack _x } foreach (nearestTerrainObjects [_pos,["TREE", "SMALL TREE", "BUSH"],_size]);
  
  // but there are some other model names (unclassified) that we should clean up too
  { if ((str(_x) find "fallen" >= 0) || 
  (str(_x) find "stump" >= 0) || 
  (str(_x) find "stone" >= 0)) then 
  { hideTObjs pushBack _x } else {}; } foreach (nearestTerrainObjects [_pos,[],_size]);
}
foreach cutters;

// good, now hide them all
{ _x hideObjectGlobal true } foreach hideTObjs;

// and remove the cutter markers from the map so that people in MP can't see them
{ deleteMarker _x } foreach cutters;

 

  • Like 3

Share this post


Link to post
Share on other sites
1 hour ago, coldnebo said:

I wanted to remove foliage in a heavy forested area, but I also wanted to do it with more control than just a single logic, so I came up with a way to use area markers to visually identify areas I wanted to defoliate.  Since this thread helped a lot, I wanted to share back how I modified the idea. 

 

https://gist.github.com/coldnebo/ec1ff71a42fffa91def88e8aba2b66b2

 

  Reveal hidden contents


/* 

  clearcut script to clear foliage from markers in Arma3 on Tanoa.

  1. place this script in a Game Logic init
  2. place one area marker (ELLIPSE/circle) named "cutter" and size it a=b in the EDEN editor
  3. copy that marker to create as many clean-cut areas as you want

  on startup, this script will automatically find any trees, small rocks fallen logs
  within those markers and hide them.

*/

// grab all cutter markers
cutters = [];
{ if (str(_x) find 'cutter' >= 0) then {cutters pushBack _x} else {}; } foreach allMapMarkers;

// collect all foliage terrain objects
hideTObjs = [];
{
  _pos = markerPos( _x );
  _size = markerSize( _x ) select 0;

  // these are the main classes of folliage
  { hideTObjs pushBack _x } foreach (nearestTerrainObjects [_pos,["TREE", "SMALL TREE", "BUSH"],_size]);
  
  // but there are some other model names (unclassified) that we should clean up too
  { if ((str(_x) find "fallen" >= 0) || 
  (str(_x) find "stump" >= 0) || 
  (str(_x) find "stone" >= 0)) then 
  { hideTObjs pushBack _x } else {}; } foreach (nearestTerrainObjects [_pos,[],_size]);
}
foreach cutters;

// good, now hide them all
{ _x hideObjectGlobal true } foreach hideTObjs;

// and remove the cutter markers from the map so that people in MP can't see them
{ deleteMarker _x } foreach cutters;

 

aye, yes. Very cool.

Share this post


Link to post
Share on other sites
On 2/8/2017 at 3:23 PM, coldnebo said:

I wanted to remove foliage in a heavy forested area, but I also wanted to do it with more control than just a single logic, so I came up with a way to use area markers to visually identify areas I wanted to defoliate.  Since this thread helped a lot, I wanted to share back how I modified the idea. 

 

https://gist.github.com/coldnebo/ec1ff71a42fffa91def88e8aba2b66b2

 

  Reveal hidden contents


/* 

  clearcut script to clear foliage from markers in Arma3 on Tanoa.

  1. place this script in a Game Logic init
  2. place one area marker (ELLIPSE/circle) named "cutter" and size it a=b in the EDEN editor
  3. copy that marker to create as many clean-cut areas as you want

  on startup, this script will automatically find any trees, small rocks fallen logs
  within those markers and hide them.

*/

// grab all cutter markers
cutters = [];
{ if (str(_x) find 'cutter' >= 0) then {cutters pushBack _x} else {}; } foreach allMapMarkers;

// collect all foliage terrain objects
hideTObjs = [];
{
  _pos = markerPos( _x );
  _size = markerSize( _x ) select 0;

  // these are the main classes of folliage
  { hideTObjs pushBack _x } foreach (nearestTerrainObjects [_pos,["TREE", "SMALL TREE", "BUSH"],_size]);
  
  // but there are some other model names (unclassified) that we should clean up too
  { if ((str(_x) find "fallen" >= 0) || 
  (str(_x) find "stump" >= 0) || 
  (str(_x) find "stone" >= 0)) then 
  { hideTObjs pushBack _x } else {}; } foreach (nearestTerrainObjects [_pos,[],_size]);
}
foreach cutters;

// good, now hide them all
{ _x hideObjectGlobal true } foreach hideTObjs;

// and remove the cutter markers from the map so that people in MP can't see them
{ deleteMarker _x } foreach cutters;

 

How do I use it, everytime I put it in a game logic it says "invalid number expression"

Share this post


Link to post
Share on other sites

Hello everyone I would like to remove the small wired fences in an Area. How could I know the kind of object it is or the category that I should write in the logic init.

 

The objects I want to remove are Land_wired_fence_4m_F, Land_wired_fence_4mD_F, Land_wired_fence_8m_F, Land_wired_fence_8mD_F.

 

Also I would like to remove the grass too.

Share this post


Link to post
Share on other sites

I can't seem to get the below code to work:

_trashDelete1="trashRemoval_1";
_trashobjectsdelete1=nearestObjects [(getMarkerPos _trashDelete1),["Land_GarbageWashingMachine_F","Land_GarbageBags_F","Land_Garbage_square3_F","Land_Garbage_line_F","Land_ToiletBox_F","Land_GarbageContainer_open_F","Land_GarbageContainer_closed_F"],(getmarkersize _trashDelete1)select 0];
{hideObjectGlobal _x} foreach _trashobjectsdelete1;

I've got an ellipse marker over the objects named "trashRemoval_1". I've tried both "nearestTerrainObjects" and "nearestObjects". Neither of them seem to work with the classnames I'm inputting. I've got the exact same script without the filter working perfectly for some markers out in a field where I don't need to filter due to buildings and whatnot that'll be removed.
 

On 2017-03-09 at 5:33 AM, tbowen98 said:

How do I use it, everytime I put it in a game logic it says "invalid number expression"

Did you place the ellipse markers and name them "cutter", "cutter_1", cutter_2", etc? That error sounds to me like the ">= 0" in the following section not getting the correct input:

// grab all cutter markers
cutters = [];
{ if (str(_x) find 'cutter' >= 0) then {cutters pushBack _x} else {}; } foreach allMapMarkers;

Edit:

On 2017-04-01 at 7:34 AM, esfumato said:

Hello everyone I would like to remove the small wired fences in an Area. How could I know the kind of object it is or the category that I should write in the logic init.

 

The objects I want to remove are Land_wired_fence_4m_F, Land_wired_fence_4mD_F, Land_wired_fence_8m_F, Land_wired_fence_8mD_F.

 

Also I would like to remove the grass too.

I don't know about the grass, but I think what you're looking for is simply "FENCE", assuming there's no other fences within range of the game logic that you want to keep.
See the wiki page for a list of object types: nearestTerrainObjects

Edited by Drift_91
Realized I knew the answer to esfumato's question.

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

×