IDK, I think I remember reading somewhere that actual cameras will trigger the seen checks but textured ones won't. That's easy enough for you to make a map and test that out though.Enjay wrote:How does this handle camera textures? I mean, if the map has a camera texture, and the actor concerned is in view of the camera texture, does the CheckIfSeen register as the thing is seen all the time (because a camera that is actively being cast to a texture can see it) or would it only register as seen if a player could see the camera texture?
Reason I ask is that camera textures sometimes seem to reveal parts of a map on the automap even if the player has not yet been to the part of the map where either the camera or the camera texture are.
Again I haven't looked at the code, but I remember someone saying that the automap works by watching the renderer, any line sent to the renderer is considered seen and marked as such on the automap. That might be why you see that behavior. But I myself haven't messed with cameras much, can't really answer that.
Ok, so about the sight checks, I just checked and both CheckSight and IsVisible functions return true when the object is unobstructed, regardless if it's in the player's FOV. IsVisible even has a boolean to turn off LOOKALLAROUND, but that doesn't seem to change anything.
If there's no built-in way, the way I'd do it is:
- first use CheckSight to decide if the target is even worth considering
- if so, check the angle from the viewer to the target. I know there is a function to do this that even considers portals and cameras, but I don't recall it's name.
- get the viewer's fov (it's in playerinfo)
- check if the angle to the target is within the fov range