• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Floating Text

Status
Not open for further replies.
Level 14
Joined
Aug 31, 2009
Messages
775
Here's a nice simple method.
  • CastName
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempPoint = Position of (Triggering Unit)
      • Floating Text - Create floating text that reads (Name of (Ability being cast)) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 120.00 towards (90.00) degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.01 seconds
      • Custom Script: call RemoveLocation(udg_TempPoint)
 
Last edited:
Level 14
Joined
Aug 31, 2009
Messages
775
Which funnily enough, is exactly how I would normally do it.

I'd also do it via Remote Triggers, so as to cut down on the space/size of each trigger. I was just keeping it nice and simple for this example.

Below is how I have done it in the past:

This is a simple spell which gives the caster (The Deeplord) a buff, which when it is active gives attackers a chance to heal the Deeplord.
  • Tidal Shield Heal
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Tidal Shield ) Equal to True
      • (Unit-type of (Attacking unit)) Not equal to Ball Lightning
      • (Unit-type of (Attacking unit)) Not equal to Universal Dummy Unit
    • Actions
      • Set TempInt = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Less than or equal to ((Level of Tidal Shield for Deeplord) x 10)
        • Then - Actions
          • Unit - Set life of Deeplord to ((Life of Deeplord) + ((Max life of Deeplord) / 40.00))
          • Floating Text - Create floating text that reads (+ + (PlayerColourCode[(Player number of (Owner of Deeplord))] + (String((Integer(((Max life of Deeplord) / 40.00))))))) at (Position of Deeplord) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set TempFloatText = (Last created floating text)
          • Trigger - Run Global Text Removal <gen> (ignoring conditions)
        • Else - Actions
          • Do nothing
Which is then followed by
  • Global Text Removal
    • Events
    • Conditions
    • Actions
      • Floating Text - Set the velocity of TempFloatText to 120.00 towards (Random angle) degrees
      • Floating Text - Change TempFloatText: Disable permanence
      • Floating Text - Change the lifespan of TempFloatText to 2.00 seconds
      • Floating Text - Change the fading age of TempFloatText to 0.01 seconds
So yeah, I'd use a more complicated method, but I was keeping it simple for the OP.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Do nothing
Remove this.

  • Set TempInt = (Random integer number between 1 and 100)
This is not needed, but its not a mistake.

  • (Position of Deeplord)
Leaks, you can attach the floating text above the unit.

The second trigger can be merged with the first one, clearing the space.

Default settings of floating text is (I think they are the best ones if you going to make floating texts appear too much):
Velocity: 64-90 degrees
Permenance: disabled
Lifespan: 5 seconds
Fading Age: 1 second
Thats the Warcraft 3 default settings, like in the Evasion ability or the Critical Strike.
 
Level 14
Joined
Aug 31, 2009
Messages
775
True true, there's a fair number of leaks in that map, but it was made long before I knew what leaks actually were/how to remove them, so when I did learn of them I went back and removed leaks from the most dangerous triggers (such as the periodic ones).

As for merging the triggers together, it's not a good idea as I'd have to merge the floating text with each and every source of floating text in the entire map - and there's easily over 100 sources of FT. It saves a fair bit of time especially if someone said "I think the text is too fast/slow/doesn't last long enough" - I can just edit the global removal trigger, rather than each and every one of the source triggers.
 
Status
Not open for further replies.
Top