Inventory

Parent

A actor component that can hold multiple item stacks. WARNING! Be aware of container inventories, and never open their UI, otherwise these function will not work as expected.

Properties

itemCount : Int

The absolute amount of items in the whole inventory.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Item Count

size : Int

The count of available item stack slots this inventory has.

Details
Flags ReadOnly RuntimeSync RuntimeParallel

Display Name

Size

Functions

canSplitAtIndex (index : Int) → canSplit : Bool

Returns true if the item stack at the given index can be split.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Can Split at Index

Parameters
Name Type Description

Index index

Int

The slot index of which you want to check if the stack can be split.

Return Values
Name Type Description

Can Split canSplit

Bool

True if the stack at the given index can be split.

flush ()

Removes all discardable items from the inventory completely. They will be gone! No way to get them back!

Details

Flags

RuntimeSync MemberFunc

Display Name

Flush

getStack (…​)

Returns the item stack at the given index. Takes integers as input and returns the corresponding stacks.

Details

Flags

VarArgs RuntimeSync RuntimeParallel MemberFunc

Display Name

Get Stack

sort ()

Sorts the whole inventory. (like the middle mouse click into a inventory)

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Sort

splitAtIndex (index : Int, num : Int)

Tries to split the stack at the given index and puts the given amount of items into a free slot.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Split At Index

Parameters
Name Type Description

Index index

Int

The index of the stack you want to split.

Num num

Int

The number of items you want to split off the stack at the given index.

swapStacks (index1 : Int, index2 : Int) → successful : Bool

Swaps two given stacks inside the inventory.

Details

Flags

RuntimeSync RuntimeParallel MemberFunc

Display Name

Swap Stacks

Parameters
Name Type Description

Index 1 index1

Int

The index of the first stack in the inventory.

Index 2 index2

Int

The index of the second stack in the inventory.

Return Values
Name Type Description

Successful successful

Bool

True if the swap was successful.