• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code If i wanted to increase player max health...

Small problem... Now it was explained to me, i can extend a class to edit it, without replacing...

So i did this...

Code:
//=============================================================================
// Pawn, the base class of all actors that can be controlled by players or AI.
//
// Pawns are the physical representations of players and creatures in a level.
// Pawns have a mesh, collision, and physics.  Pawns can take damage, make sounds,
// and hold weapons and other inventory.  In short, they are responsible for all
// physical interaction between the player or AI and the world.
//
// This is a built-in Unreal class and it shouldn't be modified.
// Test To see if more health is given?
//=============================================================================
class DeathsDoorPawn extends Pawn
	abstract
	native
	placeable
	config(user)
	nativereplication
	exportstructs;

// Player info.
var float           HealthMax;
var float           SuperHealthMax;
var travel int      Health;         // Health: 100 = normal maximum


defaultproperties
{
     Health=150
     HealthMax=200
     SuperHealthMax=200
}

However when i try to compile it says this...

The file '..\DeathsDoor\Inc\DeathsDoorClasses.h' needs to be updated. Do you wa
nt to overwrite the existing version? (Y/N):


If i hit no, it moves and exports fine. However i cant seem to increase my health(however all i tryed was vannila syringe, and medic nade on the ground).

If i hit yes on the prompt, it errors out saying it cant find the file.


Thoughts?
 
Last edited:
Upvote 0
Small problem... Now it was explained to me, i can extend a class to edit it, without replacing...

So i did this...

Code:
//=============================================================================
// Pawn, the base class of all actors that can be controlled by players or AI.
//
// Pawns are the physical representations of players and creatures in a level.
// Pawns have a mesh, collision, and physics.  Pawns can take damage, make sounds,
// and hold weapons and other inventory.  In short, they are responsible for all
// physical interaction between the player or AI and the world.
//
// This is a built-in Unreal class and it shouldn't be modified.
// Test To see if more health is given?
//=============================================================================
class DeathsDoorPawn extends Pawn
	abstract
	native
	placeable
	config(user)
	nativereplication
	exportstructs;

// Player info.
var float           HealthMax;
var float           SuperHealthMax;
var travel int      Health;         // Health: 100 = normal maximum


defaultproperties
{
     Health=150
     HealthMax=200
     SuperHealthMax=200
}

However when i try to compile it says this...

The file '..\DeathsDoor\Inc\DeathsDoorClasses.h' needs to be updated. Do you wa
nt to overwrite the existing version? (Y/N):


If i hit no, it moves and exports fine. However i cant seem to increase my health(however all i tryed was vannila syringe, and medic nade on the ground).

If i hit yes on the prompt, it errors out saying it cant find the file.


Thoughts?



So i removed the single file, and added it to the SRHumanPawn file, and added the bots mutator. Their health didnt appear to be over 150, nor did mine. Was still at 100.
 
Upvote 0
A little hint. By the sounds of it, you are using ServerPerks. ServerPerks uses it's own Pawn class which it forces the game to use through it's mutator. If you're trying to do the same, they will conflict. You are better off making a mutator to force your new pawn but extend off the ServerPerks pawn (SRPawn I believe). If you don't do that, you are not using a single bit of code from the ServerPerks Pawn and the one/two extended before that. If you want to force the health then change the default property, nothing more then that.
 
Upvote 0
A little hint. By the sounds of it, you are using ServerPerks. ServerPerks uses it's own Pawn class which it forces the game to use through it's mutator. If you're trying to do the same, they will conflict. You are better off making a mutator to force your new pawn but extend off the ServerPerks pawn (SRPawn I believe). If you don't do that, you are not using a single bit of code from the ServerPerks Pawn and the one/two extended before that. If you want to force the health then change the default property, nothing more then that.

Allow me to re explain, the code i pasted is irrelevant, I added the Health portions to the srhumanpawn, but its still not overriding it



To clarify, this is now in SRHumanPawn

Code:
var float           HealthMax;
var float           SuperHealthMax;
var travel int      Health;         // Health: 100 = normal maximum


defaultproperties
{
     Health=150
     HealthMax=200
     SuperHealthMax=200
}
 
Upvote 0
Allow me to re explain, the code i pasted is irrelevant, I added the Health portions to the srhumanpawn, but its still not overriding it



To clarify, this is now in SRHumanPawn

Code:
var float           HealthMax;
var float           SuperHealthMax;
var travel int      Health;         // Health: 100 = normal maximum


defaultproperties
{
     Health=150
     HealthMax=200
     SuperHealthMax=200
}

and why did you add the vars? that is most likely why everything is getting screwed up. Pointless to add them if you're extending SRHumanPawn
 
Upvote 0