Jump to content

i need some help with my mod!


glad0s98

Recommended Posts

Cant you just turn these:

if (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) <=0.75 && (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) > 0.5
to these:

if (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) =0.75
Edited by glad0s98
Link to comment
Share on other sites

The thing is that the update event is run in intervals. I recommended 1 second intervals, because higher intervals WILL impact performance. So, consider the possibility that you are in combat. Let's say your health is at 82%. You get hit with a spell that drains your health at a continuous rate. The update event is triggered at the time that you have 78% health, then 0.5 seconds later, you have 74% health. The next update event is triggered when you have 70% health. Notice that if the "if" statement used "=", then the sound will not be played even though you passed the 75% health mark. Edited by BrotherBob
Link to comment
Share on other sites

Instead, you could use:

 

 

if (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) <=0.80 && (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) >= 0.70
 

 

This way you can limit the amount of repetition of the sound, but try to ensure that the sound at least triggers once as you pass the 75% mark. You could do something similar with the other intervals.

Link to comment
Share on other sites

I've actually managed to do my own script for that magicka drain thing.

 

ScriptName NanosuitMagickaDrain extends MagicEffect
float Property UpdateInterval auto ;probably best to set it to 1 or longer
float playersMagicka = Game.GetPlayer().GetActorValuePercentage("magicka")

Event onUpdate()
If playersMagicka =0.0
Function dispel()
Endevent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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