cover finding

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA

cover finding

Post 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.
Herp derp.
User avatar
zany_001
Posts: 1047
Joined: Fri Mar 02, 2007 8:36 am
Location: Aotearoa

Post 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.
Once I was sad, and I stopped being sad and was awesome instead.
True story.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post 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.
Pain is only psychological.
Post Reply