/* ============== BotAISetup ============== */ int BotAISetup( int restart ) { int errnum; #ifdef RANDOMIZE srand( (unsigned)time( NULL ) ); #endif //RANDOMIZE trap_Cvar_Register( &bot_thinktime, "bot_thinktime", "100", 0 ); trap_Cvar_Register( &memorydump, "memorydump", "0", 0 ); //if the game is restarted for a tournament if ( restart ) { return BLERR_NOERROR; } //initialize the bot states memset( botstates, 0, sizeof( botstates ) ); trap_Cvar_Register( &bot_thinktime, "bot_thinktime", "100", 0 ); errnum = BotInitLibrary(); if ( errnum != BLERR_NOERROR ) { return qfalse; } return BLERR_NOERROR; }
/* ============== BotAISetup ============== */ int BotAISetup( int restart ) { int errnum; trap_Cvar_Register(&bot_thinktime, "bot_thinktime", "100", CVAR_CHEAT); trap_Cvar_Register(&bot_memorydump, "bot_memorydump", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_saveroutingcache, "bot_saveroutingcache", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_pause, "bot_pause", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_report, "bot_report", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_testsolid, "bot_testsolid", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_testclusters, "bot_testclusters", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_developer, "bot_developer", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_interbreedchar, "bot_interbreedchar", "", 0); trap_Cvar_Register(&bot_interbreedbots, "bot_interbreedbots", "10", 0); trap_Cvar_Register(&bot_interbreedcycle, "bot_interbreedcycle", "20", 0); trap_Cvar_Register(&bot_interbreedwrite, "bot_interbreedwrite", "", 0); //if the game is restarted for a tournament if (restart) { return qtrue; } //initialize the bot states memset( botstates, 0, sizeof(botstates) ); errnum = BotInitLibrary(); if (errnum != BLERR_NOERROR) return qfalse; return qtrue; }
/* ============== BotAISetup ============== */ int BotAISetup( int restart ) { int errnum; trap_Cvar_Register(&bot_thinktime, "bot_thinktime", "100", CVAR_CHEAT); trap_Cvar_Register(&bot_memorydump, "bot_memorydump", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_saveroutingcache, "bot_saveroutingcache", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_pause, "bot_pause", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_report, "bot_report", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_testsolid, "bot_testsolid", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_testclusters, "bot_testclusters", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_developer, "bot_developer", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_shownodechanges, "bot_shownodechanges", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_showteamgoals, "bot_showteamgoals", "0", CVAR_CHEAT); trap_Cvar_Register(&bot_reloadcharacters, "bot_reloadcharacters", "0", 0); trap_Cvar_Register(&bot_interbreedchar, "bot_interbreedchar", "", 0); trap_Cvar_Register(&bot_interbreedbots, "bot_interbreedbots", "10", 0); trap_Cvar_Register(&bot_interbreedcycle, "bot_interbreedcycle", "20", 0); trap_Cvar_Register(&bot_interbreedwrite, "bot_interbreedwrite", "", 0); level.botReportModificationCount = bot_report.modificationCount; //if the game isn't restarted for a tournament if (!restart) { //initialize the bot states memset( botstates, 0, sizeof(botstates) ); errnum = BotInitLibrary(); if (errnum != BLERR_NOERROR) return qfalse; } errnum = EA_Setup(); //ai_ea.c if (errnum != BLERR_NOERROR) return qfalse; errnum = BotSetupWeaponAI(); //ai_weap.c if (errnum != BLERR_NOERROR)return qfalse; errnum = BotSetupGoalAI(); //ai_goal.c if (errnum != BLERR_NOERROR) return qfalse; errnum = BotSetupMoveAI(); //ai_move.c if (errnum != BLERR_NOERROR) return qfalse; errnum = BotSetupChatAI(); //ai_chat_sys.c if (errnum != BLERR_NOERROR) return errnum; return qtrue; }