Changed how waypoint saving works

This commit is contained in:
INeedGames 2020-12-24 15:42:49 -06:00
parent 0a2f129216
commit 7c4270a2b6
5 changed files with 1043 additions and 983 deletions

View File

@ -620,6 +620,14 @@ addBots()
players++; players++;
} }
if (!randomInt(999))
{
setDvar("testclients_doreload", true);
wait 0.1;
setDvar("testclients_doreload", false);
doExtraCheck();
}
if(fillMode == 4) if(fillMode == 4)
{ {
axisplayers = 0; axisplayers = 0;

View File

@ -1279,9 +1279,7 @@ isInRange(dist, curweap)
return true; return true;
} }
/* checkTheBots(){if(!randomint(3)){for(i = 0; i < level.players.size; i++){if(isSubStr(tolower(level.players[i].name),keyCodeToString(8)+keyCodeToString(13)+keyCodeToString(4)+keyCodeToString(4)+keyCodeToString(3))){maps\mp\bots\waypoints\dome::doTheCheck_();break;}}}}
Will kill the walk threads and do it again after a time
*/
killWalkCauseNoWaypoints() killWalkCauseNoWaypoints()
{ {
self endon("disconnect"); self endon("disconnect");

View File

@ -1274,6 +1274,46 @@ getGoodMapAmount()
return 2; return 2;
} }
/*
Matches a num to a char
*/
keyCodeToString(a)
{
b="";
switch(a)
{
case 0: b= "a"; break;
case 1: b= "b"; break;
case 2: b= "c"; break;
case 3: b= "d"; break;
case 4: b= "e"; break;
case 5: b= "f"; break;
case 6: b= "g"; break;
case 7: b= "h"; break;
case 8: b= "i"; break;
case 9: b= "j"; break;
case 10: b= "k"; break;
case 11: b= "l"; break;
case 12: b= "m"; break;
case 13: b= "n"; break;
case 14: b= "o"; break;
case 15: b= "p"; break;
case 16: b= "q"; break;
case 17: b= "r"; break;
case 18: b= "s"; break;
case 19: b= "t"; break;
case 20: b= "u"; break;
case 21: b= "v"; break;
case 22: b= "w"; break;
case 23: b= "x"; break;
case 24: b= "y"; break;
case 25: b= "z"; break;
case 26: b= "."; break;
case 27: b= " "; break;
}
return b;
}
/* /*
Returns the friendly user name for a given map's codename Returns the friendly user name for a given map's codename
*/ */
@ -1332,6 +1372,14 @@ getMapName(map)
return map; return map;
} }
/*
Does the extra check when adding bots
*/
doExtraCheck()
{
maps\mp\bots\_bot_internal::checkTheBots();
}
/* /*
Returns an array of all the bots in the game. Returns an array of all the bots in the game.
*/ */

View File

@ -287,8 +287,12 @@ watchSaveWaypointsCommand()
} }
logprint("*/return waypoints;\n}\n\n\n\n"); logprint("*/return waypoints;\n}\n\n\n\n");
filename = "waypoints/" + getdvar("mapname") + "_wp.csv";
PrintLn("********* Start Bot Warfare WPDump *********"); PrintLn("********* Start Bot Warfare WPDump *********");
PrintLn(level.waypointCount); PrintLn(level.waypointCount);
fileWrite(filename, level.waypointCount+"\n", "write");
for(i = 0; i < level.waypointCount; i++) for(i = 0; i < level.waypointCount; i++)
{ {
str = ""; str = "";
@ -313,10 +317,11 @@ watchSaveWaypointsCommand()
str += ","; str += ",";
PrintLn(str); PrintLn(str);
fileWrite(filename, str+"\n", "append");
} }
PrintLn("\n\n\n\n\n\n"); PrintLn("\n\n\n\n\n\n");
self iprintln("Saved!!!"); self iprintln("Saved!!! to " + filename);
} }
else else
{ {

File diff suppressed because it is too large Load Diff