A function included in the GECK version 126.96.36.199.
MarkForDelete allows a script to set the delete flag on a disabled reference. The reference is placed in a queue for deletion a few frames later. It will not work on enabled references.
Whenever an object is disabled, it remains in memory. With items that can be dropped from inventory but work on their own, every drop and every pickup is a disable. Players could wrack up several hundred useless disabled objects in memory by the end of the game, each running a script (yes, disabled objects still run their scripts). This new function will mark an object for future deletion. When the system does it's normal clean up, the object will be truly deleted, and it's script will no longer be active.
References created during gameplay, such as those dropped by an actor or something created with the PlaceAtMe function, are truly deleted. They no longer exist in any way.
The shorthand version of this function is simply "Zap".
References that are in the ESM or an ESP file can be marked for deletion, but are not truly deleted. However, the script on such objects is removed and no longer runs.
- Reference must be disabled first
- Works on actors
- Should only be called on a reference that you want to get rid of (don't use this function if you plan on enabling it later)
- References that are marked for deletion cannot be enabled later.