Health

Inside3D
 • Front Page
 • Articles
 • Downloads
 • Forums
 • Hosting
 • Help Wanted
 • Interviews
 • Reviews
 • Staff

 
Allied Sites
 - AI Cafe
 - Bot Epidemic
 - Dark Places
 - Flat Earth
 - FrikBot
 - Ghoulish Art
 - Kilbert3D
 - Quake Info Pool
 - QSG: Quake Standards
 - Rusted Fork
 - Stroggs Gone Mad
 - More...
 
Quake
 - Getting Started
 - QuakeC Specs v1.0
 - QuakeC Tutorials
 - Quake Mod Index
 
Quake II
 - Getting Started
 - dll Sourcecode
 - Coding Tutorials
 
.dll Central
 - Getting Started
 - Learning
 - dll Primer
 - dll in C
 - dll in Delphi
 - Compilers
 
Jedi Knight
 - Getting Started
 - COG Specs
 - Sound Specs
 - Tutorials
 
Level Editing
 - Tutorials/Tips
 
 
Telefragged!!!
Created By: Marius
eMail: lordshoel@yahoo.com
Difficulty Scale: Easy


After playing Quake 2 and collecting Stimpacks, seeing the health rise above 100 without affecting the maximum was fantastic. In this tutorial I'll show you how to modify the Rotten helath to be similar to that of Quake 2 stimpacks. So lest go shall we...

Step 1.

First open up Items.qc and scroll to the function Item_Health. Find the following code:

	if (self.spawnflags & H_ROTTEN)
	{
		precache_model("maps/b_bh10.bsp");

		precache_sound("items/r_item1.wav");
		setmodel(self, "maps/b_bh10.bsp");
		self.noise = "items/r_item1.wav";
		self.healamount = 15;
		self.healtype = 0;
	}
Now change the value of self.healamount from 15 to 5. Leave everything else as is for now. It should now look like this:

	if (self.spawnflags & H_ROTTEN)
	{
		precache_model("maps/b_bh10.bsp");

		precache_sound("items/r_item1.wav");
		setmodel(self, "maps/b_bh10.bsp");
		self.noise = "items/r_item1.wav";
		self.healamount = 5;
		self.healtype = 0;
	}
When you have made that simple change go on to Step 2.

Step 2.

Now scroll down a little till you come to the function Health_Touch. Find the following segment:

	if (self.healtype == 2) // Megahealth?  Ignore max_health...
	{
		if (other.health >= 250)
			return;
		if (!T_Heal(other, self.healamount, 1))
			return;
	}
	else
	{
		if (!T_Heal(other, self.healamount, 0))
			return;
	}
Once you found it replace it with the following code and that should be it.

	if (self.healtype == 1) // Rotten Health...
	{
		if (other.health >= 150) return;
		if (!T_Heal(other, self.healamount, 1)) return;
	}
	else if (self.healtype == 2) // Megahealth?  Ignore max_health...
	{
		if (other.health >= 250) return;
		if (!T_Heal(other, self.healamount, 1)) return;
	}
	else
	{
		if (!T_Heal(other, self.healamount, 0)) return;
	}

Step 3.

There we go. All done. Save, Compile, and Play. What do you think? If you have any commments or suggestions email me via lordshoel@yahoo.com. Thanks. Marius






The Inside3D content and design is copyrighted by the Inside3D team, and may not be re-produced or copied without proper consent. All rights reserved. Any work credited to any author not part of InsideQC is copyrighted by that author. If you have any feedback, suggestions or flames please send it in to the author. Inside3D is hosted by telefragged and the design was originated by project-9.