Storm Game Framework 2.0.0
User guide
Loading...
Searching...
No Matches
Equip and show the item

Put the owned supply kit into Main hand, prove which instance is equipped, then show a simple prop on the character. The prop display in this chapter is project Blueprint presentation driven by SGF equipment state. It is intended for the third-person tutorial view.

Before you start

Complete Give the player an item. Keep Starter Item set to DA_SupplyKit. You will continue using the same pawn and game mode.

Give the tutorial its own equipment configuration

Duplicate these assets into Tutorial/Characters:

Original Copy
DA_PlayerCharacter_Equipment DA_TutorialEquipment
DA_PlayerCharacter_ItemEquipment DA_TutorialItemEquipment
DA_PlayerCharacter_Loadouts DA_TutorialLoadouts

Open DA_TutorialEquipment. Keep Slot Config at DA_PlayerCharacter_EquipmentSlots, set Descriptor Provider to DA_TutorialItemEquipment, and set Loadout Catalog to DA_TutorialLoadouts. Keep the selected Loadout tag, Loadout.SGFSetup.Starter. Save.

In DA_TutorialCharacter, change the profile for Storm.Capability.Equipment to DA_TutorialEquipment. Save. These copies let you change item rules while retaining the original starter configuration.

Allow and select the supply kit

  1. Open DA_TutorialItemEquipment. Change its existing entry's Item Archetype Id to StormItemArchetype:DA_SupplyKit. Add Equipment.Slot.SGFSetup.MainHand to Compatible Slots. Save.
  2. Open DA_TutorialLoadouts. Expand the loadout named Loadout.SGFSetup.Starter. Add one Entries element.
  3. Set Slot Tag to Equipment.Slot.SGFSetup.MainHand and Item > Definition Id to StormItemArchetype:DA_SupplyKit. Save.

The slot tag comes from the generated slot configuration. Use that exact tag in each asset. The loadout selects an instance the pawn already owns; it does not replace the game mode's grant.

Check the equipped identity

In BP_PlayerCharacter, create a function DescribeEquipment. Get the Equipment component and call Get Equipped In Slot with the Main hand tag. Branch on its Boolean return value.

On true, break Out Equipped, print its Instance Id GUID and label it Main hand. On false, print Main hand is empty. Add keyboard 4, connecting Pressed to this function. Compile, play, then press 3 and 4. The equipped instance ID should match the inventory instance ID from this same play session.

For a refusal check, stop Play and temporarily remove Main hand from the item's Compatible Slots. On the next Play, character assembly can refuse the invalid starting loadout and leave the character unready. Check the definition's validation and Output Log. Restore compatibility before continuing; a matching loadout entry alone does not grant permission.

Add the third-person prop

  1. In BP_PlayerCharacter > Components, add a Static Mesh component named SupplyKitVisual beneath the inherited Mesh component.
  2. Set its mesh to the Engine Cube, Collision Presets to NoCollision and Hidden in Game on. Leave Owner No See off so the owning player can see the prop in third person.
  3. Set Parent Socket to the mannequin's hand_r bone. Start with relative location and rotation zero and scale 0.15, 0.10, 0.10. You can adjust the offset while inspecting the right hand in the Blueprint viewport.

    Give the cube a bright material if it is hard to distinguish from the character. This is ordinary project presentation; its visibility still comes from the equipment check below.

  4. Create RefreshSupplyKitVisual. Call Equipment > Get Equipped In Slot for Main hand, break the returned equipped item and its Item reference, and compare that Definition Id with Get Primary Asset Id From Object targeting DA_SupplyKit.
  5. Combine the slot's Boolean return with the ID comparison using AND. Negate that Boolean and pass it to SupplyKitVisual > Set Hidden in Game. This keeps the prop hidden for an empty slot or a different item.
  6. Select Equipment and add its On Slot Changed event to the Event Graph. Call RefreshSupplyKitVisual from it.
  7. Add a handler for On Character Readiness Changed. When its ready Boolean is true, call RefreshSupplyKitVisual. Also call it from BeginPlay to establish the initial hidden state. Compile and save.

Keep one BeginPlay event: add a Sequence if the graph already uses it. Readiness can happen after BeginPlay, so the readiness event performs the final refresh once assembly finishes. Slot changes refresh from the current complete state; the event's payload need not become a second source of truth.

Play and check

Use third person. The cube should follow the right hand when the kit starts equipped. In a fresh session with an empty starting loadout, the inventory still contains the kit but the prop should stay hidden. Restore the loadout afterwards.

The bright cube follows the right hand while the supply kit is equipped.

For a local standalone teardown check, temporarily add keyboard 6 to Equipment > Try Unequip Slot, using Main hand. Pressing it should hide the prop while inventory inspection still finds the kit. That mutation is server-only; a networked inventory UI should use SGF's owner request/coordinator workflow instead.

Check this prop in third person. The exercise does not provide a separate first-person viewmodel or camera-mode visibility rules. First-person item presentation, multiple presentation actors and semantic attachment rules belong to the native held-item path described in Native held-item integration.

If something does not match

Symptom Check
The character does not become ready. Check the grant, compatible slot, profile links and selected loadout.
Slot and inventory IDs differ. Compare the same pawn in the same play session. Use the owned instance, not an archetype ID.
The prop is always visible. Check Hidden in Game and the state refresh graph.
The prop is at the character's feet. Attach it beneath Mesh and set Parent Socket > hand_r.
The prop appears differently in first person. Use third person for this check; first-person visibility and viewmodel presentation need their own setup.

Checkpoint: Main hand names the owned kit instance and the prop reflects that slot's current state.

Next: Add your first game rule.