Need help modifying trigger

Firezy

New Member
Reaction score
14
This is the trigger I'm using for one of my dungeons in my RPG map

It's basically if a unit enters the exit region and no one else is in the dungeon then it resets the dungeon
Trigger:
  • Reset
    • Events
      • Unit - A unit leaves GauntletArea <gen>
    • Conditions
      • ((Units in GauntletArea <gen> matching (((Matching unit) belongs to an enemy of p_hostilecreep) Equal to True)) is empty) Equal to True
    • Actions
      • Set ug_gauntlet1 = (Units in GauntletArea <gen> matching (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True))
      • Unit Group - Pick every unit in ug_gauntlet1 and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Destructible - Close Flow Gate (Vertical) 0317 <gen>
      • Destructible - Close Flow Gate (Vertical) 0318 <gen>
      • Set b_gauntlet = False
      • Trigger - Turn on Send <gen>
      • Custom script: call DestroyGroup (udg_ug_gauntlet1)


However it doesn't work when a hero does, thus the dungeon becomes closed forever and won't reset.

So how do I modify it so that when a unit dies and the unit is a player hero, and there is no longer any player controlled units in the area that the dungeon will reset?
 

Tom Jones

N/A
Reaction score
437
Triggers can have more than one event, so just add the event a unit dies to the trigger. Alternatively you could create a triggger with the event a unit dies, check if it's a hero, and then run your current trigger checking for conditions.
 

Firezy

New Member
Reaction score
14
so something like

blah
event
a unit dies
condition
dying unit equal to hero & enemy of neutral hostile
action
run initialtrigger ignoring conditions
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
No, just add the event 'A unit dies' to the first trigger. No need to make a second one.

You might want to add a condition 'Matching unit is alive' to the unit groups, however, because otherwise it won't work properly.
 
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