中EN

Gameplay Effects

  • Gameplay Effects change Attributes on targeted Actors; instant (damage) or persistent (poison). Buffs/debuffs.
  • Gameplay Effects are assets and therefore are immutable at runtime (exceptions: created at runtime but not modified after). Gameplay Effect Specs are the runtime versions (instanced data wrapper); Blueprint/Ability System Blueprint Library works with Specs.
  • Duration: Instant, Infinite, Has Duration. Duration GEs added to the Active Gameplay Effects Container (part of ASC). Instant is "Executed", never enters container. Both are "Applied" (CanApplyGameplayEffect). Periodic effects are both "Added" and "Executed" each period.
  • Properties: Duration; Components; Modifiers (math on attributes e.g. +5% of base armor, tag requirements); Executions (UGameplayEffectExecutionCalculation for complex equations); Gameplay Cues (four functions: On Active, While Active, Removed, Executed (GE only); tags must start with GameplayCue, e.g. GameplayCue.ElectricalSparks); Stacking (threshold, stack count to max, reset/append time, independent instances).
  • GEComponents: limited to native code; live inside the GE (data-only Blueprint asset), only one GEComponent exists for all applied instances. List: UChanceToApplyGameplayEffectComponent, UBlockAbilityTagsGameplayEffectComponent, UAssetTagsGameplayEffectComponent (don't transfer to actors), UAdditionalEffectsGameplayEffectComponent, UTargetTagsGameplayEffectComponent, UTargetTagRequirementsGameplayEffectComponent, URemoveOtherGameplayEffectComponent, UCustomCanApplyGameplayEffectComponent, UImmunityGameplayEffectComponent.
  • Attributes and Attribute Sets must be created in native code — they cannot be created in Blueprints.
  • Overrides: PreAttributeChange / PreAttributeBaseChange (enforce rules like 0..MaxHealth; should not trigger in-game reactions); PreGameplayEffectExecute (reject/alter); PostGameplayEffectExecute (react, clamp, e.g. die at zero health).

引用这一章的笔记

输入关键词开始搜索

滚轮或双指缩放 · 拖动平移 · 双击放大 / 还原