Show Floating Text for Specific Player?

J

JRPereira

Guest
You'd need to use GetLocalPlayer() - at least some jass will be involved.

It'll basically be like:

if (thisplayer == GetLocalPlayer()) then
// Don't include anything that will modify the game state here, aka the floating text needs to already be created and hidden. Otherwise you'll cause a desync.
SetTextTagVisibility(thistag, true) // Show tag
endif


Unless you're using WEU or something. I think they have UI functions you can use to set a global player variable to localplayer.
 

DrinkSlurm

Eat Bachelor Chow!
Reaction score
50
Wait, would it work if I simply have this?
Code:
temp
    Events
        Unit - A unit owned by Player 10 (Light Blue) Dies
    Conditions
        (Owner of (Killing unit)) Not equal to Player 9 (Gray)
    Actions
        Floating Text - Create floating text that reads ((P + (String((Player number of (Owner of (Killing unit)))))) + (String((Point-value of (Dying unit))))) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards (((Real((Random integer number between 0 and 1))) x 90.00) + 45.00) degrees
        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 2.00 seconds
[COLOR="Red"]        Floating Text - Hide (Last created floating text) for (All players)
        Set tempForce = (All players matching ((Matching player) Equal to (Owner of (Killing unit))))
        Floating Text - Show (Last created floating text) for tempForce
        Custom script:   call DestroyForce (udg_tempForce)[/COLOR]

(I can't test this by myself.)
 
J

JRPereira

Guest
I believe so. The functions that those ui actions are based off of use getlocalplayer I believe.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top