RemoveMe

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Syntax:

RemoveMe TargetContainerID (optional) 

Example:

RemoveMe 
RemoveMe player 

Removes the calling object from the inventory of the container that it is in (if applicable). If TargetContainerID is specified, the object is moved to the target container.


Notes[edit | edit source]

  • This function acts as a "return" when called -- the lines of script following it will NOT be executed (since it has just destroyed itself in the process of removing itself from inventory).
  • This function does not display the "xxx has been removed." message.
  • Like RemoveItem, using RemoveMe immediately after the object has been added may cause random crashes. To prevent this wait more than one frame before you remove the item. A counter to 10 that delays the RemoveMe command, increasing one step on every frame, should do the trick.
  • When RemoveMe can be called inside the barter-menu (e.g. within an OnAdd Block) then the game will crash when the item with the script is stackable, you sell more than one of them and then switch from "sell" to "buy". To prevent this, either wait until the barter-screen closes (Menumode=1009) before removing the item or don't use such a script on stackable non-unique items.
  • This function preserves script variables, health, and charges associated with the item.
  • If there are multiple items of the same type in the same container, the one that actually gets removed may be first one in the container instead of the one that actually called this function.
  • Calling this function within blocks like onEquip and onUnequip can cause those blocks to loop repeatedly. However, the loop can be circumvented by ensuring that onEquip or onUnequip exits normally on the second pass. See Generic Unequip.

See Also[edit | edit source]