wizardmirth Posted June 25, 2011 Share Posted June 25, 2011 I'm trying to figure out how to check the health of an NPC while in a non-lethal duel with the player. This NPC would then yield when his health is like maybe at 30% or whatever. I think I need to use GetActorValue, set/ref it, and then use variable equations, but variables scare me and I'm not sure how to format it properly. Anyone know of a script I can check vanilla or otherwise or have a suggestion on the best way to do this. Not sure if OBSE has a simpler method for this. Link to comment Share on other sites More sharing options...
fg109 Posted June 25, 2011 Share Posted June 25, 2011 That depends... are you talking about a specific NPC, or is this supposed to work for anyone? Link to comment Share on other sites More sharing options...
wizardmirth Posted June 25, 2011 Author Share Posted June 25, 2011 This is a one time occurence for a specific NPC that I created. The script must keep checking the NPC's health from the time the duel starts until the threshold I set is reached, and then it can stop. Link to comment Share on other sites More sharing options...
fg109 Posted June 25, 2011 Share Posted June 25, 2011 You would need to insert this code into the script attached to the NPC: ... short dueling ... if (dueling == 1) if (GetAV Health < (0.3 * GetBaseAV Health)) Yield set dueling to 0 endif endif ... You'll need to define when dueling should be 1. Maybe through checking for a quest stage or AI package or something. Link to comment Share on other sites More sharing options...
wizardmirth Posted June 25, 2011 Author Share Posted June 25, 2011 That looks a lot simpler than I thought. :sweat: Your format example is a tremendous help. Kudos. Link to comment Share on other sites More sharing options...
Recommended Posts