unkillable player option?

DonoVane

New member
Is there a way to make it so that the player can lose damage normally but will never fall to zero health? I want to make a game where the player can only be killed through some specific events but where being at low health can still trigger something. I can't find this option in the documentation yet.
 
Solution
There's no such native option, in the current version, but it's super easy to script. We can leverage the takedamage event since it activates right after the entity has damage applied to it but before the death logic takes place.

All you need to do is create a script file and reference it in the model text file header like this:

Code:
takedamagescript {path to your script file}

Each time an entity with that model takes damage, it will execute the script file in {path}. I wrote you an example of what the script file itself looks like. You can view it here. All it does is look at the entity's current hitpoints and restore them to 1 if they are at or below 0.

HTH,
DC
There's no such native option, in the current version, but it's super easy to script. We can leverage the takedamage event since it activates right after the entity has damage applied to it but before the death logic takes place.

All you need to do is create a script file and reference it in the model text file header like this:

Code:
takedamagescript {path to your script file}

Each time an entity with that model takes damage, it will execute the script file in {path}. I wrote you an example of what the script file itself looks like. You can view it here. All it does is look at the entity's current hitpoints and restore them to 1 if they are at or below 0.

HTH,
DC
 
Solution
Damon Caskey said:
There's no such native option, in the current version, but it's super easy to script. We can leverage the takedamage event since it activates right after the entity has damage applied to it but before the death logic takes place.

All you need to do is create a script file and reference it in the model text file header like this:

Code:
takedamagescript {path to your script file}

Each time an entity with that model takes damage, it will execute the script file in {path}. I wrote you an example of what the script file itself looks like. You can view it here. All it does is look at the entity's current hitpoints and restore them to 1 if they are at or below 0.

HTH,
DC

I've used  nokill before (unless I didn't understand the OP)

nokill {bool}

0 - (default) The attack will kill the target. Useful to turn NOKILL off.1 - The attack won't kill the target but will leave 1 HP.


 
@PS_VITA,

PS VITA said:
I've used  nokill before (unless I didn't understand the OP)

That's not applicable here at all. What you are talking about is making an attack that never kills its target.

He wanted to make a specific model unkillable regardless of what attack it's hit with. Also, he presumably wanted it tied to some in game condition.

DC
 
Back
Top Bottom