finish sab

This commit is contained in:
INeedBots 2020-11-21 23:25:58 -06:00
parent 2aae13900e
commit d57d38d478
3 changed files with 37 additions and 5 deletions

View File

@ -1511,6 +1511,35 @@ bot_go_plant(plant)
self notify("goal"); self notify("goal");
} }
/*
Bots will go defuse the bomb
*/
bot_go_defuse(plant)
{
self endon( "death" );
self endon( "disconnect" );
level endon("game_ended");
self endon( "goal" );
self endon( "bad_path" );
self endon( "new_goal" );
for (;;)
{
wait 1;
if (!level.bombPlanted)
break;
if (self isTouching(plant.trigger))
break;
}
if(!level.bombPlanted)
self notify("bad_path");
else
self notify("goal");
}
/* /*
Creates a bomb use thread and waits for an output Creates a bomb use thread and waits for an output
*/ */
@ -4479,7 +4508,7 @@ bot_sab()
if(bombteam == myTeam) if(bombteam == myTeam)
{ {
site = level.bombZones[otherTeam]; site = level.bombZones[otherTeam];
origin = ( site.curorigin[0]+50, site.curorigin[1]+50, site.curorigin[2]+32 ); origin = ( site.curorigin[0]+50, site.curorigin[1]+50, site.curorigin[2]+5 );
// protect our planted bomb // protect our planted bomb
if(level.bombPlanted) if(level.bombPlanted)
@ -4590,7 +4619,7 @@ bot_sab()
} }
//protect bomb site //protect bomb site
origin = ( site.curorigin[0]+50, site.curorigin[1]+50, site.curorigin[2]+32 ); origin = ( site.curorigin[0]+50, site.curorigin[1]+50, site.curorigin[2]+5 );
self thread bot_inc_bots(site); self thread bot_inc_bots(site);
@ -4627,7 +4656,7 @@ bot_sab()
} }
// bomb is planted we need to defuse // bomb is planted we need to defuse
origin = ( site.curorigin[0]+50, site.curorigin[1]+50, site.curorigin[2]+32 ); origin = ( site.curorigin[0]+50, site.curorigin[1]+50, site.curorigin[2]+5 );
// someone else is defusing, lets just hang around // someone else is defusing, lets just hang around
if(site.bots > 1) if(site.bots > 1)
@ -4648,8 +4677,11 @@ bot_sab()
// lets go defuse // lets go defuse
self.bot_lock_goal = true; self.bot_lock_goal = true;
self thread bot_inc_bots(site); self thread bot_inc_bots(site);
self SetScriptGoal( origin, 1 ); self SetScriptGoal( origin, 1 );
self thread bot_go_defuse(site);
event = self waittill_any_return( "goal", "bad_path", "new_goal" ); event = self waittill_any_return( "goal", "bad_path", "new_goal" );
if (event != "new_goal") if (event != "new_goal")

View File

@ -1806,7 +1806,7 @@ AStarSearch(start, goal, team, greedy_path)
// have certain types of nodes more expensive // have certain types of nodes more expensive
if (childtype == "climb" || childtype == "prone") if (childtype == "climb" || childtype == "prone")
penalty++; penalty += 4;
//calc the total path we have took //calc the total path we have took
newg = bestNode.g + DistanceSquared(nodeorg, childorg)*penalty;//bots on same team's path are more expensive newg = bestNode.g + DistanceSquared(nodeorg, childorg)*penalty;//bots on same team's path are more expensive

View File

@ -1 +1 @@
start "" "%~dp0iw4x.exe" -nosteam -scriptablehttp -console +set r_fullscreen "0" +set sv_lanonly "1" +set r_mode "1024x768" +set drawlagometer "1" +set cg_drawfps "4" +set fs_game "" +set bots_manage_fill "4" +set cg_drawsnapshot "1" +set ui_mapname "mp_rust" +set scr_game_spectatetype "2" +set scr_war_scorelimit "0" +set thereisacow "1" +set sv_cheats "1" +map mp_rust start "" "%~dp0iw4x.exe" -nosteam -scriptablehttp -console +set r_fullscreen "0" +set sv_lanonly "1" +set r_mode "1024x768" +set drawlagometer "1" +set cg_drawfps "4" +set fs_game "" +set bots_manage_fill "4" +set cg_drawsnapshot "1" +set ui_mapname "mp_rust" +set scr_game_spectatetype "2" +set scr_war_scorelimit "0" +set thereisacow "1" +set sv_cheats "1" +devmap mp_rust