• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Solved] Uhm. Is anybody can help me with brackets and Math?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,193
Hello everyone. I am trying to make this ability and i have a serious problems with Math and Brackets. What am i missing in here?

Hero deals extra damage based on his Strength. 1.4/1.8/2.2/2.6x damage based on Strength.

  • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing ((Real((Strength of GDD_DamageSource (Include bonuses)))) + (1.00 + ((Real((Level of X for GDD_DamageSource))) x 0.40))) damage of attack type Normal and damage type Normal
Update: Ok it looks like i have solved the issue. I have changed first + with x...
 
Last edited:
Level 41
Joined
Feb 27, 2007
Messages
5,191
In the future if the grouping is really starting to make it difficult to follow, you can always create some variables and compute the value sequentially in a few lines. Efficiency doesn't matter here.
  • Set Dmg = (Real(Strength of GDD_DamageSource (Include Bonuses)))
  • Set Level = (Level of ... )
  • Set Scaling = (1.00 + (0.40 x Level))
  • Set Dmg = (Dmg x Scaling)
In this instance you could have used 1.40 + 0.4*(lvl - 1) as well. If there isn't an easy/simple relationship to get the values you want you can also use an array:
  • Set StrScaling[1] = 0.8
  • Set StrScaling[2] = 1.2
  • Set StrScaling[3] = 3.33
  • Set StrScaling[4] = 6.5
  • Set StrScaling[5] = 10.0
  • -------- then you do something like --------
  • Set Dmg = (Dmg x StrScaling[Level])
 
Status
Not open for further replies.
Top