• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Pick every unit type in region and

Status
Not open for further replies.
Level 2
Joined
Jul 29, 2011
Messages
9
Does such Action Trigger exist? I have been trying to figure this out for like an hour. There is a region, in that region there are 5 grunts and 5 footmen. Now, I am trying to find an Action to kill all the footmen in that region.

-I don't want to assign unitgroups
-I don't want to assign each footman into individual Actions

Thank you in advance.
 
You need to assign a unit group to prevent getting a memory leak (which can lead to lag).

It's simple:
  • Set group1 = (Units in (Playable map area))
  • Unit Group - Pick every unit in group1 and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Picked unit)) Equal to Footman
        • Then - Actions
          • Unit - Kill (Picked unit)
        • Else - Actions
  • Custom script: call DestroyGroup(udg_group1)
 
Level 21
Joined
Nov 4, 2013
Messages
2,016
Simple. Use Units In Region Matching Condition. The condition will be Unit-type comparison where you'll do this: Unit-type of (Matching unit) Equal to Footman. You should get this:

  • Unit Group - Pick every unit in (Units in (Your region) matching ((Unit-type of (Matching unit)) Equal to Footman)) and do (Unit - Kill (Picked unit))
That's all but this will leak so you will need to assign these units to a unit group so that you can destroy it eventually.

  • Set UnitGroup = Units in (Your region) matching (Unit-type of ((Matching unit)) Equal to Footman))
  • Unit Group - Pick every unit in UnitGroup and do (Unit - Kill (Picked unit))
  • Custom script: call DestroyGroup(udg_UnitGroup)
 
Level 2
Joined
Jul 29, 2011
Messages
9
Simple. Use Units In Region Matching Condition. The condition will be Unit-type comparison where you'll do this: Unit-type of (Matching unit) Equal to Footman. You should get this:

  • Unit Group - Pick every unit in (Units in (Your region) matching ((Unit-type of (Matching unit)) Equal to Footman)) and do (Unit - Kill (Picked unit))
That's all but this will leak so you will need to assign these units to a unit group so that you can destroy it eventually.

  • Set UnitGroup = Units in (Your region) matching (Unit-type of ((Matching unit)) Equal to Footman))
  • Unit Group - Pick every unit in UnitGroup and do (Unit - Kill (Picked unit))
  • Custom script: call DestroyGroup(udg_UnitGroup)

Oh, okay.

Thank you, guys.

TIL about memory leaks, and had to go through countless of cinematic triggers to remove them. Thanks!
 
Status
Not open for further replies.
Top