n00dHolster + ESRPGv5
Jump over to Setup to learn how to setup the plugin from the Epic Launcher, return here when you're ready. You can also right-click an image in this guide to potentially see it as a larger image if available by opening the image in another tab.
Base
Create a new folder called n00d, and a subfolder called Holster
Create a child of BPC_N00dHolster, call it BPC_Holster, and drag it into the Holster folder
Project Settings
Add DTGT_N00dHolster to the gameplay tag list, you might create your own and reference this instead but keep in mind your changes to the tags going forward. If you do create your own, move it into the Holster folder
n00dHolster comes with a built in save game system that can persist your equipped weapons when quit, for this tutorial we will switch this off by clearing the reference to the save game class so that each time you come back in you must equip weapons to the hotbar to holster again. If you'd like the guide to handle this for you, let us know in the Discord!
Skeleton
Open up SK_Jess_Skeleton (or whatever your character's skeleton is called) and add holster sockets on the skeleton. You can name these whatever you’d like.
Jess skeleton location: EasySurvivalRPG/Characters/Jess/Meshes/SK_Jess
Optional: you can highlight the sockets found on the n00dmannequin skeleton and copy them over to your own - make sure to paste on root.
Items Library
In BP_ItemsLibrary (EasySurvivalRPG/Blueprints/Game/Libraries/BP_ItemsLibrary) create a new function called GetItemHolsterData, make it Pure, and add this script within - making sure to add the Key HolsterData to the Find node. Item input pin is STR_ItemData and Value output pin is DataTableRowHandle
Character
Open BP_Character_Player (under EasySurvivalRPG/Blueprints/Characters/Base) and add BPC_Holster to the components window.
If your want the holstering to happen on all characters, do this on BP_Character_Base, but we will just focus on the player
With the component selected, fill out its defaults. We care about the Slots and the ExitReasons
Player State
Create a Player State from the Pick Parent Class window and call it BP_PlayerState
You might want to move this to a central location to use it within your project for other systems. For this tutorial we will just leave it in the Holster folder
Open it and add BPC_Holster to the components window
Call ConstructHolsterState on the construction script
Game Mode
Open BP_GameMode_Game and reference BP_PlayerState
Container Component
EasySurvivalRPG/Blueprints/Components/BP_ContainerComponent
Create a function called HandleHolster and implement this script
Call HandleHolster in TryAddItem
Add UnholsterByHandle to the SpawnDropItemAtLocation and SpawnDropItem functions
Create this script at the end of TryMoveItemToContainerSlot (see below for close-ups
Close-up of top thread
Close-up of bottom thread
BP_Character_Player
TryToChangeHotbarSlot
This data table is based off FN00dHolsterData and contains the holster values you reference in DT_Items
In DT_Items on each of the weapons you want holstered, add the Handle HoslterData and define the DT_HolsterItems we created eariler. Choose the row that is relevant for this weapon.
We are choosing Weapon_Sword_002 for Weapon_Sword_002. These do not have to be exact matches.
In BP_Character_Player add a static mesh childed to the Mesh, with it selected, choose the parent socket you want to align for each mesh you need holstered on the specific socket
Position each mesh where you want it and copy both the Location and the Rotation into the data table for that weapon in the FN00dHolsterData data table. Delete this static mesh component once done.
You're all set for holstering! Enjoy!