• 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.

[General] Overall damage and unit's damage aren't the same lol

Status
Not open for further replies.
I changed the lumber panel to show overall damage done. An I have leaderboard where also the damage shows. But in the lumber panel the numbers become way bigger The normal damage is like 1-2-3k while the damage in lumber bar is like 30k+. Why? Where I am wrong here:
  • damage detect
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (target has buff Power Word: Shield ) Equal to False
              • (target has buff Frost Armor) Equal to False
              • (target has buff Fel Armor ) Equal to False
        • Then - Actions
          • Set DAMAGE_DONE[(Player number of (Owner of source))] = (DAMAGE_DONE[(Player number of (Owner of source))] + (Integer(amount)))
          • Set DAMAGE_DONE_OVERALL[(Player number of (Owner of source))] = (DAMAGE_DONE_OVERALL[(Player number of (Owner of source))] + DAMAGE_DONE[(Player number of (Owner of source))])
          • Leaderboard - Change the value for Players[(Player number of (Owner of source))] in Leaderboard to DAMAGE_DONE[(Player number of (Owner of source))]
          • Player - Set (Owner of source) Current lumber to (((Owner of source) Current lumber) + DAMAGE_DONE_OVERALL[(Player number of (Owner of source))])
          • Leaderboard - Sort Leaderboard by Value in Descending order
        • Else - Actions

btw I use DDS
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Let's add numbers instead of the variables, ok?
Say you deal 20, then 30 and then 35 damage.
Your calculations are: DAMAGE_DONE = DAMAGE_DONE + amount
DAMAGE_OVERALL = DAMAGE_OVERALL + DAMAGE_DONE

For 20 damage:
Damage_done = 0 + 20 => 20
Damage_overall = 0 + 20 => 20

For 30 damage:
Damage_done = 20 + 30 => 50
Damage_overall = 20 + 50 => 80

For 35 damage:
Damage_done = 50 + 35 => 85
Damage_overall = 80 + 85 => 165

Do you see the problem now?
Also, I don't know if that is the intention or not, but the trigger fires when unit doesn't have only one of the specified buffs - in other words, the unit can have 2 of the specified buffs (but not 3!) and the trigger will still fire.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Wait, you have now:
Damage_done = damage_done + amount
Damage_overall = damage_overall + amount
and the results are different? If those actions are placed one after another, like in the trigger you showed, then there should be no difference.
Try displaying those values via game messages. Maybe you're expecting something else, or some other calculation is incorrect, but the values in both variables are same.
 
They are displayed the same

I don't think I have other triggers except this.
  • damage detect
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (target has buff Power Word: Shield ) Equal to False
              • (target has buff Frost Armor) Equal to False
              • (target has buff Fel Armor ) Equal to False
        • Then - Actions
          • Set DAMAGE_DONE[(Player number of (Owner of source))] = (DAMAGE_DONE[(Player number of (Owner of source))] + (Integer(amount)))
          • Set DAMAGE_DONE_OVERALL[(Player number of (Owner of source))] = (DAMAGE_DONE_OVERALL[(Player number of (Owner of source))] + (Integer(amount)))
          • Leaderboard - Change the value for Players[(Player number of (Owner of source))] in Leaderboard to DAMAGE_DONE[(Player number of (Owner of source))]
          • Player - Set (Owner of source) Current lumber to (((Owner of source) Current lumber) + DAMAGE_DONE_OVERALL[(Player number of (Owner of source))])
          • Leaderboard - Sort Leaderboard by Value in Descending order
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of source) Equal to Player 1 (Red)
            • Then - Actions
              • Game - Display to (All players) for 10.00 seconds the text: (String(DAMAGE_DONE[(Player number of (Owner of source))]))
              • Game - Display to (All players) for 10.00 seconds the text: (String(DAMAGE_DONE_OVERALL[(Player number of (Owner of source))]))
            • Else - Actions
        • Else - Actions
but i better check...
 
Status
Not open for further replies.
Top