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

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 39
Joined
Feb 27, 2007
Messages
4,994
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