I'm having problems with mobs shooting through walls (which have opacity = 1) . The way I test to see if they can attack is if:
get_dist(src,target) <= maxRange
where maxRange is 1 for melee weapons and then varies depending on the weapon ( a bow might have 5 or so).
But this means they can shoot through walls, because the distance is still less than their maxRange. I was thinking of using get_step but that would let them shoot arround corners which I don't want either.
By the way, I'm using missile to fire so it won't just impact on the wall.
I looked through the visibility stuff in the help but it didn't cover this type of issue, there isn't any type of:
isVisible()
proc is there?
ID:179510
Dec 13 2001, 6:15 am
|
|
Dec 13 2001, 6:26 am
|
|
You want to make sure the target is in view(world.view,src).
|