Open a Shared Loot Container
Build a supply chest that offers one bandage stack. The chest owns the original stack, the player chooses Take, and a later visitor sees the chest without it. Start with a player inventory with room for the reward.
Stock the chest
Create a Blueprint based on
NinjaInventorySharedStorageActor, add a mesh, and place it in the level. Its shared manager handles the world inventory. Give it an Initial Containers entry with Simple Layout and the default-container tag.Add a Loot Fragment to the bandage definition. Leave Only From Loot Containers off for this example. Add one bandage stack to the chest's Initial Items. Keep it unbound so it can be offered as loot.
On the chest's manager choose Inventory Items Loot Selector. Disable Roll for Items and Consume Item Budget for a guaranteed offer. Use None for Loot Persistency Mode to read the current contents each time. On the player's receiving manager, enable Remove Looted Items From Source.
Offer the contents and take one entry
When the player opens the chest, check your range or access condition on the server. Call
OpenSessionForActoron the chest with the player actor. CheckIsActorAuthorizedbefore allowing access.Open a panel owned by the player. Give it an Inventory Loot ViewModel with Inventory Resolver and bind Get Items to the panel's item entries. Once the panel is listening, call
GenerateLooton the chest's manager with the player's manager. The resulting selection is sent to that player.On Take, pass the selected entry to the Loot ViewModel's
TransferLootEntryFromViewModel. For a custom menu using manager functions, callTransferLooton the player's manager with the original offered entry. It carries the identity of this chest and this reward.On close, call
DismissLooton the Loot ViewModel, or on the player's manager with the source manager. Close the chest's session withCloseSessionForActoron the server. Use the same cleanup when the player walks away.
Use the player's OnLootEvent delegate for a custom reward notification. C++ listeners can bind Native_OnLootEvent. To change eligibility without rebuilding the panel, customize the source's loot selector.
Try It in Play
Open the chest, take the stack, and check the player's bag. Inspect the chest's inventory in the Gameplay Debugger and confirm that its original stack is gone. Close the panel and check that the chest no longer authorizes that player. Reopen it with a second player and check that the bandages are gone.