How to create "crit"-like floating text?

Status
Not open for further replies.
  • Actions
    • Set Point1 = (Center of (Playable map area))
    • Floating Text - Create floating text that reads ((String((Random integer number between 500 and 8000))) + !) at Point1 with Z offset 0.00, using font size 13.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 64.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 4.00 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
    • Custom script: call RemoveLocation (udg_Point1)
Test Map:
 

Attachments

  • Floating Text.w3x
    16.4 KB · Views: 152
Level 33
Joined
Mar 27, 2008
Messages
8,035
A triggered critical strike (trick by using "Floating Text") is harder than to do the easy one (adding Critical Strike at the right moment (% occur on hit) and remove Critical Strike ability immediately after hitting an enemy)
You can of course hide first this Critical Strike skill in a SpellBook and disable
By using this, you can't actually see the ability on UI but it is there :)
One of the example a creator using this method is IceFrog, which he made a hero named Tuskarr, his ultimate, Walrus Punch.
 
Level 5
Joined
Nov 27, 2007
Messages
85
Pharaon's version worked fine.
I made some modifications - reduced font size (13 -> 10) and set zOffset to 100, so the text appears just above the unit.

I also wondered if floating text can be displayed only for specific player(s), here's what I found:
JASS:
function ShowTextTagForceBJ takes boolean show, texttag tt, force whichForce returns nothing
    if (IsPlayerInForce(GetLocalPlayer(), whichForce)) then
        // Use only local code (no net traffic) within this block to avoid desyncs.
        call SetTextTagVisibility(tt, show)
    endif
endfunction

Ok Thanks everyone for the replies =)
 
You can use this:
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked player) is an ally of (Owner of (Triggering unit))) Equal to True
          • Then - Actions
            • Set Player = (Player group((Picked player)))
            • Floating Text - Show (Last created floating text) for Player
            • Custom script: call DestroyForce (udg_Player)
          • Else - Actions
The condition is a Boolean comparison, Player - Player belongs to an ally of player.
Player variable is of type "Player Group".
 
Status
Not open for further replies.
Top