• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Floating text without decimals

Status
Not open for further replies.
Level 17
Joined
Jan 21, 2007
Messages
2,013
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