• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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,276
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:
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.
Back
Top