Table of Contents

Inventory functions

SetInventory

Sets the number of items in actor's inventor to count. This is useful when treating inventory items like variables stored in actors.

This function is optimized to minimize bandwidth use. It computes the difference between the current item count and the requested count, and gives or takes the needed number of items. If the actor already has the exact number of items, this function does nothing.

GiveMaxInventory/TakeMaxInventory

Give maximum possible number of itemname to actor. Shorthand for GiveInventory(itemname, INT_MAX).

Take all items of type itemname from actor. Shorthand for TakeInventory(itemname, INT_MAX).

ToggleInventory

If the actor has no itemname, give one item of this type. If it has one or more item of itemname, take them all.

This is a shorter way of writing x = !x when using inventory items as boolean variables.