.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   how to find the surface of the water. (http://forums.bots-united.com/showthread.php?t=3505)

Whistler 31-01-2005 03:24

how to find the surface of the water.
 
well I have an idea that when bot is underwater for too long, just let the bot "pickup" the surface of the water (just like picking up weapons)

But I can't seem to find the surface of the water using tracelines. In Quake2 I can use gi.trace() with MARK_WATER, but HL doesn't seem to have such a function.

So do you have an idea about how to do this ? Thanks.

Pierre-Marie Baty 31-01-2005 07:51

Re: how to find the surface of the water.
 
Perhaps yes.
I have noticed that some brush entities block TraceLines, even if they shouldn't, such as certain types of glass being opaque for bots. In order to fix that, I found out that you need to clear the FL_WORLDBRUSH flag of the entity after it is spawned.
So if the FL_WORLDBRUSH flag can block a TraceLine, you might want to add it temporarily to your water entity before issuing a trace from the top down. In my opinion this could work.

@$3.1415rin 31-01-2005 09:58

Re: how to find the surface of the water.
 
or you have to use POINTS_CONTENTS and write your own trace function. since we can mainly assume that over the water won't be air and then again water, you could use some 'divide and conquer' strategy to find the exact location of the water surface. dunno how that's implemented in the BSP, this water, it might be faster if doing it right there.


All times are GMT +2. The time now is 08:50.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.