Ryyz Posted February 17, 2017 Author Share Posted February 17, 2017 On effect start Target.ModActorValue("health", 100) ; or what ever your damage% would be. On effect finish Target.RestoreActorValue("health", 100) ; or what ever your damage% would be. Target.ModActorValue("health", - 100) ; or what ever your damage% would be.That's simple. I'll give it a whirl. Link to comment Share on other sites More sharing options...
Masterofnet Posted February 17, 2017 Share Posted February 17, 2017 (edited) Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.ModActorValue("health", 100) ; or what ever your damage amount would be. EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) akTarget.RestoreActorValue("health", 100) ; or what ever your damage amount would be. akTarget.ModActorValue("health", - 100) ; or what ever your damage amount would be. EndEventThat's simple. I'll give it a whirl. You would replace 100 with the amount of damage for the spell to dispel not %. Edited February 18, 2017 by Masterofnet Link to comment Share on other sites More sharing options...
Ryyz Posted February 17, 2017 Author Share Posted February 17, 2017 On effect start Target.ModActorValue("health", 100) ; or what ever your damage amount would be. On effect finish Target.RestoreActorValue("health", 100) ; or what ever your damage amount would be. Target.ModActorValue("health", - 100) ; or what ever your damage amount would be.That's simple. I'll give it a whirl. It would be the amount of damage you would set for the spell to dispel not %. I gathered as much. Link to comment Share on other sites More sharing options...
FrankFamily Posted February 18, 2017 Share Posted February 18, 2017 Just FYI, you don't really need a script to fortify, theres a effect archetype for that, but of course, is a way to practice scripting. Link to comment Share on other sites More sharing options...
Masterofnet Posted February 18, 2017 Share Posted February 18, 2017 (edited) Here you go Freaky Frank. I redid your script to show you what I was talking about earlier. However all this script does is basically fortify health so it would probably be better to just do that. I also have some other concerns as well. Scriptname InvincibleSpell extends activemagiceffect Float Property SpellBaseHP = 100.0 Auto String Property ActorValue = "Health" Auto Float Property UpdateSpeed = 0.2 Auto Actor Target Float HealthCurrent Float HealthPercent Float HealthToHeal Float SpellHP Event OnEffectStart(Actor akTarget, Actor akCaster) Target = akTarget SpellHP = SpellBaseHP RegisterForSingleUpdate(UpdateSpeed) EndEvent Event OnUpdate() If (SpellHP > 0.0) HealthPercent = Target.GetAVPercentage(ActorValue) If (HealthPercent < 1.0) HealthCurrent = Target.GetActorValue(ActorValue) HealthToHeal = ((HealthCurrent / HealthPercent) - HealthCurrent) If HealthToHeal > SpellHP HealthToHeal = SpellHP Endif Target.RestoreActorValue(ActorValue, HealthToHeal) SpellHP -= HealthToHeal Endif RegisterForSingleUpdate(UpdateSpeed) Else self.Dispel() Endif EndEvent"Frank, Some advice. Do not define something outside an event unless you have to and do not define something unless you have to use it more than once in the same event. Also did you consider using while as opposed to regiseterforsingleupdate?" Scriptname InvincibleSpell extends activemagiceffect Float Property SpellBaseHP = 100.0 Auto Float Property w = 1.0 Auto Event OnEffectStart(Actor akTarget, Actor akCaster) Float Heal Float HealthCurrent = akTarget.GetActorValue("Health") While SpellBaseHP > 0.0 Heal = HealthCurrent - akTarget.GetActorValue("Health") If Heal > 0.0 SpellBaseHP = SpellBaseHP - Heal akTarget.RestoreActorValue("Health", Heal) Endif Utility.Wait(w) EndWhile Dispel() EndEvent Edited February 19, 2017 by Masterofnet Link to comment Share on other sites More sharing options...
Ryyz Posted February 18, 2017 Author Share Posted February 18, 2017 (edited) Here you go Freaky Frank. I redid your script to show you what I was talking about earlier. However all this script does is basically fortify health so it would probably be better to just do that. I also have some other concerns as well. Scriptname InvincibleSpell extends activemagiceffect Float Property SpellBaseHP = 100.0 Auto String Property ActorValue = "Health" Auto Float Property UpdateSpeed = 0.2 Auto Actor Target Float HealthCurrent Float HealthPercent Float HealthToHeal Float SpellHP Event OnEffectStart(Actor akTarget, Actor akCaster) Target = akTarget SpellHP = SpellBaseHP RegisterForSingleUpdate(UpdateSpeed) EndEvent Event OnUpdate() If (SpellHP > 0.0) HealthPercent = Target.GetAVPercentage(ActorValue) If (HealthPercent < 1.0) HealthCurrent = Target.GetActorValue(ActorValue) HealthToHeal = ((HealthCurrent / HealthPercent) - HealthCurrent) If HealthToHeal > SpellHP HealthToHeal = SpellHP Endif Target.RestoreActorValue(ActorValue, HealthToHeal) SpellHP -= HealthToHeal Endif RegisterForSingleUpdate(UpdateSpeed) Else self.Dispel() Endif EndEvent"Frank, Some advice. Do not define something outside an event unless you have to and do not define something unless you have to use it more than once in the same event. Also did you consider using while as opposed to regiseterforsingleupdate?" Scriptname InvincibleSpell extends activemagiceffect Float Property SpellBaseHP = 100.0 Auto Float Property w = 1.0 Auto Event OnEffectStart(Actor akTarget, Actor akCaster) Float Heal Float HealthCurrent = akTarget.GetActorValue("Health") While SpellBaseHP > 0.0 Heal = HealthCurrent - akTarget.GetActorValue("Health") If Heal > 0.0 SpellBaseHP = SpellBaseHP - Heal akTarget.RestoreActorValue("Health", Heal) Endif Utility.Wait(w) EndWhile self.Dispel() EndEvent Hey cool. I'm still working on that spell. Sorry to bug you again, but how would I add a cooldown to that? I've looked it up in various places one said to use a script, other said to use global variables, and another said to use conditions and stuff. Is there a clean easy way to do it? As it is now you can use that spell as much as you want... that's a little unbalanced. I couldn't get the other three things to work. Can't really find any reliable info on it. Cooldowns truly were overlooked in skyrim. I obviously don't wanna make it a shout. I imagine using utlility.wait would come into play. Could be wrong. Edited February 18, 2017 by Ryyz Link to comment Share on other sites More sharing options...
Masterofnet Posted February 18, 2017 Share Posted February 18, 2017 (edited) You could make it a greater power. That would only allow it to be used once a day. Why don't you check out the greater powers in the kit and see how they are gated to only work once a day. You may be able to set up your spell to work twice a day or whatever you feel is best. Edited February 18, 2017 by Masterofnet Link to comment Share on other sites More sharing options...
FrankFamily Posted February 19, 2017 Share Posted February 19, 2017 Freaky frank? First of all, master of ego, what is wrong with you? Calm down and behave like a normal person please. All this advices and corrections of yours, being wise comes first, not the other way around. Second, no, it's not fortify, i believe i've explained it already. Third, rethink the math please, it's pretty easy, i can explain if you need. Your "script correction" is simply wrong (as in: it fails to achieve its goal) you are healing the difference with the current health the player had when casting it instead of maximum health, which is pure nonsense. And the while loop is a messy way to do it with zero benefits over the one i did. You can check EnaiSiaion's scripts for example and you'll find a similar structure, it's not just me. And as said, putting those two variable definitions within the event is meaningless. Seriously, you are trying too hard. There is nothing wrong with my script no matter how hard you try to proof yourself over other people, inferiority complex or what? And this crusade of yours doesn't help the OP, for what my script was meant to achieve, it apparently works and it's perfectly fine, no need to overthink it. Scripting is not about using less lines, shorter variable names, messy structures that appear more compact and removing functionality to save variables. ------------------------------------------------ I wouldn't recommend cooldown as a mean of balancing spells, better (and easier) to do it with the casting cost. Link to comment Share on other sites More sharing options...
Masterofnet Posted February 19, 2017 Share Posted February 19, 2017 Frank , whatever planet you are on I hope it's nice there. "You can lead a Frank to water but you can not make them drink." What is wrong with Freaky Frank? Link to comment Share on other sites More sharing options...
FrankFamily Posted February 19, 2017 Share Posted February 19, 2017 What is wrong is the same that is wrong with your silly new sentence, your lack of respect, almost as big as your lack of knowledge. I happen to live on planet earth, in which knowledge doesn't come from boasting, rules in your pink cloud are surely different. I'd suggest you got off it and learned something. Link to comment Share on other sites More sharing options...
Recommended Posts