• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Boss Wipe

Status
Not open for further replies.
Level 3
Joined
Sep 1, 2011
Messages
25
Basicly I want the boss mechanics to reset when all the player units is wiped out from a region. This is the trigger I made but it doesn't seem to work:

  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
    • (SPIDER CAVE WIPE <gen> contains (Position of (Random unit from SpiderCavePlayer))) Equal to False
  • Actions
    • -------- TRIGGERS --------
    • Trigger - Turn on Second Wave <gen>
    • Trigger - Turn on Queen Engage <gen>
    • Trigger - Turn off Spider Event Small Adds <gen>
    • -------- UNITS --------
    • Unit - Remove ArachWarrior from the game
    • Unit - Remove ArachWorker from the game
    • Unit - Order The Queen 0067 <gen> to Stop
    • Unit - Move The Queen 0067 <gen> instantly to (Center of SPIDER QUEEN <gen>), facing 140.00 degrees
    • Game - Display to (All players) for 30.00 seconds the text: TRIGGER LOADED
I've tried many different events so I decided to let the game check SPIDER CAVE WIPE region if units from the unitgroup SpiderCavePlayer was there every second, but to no result.

The Queen is a unit that will slowly move after the player units, and the ArachWorker/Warrior are units that tries to slow the player units. So if the units die I want the adds to vanish, their triggers reset, and the Queen to teleport back to her original place.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
As an example, this checks whether there are alive heroes that are not owned by neutral hostile in the region.

  • Untitled Trigger 035
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Region 004 Copy <gen> matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Not equal to Neutral Hostile))))) Equal to 0
        • Then - Actions
          • -------- No alive heroes in the region --------
        • Else - Actions
 
Level 3
Joined
Sep 1, 2011
Messages
25
As it is now the adds spawn at the end of a tunnel which the player must reach in order to teleport away, but the adds come in the way and the Queen comes from behind, so if the player units die the adds will vanish and the periodic event spawning the adds will stop and the queen will return to her original place.
 
Level 3
Joined
Sep 1, 2011
Messages
25
I think I've fixed it now using this trigger:

  • Spider Cave Wipe
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SPIDER CAVE WIPE <gen> contains (Position of (Random unit from SpiderCavePlayer))) Equal to False
        • Then - Actions
          • Trigger - Turn off Spider Event Small Adds <gen>
          • Trigger - Turn on Second Wave <gen>
          • Trigger - Turn on Queen Engage <gen>
          • Unit Group - Pick every unit in ArachWorkers and do (Unit - Remove (Picked unit) from the game)
          • Unit - Order The Queen 0067 <gen> to Stop
          • Wait 0.50 seconds
          • Unit - Move The Queen 0067 <gen> instantly to (Center of SPIDER QUEEN <gen>), facing 140.00 degrees
          • Game - Display to (All players) for 30.00 seconds the text: TRIGGER ENABLED
        • Else - Actions
          • Do nothing
I took every add that spawned and put them all in a unit group. It seem to work cause every unit do vanish and the Queen is put back to her original place, but this isn't leak-free, right?
 
Status
Not open for further replies.
Top