Strange Problem With Code

Warraven

New Member
Reaction score
1
Hey everyone I have a map that I am making and it uses a code that makes it so when a hero dies it adds +1 to a variable. When that variable reaches the number of players in game (So if there were ten players in the game it would have to reach 10) it would revive all heros at a certain spot then make them invulnerable.

Variables:
Code:
Deadheros - Integer - 0 Default

Code(s):
1,
Code:
All Dead
    Events
    Conditions
        DeadHeros Equal to (Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))
    Actions
        Trigger - Turn off Alien Flying <gen>
        Trigger - Turn off Aliens <gen>
        Trigger - Turn off Aliens Boss 1 <gen>
        Trigger - Turn off Poisend <gen>
        Trigger - Turn off Virus Lord <gen>
        Unit Group - Pick every unit in DeadGroup and do (Actions)
            Loop - Actions
                Hero - Instantly revive (Picked unit) at (Random point in Save Area <gen>), Hide revival graphics
                Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 0.00 seconds

2,
Code:
Death Heros
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set DeadHeros = (DeadHeros + 1)
        Unit Group - Add (Dying unit) to DeadGroup
        Trigger - Run All Dead <gen> (checking conditions)

It just won't work, it adds +1 to the variable, because it says a message when it triggers. When we all die, it doesn't show a message which means it didn't happen.
 

vypur85

Hibernate
Reaction score
803
Code:
Death Heros
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Unit Group - Add (Dying unit) to DeadGroup
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
               (Number of units in DeadGroup) Equal to 10
            Then - Actions
               Unit Group - Pick every unit in DeadGroup and do (Actions)
                   Loop - Actions
                      Hero - Instantly revive (Picked unit) at (Random point in Save Area <gen>), Hide revival graphics
                      Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 0.00 seconds
                      Unit Group - Remove (Picked Unit) from DeadGroup
            Else - Actions

I think this simple trigger seems to suit what you need. Not sure if it's what you really want though.
 
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