Пример #1
0
//===========================================================================
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
int Export_BotLibSetup(void)
{
	int		errnum;
	
	bot_developer = LibVarGetValue("bot_developer");
  memset( &botlibglobals, 0, sizeof(botlibglobals) ); // bk001207 - init
	//initialize byte swapping (litte endian etc.)
//	Swap_Init();
	Log_Open("botlib.log");
	//
	botimport.Print(PRT_MESSAGE, "------- BotLib Initialization -------\n");
	//
	botlibglobals.maxclients = (int) LibVarValue("maxclients", "128");
	botlibglobals.maxentities = (int) LibVarValue("maxentities", "1024");

	errnum = AAS_Setup();			//be_aas_main.c
	if (errnum != BLERR_NOERROR) return errnum;
	errnum = EA_Setup();			//be_ea.c
	if (errnum != BLERR_NOERROR) return errnum;
	errnum = BotSetupWeaponAI();	//be_ai_weap.c
	if (errnum != BLERR_NOERROR)return errnum;
	errnum = BotSetupGoalAI();		//be_ai_goal.c
	if (errnum != BLERR_NOERROR) return errnum;
	errnum = BotSetupChatAI();		//be_ai_chat.c
	if (errnum != BLERR_NOERROR) return errnum;
	errnum = BotSetupMoveAI();		//be_ai_move.c
	if (errnum != BLERR_NOERROR) return errnum;

	botlibsetup = qtrue;
	botlibglobals.botlibsetup = qtrue;

	return BLERR_NOERROR;
} //end of the function Export_BotLibSetup
Пример #2
0
//===========================================================================
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
int Export_BotLibSetup(void)
{
	int		errnum;
	
	botDeveloper = LibVarGetValue("bot_developer");
 	memset( &botlibglobals, 0, sizeof(botlibglobals) );
	//initialize byte swapping (litte endian etc.)
//	Swap_Init();

	if(botDeveloper)
	{
		char *homedir, *gamedir, *basedir;
		char logfilename[MAX_OSPATH];

		homedir = LibVarGetString("homedir");
		gamedir = LibVarGetString("gamedir");
		basedir = LibVarGetString("com_basegame");

		if (*homedir)
		{
			if(*gamedir)
				Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, gamedir, PATH_SEP);
			else if(*basedir)
				Com_sprintf(logfilename, sizeof(logfilename), "%s%c%s%cbotlib.log", homedir, PATH_SEP, basedir, PATH_SEP);
			else
				Com_sprintf(logfilename, sizeof(logfilename), "%s%c" BASEGAME "%cbotlib.log", homedir, PATH_SEP, PATH_SEP);
		}
		else
			Com_sprintf(logfilename, sizeof(logfilename), "botlib.log");
	
		Log_Open(logfilename);
	}

	botimport.Print(PRT_DEVELOPER, "------- BotLib Initialization -------\n");

	botlibglobals.maxclients = (int) LibVarValue("maxclients", "128");
	botlibglobals.maxentities = (int) LibVarValue("maxentities", "1024");

	errnum = AAS_Setup();			//be_aas_main.c
	if (errnum != BLERR_NOERROR) return errnum;
	errnum = EA_Setup();			//be_ea.c
	if (errnum != BLERR_NOERROR) return errnum;
	errnum = BotSetupWeaponAI();	//be_ai_weap.c
	if (errnum != BLERR_NOERROR)return errnum;
	errnum = BotSetupGoalAI();		//be_ai_goal.c
	if (errnum != BLERR_NOERROR) return errnum;
	errnum = BotSetupChatAI();		//be_ai_chat.c
	if (errnum != BLERR_NOERROR) return errnum;
	errnum = BotSetupMoveAI();		//be_ai_move.c
	if (errnum != BLERR_NOERROR) return errnum;

	botlibsetup = qtrue;
	botlibglobals.botlibsetup = qtrue;

	return BLERR_NOERROR;
} //end of the function Export_BotLibSetup
Пример #3
0
int BotLibSetup( bool singleplayer ) {
	bot_developer = LibVarGetValue( "bot_developer" );
	Com_Memset( &botlibglobals, 0, sizeof ( botlibglobals ) );
	Log_Open( "botlib.log" );

	BotImport_Print( PRT_MESSAGE, "------- BotLib Initialization -------\n" );

	botlibglobals.maxclients = ( int )LibVarValue( "maxclients", "128" );
	botlibglobals.maxentities = ( int )LibVarValue( "maxentities", GGameType & GAME_WolfSP ? "2048" : "1024" );

	int errnum = AAS_Setup();			//be_aas_main.c
	if ( errnum != BLERR_NOERROR ) {
		return errnum;
	}
	errnum = EA_Setup();			//be_ea.c
	if ( errnum != BLERR_NOERROR ) {
		return errnum;
	}
	if ( !( GGameType & ( GAME_WolfSP | GAME_WolfMP ) ) ) {
		errnum = BotSetupWeaponAI();	//be_ai_weap.c
		if ( errnum != BLERR_NOERROR ) {
			return errnum;
		}
		errnum = BotSetupGoalAI( singleplayer );		//be_ai_goal.c
		if ( errnum != BLERR_NOERROR ) {
			return errnum;
		}
		errnum = BotSetupChatAI();		//be_ai_chat.c
		if ( errnum != BLERR_NOERROR ) {
			return errnum;
		}
	}
	if ( !( GGameType & GAME_WolfMP ) ) {
		errnum = BotSetupMoveAI();		//be_ai_move.c
		if ( errnum != BLERR_NOERROR ) {
			return errnum;
		}
	}

	if ( GGameType & GAME_ET ) {
		PC_RemoveAllGlobalDefines();
	}

	botlibsetup = true;
	botlibglobals.botlibsetup = true;

	return BLERR_NOERROR;
}
Пример #4
0
/*
==============
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;
}
Пример #5
0
int Export_BotLibSetup( void ) {
#else
int Export_BotLibSetup( qboolean singleplayer ) {
#endif // RTCW_XX

	int errnum;

	bot_developer = LibVarGetValue( "bot_developer" );

    //BBi
	////initialize byte swapping (litte endian etc.)
	//Swap_Init();
    //BBi

	Log_Open( "botlib.log" );
	//
	botimport.Print( PRT_MESSAGE, "------- BotLib Initialization -------\n" );
	//
	botlibglobals.maxclients = (int) LibVarValue( "maxclients", "128" );

#if defined RTCW_SP
	botlibglobals.maxentities = (int) LibVarValue( "maxentities", "2048" );
#else
	botlibglobals.maxentities = (int) LibVarValue( "maxentities", "1024" );
#endif // RTCW_XX

	errnum = AAS_Setup();           //be_aas_main.c
	if ( errnum != BLERR_NOERROR ) {
		return errnum;
	}
	errnum = EA_Setup();            //be_ea.c
	if ( errnum != BLERR_NOERROR ) {
		return errnum;
	}

#if !defined RTCW_ET
//	errnum = BotSetupWeaponAI();	//be_ai_weap.c
//	if (errnum != BLERR_NOERROR)return errnum;
//	errnum = BotSetupGoalAI();		//be_ai_goal.c
//	if (errnum != BLERR_NOERROR) return errnum;
//	errnum = BotSetupChatAI();		//be_ai_chat.c
//	if (errnum != BLERR_NOERROR) return errnum;
#else
	errnum = BotSetupWeaponAI();    //be_ai_weap.c
	if ( errnum != BLERR_NOERROR ) {
		return errnum;
	}
// START	Arnout changes, 28-08-2002.
// added single player
	errnum = BotSetupGoalAI( singleplayer );      //be_ai_goal.c
// END	Arnout changes, 28-08-2002.
	if ( errnum != BLERR_NOERROR ) {
		return errnum;
	}
	errnum = BotSetupChatAI();      //be_ai_chat.c
	if ( errnum != BLERR_NOERROR ) {
		return errnum;
	}
#endif // RTCW_XX

#if defined RTCW_MP
//	errnum = BotSetupMoveAI();		//be_ai_move.c
//	if (errnum != BLERR_NOERROR) return errnum;
#endif // RTCW_XX

#if !defined RTCW_MP
	errnum = BotSetupMoveAI();      //be_ai_move.c
	if ( errnum != BLERR_NOERROR ) {
		return errnum;
	}
#endif // RTCW_XX

#if defined RTCW_ET
	globaldefines = NULL;
#endif // RTCW_XX


	botlibsetup = qtrue;
	botlibglobals.botlibsetup = qtrue;

	return BLERR_NOERROR;
} //end of the function Export_BotLibSetup