Jump to content

[LE] Event to Detect Player Health


Recommended Posts

Hey all!

So I am currently working on a shape-shifting mod, and it is working quite well aside from one problem that I cannot figure out. I'd like a clean way to get the players' current health through an event if that's possible. Basically here's the scenario, you are in a shape-shifted form but your health goes below 10%, so you then revert to your original form. I use death alternative so when you hit low health you go into bleedout, so I am also trying to simultaneously make it work with this mod, as being in a different form for these scenarios can cause many problems.

 

I've tried using OnHit event, to check the players health but there's many issues with this and I'd prefer not to use it, not to mention if you are under the effect of a damage over time effect, that can take you below 10% health and it will not register.

I tried OnEnterBleedout, but that didn't really seem to work either and even if it did it wouldn't really be preferable, as I'd like you to lose your form at a certain health threshold, ie <10%.

One thing I did think of was how on a new character, when your health/stamina/magicka get low a tutorial message pops up. I am not sure where these tutorial scripts are but they seem to detect it in a way I'd like to. Does anyone know how these work?

Thanks :blush:

 


Link to comment
Share on other sites

You can poll efficiently using a spell.

 

Make a Magic Effect, type script constant and on self. Add a script to it that OnEffectStart does whatever you want when the players health dips below 10%.

 

Then attach the Magic Effect to a spell, and on the conditions of the SPELL, add GetActorValuePercentage Health < 10 Run On Player.

 

Then AddSpell this spell to the player when the battle starts or at the beginning of the game. When the players health dips below 10% the spell will run and the OnEffectStart in th MGEF script will fire.

Link to comment
Share on other sites

You can poll efficiently using a spell.

 

Make a Magic Effect, type script constant and on self. Add a script to it that OnEffectStart does whatever you want when the players health dips below 10%.

 

Then attach the Magic Effect to a spell, and on the conditions of the SPELL, add GetActorValuePercentage Health < 10 Run On Player.

 

Then AddSpell this spell to the player when the battle starts or at the beginning of the game. When the players health dips below 10% the spell will run and the OnEffectStart in th MGEF script will fire.

 

Ah! That's genius! And much cleaner than anything I had tested out. Thanks a bundle Mattiewagg, kudos. :)

Link to comment
Share on other sites

  • 6 years later...
  • Recently Browsing   0 members

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