Jump to content
Sign in to follow this  
BLSmith2112

How to flatten a forest?

Recommended Posts

I want to make a mission that allows players to easily take off with a c130 on the northern airstrip. However, there are a few trees blocking the few extra feet needed for clearance off the cliff to the west.

I would like to ether have AI set satchel charges, have artillery, or have some kind of script that blows down the area so all the trees are flattened. I don't know anything about scripting ether... :(

Could someone point me in the right direction as to where I can begin figuring out how to solve my little problem?

Thanks :)

Share this post


Link to post
Share on other sites

If the trees of object IDs then you can use setDammage. If not, then that's a very good question (I've always wondered about this myself, but I'm sure someone else has brought it up before, did you search?).

Share this post


Link to post
Share on other sites

Yea I tried searching a bit and didn't come up with anything - however, I didn't know about object ID's. I'll try that now.

ObjectNumber setDamage 1.0

Edit: I tried making a trigger and in the activation field I put something along the lines of (example): 16749 setDamage 1.0 and I got the error: "Type number, Expected Object". Also, trees in forests don't have object numbers - so I guess they can't be flattened. Is there a script out there that just creates a large amount of explosions? So I could simply place a trigger and a small patch of 100x100m forest is flattened?

Edited by Victor

Share this post


Link to post
Share on other sites

Spawn about 50 LGBs :D

Share this post


Link to post
Share on other sites

Well you can use this, but you will see the trees fall down when you start the mission:

Create a game logic and place this in the initialization field:

(position this nearestObject 195917) setDammage 1 

where 195917 the object number is of the tree you want to let fall down

Share this post


Link to post
Share on other sites
The Itch;1369248']Well you can use this' date=' but you will see the trees fall down when you start the mission:

Create a game logic and place this in the initialization field:

(position this nearestObject 195917) setDammage 1 

where 195917 the object number is of the tree you want to let fall down[/quote']

Trees dont have ID numbers... read above.

Share this post


Link to post
Share on other sites

Wrapping this around individual trees:

(position this nearestObject 195917) setDammage 1

Works, I did that on about 150 trees... got real annoying:

(position this nearestObject 195917) setDammage 1
(position this nearestObject 195937) setDammage 1
(position this nearestObject 193447) setDammage 1
(position this nearestObject 1323917) setDammage 1
(position this nearestObject 187517) setDammage 1

X150+ lol

Now for thick patches of forests, those don't have numbers. Having the ability to blow those trees down would be nice. The suggestion to drop an LGB on them sounds like a great idea. The problem is I know nothing of scripting and the last thread I read was talking about how it'll take 10 years of learning how to learn programming and scripting... fuck that. I did a search through the forums, I found "dropping LGB's from a plane" and other similar questions that spanned 1 page.. not simply blowing up a bomb automatically from the start of the mission... Those threads all dealt with complicated scripting method commands that make absolutely no sense to a beginner.

I'll just drop this question... OFPEC used to have a bomb script but they deleted it for some reason. Editing isn't any fun... :(

Edited by Victor

Share this post


Link to post
Share on other sites

This works quite well and used with a bomb looks even better but not needs for tree felling.

gclear.sqf

// Detroy it all trees
// place a game logic where you want to destroy the trees and pass gamelogic name and the radius of detruction.
// nul=[location,radius] execVM"gclear.sqf"
_location = _this select 0;
_radius   = _this select 1;

_what = (nearestObjects [_location,[],_radius]) - ((getPos _location) nearObjects _radius);
sleep 1.5;
{_x setdammage (1.0)} forEach _what; 

Or remove them XXXX WARNING ONLY use the next one if you want them removed until you restart the game or load another map XXXX

gclean.sqf

// Remove it all trees
// place a game logic where you want to remove the trees and pass gamelogic name and the radius of removal.
// nul=[location,radius] execVM"gclean.sqf"
_location = _this select 0;
_radius   = _this select 1;

_what = (nearestObjects [_location,[],_radius]) - ((getPos _location) nearObjects _radius);
sleep 1.5;
{deletecollection _x} forEach _what;

These codes will remove or flatten fences and a few other objects maybe.

Edited by F2k Sel

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  

×