• 🏆 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!

I need help with a dungeon reset after dying

Status
Not open for further replies.
Level 1
Joined
Jul 8, 2015
Messages
1
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
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
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.
Top