Page 1 of 1

cover finding

Posted: Fri Jun 22, 2007 10:13 pm
by darksmaster923
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.

Posted: Sat Jun 23, 2007 1:59 am
by zany_001
you could use script points,like if this is for your arena game,have them move to the script points as they play,and run crouch anim,then look for more enemys to kill.

Posted: Tue Jun 26, 2007 10:30 am
by Juutis
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.