mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 13:55:43 +00:00
follow target
This commit is contained in:
parent
1bfbfb4a3a
commit
ef22e7b966
@ -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.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user