• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Remove "units from region X" from the game?

Status
Not open for further replies.
Level 4
Joined
Aug 26, 2015
Messages
71
I can't find the way to do that. I've tried to use: Unit - Remove but it can only remove a certain unit, and unit group - remove only removes an unit group. How can i remove units on a X region from the game?
 
Level 11
Joined
Jun 2, 2013
Messages
613
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set YourGroup = (Units in RegionX <gen>)
      • Unit Group - Pick every unit in YourGroup and do (Unit - Remove (Picked unit) from the game)
      • Custom script: call DestroyGroup(udg_YourGroup)
To clarify,

YourGroup is a UnitGroup Variable.
You then set that UnitGroup variable to 'Units in a RegionX'.
Use the Unit Group action to pick every unit in YourGroup (the Variable you just set) and then remove picked unit from the game.
Since you set YourGroup to units in RegionX, it will remove any unit in RegionX from the game.
Then you use the custom script to destroy the group to clear the memory leak.

Easy Peasy ;)
 
Status
Not open for further replies.
Top