n00dHolster ESRPG Integration

Create a n00dHolster project from the Launcher and migrate it into your ESRPG project

Setup

In your ESRPG project, right click on BPC_N00dHolster and create a Child Blueprint Class

And drag it into your own Blueprints folder

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. 


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 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. You can name this whatever you want, just remember that you've changed its name for the following examples.

Hotbar Component

We need to go and handle the quick switching on the hotbar now, which is implemented in the HotbarComponent. 

Create two new variables of type STR_Item_Data and name them CurrentSelectedItem and PreviousSelectedItem

Add these holster functions and new variables (highlighted) to the SelectHotbarSlot function like so. 

Character Base

Open up BP_Character_Base and add our newly created BPC_N00dHolster_Child to the character’s component list. Rename it to BPC_N00dHolster (ignore the _Child append in the following images)

While we’re in the BP_Character_Base, let’s go ahead and add the Intialise function and loop the active slots to set the owner of the slot actors OnBeginPlay. You may copy paste the INTEGRATE ME part from the example character also, if that’s easier for you, and just connect up the execution thread.

Go to the Class Settings in BP_Character_Base, and add BPI_N00dHolster. Compile

In the interface panel of MyBlueprint (still in BP_Character_Base), open the GetHolsterComponent function and reference the holster component found in the components list



Character Player

Once done with the aforementioned steps, you must map the newly defined sockets to a slot in the HolsterSlots variable found in the component list of any child of BP_Character_Base, here we are modifying the component values found within BP_Character_Player. 


You can holster whatever you want on whatever character you can imagine but we have chose the traditional socket types for this example.

Set the current selected item on the hotbar to cache first press.

Player Manager Component

Open the player manager component

On the top thread of MoveItemFromHotbarToHotbarServer (off IsItem(NOT)Valid), add this script on the end. 

On the bottom thread of MoveItemFromHotbarToHotbarServer, add this script on the end. 

On the top thread of MoveItemFromContainerToHotbarServer, add this script on the end.

On the bottom thread of MoveItemFromContainerToHotbarServer, add this script on the end.

Call UnholsterOnHandle at DropItemFromContainerSlotServer

And call UnholsterOnHandle at the end of the top and the bottom thread of MoveItemFromHotbarToContainerServer.

Add this script in QuickMoveItemToHotbarServer

And Unholster in QuickMoveItemToContainerServer

Container Component

In the TryAddItem function we want to store a value of a slot index, this is where we call the following script (collapsed for easy viewing).

The script inside the collapsed n00dHolster Try Add node

Data Tables

Right-click on a space in your own project directory that makes sense to you, and create a data table called DT_HolsterItems of type FN00dHolster_Data

For each weapon that you have, define the RowName (named in your own way), a slot that this weapon can be attached to on the character's body, the mesh to use for the holster, and any offsets required for your mesh to sit where you want it to on the holster slot (more info on that below). 

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.

Offsets

Open N00dHolsterCharacter and copy the offset commented area and paste it into BP_Character_Player EventGraph. 


This allows you to control your offsets through the numpad - so you can copy paste the offset results straight into your offset values in the data table. 

Make sure WidgetPrinting is enabled in the holster component on the character for your values to be displayed on the HUD at runtime.

Replace Tab key with O key so that we may toggle the offset debug screen

The current holster slot we are focused on, the type of manipulation (rotate, locate), and what axis those are on. The top right hand corner of our screen shows us what keys to press.

The results of the runtime manipulation. Copy this and add it to the offset variable in the data table.


A downloadable data table with offsets and references for all included ESRPG weapons to exemplify the holster data is available here for verified users.

You're good to go! Enjoy your holstered items.