Yes I left out the RegisterForUpdate() thing you are correct!
But what is then override OnUpdate()?
My working script (for example):
Scriptname aadpFastRestScript extends activemagiceffect
float Amount
actor ME
Event OnEffectStart(Actor akTarget, Actor akCaster)
Me = akTarget
RegisterForUpdate(0.1)
EndEvent
Event OnUpdate()
Amount = Me.GetBaseActorValue("Stamina") as float
Amount = Amount * 0.02
Me.RestoreAV("Stamina", Ammount)
endevent
In Oblivion I would do this:
if Me == 0
set Me to this
return
endif
How can I do the same thing in this Skyrim magic script where ME is the actor the magic effect is on (I,E the target of the magic effect)?
This was VERY important to do because the ME ref would often get reset to zero for unknown reasons.
Shouldn't you do RegisterForUpdate() and then override OnUpdate()?