player health and some stuff

hello ,
i want to increase the player health using codes without increasing the health of the enemies
i also want the dead body’s of enemies to stay and not to wait for some seconds then disappear
finally i want the same thing to occur for the weapons of the enemies i want them to stay on floor without disappearing.
thanks for your help

dark space, these are very different questions, all potentially quite complicated, and the amount of background information that you provide shows very little effort on your part. Addressing just the player health, you may want to change Pawn.Health. Default is 100, but that number is pretty meaningless without some context. You can give your player’s pawn more health in the default properties with the line Health=200.

i figured it out i used the spanlife to increase the time by which the dead bodies stay visible i also figured how to increase the health of the player only by increasing it in the utpawn then go to the enemies pawn files and rechange them back to 100 by that i would change only the player

About leaving dead bodies, even if it may look realistic, however, in practical terms is not a good idea to leave the bodies, because of performance. Leaving too much enemies on screen even after they are dead may take much memory. Even some modern games they find a way to remove the enemies bodies whenever the player is not looking, without the player realizing. Is a smart way to optimize performance. But it all depends on your game, however, remember that game is a game, is not realistic even though you have ultra photorealistic graphics. And if you would create a super realistic game, it would be unplayable.

First of all if the player dies, you can`t come back to life :D, so you would never be able to play again :smiley:

If your player takes a shoot from a bullet, he will not be able to continue fighting, because in real life, whenever a soldier is wound, he will try to take cover and stop fighting to protect his life, so he would not come back to fighting so quickly.

Also, you can`t have health pickup on real life, and a bullet wound would not be cured except through surgery, which is not applicable to a game.

So you see, games must not be completely realistic, otherwise they would be unplayable.


thanks any way i figured how to fix it :smiley:

Well just as a suggestion instead of using use your own health I use GOTAHealth as new variable and variable name.

[QUOTE=dark space;n1354909
i also want the dead body’s of enemies to stay and not to wait for some seconds then disappear

Here is that part in Pawn.uc, in the Dying state (you can copy the state in your pawn class and modify it, instead modify the source):

event Timer()
if ( !PlayerCanSeeMe() )
SetTimer(2.0, false);

You can add a minimun distance to destroy the dead pawns, for example:

D = vsize(Getalocalplayercontroller().Pawn.location - location);

if ( !PlayerCanSeeMe() ) || D > 1000)

and also increase the LifeSpan var value.

The result is… a dead pawn that:

  • if you can’t see it, is destroyed inmediatly:

  • if you can see it, but is near than 1000 units, it’s not destroyed.

I use this to not see the dead paws dissapear, but to control the number of dead pawns (and with rigid bodies physics enabled, the fps killer thing).

FANTASTIC MAN!!! Now I will use this on my game also. Cheers!!!