• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] DDS Probs

Status
Not open for further replies.
Level 22
Joined
Jul 25, 2009
Messages
3,091
Occasionally, when my DDS detects damage from AoE and this function runs, and it appropriately kills squad members once a certain hp threshold is reached for the leader, the leader dies but isn't replaced. Any ideas on why?

  • Removing Units
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (Point-value of (Unit-type of DamageEventTarget)) Greater than 0
      • GDamageBlockingActive[(Custom value of DamageEventTarget)] Equal to False
    • Actions
      • Set TempUnit = GLeader[(Custom value of DamageEventTarget)]
      • Set TempInteger = (Custom value of DamageEventTarget)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of GLeader[TempInteger]) Less than or equal to (GPercentage[TempInteger] x (GCurrentSquadSize[TempInteger] - 1.00))
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DamageEventTarget Equal to GLeader[TempInteger]
            • Then - Actions
              • Set TempGroup2 = (Units in (Playable map area) matching ((TempInteger Equal to (Custom value of (Matching unit))) and ((((Matching unit) is dead) Equal to False) and (TempUnit Not equal to (Matching unit)))))
              • Set TempUnit2 = (Random unit from TempGroup2)
              • Unit - Set life of TempUnit2 to (Life of DamageEventTarget)
              • Unit - Cause DamageEventSource to damage DamageEventTarget, dealing 111111.00 damage of attack type Normal and damage type Normal
              • Unit - Replace TempUnit2 with a (Unit-type of GLeader[TempInteger]) using The old unit's life and mana
              • Set GLeader[TempInteger] = (Last replaced unit)
              • Unit - Set the custom value of GLeader[TempInteger] to TempInteger
              • Unit - Change color of GLeader[TempInteger] to (Color of (Owner of GLeader[TempInteger]))
              • Set GCurrentSquadSize[TempInteger] = (GCurrentSquadSize[TempInteger] - 1.00)
              • Unit - Add LeaderAttachment[(Player number of (Owner of (Last replaced unit)))] to (Last replaced unit)
            • Else - Actions
              • Unit - Cause DamageEventSource to damage DamageEventTarget, dealing 111111.00 damage of attack type Normal and damage type Normal
              • Set GCurrentSquadSize[TempInteger] = (GCurrentSquadSize[TempInteger] - 1.00)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DamageEventTarget Equal to GLeader[TempInteger]
              • DamageEventAmount Less than 99999.00
            • Then - Actions
            • Else - Actions
              • Unit - Set life of TempUnit to ((Life of TempUnit) - DamageEventAmount)
              • Unit - Set life of DamageEventTarget to 100.00%
Edit: This results in leaderless squads just standing around.
 
Status
Not open for further replies.
Top