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

[Solved] Calculating percentage of Damage Dealt

Level 12
Joined
May 7, 2008
Messages
342
Greetings.

I'm trying to color damage which I'm using from Bribe's System in his variable called DamageEventAmount.

The damage would be stored in my own variable called Stored_Damage which then I could reference when needed.


Example:

20% of Damage Dealt out of 100% (Stored_Damage) - Green Text
50% of Damage Dealt out of 100% (Stored_Damage) - Orange Text
100% of Damage Dealt out of 100% (Stored_Damage) - Red Text

In conclusion, how can I count a percentage of DamageEventAmount, which is a Real type value?


Solution found, and it's this:

FP_Damage_Stored = Stored Damage
FP_Damage_Limit = an array that has precise values, such as 100, 150, 200, 250, 300, etc

  • FP_Damage_Stored Less than or equal to (FP_Damage_Limit[FP_Level] x 0.25)
 
Last edited:
Level 12
Joined
May 7, 2008
Messages
342
I am not sure what you want to do. Count what as a percentage of DamageEventAmount? A percentage is just (some number / total ) * 100.0. Percentages are usually reals.

Yeah It took me a while to brainstorm that.

I was planning to calculate how much 25% is of my Stored Real Damage that I've set in my variable.
I've found the solution thought, it was the trigger down below:

  • FP_Damage_Stored Greater than or equal to (FP_Damage_Limit[FP_Level] x 0.25)
Status: Solved!
 
Last edited:
Top