HeirOfTheSeptims Posted October 11, 2017 Share Posted October 11, 2017 (edited) So I am making a weapon that the power levels on its enchantment fluctuates. I am using a global to control how hard the enchantment hits. The issue is that I can't seem to get it to go back down consistently. The Idea is that the power stacks for each hit within 7 seconds (1 hit = 20 damage, 2 hits = 25 damage, etc). I've tried using a "RegisterforsingleUpdate" but it seems like it doesn't actually update, since when I check the global in game, it just keeps going up, and never back down. This is the script that I am using now: GlobalVariable Property HitStack Auto SPELL Property StamDrain Auto Float Property Timer Auto Float Property hits Auto Actor Property Caster Auto Event OnEffectStart(Actor AkTarget, Actor AkCaster)Caster = AkCasterhits = HitStack.GetValue()If(HitStack.GetValue() < 1)RegisterForSingleUpdate(Timer)EndIfStamDrain.Cast(Caster, Caster)HitStack.SetValue(hits + 1)EndEventEvent OnUpdate()hits = HitStack.GetValue()HitStack.SetValue(hits - 1) If(HitStack.GetValue() > 0) RegisterForSingleUpdate(Timer) ElseIf(HitStack.GetValue() < 0) HitStack.SetValue(0) Else EndIfEndEvent Does anybody know a way to fix this? Another way I'd thought of fixing it was to use another magic effect that lasts 7 seconds, and at the end of it reduces your hit # by 1, but I don't know if its possible to make magic effects stack with themselves? Edited October 11, 2017 by HeirOfTheSeptems Link to comment Share on other sites More sharing options...
HeirOfTheSeptims Posted October 12, 2017 Author Share Posted October 12, 2017 Update: After some testing, it appears that the Update Event isn't even happening somehow... Link to comment Share on other sites More sharing options...
HeirOfTheSeptims Posted October 12, 2017 Author Share Posted October 12, 2017 Update 2: I've circumvented the issue by making a stacking magic effect that lasts the required duration, then removes 1 hit point on finish. Still, if anyone knows why the hell that Update event wasn't firing, I'd love to know. Link to comment Share on other sites More sharing options...
Recommended Posts