Add debug prints. Move objective related code into separate scripts.

Add the ability to prioritize objectives over targets.
This commit is contained in:
JezuzLizard
2023-05-03 21:42:59 -07:00
parent b9fe21d15f
commit a209af39b8
7 changed files with 1228 additions and 1069 deletions

View File

@@ -279,7 +279,6 @@ ClearScriptGoal()
/*
Returns whether the bot is at it's goal
*/
AtScriptGoal()
{
if ( !isDefined( self.bot.script_goal ) )
@@ -289,6 +288,40 @@ AtScriptGoal()
return distanceSquared( self.origin, self.bot.script_goal ) <= ( self.bot.script_goal_dist * self.bot.script_goal_dist );
}
/*
Returns whether the bot has a priority objective
*/
HasPriorityObjective()
{
return self.bot.prio_objective;
}
/*
Sets the bot to prioritize the objective over targeting enemies
*/
SetPriorityObjective()
{
self.bot.prio_objective = true;
self notify( "kill_goal" );
}
/*
Clears the bot's priority objective to allow the bot to target enemies automatically again
*/
ClearPriorityObjective()
{
self.bot.prio_objective = false;
}
/*
Checks whether the path generated by the ASTAR path finding is inaccessible
*/
GetPathIsInaccessible()
{
waittillframeend;
return self.bot.path_inaccessible;
}
/*
Sets the aim position of the bot
*/