Last active
March 24, 2020 11:09
-
-
Save coldnebo/ec1ff71a42fffa91def88e8aba2b66b2 to your computer and use it in GitHub Desktop.
clearcut script to clear foliage from markers in Arma3 on Tanoa.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote this after reading the discussion on https://forums.bistudio.com/topic/187204-removing-bushes-and-trees/