Difference between revisions of "RemoveMe"

Jump to navigation Jump to search
391 bytes added ,  00:07, 11 July 2006
Changed layout, edited one note, added another.
imported>Wz
m
imported>JOG
(Changed layout, edited one note, added another.)
Line 7: Line 7:
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.  
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.  


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


NOTE2: This function does not seem to show the "xxx has been removed." message.
'''Notes:'''


NOTE3: When using RemoveMe right after the object has been added, you usually have to wait more than one frame before you can safely do so. A counter to 10 that delays the RemoveMe command, increasing one step on every MenuMode or GameMode, should prevent random CTDs.
*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.
 
*When using RemoveMe right after the object has been added, you might get 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 MenuMode or GameMode, 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.  


==See Also==  
==See Also==  
Anonymous user

Navigation menu