• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

I need help with a dungeon reset after dying

Status
Not open for further replies.

CoreySheep

C

CoreySheep

Hello!

So I have the dungeon set up and what not, and the reset when the boss dies.. But i need a trigger for when every player dies and they haven't finished the dungeon.. But I have no idea what trigger to use.. if someone could help me that would be amazing!


*the trigger would also need to remove the remaining units in the dungeon and replace them or just add new ones and keep the remaining ones.**


Thanks,

Corey
 
Put all players playing (Player Group) into a variable.
In your 'Unit dies'-trigger, subtract one player per player-death (condition might be like: Owner of Triggering Unit equal to Player 1 and so on) and additionally check if the number of players in the group equals 0.
If it does, do the reset.

This too works for units as you can count the active player units on the map by say,
Player 1 plays -> put hero into the variable
Player 2 plays -> put hero into the variable
etc...
and later, you check for the amount of units left in the group.
If you want to remove the remaining units, just pick all of them by setting a variable, pick the units in the unit group variable and remove them.
Replacing works similarily but a little more complicated if you want to preserve the spawning points of those units (that'd mean you should put each enemy unit into a variable (array maybe?) and get the initial position from there).

Hope that helps~
 
Status
Not open for further replies.
Back
Top