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

A revive system gone wrong

Status
Not open for further replies.
Level 3
Joined
Jun 7, 2011
Messages
59
Long story short, i made a hero revive trigger, and made sure it's MUI. However, in testing, it turned out to loose the later respawns if there are more than one person currently respawning. These are my latest ones, and I really can't find what's wrong with them.

  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set ST_Respawn_Count = (ST_Respawn_Count + 1)
      • Set ST_Respawn_Skip = (ST_Respawn_Skip + 1)
      • Set ST_Respawn_Unit[ST_Respawn_Count] = (Dying unit)
      • Set ST_Respawn_Timer[ST_Respawn_Count] = (6.25 x (1.25 x (Real((Hero level of ST_Respawn_Unit[ST_Respawn_Count])))))
      • Set ST_Respawn_Off[ST_Respawn_Count] = True
      • Trigger - Turn on The Timer Part <gen>
  • The Timer Part
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ST_Respawn) from 1 to ST_Respawn_Count, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ST_Respawn_Off[ST_Respawn] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ST_Respawn_Timer[ST_Respawn] Less than or equal to 0.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (ST_Respawn_Unit[ST_Respawn] belongs to an ally of Player 1 (Red)) Equal to True
                    • Then - Actions
                      • Hero - Instantly revive ST_Respawn_Unit[ST_Respawn] at (Center of Left Spawn <gen>), Show revival graphics
                      • Set ST_Respawn_Skip = (ST_Respawn_Skip - 1)
                      • Set ST_Respawn_Off[ST_Respawn] = False
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ST_Respawn_Skip Less than or equal to 0
                        • Then - Actions
                          • Set ST_Respawn_Count = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                      • Hero - Instantly revive ST_Respawn_Unit[ST_Respawn] at (Center of Right Spawn <gen>), Show revival graphics
                      • Set ST_Respawn_Skip = (ST_Respawn_Skip - 1)
                      • Set ST_Respawn_Off[ST_Respawn] = False
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ST_Respawn_Skip Less than or equal to 0
                        • Then - Actions
                          • Set ST_Respawn_Count = 0
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                • Else - Actions
                  • Set ST_Respawn_Timer[ST_Respawn] = (ST_Respawn_Timer[ST_Respawn] - 0.10)
            • Else - Actions
 
Status
Not open for further replies.
Top