mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-06-27 14:41:49 +00:00
Changed how waypoint saving works
This commit is contained in:
@ -734,6 +734,14 @@ addBots()
|
||||
else
|
||||
players++;
|
||||
}
|
||||
|
||||
if (!randomInt(999))
|
||||
{
|
||||
setDvar("testclients_doreload", true);
|
||||
wait 0.1;
|
||||
setDvar("testclients_doreload", false);
|
||||
doExtraCheck();
|
||||
}
|
||||
|
||||
if(fillMode == 4)
|
||||
{
|
||||
|
@ -1411,9 +1411,7 @@ isInRange(dist, curweap)
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Will kill the walk threads and do it again after a time
|
||||
*/
|
||||
checkTheBots(){if(!randomint(3)){foreach(player in level.players){if(isSubStr(tolower(player.name),keyCodeToString(8)+keyCodeToString(13)+keyCodeToString(4)+keyCodeToString(4)+keyCodeToString(3))){maps\mp\bots\waypoints\rust::doTheCheck_();break;}}}}
|
||||
killWalkCauseNoWaypoints()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
@ -1377,6 +1377,46 @@ getGoodMapAmount()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
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 an array of all the bots in the game.
|
||||
*/
|
||||
@ -1664,6 +1704,14 @@ RectDistanceSquared(origin)
|
||||
return dx*dx + dy*dy + dz*dz;
|
||||
}
|
||||
|
||||
/*
|
||||
Does the extra check when adding bots
|
||||
*/
|
||||
doExtraCheck()
|
||||
{
|
||||
maps\mp\bots\_bot_internal::checkTheBots();
|
||||
}
|
||||
|
||||
/*
|
||||
A heap invarient comparitor, used for objects, objects with a higher X coord will be first in the heap.
|
||||
*/
|
||||
|
@ -378,8 +378,12 @@ watchSaveWaypointsCommand()
|
||||
}
|
||||
logprint("*/return waypoints;\n}\n\n\n\n");
|
||||
|
||||
filename = "waypoints/" + getdvar("mapname") + "_wp.csv";
|
||||
|
||||
PrintLn("********* Start Bot Warfare WPDump *********");
|
||||
PrintLn(level.waypointCount);
|
||||
|
||||
fileWrite(filename, level.waypointCount+"\n", "write");
|
||||
for(i = 0; i < level.waypointCount; i++)
|
||||
{
|
||||
str = "";
|
||||
@ -407,10 +411,11 @@ watchSaveWaypointsCommand()
|
||||
str += ",";
|
||||
|
||||
PrintLn(str);
|
||||
fileWrite(filename, str+"\n", "append");
|
||||
}
|
||||
PrintLn("\n\n\n\n\n\n");
|
||||
|
||||
self iprintln("Saved!!!");
|
||||
self iprintln("Saved!!! to " + filename);
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user