• 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] How can i make it flat number?

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,233
Hello everyone. I am trying to calculate 0.25x of Agility for the Hero. But i cannot make it Float number.

  • Set TempString = (String(((Agility of DamageEventSource (Include bonuses)) + ((Level of Heart of Anub'Arak // for DamageEventSource) x (Integer(0.25))))))
When i convert it into Integer, i cannot put point.
When i conver it into Real, i can put point but this time it not works.
How can i make it properly?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
It looks like you want to get 25%, 50%, 75%, etc. of the Agility based on ability level. I find breaking it up helps:
  • Set HeartAgility = (Real(Agility of DamageEventSource (Include bonuses))
  • Set HeartLevel = (Real(Level of Heart of Anub'Arak for DamageEventSource)
  • Set HeartMultiplier = (HeartLevel x 0.25)
  • Set HeartAgility = (HeartAgility x HeartMultiplier)
  • Set TempString = (String(HeartAgility))
Those Heart variables are all Reals. If you want to cut off the decimals in the String then you can convert HeartAgility to an Integer inside of TempString.
  • Set TempString = (String(Integer(HeartAgility)))
 
Last edited:
Level 18
Joined
Jun 2, 2009
Messages
1,233
It seems i have solved it like this. Thank you for your help dear Uncle.

  • Set TempReal = ((Real((Agility of DamageEventSource (Include bonuses)))) x (0.25 x (Real((Level of Heart of Anub'Arak // for DamageEventSource)))))
  • Set DamageEventAmount = (DamageEventAmount + TempReal)
  • Set TempString = (String((Integer(TempReal))))
  • Floating Text - Create floating text that reads (+ + TempString) above DamageEventTarget with Z offset 50.00, using font size 10.00, color (100.00%, 50.00%, 25.00%), and 0.00% transparency
 
Status
Not open for further replies.
Top