Jump to content
A-SUICIDAL

Remove grass is a specific area?

Recommended Posts

Is it possible to remove grass within a specific area?

Like maybe within the radius of a trigger?

Share this post


Link to post
Share on other sites

Sounds like you're hitting the pipe again. Unless you were actually serious with that response.

I'm not looking to cut the grass, I just need to remove it within a specific small area.

Share this post


Link to post
Share on other sites

idk man go look at the modules, I wouldn't be suprised if there was some lawnmower module. Else, prof is kidding :rolleyes:

Share this post


Link to post
Share on other sites

It's called grasscutter. It was in Armed Assault and disappeared in Arma2, much to the annoyance of many. But it's made a come back in Arrowhead.

Classnames (in order of diminishing size)

ClutterCutter_EP1

ClutterCutter_small_EP1

ClutterCutter_small_2_EP1

Share this post


Link to post
Share on other sites
It's called grasscutter. It was in Armed Assault and disappeared in Arma2, much to the annoyance of many. But it's made a come back in Arrowhead.

Classnames (in order of diminishing size)

ClutterCutter_EP1

ClutterCutter_small_EP1

ClutterCutter_small_2_EP1

This. In French it's translated like lawn mower, which is funny.

Share this post


Link to post
Share on other sites

Thanks, I will try to spawn them at marker positions and see if it works.

Share this post


Link to post
Share on other sites

Here's a small one at the same pos as the flag pole

gRVcxRy.jpg

and here's a large one.

e7cbTfe.jpg

They are in empty>objects grasscutter

Share this post


Link to post
Share on other sites

Yeah, it works, but in order to clear the grass within the base, which is a 45x86 rectangle area, I would need to place about 100 markers and then spawn a ClutterCutter_EP1 at each marker position.

Where can I find the class names for the different types of grass?

at missions start:

grass_count = 0;

then run some kind of script like this:

while {grass_count < 1} do {

_object_grass = (getMarkerPos "respawn_west") nearObjects 150;
{if (_x isKindOf "GRASS_CLASSNAME") then {sleep 0.1; deletevehicle _x}} forEach _object_grass;};

grass_count = grass_count + 1;

Share this post


Link to post
Share on other sites

I believe it does. I've never had to do anything with grass aside from adjusting the terraingrid, so I'm not 100%. But I think the OA gras differs from A2 grass. And maybe even different classes of each too.

Share this post


Link to post
Share on other sites

Grass and plants don't have classnames. They have models, but not classnames.

Share this post


Link to post
Share on other sites

Perhaps something like this for a larger area, place an object top left and pass the sizes

//null=[objectname,86,45] execvm "cutter.sqf"

_start = getpos  (_this select 0);
_xpos = _this select 1;
_ypos = _this select  2;

for [{_xx = 0},{_xx < _xpos},{_xx = _xx + 10}] do {

for [{_yy = 0},{_yy < _ypos},{_yy = _yy + 10}] do {

veh = createVehicle ["ClutterCutter_EP1",[(_start select 0) +_xx,(_start select 1)+_yy,0],[], 0, "can_collide"];
};};

I'm not sure how you would do it if the base is on an angle though

Edited by F2k Sel

Share this post


Link to post
Share on other sites

I'll try it.

The base is very flat. When trying to spawn enough clutter cutters to cover my base, it took 153 of them. 9 collums by 17 rows, each clutter cutter is 1 grid square away from the next. At mission start the grass is removed. There is a nasty bit of lag while it removes the grass. It would be so much easier if there was a way to remove the grass within a trigger radius some how, without having to add a ton of ugly markers to my base. At least I made the markers 0.5 x 0.5 in size and colored them white named ng1 - ng167 (ng for "no grass").

Share this post


Link to post
Share on other sites

Slight improvement.

Place a trigger over the are you want to clear and name ie trig1

Then set the are much larger than what you neeed.

When the program runs it will only remove grass within the trigger circular, oval or rectangle

//null=[objectname,86,45,trig1] execvm "cutter.sqf"

_start = getpos  (_this select 0);
_xpos = _this select 1;
_ypos = _this select  2;
_trig = _this select 3;

for [{_xx = 0},{_xx < _xpos},{_xx = _xx + 10}] do {

for [{_yy = 0},{_yy < _ypos},{_yy = _yy + 10}] do {
_newpos = [(_start select 0) +_xx,(_start select 1)+_yy,0];	
if ( [_trig, _newpos] call BIS_fnc_inTrigger) then {
veh = createVehicle ["ClutterCutter_EP1",_newpos,[], 0, "can_collide"];
};};};

Edited by F2k Sel

Share this post


Link to post
Share on other sites

I tried the first script and it worked well. I used an invisible helipad as the object and placed it in the center of the base area. It worked, but it did not use the same direction that the invisible H was pointing in, which was 300 degrees.

I will try your second script now that uses a trigger.

---------- Post added at 06:19 PM ---------- Previous post was at 06:02 PM ----------

I placed a trigger 45 x 87 at an angle of 300 and named it "trig1".

I placed and invisible helipad named "Hcutter" in the center at an angle of 300 - right on top of the trigger.

In the init of the invisible helipad I put:

null=[Hcutter,45,87,trig1] execvm "cutter.sqf";

Then I used your script:

cutter.sqf:

_start = getpos  (_this select 0);
_xpos = _this select 1;
_ypos = _this select  2;
_trig = _this select 3;

for [{_xx = 0},{_xx < _xpos},{_xx = _xx + 10}] do {

   for [{_yy = 0},{_yy < _ypos},{_yy = _yy + 10}] do {
   _newpos = [(_start select 0) +_xx,(_start select 1)+_yy,0];    
   if ( [_trig, _newpos] call BIS_fnc_inTrigger) then {
   veh = createVehicle ["ClutterCutter_EP1",_newpos,[], 0, "can_collide"];
};};};

But it didn't work. I didn't see any change and I received no errors.

Share this post


Link to post
Share on other sites

I just copied the script back and it works, did you set the trigger name trig1 and not the text?

Share this post


Link to post
Share on other sites

...yes

axis a: 45

axis b: 87

angle: 300

shape: rectangle

trigger name: trig1

activation: none

condition: this

Invisible Helipad

name: Hcutter

init: null=[Hcutter,45,87,trig1] execvm "cutter.sqf"

---------- Post added at 06:51 PM ---------- Previous post was at 06:32 PM ----------

and I just added a functions module, still no luck. Anything else I might be missing?

Share this post


Link to post
Share on other sites

add this to the top of the script, maybe the function is running to soon.

waitUntil {not(isNil "BIS_fnc_init")};

Other than that I can't see anything wrong.

Share this post


Link to post
Share on other sites

waitUntil {not(isNil "BIS_fnc_init")};

worked!

but I still can't get it to use the correct angle of 300. It seems to want to face north 0 degrees.

---------- Post added at 07:10 PM ---------- Previous post was at 06:53 PM ----------

Like you mentioned earlier, I would need to make it much bigger to cover the area. I'll play around with it a bit and see if I can get it to at least cover the base area enough that it gets the job done. I very much appreciate the help you've offered me. Thanks F2K Sel :)

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

I just had the same problem when I moved location, it seems to depend where you place the start point. I'm finding bottom left is working well now, which may make sense as were adding the x and y positions to the start pos.

I find placing a flag pole in each corner of the trigger helps identify the area.

Share this post


Link to post
Share on other sites

Yeah, bottom left works great. I got it to remove all the grass at my base. Now my base doesn't look like it an abandoned outpost that has not be well maintained. This is a good script. Thanks again.

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

×