follow target

This commit is contained in:
Your Name 2020-09-14 23:29:33 -06:00
parent 1bfbfb4a3a
commit ef22e7b966

View File

@ -1114,6 +1114,7 @@ start_bot_threads()
self thread bot_uav_think();
self thread bot_listen_to_steps();
self thread follow_target();
self thread bot_think_follow();
self thread bot_think_camp();
@ -1130,6 +1131,35 @@ start_bot_threads()
self thread bot_cap();
}
follow_target()
{
self endon( "death" );
self endon( "disconnect" );
for(;;)
{
wait 1;
if ( self HasScriptGoal() || self.bot_lock_goal )
continue;
if ( !self HasThreat() )
continue;
threat = self GetThreat();
if (!isPlayer(threat))
continue;
if(randomInt(100) > self.pers["bots"]["behavior"]["follow"]*5)
continue;
self SetScriptGoal(threat.origin, 64);
if (self waittill_any_return("new_goal", "goal", "bad_path") != "new_goal")
self ClearScriptGoal();
}
}
/*
Bot logic for bot determining to camp.
*/