Difference between revisions of "DropObject - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Fg109
imported>AmethystDeceiver
Line 33: Line 33:
* If a number greater than 1 is used for aiCount, the objects dropped will be stacked. In order to drop individual items, DropObject must be called for each instance of the item.
* If a number greater than 1 is used for aiCount, the objects dropped will be stacked. In order to drop individual items, DropObject must be called for each instance of the item.
* If akObject is equipped, the game will first search for unequipped items in inventory to drop.  Only when there are no more unequipped items will it drop the equipped items.
* If akObject is equipped, the game will first search for unequipped items in inventory to drop.  Only when there are no more unequipped items will it drop the equipped items.
* if akObject is a permanently-persistent reference, DropObject will not return a FormID value, even though it still drops the object from the inventory.


== See Also ==
== See Also ==
*[[ObjectReference Script]]
*[[ObjectReference Script]]

Revision as of 07:38, 17 June 2012

Member of: ObjectReference Script

Drops the specified object from this object's inventory.

Syntax

ObjectReference Function DropObject(Form akObject, int aiCount = 1) native

Parameters

  • akObject: The object to drop from the inventory.
  • aiCount: How many to drop
    • Default: 1

Return Value

The object that was dropped.

Examples

; Drops one chest from the player's inventory, and unlocks it
Game.GetPlayer().DropObject(ChestProperty).Lock(false)


; Drops one hundred arrows from the player's inventory
Game.GetPlayer().DropObject(ArrowProperty, 100)

Notes

  • If a number greater than 1 is used for aiCount, the objects dropped will be stacked. In order to drop individual items, DropObject must be called for each instance of the item.
  • If akObject is equipped, the game will first search for unequipped items in inventory to drop. Only when there are no more unequipped items will it drop the equipped items.
  • if akObject is a permanently-persistent reference, DropObject will not return a FormID value, even though it still drops the object from the inventory.

See Also