Sign in to follow this  

Marking Player / Mobs / Entities

Recommended Posts

Clopen    12

This is more of a consultation than a direct how-to question.

I implemented a feature that temporarily adds a tag to a specific target (can be anything that can do combat), and now I'd like to give this effect some visual representation, but I don't know what.

I tried tinting the target red (by setting AnimState:SetMultColour(1, 0.5, 0.5, 1)), and while it worked, I'm not sure it's a good idea - A. because it might not be too noticeable, especially for reddish entities; B. because I think it might clash with other places setting color multipliers; and C... pretty sure I had a C when I started typing this sentence but I forgot it already. O_o

I thought maybe to put a ring on the ground around it, but I'm not sure how to do that and it would also need to be scaled based on the target's size.
Also I think if I did that then I'd want the back of the ring to be hidden by the character, another something I don't know how to do.

Another idea is an aura, but I think just adding a light source would make it difficult to see exactly which entity is the target when there are several around. Also it has gameplay ramifications at night which I'd rather not have. Would be easy to abuse.

So any feasible ideas on how to mark the target (and if possible an ideas on how to implement them) would be appreciated.
If it helps, it's possible that only specific players will be able to see this marking (I already know how to implement that part).

Thanks in advance. =)

Share this post

Link to post
Share on other sites
Ultroman    715

This is a difficult one, that I really, really want to answer, because it's a great discussion, but I only see a lot of edgecases to take care of. You can always check which monsters are actually visible to the player, by checking their LightWatcher (I think monsters also have this (?))

Look at this check in the sanity component:

local lightval = CanEntitySeeInDark(self.inst) and .9 or self.inst.LightWatcher:GetLightValue()

It says, if the entity can see in the dark, then its current light value is considered 0.9, but if it cannot then its value is read from the LightWatcher. Obviously, these checks are made in the context of sanity calculations, but you can discern a lot about how the game works from just that line of code.

Anyway, you seem to have already mentioned the most obvious ideas, and they're all good, but have some problems which you mention. I know you can place a 2D texture with transparency on the ground (see the mod for showing the range of the lightning rod) which places itself underneath entities. If that doesn't work, technically a half-circle (the bottom half) would also be sufficient to show the targets.

That's probably the best way, since changing the hue of the monsters presents a lot of problems, unless you do it enough that it'll also look like crap.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this