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

[Trigger] Floating text without decimals

Status
Not open for further replies.
Level 17
Joined
Jan 21, 2007
Messages
2,014
Hi again :grin:

I've been working alot on my map lately, but i got a small problem with one of my triggered spells. It damages enemies around the hero by his current mana. The spell works properly, but since it is such a random damage spell i wanted to create a floating text telling how much it damaged. And here is my problem, how do i make the floating text without decimals?
 
Level 6
Joined
Feb 12, 2008
Messages
207
so it shows like "145.536" in the floating text right? what you should do is this to remove the decimals:

  • Untitled Trigger 002
    • Events
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (String((Integer(DAMAGE DONE BY SPELL)))) at (Center of (Target point of ability being cast)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
ok as you can see... in the floating text message i used: Convert Integer To String > Conversion - Convert Real To Integer > Variable responding to damage done by spell

that way you truncate the REAL number (example: 1440.125) to an INTEGER number (1440)

hope i helped you :)
 
Level 6
Joined
Feb 12, 2008
Messages
207
next time wont be bad some rep... not just for me... for everyone that helps ya :)

at your service :)
 
Last edited:
Status
Not open for further replies.
Top