How-To: Drive Node Actions at Runtime
Goal: activate nodes, commit atomic batches, respec, and save/restore loadouts through the manager - all server-validated.
Prerequisites
Quick Start complete: an initialized
UCrimsonSkillTreeManager with at least one configured tree.1. Single action
The simplest path - one node, one action. Routed through a validated Server_ RPC.
STM->RequestSkillNodeAction(NodeGuid, ECrimsonSkillNodeActionType::Activate);// Also: Deactivate, IncrementLevel, DecrementLevel
2. Atomic batch (all-or-nothing)
Commit several changes as one transaction - it applies only if every change is valid (great for 'spend N points then confirm' UIs).
TArray<FSkillNodeChangeRequest> Batch;Batch.Add({ TalentGuid, ECrimsonSkillNodeActionType::Activate });Batch.Add({ OtherGuid, ECrimsonSkillNodeActionType::IncrementLevel });STM->RequestCommitNodeChanges(Batch);
3. Atomic respec
Wipe a tree and apply a new end-state allocation in one step.
TArray<FSkillNodeChangeRequest> NewAllocation;// ... populate with Activate / IncrementLevel requests for the desired end state ...STM->RequestRespecAndCommit(SkillTreeTag, NewAllocation);
4. Named loadouts
STM->SaveLoadout(FName("PvP"), SkillTreeTag);STM->RestoreLoadout(FName("PvP")); // internally respecs + batch-appliesSTM->DeleteLoadout(FName("PvP"));
Authority
All of these are validated server-side. Clients call them freely; the manager fires
Server_ RPCs and applies changes only on the server, which replicates the result back. Never mutate node state on a client directly.Verify
After each call,
OnSkillTreeStateUpdated broadcasts. In a Listen Server + Client test, node levels and bIsActive match on both ends.See also
- How-To: Save & Load - persist the allocation
- Concept: Multiplayer - RPCs, FastArrays, authority guards