Hi, I'm trying my hand at redoing the scripts for Size Changing Spell Effects to use SKSE functionality and at the same time pull the values as variables to expand the range of possible original sizes and to affect more actors (eventually). That seemed to work without crashing as badly as the default thanks to the wait delays I added. Then I decided to try my hand at using the GetWeight/SetWeight functions as well since no one else seems to be doing this specifically. In short, the weight is changing, but I'm not getting the body to update on the fly like the height is without constantly equipping/unequipping the armor.
From the included code, can anyone give suggestions/ideas as to why this is and how to fix it?
Scriptname lxlFattenTemp extends ActiveMagicEffect
float Property OriginalWeight auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
actorbase pakTarget = akTarget.GetActorBase()
float Weight = pakTarget.GetWeight()
Debug.Notification(Weight)
OriginalWeight = Weight
while (Weight < 100.0)
Weight += 0.5
akTarget.GetActorBase().SetWeight(Weight)
akTarget.QueueNiNodeUpdate()
Utility.Wait(0.5)
endWhile
Debug.Notification(Weight)
EndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)
actorbase pakTarget = akTarget.GetActorBase()
float Weight = pakTarget.GetWeight()
while (Weight > OriginalWeight)
Weight -= 0.4
akTarget.GetActorBase().SetWeight(Weight)
akTarget.QueueNiNodeUpdate()
Utility.Wait(0.5)
endWhile
akTarget.GetActorBase().SetWeight(OriginalWeight)
akTarget.QueueNiNodeUpdate()
EndEvent