Tutorial *61*


Yipee the RIPs are back...

Legion (Roscoe Sincero) has buggered off to work on his ElimaReaper patch, so I'll be filling his shoes for a while.
He is still active in a consultancy capacity, so I can still draw on his wealth of knowledge for support.

So, my name is Pob the Impaler (Paul Johnstone), you can send me mail at:
[email protected] (for home)
OR
[email protected] (for College)
I don't mind which address you use, so when I inevitably make a boo-boo you'll know how to send me
hate-mail :)
My site is at: http://www.btinternet.com/~impaler please help my hit-counter and visit!

Roscoe Sincero's address is [email protected]

//------------//
//-Credits--//
//-----------//

Steve Polge - For the Reaper bots
Alan Kivlin - For the clever scoreboard stuff
Lee Smith - For ProQCC
Roscoe Sincero - For starting it all off and for giving me a shot of his ElimaReaper!


----My Mission------------
My aim is to make the bot's at least aesthetically indistinguishable from human opponents.
So eventually there will be a facility for random bot skills in Teamplay (incase you haven't noticed
teamplay games are stacked HEAVILY in favour of your team).
We will also lose the "The_Mastermind (skill 3) entered the game" and replace with "The_Mastermin entered the game".
This lesson is a step in the right direction....


|=========================================================|

ALWAYS MAKE A BACKUP OF YOUR CODE BEFORE TRYING ONE OF MY LESSONS. IF THERE IS A MISTAKE IN IT WHICH RUINS YOUR CODE OR BLOWS UP YOUR HOUSE, TOUGH SHIT, RESTORE THE BACKUP AND TELL ME WHERE I FUCKED UP.

Good morning class, Oy! you at the back, stop waving that around! Right is everyone paying attention?
Good.
Roscoe told me that a lot of you "loveable little rogues" wanted the deathmatch 4 rules in.
Ok.
Between us we discovered three different variations of DM 4 and this is the one that we decided on,
it is by no means the "definative" set of rules.
After this RIP and the "Last Man Standing" RIP you should be confident enough to alter it anyway.

Basic Premise...

Everybody starts with all weapons. Full armor. Full Health. Full ammo.
No weapons exist on the level.
The Grenade Launcher fires at half rate.
When a player/bot dies, and drops a backpack, it will contain 10 health.
If (a player/bot picks up enough backpacks to reach 300 Health.)
{
player's health is reset to 100

Player gets a Pentagram of Protection and an "Octa" Damage
}
This may sound kinda complicated, but it's not, it's piss easy! :)


Step 1

client.qc

Right first of we will give the player and bots all the stuff to start with.

We'll do the player first so open up client.qc.

Find the function PutClientInServer. search for void () PutClientInServer = {

Above the line:

void () PutClientInServer = {



We are going to add another function called Dm4Start.

So (Make sure you are above the PutClientInServer line)

add:



//====Start Code=======//

void () Dm4Start = {

// For DM 4 rules start with all guns, full health,armor, and ammo, and all guns



self.health = 200;

self.armorvalue = 250;

self.armortype = 0.800;

self.ammo_rockets = MUST_HAVE;

self.ammo_nails = 200.000;

self.ammo_shells = MUST_HAVE;

self.items = self.items |

    IT_AXE |

    IT_SHOTGUN |

    IT_SUPER_SHOTGUN |

    IT_NAILGUN |

    IT_SUPER_NAILGUN |

    IT_GRENADE_LAUNCHER |

    IT_ROCKET_LAUNCHER;



self.ammo_cells = 200.000;

self.items = (self.items | IT_LIGHTNING);

self.weapon = IT_LIGHTNING;

self.impulse = FALSE;

W_SetCurrentAmmo ();

};

//====End Code=========//





Now we need to call this function when the player is put in the game, So..



Go to PutClientInServer (Under the function you just added.)



Find the line:

spot = SelectSpawnPoint ();



ABOVE this line add:



//====Start Code=======//

if (deathmatch == 4)

{

Dm4Start();

}

//====End Code=========//



Save and close client.qc



We now need to give the bots all this stuff when they spawn.

So open botspawn.qc.

At the very top of botspawn.qc add:

//====Start Code=======//

void () Dm4Start;

//====End Code=========//



Find the function PutBotInServer. search for void () PutBotInServer = {



Find the line:



spwn = SelectSpawnPoint ();



Above this line add:



//====Start Code=======//

if (deathmatch == 4)

{

Dm4Start();

}

//====End Code=========//



Save and close botspawn.qc







Step 2

items.qc

Now we want to put 10 health and stuff in the backpacks.



Open up items.qc



Find BackpackTouch. search for void () BackpackTouch = {



find the line:



other.ammo_shells = (other.ammo_shells + self.ammo_shells);



above this line add:



//====Start Code=======//

if (deathmatch = 4)

{

other.health = (other.health + 10); // if dm4 give + 10

if (other.health >= 300)

{

  other.health = 100;

  other.super_time = 1;

  other.super_damage_finished = 1 + SVC_INTERMISSION;

  other.items = other.items | IT_QUAD;

  other.invincible_time = 1;

  other.invincible_finished = 1 + SVC_INTERMISSION;

  other.items = other.items | IT_INVULNERABILITY;

}

}

//====End Code=========//



Save and close items.qc


Step 3

weapons.qc

Now we want to slow down the fire rate of the grenade launcher (I think this is a stupid rule,

but hey! I didn't make them up   :)



Open weapons.qc



Find the function W_Attack. search for void () W_Attack = {



Find the line:



W_FireGrenade ();



delete the line underneath, which reads:

 self.attack_finished = (time + 0.600);



Now, under the W_FireGrenade (); add:



//====Start Code=======//

if (deathmatch = 4)

{

self.attack_finished = (time + 1.200);

}

else

{

self.attack_finished = (time + 0.600);

}

//====End Code=========//



That means the grenade launcher will take twice as long to fire than normal   :(

To be honest you can't see much of a difference.

save and close weapons.qc;

//---End Code---//


Step 4

combat.qc

Now what we have to do is make the Quad Damage an Octa Damage.

Excuse me while I figure out how to do it.....

Erm.... Umm.... Ehm.... Bloody hell.... Erm..... Ah Ha!... no :(

We'll come back to this one I think.



Right, got it know, ThanX James Abbatiello!



Open up combat.qc

Find the function T_Damage



Find the lines which read:



   if ( (attacker.super_damage_finished > time) ) {



      damage = (damage * MOVETYPE_STEP);



   }



Change these lines to read:

//====begin code====//

 if ( (attacker.super_damage_finished > time) ) {

		if (deathmatch == 4)

			{

			damage = (damage * 8);

			}

		else

			{

      		damage = (damage * MOVETYPE_STEP); // MOVETYPE_STEP == 4

			}

   }

//====end code=====//


Step 5

items.qc

Apparently we don't want weapons on the level so...



Open items.qc again



Find the function weapon_supershotgun. search for void () weapon_supershotgun = {



Now add the following lines to the top of the function:

//==add code==//

if (deathmatch == 4)

{

remove(self);

return;

}

//==add code==//



Now do EXACTLY the same again for the following function:

void () weapon_nailgun = {

void () weapon_supernailgun = {

void () weapon_grenadelauncher = {

void () weapon_rocketlauncher = {

void () weapon_lightning = {

also if you have done the plasma gun RIP do this function as well:

void () weapon_plasma = {

There ya go! Start your game, type "deathmatch 4" at the console then "restart" I think these rules are crap, but hey, I'm just a mere mortal! :) It seems to be far too hard to stay alive long enough to get 300 health! Anyway... See 'ya next time for more red-hot bot-on-bot action! :)



 
Not logged in
Sign up
Login:
Passwd: