Difference between revisions of "OnDrop"

217 bytes added ,  10:34, 19 September 2009
clarification on when ondrop runs
imported>Illyism
(created page)
imported>Zumbs
(clarification on when ondrop runs)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
__NOTOC__
This block will be run once when the scripted object is removed from the container's inventory. If no parameter is used, the block will be run whenever the object is removed from anything's inventory.
This block will be run once when the scripted object is removed from the container's inventory. If no parameter is used, the block will be run whenever the object is removed from anything's inventory.


==='''Syntax:'''===
''Syntax:'''
   begin OnDrop ''ContainerRefID''  
   begin OnDrop ''ContainerRefID''  
==='''Example:'''===
'''Example:'''
   begin OnDrop  
   begin OnDrop  
   begin OnDrop player  
   begin OnDrop player  
Line 10: Line 12:


==Notes==
==Notes==
*Other than it's name suggests, this Blocktype does not only run when the calling object is dropped to the ground but whenever the object it is removed from an inventory (however, it will not run if the scripted object no longer exists).
*Other than it's name suggests, this Blocktype does not only run when the calling object is dropped to the ground but whenever the object it is removed from an inventory. It is, however, not called if the scripted object no longer exists. This includes objects removed using the [[RemoveItem]] function. This subject is discussed in more detail in the TES4 Construction Set Wiki [http://cs.elderscrolls.com/constwiki/index.php/Talk:OnDrop Talk:OnDrop].
*If you need to know whether the object is dropped to the ground, you need additional tests.  
*If you need to know whether the object is dropped to the ground, you need additional tests.  
:if the object isn't within a container - '''if GetContainer == 0'''
:if the object isn't within a container - '''if GetContainer == 0'''
Line 16: Line 18:
:or if the player was in inventory mode when he dropped it - '''if MenuMode == 1002'''
:or if the player was in inventory mode when he dropped it - '''if MenuMode == 1002'''


==See Also==
===See Also===
[[OnAdd]]
* [[OnAdd]]


[[Category: Blocktypes]]
[[Category: Blocktypes]]
Anonymous user