Difference between revisions of "MarkForDelete"

63 bytes removed ,  01:08, 2 July 2011
no edit summary
imported>Geckbot
m (Robot: Automated text replacement (-\[\[Category:(.*?)\(GECK 1.0\)\]\] +Category:\1(GECK 1.1)))
imported>MadCat221
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
=='''Description'''==
{{Function
 
|origin = GECK1
'''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.
|summary = '''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.
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.
Line 7: Line 7:
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.
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.


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.  
The shorthand version of this function is simply "Zap".


=='''Syntax'''==
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.
 
|name = MarkForDelete
  [''ReferenceID''.]MarkForDelete
|returnType = void
|referenceType = [ObjectRefID]
|example = PileOfBonesRef.Disable
  PileOfBonesRef.MarkForDelete


=='''Examples'''==
}}
PileOfBonesRef.Disable
PileOfBonesRef.MarkForDelete


=='''Notes'''==
==Notes==
*Features:  
*Features:  
**Reference must be disabled first
**Reference must be disabled first
Line 23: Line 24:
**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)
**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.
**References that are marked for deletion cannot be enabled later.
<!--
=='''See Also'''==
=='''Reference'''==
None provided.
<!-- [[MarkForDelete_Reference|List of functions that use MarkForDelete]]  (wiki) -->


[[Category:Functions]]
[[Category:Functions]]
Anonymous user