HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Floating text for GetLocalPlayer()

05-20-2010, 05:17 AM#1
Darkrider
If i want to create a floating text for GetLocalPLayer()... does it desync?

or there is a safer way to create a floating text for only 1 player?
05-20-2010, 06:23 AM#2
akolyt0r
you can create a floating text for one player only, but you have to make sure that the actual floating text handle exists for every player...
so what you can do is:
create the floating text in a place noone can see (for ALL players),
move the text to the desired position for LocalPlayer only

and make sure that the texttag is destroyed for all players afterwards.
05-20-2010, 06:47 AM#3
TheKid
Or you could fade the text-tag so that it is completely transparent for all the players except the one you want it to be visible to.
05-20-2010, 07:10 AM#4
Tot
SetTextTagVisibility(<texttag>,(GetLocalPlayer()==<player>))
05-20-2010, 01:28 PM#5
Troll-Brain
You can even create a textag locally, it's a pseudo handle, it won't desync.
Which is handy because of the limit of 100 textags simultaneously.
100 is not a high limit so 100/12 would be very lame ...
05-20-2010, 03:25 PM#6
Darkrider
can you show me that in code troll-brain? (Im a guier). In JASS is ok, i can understand some.

so far this

Trigger:
custom script : if (not (GetTriggerPlayer() == GetLocalPLayer())) then
set : visibility = 0.0
Custom Script : else Visibility = 100.0
custom script : endif
...
Show and destroy the floating text.

(or something like this. But i got the idea :P (im at work now))

seems the easier solution to implement in GUI :P
05-20-2010, 04:48 PM#7
Troll-Brain
No the easiest solution in GUI is that :

Create a player variable name "LocalPlayer", and make this trigger in the top :
Trigger:
init
Collapse Events
Map initialization
Conditions
Collapse Actions
Custom script: set udg_LocalPlayer = GetLocalPlayer()

Then you can simply use the variable LocalPlayer.

But care it opens the way of de-synchronisation, don't create handles (for example locations), use waits and other things inside a such block.
But i repeat myself you can create a textta locally though.

Here is an example of texttag creation for player red only :

Trigger:
example
Events
Conditions
Collapse Actions
Set Loc = (Position of (Triggering unit))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
LocalPlayer Equal To Player 1 (Red)
Collapse Then - Actions
-------- do your stuff here --------
TextTag - Create floating text that reads some text at Loc with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Else - Actions
-------- anti leak --------
Custom script: call RemoveLocation(udg_Loc)
05-20-2010, 08:43 PM#8
Darkrider
Thank you very much troll-brain. i was thinking in doing something like that, but i thought it might desync

something like

Trigger:
idea
Collapse if owner of GetTriggerUnit() == GetLocalPlayer() then
TextTag - Create floating text that reads some text at Loc with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency

just like you said :)

thanks =D