Difference between revisions of "OnDrop"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Flatline hun
imported>JOG
(restated,corrected error and moved notes to "notes")
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.
'''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 removed from an inventory.
*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 - '''GetContainer == 0'''
:or if the object is near the player after he dropped it - '''Getdistance Player < 64'''
:or if the player was in inventory mode when he dropped it - '''if MenuMode == 1'''


This block will be run once when the scripted object is dropped from the Container's inventory. If no parameter is used, the block will be run whenever the object is dropped from anything's inventory.
Apparently this block will run when object is placed from one container to another, such as placing the object from player's inventory to any container.
If you need to execute script when the object is dropped to the ground by the player, you need to place an '''if (MenuMode == 2)''' condition within the OnDrop block, or else the OnDrop block will run even if the object is placed into a container.--[[User:Flatline hun|Flatline hun]] 04:45, 22 June 2006 (EDT)
[[Category: Blocktypes]]
[[Category: Blocktypes]]

Revision as of 09:25, 22 June 2006

Syntax:

 begin OnDrop ContainerRefID (optional) 

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

  • 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 the object isn't within a container - GetContainer == 0
or if the object is near the player after he dropped it - Getdistance Player < 64
or if the player was in inventory mode when he dropped it - if MenuMode == 1