text
stringlengths
0
17.2k
ULyraGameplayAbility_Jump
Provides functionality to trigger Jump and StopJumping inputs on the pawn's Character Movement Component while checking that the ability owner is a valid, locally controlled Pawn.
ULyraGameplayAbility_Reset
When activated, this ability instantly resets the owning player with a new pawn in its initial spawned state and cancels all other abilities.
ULyraGameplayAbility_FromEquipment
Provides functionality to interact with Lyra's Equipment system and retrieve the item associated with the ability.
ULyraGameplayAbility_RangedWeapon
Native implementation of weapon firing. Interacts with the associated weapon to determine ammo count, hit accuracy, and others. Provides ray casting functionality to calculate bullet trajectories within a firing cone, find and validate hit targets.
GA_AbilityWithWidget
The base class for any ability that provides additional UI features. This manages the widget state for the ability, so it can display status, cooldown, and other ability information. One example is Lyra's Melee ability, with a custom touch input widget for mobile platforms. The OnAbilityAdded event registers the widget extensions with the UI Extension Subsystem, this saves the extension handles. The OnAbilityRemoved event unregisters and clears the extension handles.
GA_Melee
Contains an Asset Tag of Ability.Type.Action.Melee that grants the Event.Movement.Melee tag while active. This ability is Triggered by the tag InputTag.Ability.Melee, when this tag becomes activated the On Activation event will Commit ability costs in the following order: Find the currently equipped weapon, and play its associated animation montage. Check for authority (server only), then perform a capsule trace in front of the player. If the trace hits a Pawn, additional checks are run, like a team comparison to avoid friendly fire and a secondary check to make sure the target is not occluded by level geometry. If a valid hit is registered, the character is moved towards the target through a RootMotion force. Next, a melee damage gameplay effect is applied on the target, and a melee hit gameplay cue is triggered on the owner. Finally, a Melee Impact sound is played on all clients through a multicast RPC.
GA_Weapon_Fire
Fire and Reload abilities are granted through an Ability Set inside the Lyra Equipment Definition (ULyraEquipmentDefinition) class when the associated weapon is picked up. The activation requirements are handled by the ULyraGameplayAbility_RangedWeapon class, and the targeting logic is done in C++ by the same class. The Weapon Fire Gameplay Ability is activated by the tag InputTag.Weapon.FireAuto (input binding) and the Input.Weapon.Fire tag (gameplay event). It is Inhibited by the Ability.Weapon.NoFiring tag that is set from the reload ability, if the magazine is empty. The Asset Tag of Ability.Type.Action.WeaponFire grants the Event.Movement.WeaponFire tag. While the tag is active the On Ability Added event will set up a listener for the Ability.PlayMontageOnActivateFail.Message tag. This event is triggered when the player attempts to fire the weapon while no ammo is left. When the message is received, it plays a failed to fire montage (dry fire). This montage is only played if the player is still alive, and the animation will only be retriggered if a set amount of time has elapsed to prevent animation spamming. When On Activation is called, If the character is locally controlled, it will perform native targeting traces and builds the targeting data in the following order: Ability costs (ammo consumption) are committed natively. The targeting data is network predicted and sent to the server, where it's validated and confirmed by the ULyraWeaponStateComponent. If the targeting data is confirmed by the server, then the BP event OnRangedWeaponTargetDataReady is called, passing all found targets. This allows the ability to apply damage, play hit effects. Plays the firing Animation montage. Sets a timer to Fire Delay, which is the effective delay between shots. When Fire Delay or the timer finishes, ends the ability. Additional firing attempts are handled by the activation logic. On Ranged Weapon Target Data Ready Is Called from C++ when all targets hit by the weapon are validated. This triggers the Firing gameplay cue on the weapon's owner, which then passes the first hit as a parameter. The cue Iterates through all targets hit, playing impact gameplay cues on each target location. If the ability has authority (is executed on the server), it applies the damage Gameplay Effect on each target hit.
GA_Weapon_ReloadMagazine
This Gameplay Ability is activated by the InputTag.Weapon.Reload, which is an Asset of the Ability.Type.Action.Reload tag. This grants the Event.Movement.Reload tag. While active, it will limit movement options. The reload logic revolves around three gameplay tag stacks on the associated weapon. The Lyra.ShooterGame.Weapon.MagazineSize is the maximum amount of ammo allowed per magazine for the current weapon. Lyra.ShooterGame.Weapon.MagazineAmmo is the remaining amount of ammo in the current magazine. When the amount reaches zero, the weapon must be reloaded to continue firing. Lyra.ShooterGame.Weapon.SpareAmmo is the remaining amount of ammo not in the current magazine. It overrides the K2_CanActivateAbility function, which is a Blueprint implementation of the following activation check logic: Checks if MagazineAmmo is less than MagazineSize. If false, the magazine is full, and reloading should not continue. Checks if SpareAmmo is greater than zero. If false, the player is out of ammo for this weapon. On Activation of the ability: Check for the MagazineAmmo stack count of the associated item. If there's no ammo remaining in the current magazine, it applies a tag to inhibit activation of weapon firing abilities. Plays the weapon reload animation montage, then listens for the GameplayEvent.ReloadDone event. This event is sent through an Animation Notify on the mannequin's montage. When the event is received, checks for authority (server), then performs the reload logic, which is simply changing values for the Lyra.ShooterGame.Weapon.MagazineAmmo and Lyra.ShooterGame.Weapon.SpareAmmo in the associated weapon on the character's inventory. Then ends the ability. If for any reason the event was not processed, the ability ends locally once the montage is stopped or interrupted. On End Ability is called to remove the shooting inhibition tag set on activation if it was set earlier.
GA_Grenade
This ability is activated by the InputTag.Weapon.Grenade Asset tag of the Ability.Type.Action.Grenade. This uses GE_Grenade_Cooldown as a cooldown effect. On Pawn Avatar Set registers the widget with the UI Extension Subsystem on the local client, ensuring that only one widget is added per ability instance. On Activation checks for ability costs and cooldowns and commits them. It ends the ability if either check fails. It will then execute in the following process: Commits the ability cost and cooldown. Calculates the grenade spawn location and rotation. Checks for authority. If the authority is on the server, then it spawns the grenade Actor at the calculated values and sets the owning Lyra Character as the instigator. The spawned B_Grenade Actor is responsible for doing the detonation checks and applying relevant Gameplay Effects. B_Grenade detonates automatically on collision with an enemy pawn. It applies friendly fire to the instigating character (the one who threw the grenade), but not to their teammates. Plays the grenade throw montage, then broadcasts the remaining cooldown time through the Gameplay Message Subsystem, so the associated widget can sync up its cooldown display. Ends the ability immediately, without waiting for the montage to complete. On Ability Removed unregisters and clears the UI Extension.
GA_ADS (Aim Down Sights)
Inherits from GA_AbilityWithWidget to handle the HUD display buttons. This ability is Activated by the InputTag.Weapon.ADS tag, an Asset Tag of Ability.Type.Action.ADS that grants the Event.Movement.ADS tag. While active it is Local predicted, meaning it runs on the client immediately, then the server syncs to catch up. On Activation: Applies a custom camera mode to narrow the Field of View(FOV). Caches and overrides the character's walk speed. Because the ability is locally predicted, this will run on the owning client and server, then replicate to non-local clients. Applies a temporary input mapping context, overriding the movement inputs to one with a lower multiplier. By decreasing the input magnitude, any further movement inputs produce a lower acceleration and are replicated to the server with the lower acceleration value, forcing the character to walk while aiming. For the local player, updates the UI and plays the 'aim started' sound. Waits until the input button is released, and ends the ability once it does. On End Ability: Clears the custom camera mode. If locally controlled, the UI updates and plays the 'aim ended' sound. Restores the controlled character's walk speed and removes the input mapping context to restore normal movement speed.
GA_Hero_Dash
Inherits from the GA_AbilityWithWidget. This ability is activated by the InputTag.Ability.Dash, an Asset tag of the Ability.Type.Action.Dash. This grants the Event.Movement.Dash. while active it uses a cooldown effect: GE_HeroDash_Cooldown: On Activation the cooldown: Checks the ability costs. If the costs can be paid, commits them, otherwise ends the ability. Checks for local control, and ends the ability on the server. In the local client, the dash direction is chosen based on input and look direction. If there's no movement input, then the ability ends on the client (dash will only happen if there's a dash direction input). Selects an animation montage to play based on the movement direction and the character's orientation. The character stops crouching if it's crouched. If the ability doesn't have authority (local client), replicates the dash direction and chosen montage through a server RPC. On both the owning client and the server, plays the chosen montage, then applies a root motion force in the dash direction. Sends a message through the messaging subsystem, so the client-side UI can synchronize its cooldown time. On the server, triggers the dash effect gameplay cue, so it is replicated to all clients When the root motion force is completed, delays for a few additional moments then ends the ability. This keeps the granted ability tags for a few extra moments and inhibits other actions such as shooting or jumping.
GE_InstantHeal
Granted by the B_AbilitySpawner, which has a ALyraWeaponSpawner class that overrides the GiveWeapon function to apply a gameplay effect to the receiving Pawn and applies an instant heal gameplay effect.
Duplicate()
Performs a deep copy of HitResults and the other members that can't be memory-copied.
GetScriptStruct()
Returns a FLyraGameplayEffectContext::StaticStruct() to provide the correct reflection data to Blueprint.
NetSerialize()
Adds replication for any extra members defined.
GetWorld()
Convenience getter that gets a reference to the world.
GetLyraAbilitySystemComponent()
Convenience getter that gets a reference to the lyra ability system component.
Health
The current health value, capped at MaxHealth.
MaxHealth
Determines the maximum allowed health value.
Healing
Accumulates the amount of healing applied to the character. Affects the Health value, then gets automatically reset to zero.
Damage
Accumulates the amount of damage applied to the character. Affects the Health value.
BaseDamage:
The base amount of damage to be dealt in a damage execution. It is fed as an input to the damage execution calculation to determine actual damage dealt.
BaseHeal:
The amount of health to restore when the execution runs.
GA_
Gameplay Abilities
GE_
Gameplay Effects