Jump to content

Running a script on player death


Odessa

Recommended Posts

My mod 'Another Kick in the Head' is based around the idea you get knocked out rather dying and having to load game.

 

Currently I achieve this by a short quest script that runs every 2 seconds to check whether players health has dropped to xx%, and teleports them out of combat- but unless the xx% is quite high the player will often die before it can trigger.

 

Clearly there must be a better way of achieving this.

 

It would be better for a script to run every time the player was hit instead of every 2 seconds, I tried this using an OnHit block effect script attached to a perk, but have been unable to make it work.

 

 

Ideally I also want to prevent the player from being able to die; so somehow blocking or reducing damage from a lethal hit, without the workaround being obvious (like screwing the UI health bar)

 

If anyone has any scripting suggestions for either of these, I'd be very interested to hear

 

Thanks

Link to comment

The wiki seems to suggest OnHit runs on the weapon now, instead of an actor. OnHitWith followed by a formlist of all weapons might provide an alternative, although i'm not sure either of them can work in effect scripts. (All of this is guess work.)

 

There's this Oblivion mod that intercepts death though. From what I can tell at a quick glance it runs a getAV check in a gamemode block in an ability's spell script. When health gets below 0, the player's resurrected with resurrect & moveto'd someplace. Looks a little MacGuyvered, but I hear it works. Not sure how it all plays out with fallout's dismemberment mechanics.

Link to comment

Yes, I believe effect scripts are limited to scripteffect blocktypes. Is there any way of attaching an object script to the player?

 

The problem with using resurrect on the player is that the game engine isn't meant to allow this; it causes crashes, broken physics and probably a whole load of other potential problems even if I could get around those two

Link to comment

Attaching an object script to the player seems fraught with danger to me.

 

There may be something here that you can use:

http://www.uesp.net/wiki/Tes4Mod:Resurrecting_the_Player ; the gist of it is you use a combo of getAV & SetEssential, also list some examples

http://www.uesp.net/wiki/Tes4Mod:Cobl/Modding/Death_Handling

http://wryemusings.com/Wrye%20Shivering%20Death.html

 

Can't speak to how reliable it all is, or how it translates to FNV, but you may pick up an idea or two.

Link to comment
  • 2 weeks later...

Hello, surely you know this mod, but in case you don't I write it here. I remember there's something like that in Arwen's mod, that should do something like that, it doesn't kill you but place you somewhere without items etc.

 

I admit I never tried it, nor I opened it to check how it is done, I just remember what I've read in the description:

(quote)
"You no longer die. Instead you now pass out and are left for dead. When you finally do come to again, you discover that you have been looted. This is my own unique concept, where your character's death becomes a major penalty, instead of just an inconvenient reload."

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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