Jump to content

Live Forever


Recommended Posts

I've been experimenting with flagging the player essential to change how player death is handled, similar to the SM Essential Player mod, but without the ghost respawning. The idea would be to add cumulative XP gain or maximum health/stats penalties each time player is crippled, that are cured either after some time passes or by use of consumable items or visiting a shrine.


My problem is this: When the essential player is brought to 0 health or below, they fall to the ground crippled just like a follower would. So far so good. But if you drink a Restore Health potion (via inventory or favorites/hotkey) after this your character gets back up and is no longer crippled. Even worse, if you are crippled a second time later on your character gets back up on their own after a few seconds WITHOUT having to drink a healing potion.


I would like to know if someone has managed to prevent potions from reviving the essential player when they are crippled. It appears you can prevent this if you give all healing item effects a duration instead of making them instantaneous, but I'd like a simpler solution instead of altering all healing item/magic effects.


Once that is done I hope to revive the player through different means, without them auto-reviving the second time they are crippled. So far I've tried the player.Resurrect() function but this has issues with unequipping/showing weapons and camera control after resurrection. Fortunately this does not trigger a second auto-revive next time the player is crippled, so with some work (and reverse-engineering SM Essential Player maybe?) I might be able to solve this.


But if someone has already figured this out, please don't hesitate to post below. No point in me reinventing stuff that's already been figured out elsewhere. Thanks.

Edited by Sjakal
Link to comment
Share on other sites

I since learned that SM Essential Player keeps the player alive on death via the StartDeferredKill() functions and removes control temporarily. Funnily enough the mod never calls EndDeferredKill(), which I assume will permanently corrupt the savegame. I tested this in-game; activated SM Essential Player, got crippled, got back up and ran, saved, loaded with my testmod instead, could not die in combat, called EndDeferredKill(), player died instantly, both before second fight or after. So, a potential warning to users of SM Essential Player v2.0b - your savegame might suffer from this.


Thus an alternative solution is required for preventing player death. Somehow I have to always keep the player over 0 health, and disable controls/animate player while at 1 health, never touching DeferredKill() or SetEssential() to avoid damaging the savegame. SetInvulnerable(true) apparently does nothing; I tried enabling it and got killed in the next fight anyway. So if anyone knows how to ensure player health never goes below 1 via script, similar to how the TIM cheat code prevents any damage that would take you to 0 health or below, please reply. Thanks again.

I'm currently investigating the Mod Incoming Damage entry point for perks. According to the Creation Kit Wiki talk for OnHit this is done prior to damaging the player's health. As a crude workaround, I could multiply all incoming damage with 0.01 through a new perk given to the player, and then OnHit I would multiply the damage by 100 again, but subtract damage until it only brings the player to 1 health at minimum. If player is ever brought below 5 or 10 health I would trigger the crippled animations, remove player control, make enemies ignore the player, etc. That's my best bet unless others have a different approach.

Edited by Sjakal
Link to comment
Share on other sites

  • Recently Browsing   0 members

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