Onliners

Affiliates

Adding new monster factions

By Caleb 'Ghoul' Delnay

Alrighty, this tutorial will show you how to add new factions to monsters. Ex. a human grunt uses a faction type of CLASS_HUMAN_MILITARY. Lets say you added in Black Ops from Op4. If they were CLASS_HUMAN_MILITARY then they would be friends with human grunts, but that isn''t the way it worked in Op4, so lets add a CLASS_BLACK_OP. First open up cbase.h, scroll down a little and you should see this:

Now that we have our new class declared, we have to open up monsters.cpp. Find the IRelationship function for the class CBaseMonster. Close to the top of the function you should see a grid of code like this (only first part shown):

As you can see, not all the code for the grid is shown. Ok, next is the main part of the tutorial. Examine the grid, first, change the

iEnemy[14][14]

to...

iEnemy[15][15]

Now you need to add one row and one column to the code grid. Just copy and paste the last column and row onto the grid. Change the labels to /*BLACKOP*/ and BLKOP or whatever. Your grid should look like this:

Those are the monster relationship types. Using those defines set up your Black Op to have its enemies and friends. It works just like a normal grid, take ALIENMILITAR for example, going across it's grid section, it will dislike machines, hate players, dislike passive humans, etc. Now the only thing you have to do is go into your monsters Classify() function and have it return CLASS_BLACK_OP and your all set. I hope you learned from the tutorial. Now good luck. :)