Description
Wiki Description
Drops the specified object from this object's inventory.
Documentation Comment
Drops the specified object from this object's inventory
Caveats
CK Wiki - 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 Form ID value for the ObjectReference, even though it still physically drops the object from the inventory. If you need to run further ObjectReference Functions onto the dropped object, you will need to refer to that object's reference ID directly.
- If akObject is an ObjectReference, even one which was just received by i.e. OnItemAdded(), DropObject() will fail with an error in the script log: "cannot be dropped, it has no 3d." You can instead use itemRef.MoveTo(containerRef) to pull a specific reference out of inventory, but note that if itemRef is a weapon and containerRef is an actor (such as the player), the actor may be wounded unless you give MoveTo() a sufficient offset.
Parameters
intaiCount=1
CK Wiki Description
How many to drop
- Default:1
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)Auto-Generated Example
Form myForm__akObject
int myInt__aiCount
ObjectReference returnedValue = myObjectReference__toCallFunctionOn.DropObject(myForm__akObject, myInt__aiCount)