I'm currently making a magic effect mod to Miraak's boots that causes the wearer to leave a damaging trail of lightning in their wake during combat. The way I'm currently doing this is to use RegisterForSingleUpdate to constantly check if the wearer is in combat, and if true, to then constantly place a short-lived hazard object using PlaceAtMe. There's also additional checks to see if the wearer is sneaking (won't place hazard), running or sprinting (places hazard faster by using a shorter time on RegisterForSingleUpdate).
Since the time needs to be quite short to simulate a continuous "trail" I'm worried that the script could cause save game bloating, as outlined on the wiki page. As is, the timer property value I'm currently using is WaitTimer = 0.3, and that timer is even shorter if running (= 0.2) or sprinting (= 0.1).
Scriptname aaaMiraakStormWalkHazardPlacer extends ActiveMagicEffect Hazard Property HazardtoPlace Auto Float Property WaitTimer AutoActor selfrefBool bKeepUpdating Event OnEffectStart(actor target, actor caster) RegisterForSingleUpdate(WaitTimer) bKeepUpdating = TrueEndEventEvent OnUpdate()selfref = (gettargetactor()) if (selfref.IsInCombat() == True) if (selfref.issneaking() == False) selfref.placeatme(HazardtoPlace) endif endif if bKeepUpdating if (selfref.isrunning() == True) RegisterForSingleUpdate(WaitTimer*(2/3) elseif (selfref.issprinting() == True) RegisterForSingleUpdate(WaitTimer/3) else RegisterForSingleUpdate(WaitTimer) endif endifEndEvent Event OnEffectFinish(actor target, actor caster) bKeepUpdating = falseEndEvent
So, how safe am I?