How-To: Get the Building Blocks
Goal: every handle the other pages assume - the manager, the slots component, an equipment instance, the settings - plus the one piece this plugin deliberately does not ship: the route that carries a client's intent to the server.
1. Get the manager component
Everything mutating and most querying goes through UCrimsonEquipmentManagerComponent. It lives on the pawn, so find it from the pawn.
Get Player Pawn -> Get Component By Class (Class = Crimson Equipment Manager Component). Anywhere you already have the pawn - inside the pawn's own graph, or from a controller with Get Controlled Pawn - use that instead of Get Player Pawn.
BeginPlay or a possession callback and cache the result - look it up when you need it, or wait for readiness (step 5).EquipmentManager (or whatever your component is named) once the pawn is fully replicated.2. Query what is equipped
All of these are BlueprintPure and safe on any machine - the equipment list replicates to every connection.
| Node | Returns | Use it for |
|---|---|---|
Get Equipment Instance For Slot (Slot Tag, Slot Index) | UCrimsonEquipmentInstance* | The item in a slot, or null when it is empty. |
Get Equipment Actor In Slot (Slot Tag, Slot Index) | AActor* | This machine's first spawned actor for that item - the mesh you can attach VFX to. |
Get Equipment Actors In Slot (Slot Tag, Slot Index) | TArray<AActor*> | All of this machine's actors for that item, when the definition spawns several. |
Get First Instance Of Type (Instance Type) | UCrimsonEquipmentInstance* | The first equipped instance of a class - how you find 'the equipped weapon' when weapons share an instance subclass. |
Get Equipment Instances Of Type (Instance Type) | TArray<UCrimsonEquipmentInstance*> | Every equipped instance of a class. |
Get Component By Class (Crimson Equipment Manager Component) -> Get Equipment Instance For Slot (Slot Tag = Equipment.Slot.Weapon, Slot Index = 0) -> Is Valid.
Equipment.Slot.Head returns null in both.3. Read the slot layout
The layout answers 'which slots does this pawn have, and how many of each'. Read it when you are building UI that draws one widget per slot.
Get Component By Class (Crimson Equipment Slots) -> Get Slot Layout returns the array of Slot Tag / Slot Count pairs. Find Slot Definition (Slot Tag) returns a single entry and a bool.
From a widget that should not name the manager, use Get Equipment Slot Layout (UCrimsonEquipmentBridgeStatics) (Context Actor = the pawn) instead - see step 6.
Slot Count = 2 still yields one entry, whose count is 2.4. Route a client's intent to the server
This is the piece the plugin does not ship. Equip Item and every other mutator are BlueprintAuthorityOnly: called on a client they do nothing at all. A click in your equipment UI has to become a Server_ RPC your project owns, and that RPC calls the manager.
Put the RPC on the PlayerController - it is owned by the client, so a client is allowed to call a server RPC on it, and it is the standard place for player intent.
In your PlayerController Blueprint, add a Custom Event named Server Equip Item. In its Details panel set Replicates to Run on Server, tick Reliable, and add two inputs: Equipment Definition (a class reference of type Crimson Equipment Definition) and Slot Index (integer).
Wire the event body: Get Controlled Pawn -> Get Component By Class (Crimson Equipment Manager Component) -> Equip Item (Equipment Definition = the input, Specific Slot Index = the input). Validate the input first - never trust what the client sent.
Your UI then calls Server Equip Item on the owning PlayerController. The event body runs on the server, so the BlueprintAuthorityOnly node executes normally.
Can Equip Item; it does not check that this player is allowed to equip this definition. Whether the player owns the item, is alive, or is out of combat is your RPC's job. A _Validate that returns false disconnects the client, so use it for impossible values and put gameplay rules in the implementation or in How-To: Gate Equipping and Unequipping.Equip Item directly from the client instead and nothing happens - LogCrimsonEquipment logs an error about authority in the client window.5. Wait until the equipment system is ready
When the components are added by a Game Feature action, they arrive after the actor does. The action announces the ModularGameplay feature state CrimsonEquipment::SystemReadyFeatureName (Crimson.SystemReady.Equipment) on the actor rather than making you poll.
| Tag constant | Tag | Announced when |
|---|---|---|
CrimsonEquipment::SystemReadyFeatureName (state tag TAG_Crimson_SystemReady_Equipment) | Crimson.SystemReady.Equipment | The Add Equipment Slots action has created the slots component and applied its layout, on that actor. |
There is no Blueprint node for ModularGameplay feature states. In Blueprint, bind the manager's On Equipment Changed Message event (it fires as the slots fill), or check Get Equipment Slot Layout on a short timer after possession. In C++, wait on the feature state (right).
6. Talk to equipment without depending on this plugin
A widget, an inventory, or another system can read and test equipment without touching the manager's type. UCrimsonEquipmentBridgeStatics exposes four pure nodes that find whatever component implements ICrimsonEquipmentHost on an actor:
| Node | Returns | Notes |
|---|---|---|
Find Equipment Host Component (Context Actor) | UActorComponent* | The component implementing the host interface, or null. |
Is Object Equipped (Context Actor, Source Object) | bool + Out Slot Tag + Out Slot Index | Whether a given object is currently the source of an equipped item. |
Get Equipped Object In Slot (Context Actor, Slot Tag, Slot Index) | UObject* | The source object in a slot - your item, not the equipment instance. |
Get Equipment Slot Layout (Context Actor) | TArray<FCrimsonEquipmentSlotInfo> | Slot tag and count pairs. Empty when the pawn has no slots component. |
BlueprintPure. The mutating half of the interface - Equip, CanEquip, UnequipBySource, UnequipSlot - is C++ only: ICrimsonEquipmentHost is declared CannotImplementInterfaceInBlueprint and those methods are plain virtuals. A Blueprint that must equip through the bridge needs a small C++ wrapper, or calls Equip Item on the manager directly. See How-To: Bridge an Item System.7. Read the settings
UCrimsonEquipmentSettings lives at Project Settings -> Crimson -> Crimson Equipment and writes to your project's Config/DefaultGame.ini.
| Setting | Default | What it does |
|---|---|---|
Display Actor Class | ACrimsonEquipmentDisplayActor | The actor spawned for Actors To Spawn entries that leave Actor To Spawn empty. Point it at your own subclass to change materials or add VFX globally. |
b Verbose Logging | false | Turns on Info-level LogCrimsonEquipment output for equip, unequip, slot resolution, swap, move, actor spawn and destroy, the lifecycle hooks, and save gathering. |
LogCrimsonEquipment shows one line per step of the equip.See also
- How-To: Bridge an Item System
- How-To: React to Equipment Changes
- Concept: Multiplayer