If you fail at a boss [Every Hero in Region is gone] Then Reset.

Ulla_t

Member
Reaction score
1
I have the whole reset trigger set up, but, how do i create a reseting effect; [When every Hero in region is gone/Dead] - DO THIS.
Thanks!
 

Marsmallos

Member
Reaction score
17
This is how I do it. You will need three triggers.

1) A trigger that detects when a unit enters a "tripwire" region that starts the boss fight, or similar. You could also make this trigger run when a hero enters the boss fight area like I've done below:

Trigger:
  • Boss Fail Detection Start
    • Events
      • Unit - A unit enters Boss fight area <gen>
    • Conditions
      • ((Triggering unit) belongs to an enemy of <Owner of the boss unit> Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Countdown Timer - Start BossFailTimer as a Repeating timer that will expire in 2.00 seconds


^This trigger as you can see simply starts a repeating countdown timer when a unit enters the boss fight area. We will refer to this timer in the second trigger.

2) A second trigger that checks if there still are any heroes left in the boss fight area

Trigger:
  • Boss Fail
    • Events
      • Time - BossFailTimer expires
    • Conditions
    • Actions
      • Set TempUnitGroup1 = (Units in Boss fight area <gen> matching (((Matching unit) belongs to an enemy of <Owner of the boss unit> Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempUnitGroup1) Equal to 0
        • Then - Actions
          • Countdown Timer - Pause BossFailTimer
          • Trigger - Turn on Boss Fail Detection Start <gen>
          • ----Do all the other stuff you want to do when you reset the fight----
      • Custom script: call DestroyGroup(udg_TempUnitGroup1)


^This trigger periodically puts all units in the boss fight area that are enemies to the boss (i e player units) into a unit group variable and checks if there are any units in the group. If there aren't, it means all units fighting the boss have died (or fled ;)) and that the fight should be reset.

3) A third trigger that pauses the timer when the boss is killed so we accidentally don't reset the fight again when the victorious heroes leave the area:

Trigger:
  • Boss Win
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to YourBossVariable (or you could do a "unit-type of triggering unit equal to <Boss unit>" here)
    • Actions
      • Trigger - Turn off (This trigger)
      • Countdown Timer - Pause BossFailTimer
    • ---Do other stuff that happens when the boss dies here---
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top