Remove Trees Within Large Area? (solved)

Hello modders!

I am an old Battlefield 1942 modder (Swaffy’s Mod) who’s started diving deep into mission-making as I am a lover of PvE missions that can be played in Custom Battles. I want to make well-designed and immersive missions for players to enjoy with friends.

I have a blocker: Tree Removal.

Many times there are fields and roads which have tons of giant trees blocking your vision and I’d rather clear these areas to place buildings, sandbags, ammo crates, vehicles, etc. No one wants to play a mission just for trees to be in your face the whole time. It’s better to keep some trees off to the side for environment purposes, but not littering the primary play area.

I am currently aware of the ObjectGroup for removing some trees:
notreeobjectgroup
notreeobjectgroup10
notreeobjectgroup100
notreeobjectgroup25

… however these areas are way too small! And I need to clear a whole field so I can make a large main base of operation.

If someone can please let me know how I can do this, would be much appreciated. I’ve begun working with Triggers and Actions, is there a way to create an Area with a box and set that for tree removal?

Thanks in advance!
Lofi Z

yes, you can make copy of notreeobjectgroup and change its size there
it wont work in multiplayer though.

1 Like

SOLUTION (for now)
I found a possible solution, however I am unsure what objects are all covered under “destructible_rendinst” target type. I have a feeling anything else under this category will need to be spawned in after this runs, somehow.

Create a Trigger > name it something useful like “remove_trees”.
Add it to the top of everything so you can remove trees before everything else.

Events: initMission {}
Action: missionDestroyArea

  • target: Add all Areas you want to use for removing trees within those areas.
  • target type: destructible_rendinst

For example, I have three Areas of different shapes:
remove_trees_mainbase
remove_trees_mainroad01
remove_trees_mainroad02

After setting this up, all trees are removed upon loading the mission. However, I’m not able to test if this will delete any other objects due to the current crashing issues. Hopefully the CDK can be updated soon.

Screenshot:

Screenshot of CDK