AbilitySystemStateComponent
- Module
- Game
- Header
#include "Game/Components/AbilitySystemStateComponent.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Properties
| Type | Name | Description |
|---|---|---|
float | health | snapshot. These are the CURRENT (aggregated) attribute values. Default 0.0f. |
float | maxHealth | Default 0.0f. |
float | mana | Default 0.0f. |
float | maxMana | Default 0.0f. |
float | stamina | Default 0.0f. |
float | maxStamina | Default 0.0f. |
uint32_t | statusFlags | Discrete status word — bit 0 = dead, higher bits = game-defined status flags. Rides the reliable channel so a dropped snapshot never strands a client on a stale death/status. Default 0. |
std::vector<uint32_t> | grantedAbilities | Every ability the server has granted, as wire ids (MAbilitySystemComponent::AbilityWireId — FNV-1a32 of the tag path, the same id the activation RPCs carry). A client uses it to refuse an activation the server would reject anyway, saving the round trip. |
std::vector<uint32_t> | cooldownAbilities | Live cooldowns as two INDEX-ALIGNED arrays: ids and the seconds left on each. Two arrays rather than one array of pairs because the codec takes fixed-width ELEMENTS — a struct entry needs a per-element codec, and a uint64 (id<<32 | ms) is not in the replicable type set either. Readers must walk min(size, size): a lost or reordered update must not read one array past the other. |
std::vector<float> | cooldownRemaining | |
uint32_t | lastRequestedAbility | Runtime-only bookkeeping (not replicated as fields — driven by the RPCs). Default 0. |
uint32_t | lastActivatedAbility | Default 0. |
uint32_t | abilityActivations | Default 0. |
uint16_t | lastRequestedPredictionKey | Default 0. |
uint16_t | lastConfirmedPredictionKey | Default 0. |
uint16_t | lastRejectedPredictionKey | Default 0. |
uint32_t | lastCueId | Last replicated cue, kept for observers and tests. The cue itself is dispatched the moment the RPC lands, not buffered — cues are cosmetic and a frame of queueing buys nothing, while a queue would need a policy for what to drop when several arrive in one tick. Default 0. |
uint32_t | lastCueEvent | Default 0. |
float | lastCueMagnitude | Default 0.0f. |
Vec3 | lastCueLocation | |
uint32_t | cuesReceived | Default 0. |
uint32_t | cuesUnresolved | Default 0. |
Public functions
| Returns | Name | Description |
|---|---|---|
float | CooldownFor | Seconds left on wireId, 0 when it is not on cooldown. |
bool | HasGrantedAbility | |
void | ServerActivateAbility | Client → server: "the owning client wants to activate ability N, and it has already predicted the result under prediction key K." MFUNCTION(Server) auto-installs an OwnerOnly policy, so only the peer that owns the pawn may send it. |
void | MulticastAbilityActivated | Server → every client: "ability N activated." Runs on the server and on each ghost, so cosmetic reactions (cues, montages) can play everywhere. |
void | ClientConfirmAbility | Server → owning client: the predicted activation stands. |
void | ClientRejectAbility | Server → owning client: the predicted activation was refused. |
void | MulticastGameplayCue | Server → every client: "this cosmetic cue fired." Reliable, because a dropped death cue leaves a corpse with no effect on it and nothing later repairs it — a cue is an edge, not a state a snapshot can re-converge. |
Function details
CooldownFor
float CooldownFor(uint32_t wireId) constSeconds left on wireId, 0 when it is not on cooldown. The pairing invariant is enforced HERE so every caller gets it right.
HasGrantedAbility
bool HasGrantedAbility(uint32_t wireId) constServerActivateAbility
void ServerActivateAbility(uint32_t abilityId, uint16_t predictionKey)Client → server: "the owning client wants to activate ability N, and it has already predicted the result under prediction key K." MFUNCTION(Server) auto-installs an OwnerOnly policy, so only the peer that owns the pawn may send it. The server validates + activates on the real ASC and answers the owning client with a confirm or a reject carrying the same key, so the client reconciles the exact activation it predicted.
MulticastAbilityActivated
void MulticastAbilityActivated(uint32_t abilityId)Server → every client: "ability N activated." Runs on the server and on each ghost, so cosmetic reactions (cues, montages) can play everywhere.
ClientConfirmAbility
void ClientConfirmAbility(uint32_t abilityId, uint16_t predictionKey)Server → owning client: the predicted activation stands. The client drops the retained baseline; the replicated attributes converge the values.
ClientRejectAbility
void ClientRejectAbility(uint32_t abilityId, uint16_t predictionKey)Server → owning client: the predicted activation was refused. The client rolls its ASC back to the captured baseline for that key.
MulticastGameplayCue
void MulticastGameplayCue(uint32_t cueId, uint32_t cueEvent, Vec3 location, float magnitude)Server → every client: "this cosmetic cue fired." Reliable, because a dropped death cue leaves a corpse with no effect on it and nothing later repairs it — a cue is an edge, not a state a snapshot can re-converge. The tag travels as FGameplayCueDispatcher::CueWireId (FNV-1a32 of the path); a receiver that has never named that tag cannot resolve it, so the cue is counted in cuesUnresolved and dropped rather than guessed at. The location rides along because a cue plays in the WORLD, not on the owner: an impact effect belongs at the hit, not at the actor's pivot.