ActionGiveItem(object, object)

From NWN Lexicon
Jump to navigationJump to search

Gives a specified item to a target creature.

void ActionGiveItem(
    object oItem,
    object oGiveTo
);

Parameters

oItem
Item to give
oGiveTo
Object to give oItem to

Description

Gives oItem to oGiveTo. No corresponding animations are played, and the item is deposited immediately into oGiveTo's inventory. If oItem is not a valid item, or oReciever is not a valid object, nothing will happen.

Remarks

oGiveTo can be a creature (PC or NPC) or a container object.

oGiveTo doesn't have to be in the vicinity, or even the same area, as the caller of the function. Nor will the function cause the caller to move towards oGiveTo.

It is much faster to transfer items between inventories (using either this function or ActionTakeItem) if the object that is assigned the action is a placeable rather than a creature. For this reason, use ActionGiveItem when transferring many items from a placeable to a creature and ActionTakeItem when transferring items from a creature to a placeable.

Version

1.61

See Also

functions:  CreateItemOnObject



author: Ryan Hunt, editor: Lilac Soul