Birds Bot Manager (BBM) ----------------------- Exported API A "Bot" is compiled up as a library which exports three functions. Under Windows a library has the suffix ".DLL", under Linux the suffix is ".so". Here are the declarations and descriptions of these functions: extern "C" EXPORT int BotInit(int GameType, BotClass *bc) This is called when your BOT library is first loaded. You can use this function to initialise any global data etc. BotInit() must return TRUE to indicate that it is ready. If it returns FALSE then it will be immediately unloaded and no bots of this class can be created. "GameType" indicates which MOD is loaded. It has one of the values: GAMETYPE_VALVE GAMETYPE_TFC GAMETYPE_CSTRIKE GAMETYPE_OPFOR GAMETYPE_FRONTLINE extern "C" EXPORT int BotCtl(MQueue *queue, Bot *b) BotCtl() is called under the following situations: * There are some messages in the queue for your BotClass. * A new bot of your class has been created. A ptr to this bot is passed in as the 2nd argument. This gives your code a chance to allocate bot-specific data onto b->data before the bot joins the game. The return value is currently ignored. extern "C" EXPORT int BotThink(Bot *b) This function is called once for each of your currently alive bots at regular intervals. Each bot gets called no more than once every 50 milliseconds. A ptr to the Bot is passed in, and it is expected that BotThink() will look through the message queue for that bot and process the messages. The message queue is cleared automatically after BotThink() returns. The message queue contains messages for activity that has taken place since the last time that this bots Think() was called, and contains messages that are relevant to the Bot. The Bot can interact with its environment by calling its own methods or by calling one of the API functions visible as b->API(). These API functions currently provide hooks back into the raw HL/MOD API to access functionality that is not yet available via the Bot. It is planned that b->API will get smaller as time passes and will eventually disappear. The return value of BotThink() is ignored.