DeleteReference

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

A command for Oblivion Script Extender

Syntax:

[reference:ref.]DeleteReference

Example:

Ref Object
Set Object to Player.PlaceAtMe Gold001
Object.DeleteReference

Attempts to delete the calling object from the game and returns true if successful.


In order for a reference to be deleted, it must:

  • be disabled
  • not be an actor
  • not be contained in an inventory
  • be dynamic


Notes[edit | edit source]

  • Dynamic references are those that are generated via PlaceAtMe or dropped from an inventory and they have a mod index of 0xFF.
  • The primary aim of this function is to combat the savegame bloat resulting from generation of large numbers of dynamic references. In most cases, it is better to avoid creating such bloat in the first place.
  • DeleteReference will not delete the calling object if it was disabled in the same frame.
  • IsRefDeleted is not related to this command in any way.


See Also[edit | edit source]