Weapon {{ currentPage ? currentPage.title : "" }}

PrimalWeapon

Purpose: Used for players to hold weapons and generate weapons from shortcut items

Variable

Explain

OwnerCharacter

OwnerCharacter

AbilitySpecHandles

Added ability Handle

AttachType

Weapon AttachType

Behind

Hand

Physic

bTempWeapon

Is it a temporary weapon, such as a weapon generated by the shortcut bar, that cannot be carried behind you

ActiveGameplayEffectHandle

ActiveGameplayEffectHandle

GameEffectClass

GE Class,The ability possessed by the weapon needs to be added to GE. When the player holds it, it will activate GE, and when carrying it behind them, it will cancel GE

DrawWeaponAbilityClasss

DisarmWeaponAbilityClasss

Pick up weapon ability type/disarm ability type

This ability will be given to the owner when generating entities to retrieve weapons from behind. If not set, it will skip the animation and be directly attached to the hand

InputAbilityMap

Enter the ability map, such as left click ->ability A, and simply add the initial ability

WeaponType

Uarmed

Melee

Range

Wizar

WeaponCategory

None

Sword

GreatSword

DualWield

Katana

Spear

Staff

Bow

Axe

PickAxe

Amount

Ammunition quantity

AmmoItemBasic

Ammo Type

Buffs

Weapon BUFF

DamageType

DamageType

bApplyHitSoundIfValid

HitEffectSound

Is open hit sound

bApplyHitEffectIfValid

HitEffectSystemType

HitEffectPS/HitEffectNS/HitGameplayCueTags

Is open hit effect,For example, the lightning effect after a lightning sword hit

SurfaceHitEffects

Physical material hit effects, used for weapons to individually set hit effects, with priority given to this variable

SlashEffectSystemType

SlashEffectPS/SlashEffectNS/SlashGameplayCueTags

Knife light special effect, generated only when hitting a character

Function

Explain

AddBuff(TSubclassOf<AWeaponBuff> BuffClass,float Duration)

Add Weapon BUFF

RemoveBuff(AWeaponBuff* Buff)

Remove Weapon BUFF

DestroyAllBuff

Destory All Weapon BUFF

SetAttach(EWeaponAttachType NewAttachType)

SetAttach

GetAbilityByInput(FGameplayTag InputTag)

Use input tags to get ability

ApplyGameEffect(bool bEnable)

Apply GE

CanEquipToHand(Override)

Can I hold it, such as being unable to hold a weapon while swimming

OnAttach(EWeaponAttachType NewAttachType)(Override)

OnAttach

OnCreate(UPrimalItemBasic* NewItemClass)

OnCreate

MulticastSetAmmoClass(UPrimalItemBasic* NewAmmoItemBasic)

MulticastSetAmmoClass

GetMeshsInternal(Override)

Obtain all weapon grid components

SetWeaponVisible(bool bVisible)

SetWeaponVisible

OpenTrail(Override)

Activate the weapon trailing effect

Using Slot TrailStart To TrailEnd

CloseTrail(Override)

Turn off weapon trailing effects

ApplyTrailParticle(UPrimitiveComponent* MeshComponent, UParticleSystem* TrailParticle)

Apply trailing particle effects, which are quick destruction effects such as flash

Need to add slots

Trail_Part_1

Trail_Part_2

Trail_Part_3

ApplyCollostion(UUltimateCollisionComponent* CollisionComponent,ECollistionType CollistionType)

ApplyCollostion

GetWeaponStats(Override)

Get Weapon Stats

ApplySurfaceHitEffect(FHitResult HitResult)

Spawn Lightning Effect and Sound,Return Is Sound Spawned

If EffectSystemType == Cue You need Handling special effects

Effect Priority: HitGameplayCue -> SurfaceHitEffects -> HitEffectPS/NS

Sound Priority: SurfaceHitEffects -> HitEffectSound

If return false,You need use WorldSettings->ApplySurfaceHitEffect(HitResult, true, true); to spawn effect and sound

If return true,You just use WorldSettings->ApplySurfaceHitEffect(HitResult, false, true); to spawn effect

  • Notification and Notification Status:

  • UANS_WeaponTrail:Weapon tail notification status, used to activate weapon tail

  • UAN_ToggleWeapon:Weapon switching status, used for weapon switching additional status bDisarmWeapon whether to retrieve the weapon

  • UAN_WeaponBuff:Give a weapon a BUFF, such as adding a Flame BUFF to the weapon in the Flame Sword ability montage

{{{ content }}}