Removing Units When All Heroes Dead

Aaronx

New Member
Reaction score
6
Here's my trigger:

Code:
RemoveLeftover
    Events
        Unit - A unit Dies
    Conditions
        (Coliseum Arena <gen> contains (Dying unit)) Equal to True
        ((Dying unit) is A Hero) Equal to True
        ((Number of units in (Units in Coliseum Arena <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 1) and (((Owner of (Matching unit)) controller) Equal to User)
    Actions
        Wait 12.00 seconds
        Game - Display to (Player group((Owner of (Entering unit)))) for 6.00 seconds the text: |cff32cd32It seems ...
        Trigger - Run Remove Left <gen> (checking conditions)

Code:
Remove Left
    Events
    Conditions
        ((Number of units in (Units in Coliseum Arena <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 0) and (((Owner of (Matching unit)) controller) Equal to User)
    Actions
        Unit Group - Pick every unit in (Units in Coliseum Arena <gen> owned by Player 11 (Dark Green)) and do (Unit - Remove (Picked unit) from the game)
        Unit Group - Pick every unit in (Units in Region 320 <gen> owned by Player 11 (Dark Green)) and do (Unit - Remove (Picked unit) from the game)
        Game - Display to (Player group((Owner of (Entering unit)))) for 6.00 seconds the text: |cff32cd32It seems ...

The idea is that when all Heroes die inside of a region, it waits 12 seconds ( giving time for someone to run in and cancel the trigger ) then removes the Enemies that are inside.

I added the game messages to check where it messed up, and I see neither of them.

I've already tried to adjust the integer in trigger one from 1 to 0 and back so that's not it.
Any ideas?
 

Shura

New Member
Reaction score
45
When checking if the owner of the hero is a user, you need to use dying unit, not matching unit.
 

Nherwyziant

Be better than you were yesterday :D
Reaction score
96
in your first trig, you have this condi

Trigger:
  • ((Number of units in (Units in Coliseum Arena &lt;gen&gt; matching (((Matching unit) is A Hero) Equal to True))) Equal to &gt;&gt;&gt;1&lt;&lt;&lt;) and (((Owner of (Matching unit)) controller) Equal to User)


So I know and you know that this means when only 1 hero left in the arena.

in your second trigger you have this condi

Trigger:
  • ((Number of units in (Units in Coliseum Arena &lt;gen&gt; matching (((Matching unit) is A Hero) Equal to True))) Equal to &gt;&gt;&gt;0&lt;&lt;&lt;) and (((Owner of (Matching unit)) controller) Equal to User)


This means if you have no hero left, but you hero is still on the arena, that's why. So set it to one
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top