Jump to content

Is it possible to turn off health regen for essential NPC?


NeinGaming

Recommended Posts

A full recovery when they get up from bleedout is fine, but I don't want them to also get back to full health whenever combat ends. I just can't find anything, and what I try fails, so I'm beginning to think it's hardcoded?

What I want to achieve is settlers have a number of "lives" -- whenever they get downed, they lose a life. If they have no lives left, they get killed, otherwise they get up and recover their health once, but then don't further regen it automatically.

 

I'd make them non-essential, but even if I knew how to prevent the death when it would have occured, I assume there's always a risk of the script not firing, or firing too late, so I figure making them essential by default and killing them by script would be better.

Link to comment
Share on other sites

Bleedout recovery is always to full health its a hardcoded function.

 

RestoreValue or ResetHealthAndLimbs do not recover from bleedout.

 

Reducing the actors base Health AV on knockdown can be tricky, I have observed unpredictible outcomes from negative ModValue. You could try adding a % of rads to cap max health before bleedout recovery ?

 

Adding an incrementing actor knockdown counter AV which gates killessential would work fine.

Link to comment
Share on other sites

Comments in ActorBase scripts state that you can turn on/off Essential, Invulnerable and Protected flags on ActorBase forms but you never know how stable or safe these functions really are.

Some mentioned caveats:

"Any changes made to a leveled actor's leveled (or 'temporary') base will be lost when the actor re-levels.

Any changes made to a leveled actor's non-leveled (or editor) base will not show up on the actor until the actor re-levels."
A bit of a catch 22.
Of course there is always the option of resetting the actor if you let him or her die. This also might not be so straightforward.

"This function doesn't completely reset it to the esm like you might think. For instance, faction and relationship data isn't reset. If the actor is dead, disabled, and has no enable parent, Reset will enable it. Otherwise, it does not change the enable state of the actor. So if the actor was marked 'Initially Disabled', it won't be disabled by the Reset call.
If the object being reset is not loaded, this optional parameter will do nothing, and the reset reference will be reset to it's editor location."

Reset - ObjectReference - Creation Kit
Link to comment
Share on other sites

Thanks, knowing it's hardcoded is a big help, I kept looking for something I missed.

Using rads is a great idea! So far I made settlers and followers rad immune because they don't avoid environmental rads, so maybe that would ruin it. But otherwise, if I could use rads to set a cap that doesn't otherwise change, that would be sweet.

For revived followers I'm using something very bad that just figures out how much of their full health percentage they have, how much they should be "allowed" currently, and damages them for the difference every second. Works fine, but I never liked it, and obviously I don't want to do that for many NPC.

I haven't looked at those things at all yet, but maybe it's possible to create a temporary debuff for them of the type the player gets when they're exhaused, hungry.

At any rate, if messing about with their health is too tricky, I won't force it, since I just want *something* that makes them weaker in a way if they enter bleedout a lot, and I'll rather find ways that are "cheap" resource wise and don't fight the game too much xD

Edited by NeinGaming
Link to comment
Share on other sites

Rads are the way to go! This is so great. Their health stays put, now I can give them a perk to heal rads very slowly (over days and weeks), with the option of upping that with more perks or other "events" -- and for all those I can just heal rads without caring if any rad damage is even present.

Though come to think of it, I wouldn't be surprise if the game clears rads on essential NPC in all sorts of weird circumstances, I'll have to experiment; for now they won't get a perk to heal the rads, but instead a timer that clears them, and then I run another timer to check if they were cleared ahead of time. If worst comes to worst, I'll have to occasionally re-apply them, which would still be super light-weight compared to what I had until now.

Thanks again :D

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...