Difference between revisions of "OnDrop"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Quetzilla
imported>LogicDragon
m (corrected error)
 
(7 intermediate revisions by 4 users not shown)
Line 4: Line 4:
   begin OnDrop  
   begin OnDrop  
   begin OnDrop player  
   begin OnDrop player  
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.




'''Notes:'''
==Notes==
 
*Other than its 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 removed from an inventory.  
*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'''
:or if the object is near the player after he dropped it - '''if Getdistance Player < 64'''
:or if the object is near the player after he dropped it - '''if GetDistance Player < 64'''
:or if the player was in inventory mode when he dropped it - '''if MenuMode == 1'''
:or if the player was in inventory mode when he dropped it - '''if MenuMode 1002'''


[[Category: Blocktypes]]
[[Category: Blocktypes]]

Latest revision as of 14:17, 30 January 2011

Syntax:

 begin OnDrop ContainerRefID 

Example:

 begin OnDrop 
 begin OnDrop player 

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.


Notes[edit | edit source]

  • Other than its 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).
  • 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
or if the object is near the player after he dropped it - if GetDistance Player < 64
or if the player was in inventory mode when he dropped it - if MenuMode 1002