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

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

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,233
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 45
Joined
Feb 27, 2007
Messages
5,578
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