Skip to content
Plugin 1.0 · Unreal Engine 5.8Version details

Inventory RPCs ​

Ric Item Operations RPCs (URicItemOperationsRPCsComponent) is the bridge from client prediction to server-side inventory changes. The supplied UI already uses the prediction components and this request flow.

From a local operation to the server ​

For a remote client, the usual inventory operation follows this sequence:

  1. Ric Client Predicted Inventory attempts the operation on its local inventory copies.
  2. If the operation succeeds, it calls the corresponding function on Ric Item Operations RPCs, using source references or IDs that the server can resolve.
  3. The RPC component executes that request on the server through a Reliable Server RPC and applies the operation to the authoritative inventory.
  4. The resulting server state replicates to clients. The prediction component uses that source state for synchronization.

For example, Move Item Rotated first tries to place the item locally. If placement fails, it returns without sending the movement request. When placement succeeds, it calls the RPC component's Move Item Rotated to perform the move on the server. Stacking and splitting follow the same local-success-first pattern.

A successful local result means prediction succeeded. The server still executes the request against its own current inventory state.

What the RPC component handles ​

Its requests cover:

  • Adding and removing items, clearing containers, and discarding items.
  • Moving, rotating, swapping, and nesting items.
  • Stacking, splitting, and changing item quantities.
  • Changing item stat tags, executing actions, and loading or unloading ammunition.
  • Assigning and clearing quick slots, requested by Ric Client Predicted Quick Slots.

Most request functions are available as Blueprint nodes. The prediction components call the appropriate requests for the supplied UI, including internal C++ requests where needed.

Standalone and authority ​

In Standalone, inventory prediction works directly with the source inventory objects. Its GetRPCComponent() returns no RPC component when the owner has authority, so this inventory-operation path does not use network forwarding. The same direct path applies to authority, including the listen-server host.

Quick-slot prediction can still call the gateway's Server functions on authority. Those calls execute locally, without a client-to-server network exchange.

Using your own Blueprint logic ​

For local player actions, use Ric Client Predicted Inventory and Ric Client Predicted Quick Slots. They handle the local change and the corresponding server request. Calling the RPC again after a predicted operation would duplicate that request.

For server-side setup and gameplay, such as creating the starting inventory, use the manager and container operations directly. The RPC component enables replication by default; its actor must also replicate and have the player's owning connection for remote client requests. See Multiplayer and prediction for setup.

Dropping items into the world ​

The demo's BP_DemoPlayerState handles On Item Discarded (RicContainerManager) separately from its BeginPlay initialization. This event supplies Item Instance and Num, the actual number removed by the discard operation.

The inventory removal operation removes the items. This event's Blueprint graph creates their world representation; it does not issue another removal request. A discard request must enable Call Discard Event to use this flow. Discard handling runs on authority, rather than spawning actors from client prediction.

Choose a world actor from the mesh type ​

The supplied handler follows this sequence:

  1. Pass Item Instance to Find Fragment by Class, with the World Mesh fragment selected.
  2. Read the fragment's Mesh and try Cast To StaticMesh.
  3. On a successful cast, use SpawnActor BP World Item Static Mesh.
  4. From Cast Failed, use SpawnActor BP World Item Skeletal Mesh.

The skeletal branch is the graph's fallback from a failed static-mesh cast. The screenshot does not show an additional mesh validity check, so use an item definition with an appropriate World Mesh fragment for this example.

Supply the spawn data ​

Both spawn nodes receive:

  • Spawn Transform Location: the output of Get Drop Location.
  • Spawn Transform Rotation: (0, 0, 0).
  • Spawn Transform Scale: (1, 1, 1).
  • Collision Handling Override: Always Spawn, Ignore Collisions.
  • Item Count: the event's Num.
  • Item Reference to Add: the event's Item Instance.
  • Enable Collision and Simulate Physics: enabled.

The graph passes the existing item reference to the world actor rather than selecting a new Item Definition on the spawn node.

On Item Discarded reads the World Mesh fragment, selects a static or skeletal world item actor, and passes the drop location, item reference, and removed quantity to SpawnActor

Get Drop Location supplies the spawn position. Its implementation and the world actors' item initialization need to be documented separately before reproducing this handler in a custom project. The shown graph also leaves the spawn return values unconnected.