New MOD default player health

  • Thread starter Thread starter blazertailgunner
  • Start date Start date
B

blazertailgunner

Guest
I've been a fan of one-hit-one-kill in MP games since "License to Kill" in Goldeneye 64. Anyways, I'm trying to encorporate this into my MOD, but having a bit of trouble finding where that is.

I did a search-within on all of the files in my /src folder, and dozens came up but they all are either for something else or commented with 'exact value is MOD dependant.'

Any suggestions to where I can set this default health value to the minumum?
 
no idea, but wouldnt it be easier to just set the weapon damage higher? look at the weapon script files
 
Look for the code that gets called when a player spawns.

Add a line saying (this->m_iHealth = 1) or something. Make sure you get the right variable, it should be defined in CBasePlayer, or CBaseCombatCharacter.

-Angry Lawyer
 
Whoohoo said:
I'm working on a mod like that :laugh:

The solution then, if you need it, is to do what Angry Lawyer said and append:

Code:
this->m_iHealth = x; //where x is default health

after the last line of CHL2MP_Player::Spawn() function in the hl2mp_player.cpp file.

Thanks Angry Lawyer for the Help!
 
Well, there are different functions to put it in, based on what you used to start your mod. For 'bare-bones', you need CSDK_Player.

You're welcome.

-Angry Lawyer
 
Gun damage is even easier, but you start getting odd things. Like a pistol being able to break down any form of destructable object, and being able to throw a character right across the level.

Health is the cleaner way to implement one hit kills.
The one flaw is that the slightest of falls will kill you.

-Angry Lawyer
 
Angry Lawyer said:
...the one flaw is that the slightest of falls will kill you.

cant you script that there no falling damage ?
 
You could just do it the proper way, by having standard health, and adding to the player in it's damage function:

if (Damage_type == DMG_BULLET)
m_fDamage = this->m_iHealth+50;

That way, everything else deals normal damage, but bullets deal damage equal to the player's health, plus 50.
(Beware, that's pseudocode, and won't work without finding out the right variables and functions).

-Angry Lawyer
 
you can easily take out fall damage, in the const's theres a few relating to fall damage (min velocity, how much).
 
It's better to simply put in checks for bullet damage on Players, so you don't get other side effects, like shooting a barrel throwing it a mile away from you.

-Angry Lawyer
 
Back
Top