Skip to content

Edit modes

Array-shaped fields take a companion Mode that says how your list combines with what the ability already has.

The default is destructive

UnrealScript uses an enum's first value when you omit the field, and in every enum below that first value is a Replace. Omitting CostMode does not add a cost - it throws away every cost the ability had and keeps only what you listed. Write the mode explicitly; you almost always want Merge. The one exception is an ability you are creating blank: there is nothing to destroy yet. A copy made with CloneFrom has everything its source had, so the rule applies to it in full.

AddOnly does not append

For name arrays (ENameArrayEditMode), eNAEM_AddOnly writes your values only when the target array is currently empty. It is "provide a default", not "add without removing" - that is Merge. For effects, conditions and costs, AddOnly is a synonym for Merge. Different enums, near-identical names, opposite behaviour.

EStatChangeMode

Value Meaning
eSCM_Replace Clear existing stat changes (m_aStatChanges) before applying yours. (Default)
eSCM_Merge Update the entry for each StatType if present, otherwise add it.

EAbilityEffectSlot

Value Meaning
eAES_Target Edit AbilityTargetEffects (effects applied to the primary target). (Default)
eAES_MultiTarget Edit AbilityMultiTargetEffects.
eAES_Shooter Edit AbilityShooterEffects (effects applied to the shooter).

EChargesBonusMode

Value Meaning
eCBM_Replace Clear existing BonusCharges entries before applying yours. (Default)
eCBM_Merge Update the entry for each AbilityName if present, otherwise add it.

EAdditionalCooldownEditMode

Value Meaning
eACEM_Replace Clear existing AditionalAbilityCooldowns entries before applying yours. (Default)
eACEM_Merge Update the entry for each AbilityName if present, otherwise add it.

EAbilityCostEditMode

Value Meaning
eACEM_ReplaceAll As CostMode: clear all existing costs before applying the entries. As per-entry Mode: edit in place if a cost of that class exists, otherwise skip (unless CostMode=eACEM_ReplaceAll, in which case a new cost is added). (Default)
eACEM_Merge Edit the existing cost of that class in place; if none exists, instantiate and add it.
eACEM_AddOnly Same as eACEM_Merge: edit in place if present, otherwise add.
eACEM_Remove Remove the cost of that class from the ability.

EArrayEditMode

Value Meaning
eAEM_ReplaceAll Clear the whole target array, then add this effect/condition. (Default)
eAEM_Merge Edit the existing effect/condition of that class in place; if none exists, instantiate and add it.
eAEM_AddOnly Same as eAEM_Merge: edit in place if present, otherwise add.
eAEM_Remove Remove the first effect/condition of that class from the target array.

ENameArrayEditMode

Value Meaning
eNAEM_Replace Replace the whole target array with the provided values. (Default)
eNAEM_Merge Append each provided value that is not already present.
eNAEM_AddOnly Set the provided values only if the target array is currently empty; otherwise do nothing. It does not append.
eNAEM_Remove Remove each provided value from the target array.

EAbilityCreatePreset

Value Meaning
eACP_Standard TypicalAbility_BuildGameState, TypicalAbility_BuildVisualization and TypicalAbility_BuildInterruptGameState: a normal activated ability such as a shot, a grenade or a protocol. The entry must still provide TargetStyle, ToHitCalc and Triggers. (Default)
eACP_MoveEnd As Standard, but the game state is built by TypicalMoveEndAbility_BuildGameState: a move-then-act ability such as Slash. Expects an X2AbilityTarget_MovingMelee target style.
eACP_Passive TypicalAbility_BuildGameState only, no visualization, bIsPassive=true, neutral hostility, icon hidden in the HUD. Installs X2AbilityTarget_Self, X2AbilityTrigger_UnitPostBeginPlay and X2AbilityToHitCalc_DeadEye, so the entry only has to add the persistent effect.