Forum

> > CS2D > Scripts > [HUD] Hide in fow area
Forums overviewCS2D overview Scripts overviewLog in to reply

English [HUD] Hide in fow area

3 replies
To the start Previous 1 Next To the start

old [HUD] Hide in fow area

The Smoker
User Off Offline

Quote
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:
IMG:https://i.imgur.com/x58fpLB.jpg
IMG:https://i.imgur.com/etMtsOY.jpg


.. and, sorry for bad english

old Re: [HUD] Hide in fow area

Rainoth
Moderator Off Offline

Quote
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

Good luck.

old Re: [HUD] Hide in fow area

The Smoker
User Off Offline

Quote
Well, apparently, will be very difficult. I will try to use hats for differentiate the class of player.
Anyway, thank you for the explanation.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview