• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[Script] Floating text info on large damage from any source.

Status
Not open for further replies.
Level 8
Joined
Dec 9, 2005
Messages
523
So basically what I need is a script which will provide a fading text over a unit when/each time it receives damage greater than xxx.

When I said a unit I meant every unit. So each time any and all units receive damage from any source greater than, say, 500, there is a floating text which says the damage received. Example:
1. A hero casts a spell on another hero, which damages it for 528. A floating text saying "528" appears over the victim.
2. A unit attacks another, and gets critical strike dealing 650 damage. A floating text saying "650" apears.
3. A hero casts an AOE damage spell, causing 700 damage to units in the AOE. Every unit receiving the damage has a "700" over its head.

Before anyone even consider doing this, please know that for some reason I can't up to this day make Jassnewpack to ever work on my computer. It always freezes. So keep that in mind should you decide to consider this.

This could be simple or complicated, I don't know honestly thats why I'm requesting it :)
Thanks.
 
Level 10
Joined
Jul 12, 2009
Messages
318
First, you need to detect damage. You can either roll your own in GUI (give the forums a search; there have been many threads on this) or you could use a system. I'm biased, but I like my own GUI-Friendly Damage Detection which takes care of all the setup for you (and does not require JassHelper/JNGP.) :csmile:

If you decide to use it, the trigger would be like this:
  • Large Damage Display
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • GDD_Damage Greater than or equal to 500.00
    • Actions
      • Floating Text - Create floating text that reads (String((Integer(GDD_Damage)))) above GDD_DamagedUnit with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
 
Level 4
Joined
Feb 1, 2011
Messages
71
its imppasiple to make like WoW dmg? like i hit enemy and in the middle screen shows how much i hit. Somethinkg like skil Critical Strike
 
Level 8
Joined
Dec 9, 2005
Messages
523
Script works great, perfectly. However I've only tried it as a single player, I hope and assume it works just as fine when there are numerous damage dealers and damage receivers, right?

Anyway, so far it detects both damage received from spells and attacks, and even damage received from returned damage (from spiky skin) which is fantastic. It's also easily customised, I changed the info a few times (the best is to convert real to integer to text so you wont get the decimals) and its always smooth.

Thanks, Weep. This is great.
 
Status
Not open for further replies.
Top