Page 1 of 1

(its overkill) M.E. script will not keep ref "persistent

PostPosted: Wed Feb 15, 2017 7:26 pm
by City Swagga
So I have been doing this kind of thing for a long time:



actor JustTarget = self.getcombattarget() <-- Pseudo code just for example


Event OnEffectfinish(Actor akTarget, Actor akCaster)

JustTarget = none

EndEvent



But it just occured to me that this may be overkill. For magic effect scripts there is no need to clear an actor ref value like this because the script will no longer "exist" in memory after this OnEffectfinish. Soooooo... it will not keep JustTarget persistent, er.. Right?

(its overkill) M.E. script will not keep ref &#34;persistent

PostPosted: Wed Feb 15, 2017 9:01 pm
by Cartoon

maybe a small possibility exists if your Actor variable is declared outside of a Function or Event scope. And it wouldn't be because of the Actor, but whenever and however the magic effects are handled for deletion.



I would be surprised if it didn't internally handle magic effects differently because they're lifetime is very short and they pile up in combat. at worst the magic effect becomes temporarily persistent and won't delete until you restart the game or move to a new cell (or whatever other criteria is met first).