jav points

This commit is contained in:
Your Name 2020-09-05 11:23:42 -06:00
parent bc322b5ab4
commit bf75ea6813
2 changed files with 46 additions and 13 deletions

View File

@ -1177,7 +1177,8 @@ bot_think_follow()
if (!isDefined(toFollow)) if (!isDefined(toFollow))
continue; continue;
self followPlayer(toFollow, randomIntRange(10,20)); self thread killFollowAfterTime(randomIntRange(10,20));
self followPlayer(toFollow);
} }
} }
@ -1210,12 +1211,11 @@ killFollowAfterTime(time)
self notify("kill_follow_bot"); self notify("kill_follow_bot");
} }
followPlayer(who, time) followPlayer(who)
{ {
self endon("kill_follow_bot"); self endon("kill_follow_bot");
self thread watchForFollowNewGoal(); self thread watchForFollowNewGoal();
self thread killFollowAfterTime(time);
for (;;) for (;;)
{ {
@ -1398,6 +1398,22 @@ bot_jav_loc_think()
if (self IsUsingRemote()) if (self IsUsingRemote())
continue; continue;
javWp = undefined;
for (i = 0; i < level.waypointsJav.size; i++)
{
if (Distance(self.origin, level.waypointsJav[i].origin) > 1024)
continue;
if (isDefined(javWp) && closer(self.origin, javWp.origin, level.waypointsJav[i].origin))
continue;
javWp = level.waypointsJav[i];
}
loc = undefined;
if (!isDefined(javWp) || self HasScriptGoal() || self.bot_lock_goal)
{
traceForward = self maps\mp\_javelin::EyeTraceForward(); traceForward = self maps\mp\_javelin::EyeTraceForward();
if (!isDefined(traceForward)) if (!isDefined(traceForward))
continue; continue;
@ -1411,6 +1427,21 @@ bot_jav_loc_think()
if (!bulletTracePassed(loc + (0, 0, 5), loc + (0, 0, 2048), false, self)) if (!bulletTracePassed(loc + (0, 0, 5), loc + (0, 0, 2048), false, self))
continue; continue;
}
else
{
loc = javWp.jav_point;
self SetScriptGoal(javWp.origin, 16);
ret = self waittill_any_return("new_goal", "goal", "bad_path");
if (ret != "new_goal")
self ClearScriptGoal();
if (ret != "goal")
continue;
}
self SetBotJavelinLocation(loc); self SetBotJavelinLocation(loc);
self setSpawnWeapon("javelin_mp"); self setSpawnWeapon("javelin_mp");

View File

@ -121,6 +121,8 @@ HasScriptGoal()
*/ */
SetScriptGoal(goal, dist) SetScriptGoal(goal, dist)
{ {
if (!isDefined(dist))
dist = 16;
self.bot.script_goal = goal; self.bot.script_goal = goal;
self.bot.script_goal_dist = dist; self.bot.script_goal_dist = dist;
waittillframeend; waittillframeend;