Appearance
Inventory operations
Choose the operation layer
Use the manager or container API on authority for gameplay setup, rewards, loot creation, and restoration.
Use URicClientPredictedInventoryComponent for supported player-facing operations. It works with the client view and sends the corresponding server requests. The RPC component is the server gateway, not a replacement for your game's permission rules.
Add items
Container.AddItemDefinition(Definition, Stack, OutItemsAdded)adds to one container.Manager.AddItemFromDefinition(...)searches managed inventory space.AddItemWithParamsandAddItemFromDefinitionWithParamsacceptFRicAddItemParams.
The manager supports container-tag search and exclusions. Always inspect how many items were added and decide what to do with the remainder.
FRicAddItemParams carries a stack policy and initial tag stacks. FRicAddResult reports AddedItemCount, AddedItemIds, and StackedItemIds. The policies are Auto, ForceNewSlots, and NoStack; test the desired policy against the concrete container implementation.
Move and drop
For a specific destination, use MoveItem or MoveItemRotated. In drag-and-drop UI:
- Resolve the destination container and slot.
- Ask
GetDropActionfor the proposed action. - Show the placement feedback.
- Call
ProcessDropwhen the player releases the drag. - Observe the resulting inventory refresh.
ERicDropAction distinguishes None, Add, Swap, Stack, Nest, and Return.
Stack and split
Use StackItems for compatible stacks and inspect OutItemsAdded. Use SplitItem or SplitItemInOwningContainer to split through the predicted model.
Splitting also needs space for the new stack. A compatible definition does not guarantee that every incoming item will fit.
Remove and discard
RemoveItem(Item, Num) removes a quantity. The default Num = -1 requests removal of the entire stack.
Use CallDiscardEvent = true when the RPC/predicted operation should notify OnItemDiscarded. Your game implements the dropped world actor or other discard effect. Inventory removal alone is not a world-pickup system.
Swaps in this snapshot
The default buffer strategy's execution methods can mutate slots while returning false. The relocate strategy can return true without completing placement. These are current implementation limitations, not reliable success signals.
Do not use swaps as an example of guaranteed atomic behavior in version 1.0. Validate or repair the strategy used by your game; see Troubleshooting.