Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

zdoom line of sight when attacking ?

Recommended Posts

Hello guys,

let say I have a monster that attack the player from lower floor than the player is, there is a way to make the monster check to see if he have enough sight to attack ? I want him to fly up a bit if his fireball would hit the wall instead of the player ?

Share this post

Link to post

A simple line of sight check won't help here. The monster is already doing that but because the size of the projectile is greater than 0 it hits the obstacle at a position that is actually below the real line of sight.

Share this post

Link to post

A monster just can't reliably predict whether its projectile would hit something on its way towards the player, don't even bother.

Something like the monster spawning dummy actors slightly above and below its own eye level, that would check their own line of sight with the monster's target, and report it to the monster somehow, so that the monster would decide whether or not to fire the projectile or whether to move before doing so - might work (although I'm not sure about it), but even if it was possible (and it'd be rather elaborate already), it'd certainly not be foolproof anyway, because it couldn't check for solid things in the path, or moving floors or ceilings that don't obstruct the path yet but will obstruct it a second later, or it'd fail if the target quickly moved into cover just after the check was performed but just before the monster actually fired, and probably more.

Share this post

Link to post

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