• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] floating texts

Status
Not open for further replies.
Level 7
Joined
Mar 22, 2010
Messages
228
hOw do i make a floating text that can only be seen by one player?

i mean like game text...but i want it floating text..im pretty sure thats possible..
 
Level 11
Joined
Apr 29, 2007
Messages
826
Using GetLocalPlayer is right though. You could also use SetTextTagVisibility

Creating them locally is better since you can create them without any problems. Also, the floating text counter will only increase on the PC on which that texttag was created, thus the other players have more available. (Remember the limit of 100?)
 
Level 7
Joined
Mar 22, 2010
Messages
228
so whAt does "GetLocalPlayer" do?

maybe you guys didnt get my point..i want the floating text to be visible for player 1..but not visible for other players..is that posible?
 
Last edited:
Level 7
Joined
Mar 22, 2010
Messages
228
so...is this possible?

JASS:
function im_cute takes nothing returns nothing
    local texttag t
    local player p = GetOwningPlayer(GetTriggerUnit())
    if GetLocalPlayer() == p then
        set t = CreateTextTag()
        //actions..
    endif
endfunction
 
so...is this possible?

JASS:
function im_cute takes nothing returns nothing
    local texttag t
    local player p = GetOwningPlayer(GetTriggerUnit())
    if GetLocalPlayer() == p then
        set t = CreateTextTag()
        //actions..
    endif
endfunction

Everything else should be done outside the block to be safe. [unless you need them to be local, or if you know what you're doing] Especially since if you were to use something like SetTextTagText, chances are that it will desync unless you've used that string before.
 
We'll hope that someone( Jesus4Lyf, Azlier, Cohadar, These vJASS Gods ) can make a safe GetLocalPlayer.

Sadly, GetLocalPlayer() isn't something you can "make" safe. =( Even with a library, there are still cautions. Really, the best method is just to read up on either the tutorial here or my tutorial and it will help you avoid such errors. =)

I could always make a local player library but I thought it'd be too pointless/time-consuming. There are actually some easy methods to debug it, namely just using a hook to the native and calling a debug message each time it is used. [That way, you can check when it is used easily and quickly coding-wise] :D
 
Status
Not open for further replies.
Top