BrotherBob Posted March 8, 2013 Share Posted March 8, 2013 I'll have to think on that one... Link to comment Share on other sites More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 (edited) Cant you just turn these: if (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) <=0.75 && (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) > 0.5to these: if (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) =0.75 Edited March 8, 2013 by glad0s98 Link to comment Share on other sites More sharing options...
BrotherBob Posted March 8, 2013 Share Posted March 8, 2013 (edited) 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 March 8, 2013 by BrotherBob Link to comment Share on other sites More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 Well... That makes sense. :/ Link to comment Share on other sites More sharing options...
BrotherBob Posted March 8, 2013 Share Posted March 8, 2013 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 More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 Well i dont need those sounds if they are so hard to make :)i can take that script you made, and make it so that it plays "health critical" sound when health goes under 20% Link to comment Share on other sites More sharing options...
BrotherBob Posted March 8, 2013 Share Posted March 8, 2013 I'm sure that if you keep searching, you'll find some sort of solution for exactly what you are looking for. Link to comment Share on other sites More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 yeah i think so. But thanks for your help! :) Link to comment Share on other sites More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 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 More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 Now i just need to know how to alter player's jump height with magic effect :) i know it requires SKSE ;) Link to comment Share on other sites More sharing options...
Recommended Posts