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

Post » Wed Feb 15, 2017 7:26 pm

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


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?
User avatar
City Swagga
Posts: 3498
Joined: Sat May 12, 2007 1:04 am

Post » Wed Feb 15, 2017 9:01 pm

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).

User avatar
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm

Return to V - Skyrim