Forum

Regenarating Armor?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Postby DusterdooSmock » Fri Oct 08, 2010 4:04 am

metlslime wrote:why regenerate armor instead of health? It would make sense in a game where armor protected 80-100% of damage, but in quake the percentages are rather low, so you end up losing a lot of health even when you do have armor.

So if you do this i recommend making armor absorb close to 100% of damage, and remove most health pickups from the game (maybe just restore health between missions or something.)


Would you care to help me make it so that the armor absorbs all of the damage until it reaches zero, then the health absorbs the damage?
DusterdooSmock
 
Posts: 170
Joined: Thu Aug 19, 2010 9:58 pm

Postby metlslime » Fri Oct 08, 2010 7:14 am

If you look in the function armor_touch, you can see that the different armors set different values for self.armortype. If the armortype is "1.0" then it would absorb 100% of any damage until it runs out.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby DusterdooSmock » Fri Oct 08, 2010 1:19 pm

metlslime wrote:If you look in the function armor_touch, you can see that the different armors set different values for self.armortype. If the armortype is "1.0" then it would absorb 100% of any damage until it runs out.


So, would i set the armor type to "1.0" ?
DusterdooSmock
 
Posts: 170
Joined: Thu Aug 19, 2010 9:58 pm

Postby Spike » Fri Oct 08, 2010 2:47 pm

set it to 2 and it'll probably heal you when you take damage!
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby frag.machine » Fri Oct 08, 2010 4:23 pm

Spike wrote:set it to 2 and it'll probably heal you when you take damage!


No, but each armor point would absorb 2 damage points.

To heal-me-on-damage-armor, use a negative factor for .armortype :)
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby DusterdooSmock » Fri Oct 29, 2010 5:32 pm

Ok, i tried to set self.armorvalue = 100; in PutClientInServer, but when the player spawns, he doesnt spawn with 100 armor, he still spawns with 0.... :(
DusterdooSmock
 
Posts: 170
Joined: Thu Aug 19, 2010 9:58 pm

Postby frag.machine » Fri Oct 29, 2010 5:48 pm

Have you set .armortype to something different from zero ?
My advice is you to read the armor_touch() function in items.qc. Also, T_Damage () in combat.qc helps to understand the armor absorption algorithm.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Orion » Fri Oct 29, 2010 7:58 pm

To make the player spawn with 100 armor, you'll need to modify SetNewParms() in client.qc.

So you may use this:

parm3 = 100;
parm9 = 1;

Where 'parm3' is armorvalue and 'parm9' is armortype.
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Previous

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest