InsideQC
 - Front Page

Tutorials are copyrighted by their author and the Inside3D staff. And may be used in any Quake modification provided that the author and the InsideQC staff are credited. Please direct any comments to the author.


Created By: Hades
eMail: danhein@hotmail.com
Difficulty Scale: Easy/Medium


Calling all DeathMatch freaks! U've all heard about the wonderful new
Deathmatch Mode 4, right?
(If u haven't, see yer Doctor, 'cause u must be dead :)

Anyways, These are the steps u need to take to add DMv4.0 to your own Patch!
note: i don't know if this is how curmo did it, but this way works as well)



Step 1


Client.qc



1a.
Open up client.qc in your favorite text editor (I use Notepad and/or Dos Edit) Scroll down until u find the 'PutClientInServer' Function
1b.
Now, look for these lines: self.attack_finished = time; self.th_pain = player_pain; self.th_die = PlayerDie; if (deathmatch == 4) { self.health = 250; //Set your Health level self.armorvalue = 200; //Set your Armor level self.armortype = 0.8; //This gives u the weapons and the armor self.items = (self.items | IT_AXE | IT_SHOTGUN | IT_SUPER_SHOTGUN | IT_NAILGUN | IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER | IT_ROCKET_LAUNCHER | IT_LIGHTNING | IT_ARMOR3); self.invincible_time = TRUE; //Temporarily Invulnerable self.invincible_finished = time + 3 + (random()*2); self.items = (self.items | IT_INVULNERABILITY); self.weapon = W_BestWeapon(); //Optional - Start them with the best gun W_SetCurrentAmmo(); //Optional }
1c.
Now, find the 'CheckPowerups' function Found it? Good. Now, find and add the following code:
1d.
if (self.invisible_finished < time) { // just stopped self.items = self.item - IT_INVISIBILITY; self.invisible_finished = 0; self.invisible_time = 0; if (deathmatch == 4) if (self.aflag > 0) //Used for determining If they were self.aflag = self.aflag - 1; //The bonus items or not } .... if (self.invincible_finished < time) { // just stopped self.items = self.items - IT_INVULNERABILITY; self.invincible_time = 0; self.invincible_finished = 0; if (deathmatch == 4) if (self.aflag > 0) self.aflag = self.aflag - 1; } ..... if (self.super_damage_finished < time) { // just stopped self.items = self.items - IT_QUAD; self.super_damage_finished = 0; self.super_time = 0; if (deathmatch == 4) if (self.aflag > 0) self.aflag = self.aflag - 1; } 1e. Alright now, almost done with Client.qc, just find the 'PlayerPostThink' function. Now, at the very end of it, put this code if (deathmatch == 4) { //This stops them from running out of ammo. if (self.ammo_cells < 100) if (!self.aflag) //this checks to see if they have bonus self.ammo_cells = 100; //items or not, if they do, don't give them cells if (self.ammo_shells < 100) self.ammo_shells = 100; if (self.ammo_rockets < 100) self.ammo_rockets = 100; if (self.ammo_nails < 200) self.ammo_nails = 200; } Phew! All done with Client.qc. Now, next step:
Step 2


Items.qc




2a.
Ok, now find the 'BackPackTouch' function, it should be near the end. Now, find this code: if (other.weapon == best) { stemp = self; self = other; self.weapon = W_BestWeapon (); self = stemp; } if (deathmatch == 4) { other.health = other.health + self.health; //Give them the extra Health sprint(other, "You get 10 health\n"); if (other.health > 299) //If they got over 300 health, Power them Up! { other.ammo_cells = 0; //Set cells to 0 so they don't go 8xDamage Discharging and stuff sound (self,CHAN_VOICE,"player/land2.wav",TRUE,ATTN_NORM); //Play a sound so they know sprint(other, "Octa-Damage!! Bonus Pentagram!! Bonus Ring!!\n"); //Tell them what they get //This stuff gives them the items and sets the Time limits other.invincible_time = TRUE; other.invincible_finished = (time + 30); other.invisible_time = TRUE; other.invisible_finished = (time + 30); other.super_time = TRUE; other.super_damage_finished = (time + 30); other.items = (other.items | IT_INVULNERABILITY | IT_QUAD | IT_INVISIBILITY); other.health = 250; //set their Health back to 250 other.aflag = 3;//Set the flag so that the Lightning doesn't recharge //and so T_Damage does 8x damage } }
2b.
Find the 'DropBackpack' Function, It should be right below the last one Put this code at the end of it: if (deathmatch == 4) item.health = 10; Wow! We're done with items.qc now. The rest is pretty simple.


Step 3


Weapons.qc




3a.
In the function 'W_Precache', paste this code precache_sound2 ("items/protect.wav"); //Just to stop some annoying precache_sound2 ("items/protect2.wav");//'Sound not precached' precache_sound2 ("items/protect3.wav");// messages
3b.
Now, find the 'W_Attack' function Find this code: if (self.weapon == IT_GRENADE_LAUNCHER) { player_rocket1 (); W_FireGrenade (); if (deathmatch == 4) self.attack_finished = (time + 1.5); //Grenades fire only every 1.5 seconds else self.attack_finished = (time + 0.6); }
3c.
AAAAAlllllrighty then. Just one more small change and yer ready to go!


Step4


Combat.qc








4a.
Find the 'T_Damage' function, and add this: local vector dir; local entity oldself; local float save; local float take; local float no; //Used to decide if it's a rocket jump or not. if (!targ.takedamage) return; if (deathmatch == 4) if (inflictor.movetype == MOVETYPE_FLYMISSILE) //If it's a rocket... if (inflictor.owner == targ) //And it's your Rocket... if (targ.jump_flag > 0) //And u just Jumped... no = 1; //Don't hurt u. damage_attacker = attacker; if (attacker.super_damage_finished > time) { damage = (damage * 4); if (deathmatch == 4) if (self.aflag > 0) //If they have the bonus items... damage = damage * 2; //Double the damage to 8x } if (!no) { //If it's a RocketJump, don't take yer armor down. save = ceil (targ.armortype * damage); if (save >= targ.armorvalue) { save = targ.armorvalue; targ.armortype = 0; targ.items = (targ.items - (targ.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3))); } targ.armorvalue = (targ.armorvalue - save); take = ceil (damage - save); if (targ.flags & FL_CLIENT) { targ.dmg_take = (targ.dmg_take + take); targ.dmg_save = (targ.dmg_save + save); targ.dmg_inflictor = inflictor; } }
4b.
K, last but not least add this: if (no) //So it won't continue to hurt u. return; if (((teamplay == TRUE) && (targ.team > FALSE)) && (targ.team == attacker.team)) return ;


Step 5
Yowza! I think that's it folks.
Compile and try it. There's a damn good chance I forgot something,
so if it don't work, Email me and I'll Fix the Tutorial.


HTMLized by: Adrian "Mr. Pink" Finol