theintangiblefatman Posted June 20, 2010 Share Posted June 20, 2010 Hey guys, I'm just starting to play around with the construction set's scripting interface, and have run into some difficulty. Google brought me to an old topic here which was helpful, so I was hoping you might be able to answer my new question. I am trying to create a spell which heals the target/caster by a percentage of their maximum health. Thanks to this tutorial (http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_My_First_Spell), I think I should be able to create the spell, but I've run into some difficulty finding the appropriate syntax to create the desired effect. I think that the following should supply the correct magnitude for the effect. Please feel free to correct me if I am wrong.(GetAV.Health * .01) Unfortunately, I cannot for the life of me figure out how to alter the character's current health. I would think that there would be a predefined restore health script that I could call with the above magnitude, but Google has turned up nothing for me. Any help is greatly appreciated. Link to comment Share on other sites More sharing options...
Pronam Posted June 20, 2010 Share Posted June 20, 2010 Asked for a move, ForceAv is what you search for.Use GetBaseAv to get their current maximum health (which is + any buffs). GetAv will only get the current health. (which could be 40/80 instead of 40/80) Added to that, I'd store the getbaseav to a variable:). Read more about scripting here.but I wouldn't do it in such way anyway as there isn't a foolproof method that'll not mess with your stats.It's better to put down a set of effects that'll heal the player by spells or potions. Link to comment Share on other sites More sharing options...
theintangiblefatman Posted June 20, 2010 Author Share Posted June 20, 2010 Alright, so GetBaseAV.Health returns the maximum including any sort of fortify health effect, while GetAV.Health returns the current value. That's good to know, the documentation I was following wasn't particularly clear on the finer distinctions. I did run into the ForceAV (and ModAV) in the documentation here (http://cs.elderscrolls.com/constwiki/index.php), but they come with warnings like "You should never use ForceActorValue" and "If you use ModActorValue in a script, the Script Modifier is adjusted, and ONLY a script can adjust it back". I think this is what you mean when you say, "I wouldn't do it in such way anyway as there isn't a foolproof method that'll not mess with your stats." It's better to put down a set of effects that'll heal the player by spells or potions. Yes, this is what I would like to do. The game obviously already includes some sort of function for adding to the current health, as evidenced by the existence of the pre-programmed Heal Minor Wounds and similar; however, I cannot figure out how to call it. Link to comment Share on other sites More sharing options...
Recommended Posts