Skip to content

Gameplay Ability System

The TACraftwrightGAS module connects crafting to Unreal’s Gameplay Ability System (GAS). It is optional: Craftwright’s core doesn’t need GAS, and nothing in this module runs unless you use its classes. The Gameplay Abilities plugin is enabled together with Craftwright so the module can load.

Class Kind What it does
Ability System Has Tags Condition The crafter’s ability system must have (and not have) gameplay tags
Attribute Requirement Condition An attribute must be at least, at most or equal to a value
Attribute Cost Condition Crafting costs an attribute per unit, paid when the craft starts
Apply Gameplay Effect Effect Applies a Gameplay Effect after each unit
Send Gameplay Event Effect Sends a gameplay event to the crafter after each unit
Craftwright Crafter GAS Crafter component Adds the ability system’s tags to Crafter Tags and multiplies crafting speed and luck by attributes
Craftwright Station GAS Station component Multiplies the station’s speed by an attribute of the station actor’s ability system

Conditions and effects go into a recipe’s Conditions and Effects lists. See Conditions and effects.

The GAS classes look for the crafter’s ability system component on, in this order:

  1. the crafter’s pawn (or its owner when there is no pawn),
  2. the crafter’s owner,
  3. the pawn’s player state,
  4. the controller’s player state, when the crafter is on a controller.

So setups that keep the ability system on the pawn and setups that keep it on the player state (like Lyra) both work. The actors are asked through GAS’s own lookup (UAbilitySystemGlobals::GetAbilitySystemComponentFromActor), so implement IAbilitySystemInterface on the actor that owns the ability system, as GAS setups usually do.

The GAS station asks its own actor, the station actor, the same way.

Conditions are checked on the client for the menu and again on the server. When a condition fails, its Fail Reason is shown; when that is empty, the default message below.

Property Default Meaning
Required Tags Empty Tags the ability system must have. Empty passes.
Require All On On: every required tag. Off: any one of them.
Blocked Tags Empty Crafting is blocked while any of these is present, for example Status.Stunned.
Fail Reason Empty Shown when the condition fails.

Default messages: “You cannot craft right now.” when a blocked tag is present, Requires <tags> when required tags are missing. The ability system’s owned tags include tags from active Gameplay Effects, so a perk or a buff can unlock a recipe.

Property Default Meaning
Attribute None The attribute to read, for example Smithing.
Compare At Least At Least, At Most or Equal.
Value 1 The value to compare with.
Fail Reason Empty Shown when the condition fails.

Default message: Requires <attribute> <value>, for example “Requires Smithing 3”. The condition fails when the ability system or its attribute set isn’t found.

Property Default Meaning
Attribute None The attribute to pay with: stamina, mana, energy.
Cost Per Unit 10 The cost of one unit; a batch of N costs N times this.
Fail Reason Empty Shown when there isn’t enough.

The cost of the whole batch is checked with the other conditions. When the craft is accepted, the server pays it by applying an instant Gameplay Effect that subtracts the cost from the attribute’s base value, so your attribute set’s clamping and replication apply. Default message: Not enough <attribute> (<cost> needed).

The whole batch is paid at once when the craft is accepted, and the cost isn’t refunded when the job is cancelled.

Effects run on the server after each crafted unit.

Property Default Meaning
Gameplay Effect None The Gameplay Effect class to apply to the crafter’s ability system.
Level 1 The effect level.
Set By Caller Tag None Optional Set By Caller tag, for example Data.XP.
Set By Caller Magnitude 0 The magnitude for that tag, for example 25 XP.
Only On Success On Apply only when the unit succeeded.

The recipe is added to the effect context as source object, so the effect (or your attribute set) can tell which recipe granted it.

Property Default Meaning
Event Tag None The event sent after a successful unit.
Failed Event Tag None A separate event for failed units. Empty = no event on failure.

The event goes to the ability system’s avatar actor, with the recipe as Optional Object, the crafter’s pawn (or owner) as Instigator and an Event Magnitude of 1. Abilities that wait for gameplay events can react: play a hammer animation, count crafted items for a quest.

UTACraftwrightGASCrafterComponent is a Craftwright Crafter that reads the ability system. Use it instead of the normal crafter component.

Property Default Meaning
Speed Attribute None When set and found, crafting speed is Crafting Speed multiplied by this attribute, for example CraftingSpeed = 1.25. Values of 0 or below are ignored.
Luck Attribute None When set and found, luck is Crafting Luck multiplied by this attribute, for example CraftingLuck = 1.5 makes lucky crafts 50 % more likely. Values of 0 or below are ignored.
  • Get Crafter Tags returns Crafter Tags plus the ability system’s owned tags, so the core Crafter Has Tags condition sees GAS tags too.
  • Get Crafting Speed applies Speed Attribute. It affects hand crafting in the crafter’s own queue, and jobs at stations with Use Crafter Speed on. See Crafting speed.
  • Get Crafting Luck applies Luck Attribute. It multiplies the Bonus Chance of recipes. See Lucky crafts.

UTACraftwrightGASStationComponent is a Craftwright Station whose speed comes from an attribute of the station actor’s ability system, for example an upgraded forge or a buff from a Gameplay Effect. Use it instead of the normal station component.

Property Default Meaning
Speed Attribute None Multiplies the station’s Crafting Speed when set and the station actor has an ability system with this attribute. Values of 0 or below are ignored.

Get Station Speed applies Speed Attribute. Turn on Use Crafter Speed to multiply it by the speed of the crafter who queues the job. See Speed.

Goal Setup
Smithing level 3 for a sword Attribute Requirement: Attribute Smithing, Compare At Least, Value 3
15 stamina per crafted bandage Attribute Cost: Attribute Stamina, Cost Per Unit 15
25 XP per crafted unit Apply Gameplay Effect: an instant effect that adds a Set By Caller magnitude to XP; Set By Caller Tag Data.XP, Magnitude 25
No crafting while stunned Ability System Has Tags: Blocked Tags Status.Stunned
Perk that speeds up hand crafting Craftwright Crafter GAS with Speed Attribute CraftingSpeed, and a perk effect that raises it
Perk that makes lucky crafts more likely Craftwright Crafter GAS with Luck Attribute CraftingLuck, and a perk effect that raises it
Upgraded forge Craftwright Station GAS on the forge, with Speed Attribute CraftingSpeed on the forge’s ability system