cover finding
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
cover finding
while rescripting my bots, i wanted them to take cover behind things. i noticed in juutis's demo, some of the bots ducked behind tables and that stuff.
Herp derp.
I used scriptpoints in my demo. I added scriptpoints where I wanted the pawns to take cover and then if a pawn spotted the player it checks for nearby scriptpoints with NearestPoint(). If there was one near enough, the pawn would go there. At that point, the pawn checks if there is an obstacle in front of it with GetCollideDistance(). I used the command to get the distances for different bones, so for example, if the distance from the feet to the object in front of the pawn is 100, and the same distance for the head is 10,000, the obstacle clearly isn't high enough to provide cover for the pawns head. In this case the pawn would crouch.
Pain is only psychological.