HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Not displaying a text tag in a fogged position?

04-13-2009, 01:36 PM#1
Tyrande_ma3x
I was wondering if anybody knows how to hide a text tag that appears at one place if that place is in fog of war? For example, a text tag appears right above a specific unit but it is fogged for Player 3. How can I make the texttag NOT show for Player 3?
04-13-2009, 01:46 PM#2
Hans_Maulwurf
Collapse JASS:
    if ( IsVisibleToPlayer(x, y, GetLocalPlayer()) == false ) then
        call SetTextTagVisibility(texttag, false)
    endif
04-13-2009, 03:32 PM#3
Toadcop
blizz should do the following for the TT
native AddLightning takes string codeName, boolean checkVisibility...

to the example above... you need do it periodicaly to achive needed result. the other way is to create TT localy but well... it's not the same. i also "suffer" from this problem.
04-14-2009, 03:58 PM#4
darkwulfv
I'm pretty sure you can make texttags only appear to indvidual player(s) or groups of them (aka a force). Here's how I did it (may not be the best way but it works).

Well, I used the BJ "ShowTextTagForceBJ" which takes a boolean (show or don't (true or false)), a texttag, and a force.

Of course, if you don't want to use the BJ, just break it down and see how Blizz did it. It's pretty easy.
04-14-2009, 04:12 PM#5
Hans_Maulwurf
Quote:
Originally Posted by darkwulfv
I'm pretty sure you can make texttags only appear to indvidual player(s) or groups of them (aka a force). Here's how I did it (may not be the best way but it works).

Well, I used the BJ "ShowTextTagForceBJ" which takes a boolean (show or don't (true or false)), a texttag, and a force.

Of course, if you don't want to use the BJ, just break it down and see how Blizz did it. It's pretty easy.

ShowTextTagForceBJ only checks if local player is in the force and hides the tt if so. So when you add the visibility check part you should get a similar code like then one i posted yetserday
04-14-2009, 09:54 PM#6
Feroc1ty
Simply loop through players, and locally check if the location is visible, if it is than make the text visible, otherwise hide it.
04-14-2009, 10:15 PM#7
darkwulfv
Quote:
Simply loop through players, and locally check if the location is visible, if it is than make the text visible, otherwise hide it.
It'd be easier to just loop through the players and see if they're an ally, and if so make it visible.
04-14-2009, 11:04 PM#8
Feroc1ty
Quote:
Originally Posted by darkwulfv
It'd be easier to just loop through the players and see if they're an ally, and if so make it visible.

If the visibility is checked locally than there will be same amount of work done. And if lets say a person isn't an ally, than you will have to check visibility again, and than loop through his allies again.
04-14-2009, 11:09 PM#9
darkwulfv
Quote:
And if lets say a person isn't an ally, than you will have to check visibility again, and than loop through his allies again.
No, when creating the texttag you could simply just loop through all the players and say "show, don't show, show, don't show" in accordance to alliance.

Of course, this is under the assumption these texttags are dynamic and temporary; miss texttags, for example. If they're long-lasting/need to stay, then that's different.
04-15-2009, 01:42 AM#10
Vexorian
Quote:
Originally Posted by Toadcop
blizz should do the following for the TT
native AddLightning takes string codeName, boolean checkVisibility...

to the example above... you need do it periodicaly to achive needed result. the other way is to create TT localy but well... it's not the same. i also "suffer" from this problem.
Theory: You can use Pitzermike's textsplat library or come up with something that uses custom lightning effects to draw letters.