Skip to content

Sein Effect Subsystem

Class · USeinEffectSubsystem : USeinSystemHostSubsystem

Parent: Sein System Host Subsystem

#include "Effects/SeinEffectSubsystem.h"

Effects in the simulation: applying, stacking, ticking and removing them in their three scopes (an entity instance, a player’s class effects, a player’s own effects), the abilities they grant, and attribute resolution with their modifiers.

C++ members (20)
  • int64 ApplyEffectTransactional(FSeinEntityHandle Target, TSubclassOf<USeinEffect> EffectClass, FSeinEntityHandle Source); Apply an effect now. Returns its ID, or 0 when the apply is rejected, in which case nothing changed. The effects it replaces (RemoveEffectsWithTag) and the new effect or stack update commit together before any callback runs. Then the replaced effects’ removal callbacks run in order, followed by the new effect’s ability grants and OnApply. For native systems whose larger transaction includes the apply. Bootstrap, restore or serial simulation context only; never defers.
  • int64 ApplyEffect(FSeinEntityHandle Target, TSubclassOf<USeinEffect> EffectClass, FSeinEntityHandle Source); Apply an effect. From a simulation callback the apply is queued for the next PreTick and 0 is returned; bootstrap and restore apply immediately through ApplyEffectTransactional. The effect’s scope decides where it lives: the target’s active effects (Instance) or the target owner’s class or player effects. Returns the effect’s ID, or 0 when deferred or rejected.
  • void ProcessPendingEffectApplies(); Drain the deferred applies. Called at PreTick by the effect tick system.
  • bool RemoveEffect(FSeinEntityHandle Target, int64 EffectInstanceID, bool bByExpiration); Remove an effect by ID, looking in the target’s instance effects and its owner’s player storages.
  • bool RemoveEffectByID(int64 EffectInstanceID, bool bByExpiration); Remove an effect by its world-global ID alone.
  • bool RemovePlayerEffect(FSeinPlayerID PlayerID, int64 EffectInstanceID, bool bByExpiration); Remove a class- or player-scope effect from a known player, even after its target died.
  • void PruneEffectAbilityGrantClaim(int64 EffectInstanceID, FSeinEntityHandle Recipient, TSubclassOf<USeinAbility> AbilityClass); Drop ability-grant claims for explicit revokes. Ability rows remain the final authority.
  • void PruneAllEffectAbilityGrantClaims(FSeinEntityHandle Recipient, TSubclassOf<USeinAbility> AbilityClass);
  • bool HasInstanceEffectWithTag(FSeinEntityHandle Target, FGameplayTag Tag) const;
  • int32 GetInstanceEffectStacks(FSeinEntityHandle Target, FGameplayTag Tag) const;
  • bool HasEffectWithTagForPlayer(FSeinPlayerID PlayerID, ESeinModifierScope Scope, FGameplayTag Tag) const; Query one player-owned storage. Scope must be Class or Player.
  • int32 GetEffectStacksForPlayer(FSeinPlayerID PlayerID, ESeinModifierScope Scope, FGameplayTag Tag) const;
  • void RemoveInstanceEffectsWithTag(FSeinEntityHandle Target, FGameplayTag Tag); Remove matching effects from the target’s instance effects and its owner’s player storages.
  • void RemoveEffectsFromDeadSource(FSeinEntityHandle DeadHandle); Remove every effect whose source is DeadHandle and whose class removes on source death.
  • void RefreshAttributes(FSeinEntityHandle Entity); Bring every field effects modify on Entity to its base with the modifiers that reach it now: its Instance effects, its owner’s Class effects for its tags, and on a player entity that player’s Player effects. A field written since the modifiers last applied takes the written value as its base. Effects call it whenever what reaches an entity changes; C++ that writes a modified field calls it after the write. Queues an AttributesChanged visual event when a value changed. Serial simulation context.
  • bool GetNumber(FSeinEntityHandle Entity, const UScriptStruct* Component, const FString& Field, FFixedPoint& OutValue) const; A number field’s value as the simulation reads it, with every modifier that reaches it applied. False when the entity has no such component or number field.
  • bool GetBaseNumber(FSeinEntityHandle Entity, const UScriptStruct* Component, const FString& Field, FFixedPoint& OutBase) const; A number field’s value without modifiers: its base when effects modify it, else the field. False when the entity has no such component or field.
  • bool SetBaseNumber(FSeinEntityHandle Entity, const UScriptStruct* Component, const FString& Field, FFixedPoint Base); Set a number field’s base; the field takes it with the modifiers that reach it applied.
  • bool CopyBaseComponent(FSeinEntityHandle Entity, const UScriptStruct& Component, void* Out) const; Copy Entity’s component of type Component into Out, a value of that type, with every field effects modify at its base. False when the entity has no such component.
  • bool GetClassComponent(const UClass* ActorClass, FSeinPlayerID Player, const UScriptStruct& Component, void* OutDefault, void* OutValue) const; ActorClass’s data for one component. Default is what the class authors, with its live-tuned class defaults; Value adds Player’s Class effects for the class’s tags: what a unit of the class spawned for Player now starts with. Either output may be null. False when the class has no such component.