Exactly what Cpl. Shrike said !
One thing that may help you first:
you must learn to separate the bot variables and the HL engine variables. Everywhere you see an "edict_t" variable, it points to a HL ENTITY. Everywhere you see pEdict->v.somestuff, it points to the variable "somestuff" that belongs to the entity pEdict that is located among the other entities of the game within the HL engine. It means that you can't CHANGE these variable names, but you can read (and sometimes write) into them.
Everything in Half-Life is an entity. The map is one big entity (entity number 0), and players, doors, crates and stuff are other small entities that are just spawned on top of the map. Every entity has a set of parameters : a model mesh (the 3D polygons), a bounding box (that is, an invisible box around that entity mostly used for collision checking), although some entities use different parameters than the others, and for some, different means of storing things. For example, the players' mesh models are overriden by their client infobuffer (you'll read about that stuff later, for now, just take the word for it). And the entity #0 (the map) is not linkable to an edict_t pointer.
Now in order to keep track of which entity is one of our bots, and since we need additional storage space for putting our own variables for each bot, botman had the idea to "embed" this edict_t pointer into a wider structure : the bot_t structure.
Since there can be at max 32 players in a HL game, the bots are an array of 32 bot_t structures. Some of which are filled, some of them are free.
bot_t bots[32]; // max of 32 bots in game
And their edict_t pointer (pointing to the HL ENTITY that describes this bot) is also stored in this bot_t structure. For example, the HL entity for the 3rd bot in our list is:
bots[2].pEdict
For convenience, botman uses bot_t pointers instead of indexing the bots array each time :
bot_t *pBot = &bots[i];
and so, later on in his functions, you see things like :
pBot->pEdict->v.v_angle.x = 0; // reset the pitch view angle of the bot (using the engine variables for the bot entity)
because pBot actually is &bots[i]. It is the same as doing :
bots[i].pEdict->v.v_angle.x = 0;
And if one wants to bind a variable in the bot_t structure (which is located in our bot DLL), one level up of the edict_t structure (which one is located within the engine) :
if (bots[bot_number].pBotEnemy != NULL) // does this bot have an enemy ?
or you can also do
if (pBot->pBotEnemy != NULL) // does this bot have an enemy ?
if you're in a function which takes "bot_t *pBot" as a parameter.
Somebody feel free to move this to the wiki if needed and comment/correct/fix over it
