• 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!

How to instantly kill specific spawned unit types?

Status
Not open for further replies.
Level 7
Joined
Mar 9, 2016
Messages
226
  • Raids end
    • Events
      • Time - Every 600.00 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Bandit (Spawn Event Melee)
          • (Unit-type of (Triggering unit)) Equal to Bandit (Spawn Event Range)
          • (Unit-type of (Triggering unit)) Equal to Bandit Warlord (Spawn Event)
    • Actions
      • Unit - Kill (Triggering unit)
The only action: "Unit -Kill"
How do i kill spawned units?
The unit isn't being triggers so i can't use "Triggering unit" and i can't select the unit because it hasn't been spawned yet.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
You can use "Unit - Remove <UNIT>" and it won't show death animations or leave a corpse.

The trigger you wrote doesn't make any logical sense. It runs off of a timer unit, and you are using conditions to check the unit-type of "triggering unit". There is no triggering unit. You will need to use a unit group:
  • Raids end
    • Events
      • Time - Every 600.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • -------- The above line automatically cleans up a the group leak from the line below this one --------
      • Unit Group - Pick every unit in Playable Map Area and do (actions)
        • Loop - Actions
          • Set YOUR_UNIT_VARIABLE = (Picked Unit)
          • If (all conditions are true) then do (then actions) else do (else actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of YOUR_UNIT_VARIABLE) Equal to Bandit (Spawn Event Melee)
                  • (Unit-type of YOUR_UNIT_VARIABLE) Equal to Bandit (Spawn Event Range)
                  • (Unit-type of YOUR_UNIT_VARIABLE) Equal to Bandit Warlord (Spawn Event)
            • Then - Actions
              • Unit - Kill YOUR_UNIT_VARIABLE
            • Else - Actions
 
Status
Not open for further replies.
Top