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

[Trigger] MUI unit removal problem

Status
Not open for further replies.
Level 4
Joined
Jun 12, 2009
Messages
57
I am trying to make a MUI unit removal system. Here's the basics, 4 units will spawn after a unit kills a creep. I want these units to live for 2 seconds then get removed. Problem is, I can't get this to work at multiple times, sometimes the units just won't get destroyed. I attempted at using a timer, but it doesn't seem to want to work.

BTW: Blue, green, red, and purple are the names of the four units i am creating.
Excuse the Jass it's for removing leaks.



Here's the trigger

  • Events
    • Unit - A unit Dies
    • Conditions
    • Actions
      • Set killingunitposition = (Position of (Killing unit))
      • Unit - Create 1 Blue fireworks for Neutral Passive at killingunitposition facing Default building facing degrees
      • Set blue = (Last created unit)
      • Unit - Create 1 Green fireworks for Neutral Passive at killingunitposition facing Default building facing degrees
      • Set green = (Last created unit)
      • Unit - Create 1 Purple fireworks for Neutral Passive at killingunitposition facing Default building facing degrees
      • Set purple = (Last created unit)
      • Unit - Create 1 Red fireworks for Neutral Passive at killingunitposition facing Default building facing degrees
      • Set red = (Last created unit)
      • Unit Group - Add blue to fireworks
      • Unit Group - Add green to fireworks
      • Unit Group - Add red to fireworks
      • Unit Group - Add purple to fireworks
      • Unit Group - Remove all units from fireworks
      • Countdown Timer - Start gametime[(Player number of (Owner of (Killing unit)))] as a One-shot timer that will expire in 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for gametime[(Player number of (Owner of (Killing unit)))]) Less than or equal to 0.20
        • Then - Actions
          • Unit Group - Pick every unit in fireworks and do (Unit - Remove green from the game)
          • Unit Group - Pick every unit in fireworks and do (Unit - Remove red from the game)
          • Unit Group - Pick every unit in fireworks and do (Unit - Remove purple from the game)
          • Unit Group - Pick every unit in fireworks and do (Unit - Remove blue from the game)
          • Custom script: call RemoveLocation(udg_killingunitposition)
        • Else - Actions
          • Wait until ((Remaining time for gametime[(Player number of (Owner of (Killing unit)))]) Less than or equal to 0.20), checking every 0.10 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for gametime[(Player number of (Owner of (Killing unit)))]) Less than or equal to 0.20
            • Then - Actions
              • Unit Group - Pick every unit in fireworks and do (Unit - Remove green from the game)
              • Unit Group - Pick every unit in fireworks and do (Unit - Remove red from the game)
              • Unit Group - Pick every unit in fireworks and do (Unit - Remove purple from the game)
              • Unit Group - Pick every unit in fireworks and do (Unit - Remove blue from the game)
              • Custom script: call RemoveLocation(udg_killingunitposition)
            • Else - Actions
 
Status
Not open for further replies.
Top