Hello guys!
I did a simple script for my server. It works by placing a HUD below of player... Okay
But has a problem, I want the HUD disappear in the fow area. Has a way for make this?
See this:
It would be a lot of computing.
I'd probably compare positions of player tiles (not pixels!) and check if there are any boxes between them (+- 1 tile) which will help you determine if you're looking at the player.
However, that would only work if the player was looking at the enemy (and couldn't see him because of the box)
The best working (does not mean the best possible) solution would be to compare positions and check each tile between players, then determine which tiles are affected by fow and which aren't. Of course, to not calculate all the time, you should calculate it only if two players are within an X amount of tiles from one another.
It's a lot of processing and not really worth it.
// And I just thought of an 'okay' solution.
You might want to try using an image. It hides automatically in fow with certain settings and it can be set on the player. I don't know how you can manipulate them to show player names but it's just a wild thought