BPI_LPSP_WEP

Introduction

The BPI_LPSP_WEP is a Blueprint Interface that helps actors access the values of a weapon actor and call different functions on it. Using this interface instead of directly accessing things on the weapon blueprint allows developers to completely replace the weapon blueprint (BP_LPSP_WEP) and simply add this interface to theirs, enabling every other piece of the asset to continue functioning. This is basic decoupling.

If you seek to access the BPI_LPSP_WEP blueprint, it is conveniently located at the following path: LowPolyShooterPack/Core/Weapons/BPI_LPSP_WEP.

Functions

LPSP - Get Ammunition Total:

Returns the maximum ammunition that this weapon's magazine can hold.

LPSP - Get Ammunition Current:

Returns the current ammunition in the weapon's magazine.

LPSP - Get Character Abilities:

This section details the abilities of a character when using this weapon. These abilities are the same as those mentioned in the character documentation.

LPSP - Get Character Animation Poses:

This method returns the Data Table containing the character's poses while carrying this weapon. These poses determine which animations are played.

LPSP - Get Character Animation Montages:

This function returns the data table containing the character's animation montages while carrying this weapon. The montages determine what animations are played when performing actions such as reloading or shooting.

LPSP - Get Settings Weapon:

Returns the Weapon’s settings in the form of a SWeaponSettings Struct.

LPSP - Is Out Of Ammunition:

Returns true if the Weapon is completely out of ammunition.

LPSP - Is Full Of Ammunition:

Returns true if the Weapon is full of ammunition.

LPSP - On Update Ammunition:

Changes the Weapon’s ammunition by a specific amount or fills it completely.

LPSP - On Fire Projectile:

Fires a projectile.

LPSP - Montage Play:

Plays an animation montage on the weapon.

This function searches the weapon's data table of montages by name to determine what to play.

LPSP - Montage Stop:

This function stops a specific Animation Montage from playing. It uses the weapon's data table of montages to find the Animation Montage to stop.

LPSP - Montage Stop All:

Stops all Animation Montages playing on the Weapon.

LPSP - On Change Settings Physical:

This function changes all of the physical settings for a weapon. This means that the weapon's properties are set to something completely different, which includes updating features such as physics and shadows.

LPSP - Get Icon Body:

Returns the body icon.

LPSP - Get Icon Magazine:

Returns the magazine icon.

LPSP - Get Icon Muzzle:

Returns the muzzle icon.

LPSP - Get Icon Scope:

Returns the scope icon.

LPSP - Get Icon Grip:

Returns the grip icon.

LPSP - Get Icon Laser:

Returns the laser icon.

LPSP - Get Icon Ironsights:

Returns the ironsights icon.

LPSP - Get Widget Class Crosshair:

This document describes the class of the Crosshair User Widget that the character should use while this weapon is equipped.

LPSP - Get Settings Animation:

Returns the animation settings.

LPSP - Get Settings Scope:

Returns the Scope settings.

LPSP - Get Static Mesh Muzzle:

Returns the Static Mesh that this Weapon’s Muzzle is using.

LPSP - Get Static Mesh Magazine:

Returns the Static Mesh that this Weapon’s Magazine is using.

LPSP - Get Static Mesh Scope:

Returns the Static Mesh that this Weapon’s Scope is using.

LPSP - Get Static Mesh Body:

Returns the Static Mesh that this Weapon’s Body is using.

LPSP - Get Static Mesh Ironsights:

Returns the Static Mesh that this Weapon’s Ironsights are using.

LPSP - Get Offset:

This method returns the offset used when a character equips the weapon. This value is useful for positioning weapons that do not have correct pivots.

LPSP - On Update:

This function updates all aspects of the weapon. It should be called every frame from the character's Tick event.

Note:

We use a custom event instead of Unreal's Tick event to avoid accidentally running this on weapons that are not equipped.

LPSP - Get Laser Settings:

Returns the equipped lasers’ settings.

LPSP - On Equipped:

Called when the Weapon is equipped by a Character.

LPSP - On Unequipped:

Called when the Weapon is Unequipped by a Character.

LPSP - Is Slide Racked Visually:

This method returns true if the slide of this weapon should be displayed as racked on the screen. It is particularly useful for handguns.

LPSP - Set Slide Racked Visually:

Sets whether the slide should be racked.

LPSP - On Laser Turn On:

Turns On the Weapon’s equipped Laser.

LPSP - On Laser Turn Off:

Turns Off the Weapon’s equipped Laser.

LPSP - On Laser Toggle:

Toggles the equipped Laser’s state.

LPSP - On Aiming Start:

Called when the Character starts aiming this Weapon.

LPSP - On Aiming Set:

Sets the Weapon’s internal Aiming value.

LPSP - On Aiming Stop:

Called when the Character stops aiming this Weapon.

LPSP - On Spawn Casing:

Spawns a Casing from the Weapon.

LPSP - Get Character Settings Movement:

This method returns the movement settings of the character while the weapon is equipped.

LPSP - On Reset Visual Ammunition:

This function resets any changes made to the visual ammunition.

Specifically, if the bullet materials on a magazine have been modified, this function will reset those changes to their default settings.

LPSP - Get Skin:

Returns the Weapon’s Skin.

LPSP - Get Attachment Handle Ironsights:

Returns the Ironsights’ Handles.

LPSP - On Swap Attachment Ironsights:

Sets the Ironsights.

LPSP - Get Attachment Handle Magazine:

Returns the Magazine’s Handles.

LPSP - On Swap Attachment Magazine:

Sets the Magazine.

LPSP - Get Attachment Handles Muzzle:

Returns the Muzzle’s Handles.

LPSP - On Swap Attachment Muzzle:

Sets the Muzzle.

LPSP - Get Attachment Handles Scope:

Returns the Scope’s Handles.

LPSP - On Swap Attachment Scope:

Sets the Scope.

LPSP - Get Attachment Handles Grip:

Returns the Grip’s Handles.

LPSP - On Swap Attachment Grip:

Sets the Grip.

LPSP - Get Attachment Handles Laser:

Returns the Laser’s Handles.

LPSP - On Swap Attachment Laser:

Sets the Laser.

LPSP - Get Static Mesh Grip:

Return the Static Mesh of the Weapon’s equipped Grip.

LPSP - On Ammunition Set:

Sets the Weapon’s ammunition to a specific value.

LPSP - On Change Settings Physical Body:

Changes the Weapon body’s Physical Settings.

LPSP - On Change Settings Physical Attachments:

Changes the Attachment’s Physical Settings.

LPSP - On Character Landed:

Called when the Character lands with this Weapon equipped.

LPSP - On Character Jumped:

Called when the Character jumps with this Weapon equipped.

LPSP - Get Weapon Name:

Returns the Weapon’s name. This is used in the different User Widgets.

LPSP - Get Bolt State:

Returns the value of Bolt State.

LPSP - On Set Bolt State:

Sets the value of Bolt State.

LPSP - On Set Shot Count:

Sets the value of Shot Count.

LPSP - Is Laser Turned On:

Returns true if this Weapon’s equipped Laser is turned on.

LPSP - On Set Laser Turned On:

Sets the state of the Weapon’s equipped Laser.

LPSP - Is Hidden Magazine Visually:

This function returns true if the magazine of the weapon is hidden. It is useful in cases where the magazine's visibility is set to false, and we want to ensure that this is properly reflected when dropping the weapon.

LPSP - On Set Hidden Magazine Visually:

Sets the value of the Magazine’s visual visibility.

LPSP - Is Slide Racked:

Returns the value of Slide Racked.

LPSP - On Set Slide Racked:

Sets the value of Slide Racked.

LPSP - Is Hidden Magazine:

Returns the value of Hidden Magazine.

LPSP - On Set Hidden Magazine:

Sets the value of Hidden Magazine.

LPSP - On Set Movement Spread:

This function sets the value of Movement Spread. It is useful when you want the spread of the weapon to change based on how much a character is moving.

If you don't need this feature, you can ignore this function or set it to one.

LPSP - On Spawn Attachment Components:

This spawns all of the weapon's attachment components. These components can include things like the Scope Scene Capture Component, or Muzzle Spotlights, etc.

LPSP - On Stop Audio Playing:

This function stops playing whatever audio the weapon was playing at that moment. It is typically called to stop reloading sounds or other similar sounds when dropping weapons.

LPSP - Is Showing Ironsights:

Returns the value of Showing Ironsights.

LPSP - Is Showing Scope:

Returns the value of Showing Scope.

LPSP - Get Weapon Settings:

Returns the value Weapon Settings.

LPSP - Get Spread Multiplier:

Returns The value of Spread Multiplier.

LPSP - Get Sounds:

Returns the Weapon’s sounds Data Table.

LPSP - Get Socket Name Scope:

Returns the name of the Weapon’s Scope socket.

LPSP - On Weapon Drop:

This method is called whenever a character drops their weapon. It handles all updates related to the drop event.

LPSP - Get Ammunition Type:

This function returns the type of ammunition used by the specified weapon actor.

LPSP - On Randomize Preset:

This method randomizes the weapon preset for the specified weapon actor.

LPSP - On Save Loadout:

Saves the current loadout.

LPSP - On Equip Saved Loadout:

Swaps the current loadout for whatever the saved one is.

LPSP - Get Settings Grip:

Returns the grip settings.

LPSP - Set Reserve Magazine Visibility:

Sets the visibility of the reserve magazine.

LPSP - On Reload Interrupted:

Called whenever a reload is completely interrupted midway through.

LPSP - Get Extra Aim Offset:

This function returns the offset location value that this weapon can apply to the procedural aim offset location for aiming purposes. This is very helpful in allowing us to add weapon-specific offsets.

LPSP - Update Animation For State:

This method ensures that the correct player character's vision state is used when playing animations. This means that third-person reloads should always play when the character is in third person, and first-person reloads should play when in first-person.

LPSP - Unholstered:

This method is called whenever the owning character unholsters this weapon.

LPSP - Update Weapon Preset:

This method helps with completely updating a weapon's preset. We use it to immediately update all attachments on a given weapon as we spawn it, for instance.

LPSP - Update Viewmodel:

This method allows us to update a weapon's view model value. This, in turn, helps us set its field of view values, and so on.

LPSP - (Local) Override Physical Settings:

This method sets a weapon's physical settings locally, which means it will not be set on other instances of the game. It does not replicate. It is important to keep in mind that sometimes it might be helpful to set these values for all clients.


Last updated

Was this helpful?