Fury Prod.  















spacer

Tutorial #1
Poison: part 4 (bots and crap)

OK so almost everything is working...except...damn... bots..

First thing we need to do is... since we changed our bg_misc.c there is another file that goes hand in hand with it. The name is inv.h and it has references for bots and such, also keeps track of modelindex's. So open up inv.h..... Looks a lot like this:

For bot support we need to change the top half... Where all the inventory stuff is. So... in the first half, towards the bottom of the inventory stuff... create a new line like this:

This way there is a reference for the bot to check if it has POISON. Next in the bottom half of inv.h where all the modelindex's are defined, we need to change the #define MODELINDEX_ROCKETLAUNCHER to #define MODELINDEX_POISON 12. Basically replacing the current modelindex with ours...and then re-add the rocketlauncher at the bottom with a unique number for compatibility sake. Like so:

Now open up ai_cmd.c. This is the file where all the bot commands are in. Look for a function named BotMatch_WhereAreYou (line 1181 or so) Should read like this:

All we are going to do is add a line for poison at the bottom of this function. Just telling the bots that is is ok to get this item too. So:

Next file we are going to work with is AI_dmq3.c. This file pretty much tells the bots how to act and re-act. Somewhere around line 563 is a function named BotUpdateInventory. If you check this out it is where the bot keeps track of what he/she is carrying and how they are doing, health wise. So we need to add our own line for poison. Here is what it should look like....

Now on to how the bot feels about attacking and such. Around line 770 is a function named BotAggression. This is where the bot checks its faculties and sees how confident it is to attack and such. We need to add a line for poison...so it should be placed like so:

Here we place it at the end, but you can place it where you feel necessary. Basically depends on how much bots should like to use the poison. Now on to a function named BotGoForPowerups. This is where the game tells the bots not to avoid these...pickem up damn it. hahah... Should reside around line 984. We need to add our powerup here as well so add a simple line with poison following ID's lead again.

Like I said, this is just telling the bot not to avoid Poison. Pick it up. Any powerup should be added here that you want the bots to use. And they know how to use it....If you notice here ID left flight out. I guess the bots cant use it properly....hmm... side project anyone? Anyways, this leaves us with a coded powerup, bots that use it..and how confident they are using it....

previous...

news | projects | FoF | tactics | download | tutorials | team