OnDrop

From GECK
Jump to: navigation, search

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

 begin OnDrop ContainerRefID

Example

 begin OnDrop 
 begin OnDrop player 

Notes

  • This blocktype does NOT run if the object is dropped via Drop,DropMe or with RemoveMe.
  • This blocktype DOES run if the object is dropped via DropAlt, DropMeAlt, dropping via the pip-boy, hitting the weapon off of its owner in VATS, or by killing the object's owner.
  • 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.
  • 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

See Also