Download

Action RPG Inventory System

I thought i would share a better way to set the visibility and position of the Tooltip, I created this way because of a bug i was getting when some times the Tooltip would still be visible even when a slot wasn’t hovered.

I thought i would share a better way to set the visibility and position of the Tooltip, I created this way because of a bug i was getting when some times the Tooltip would still be visible even when a slot wasn’t hovered.

Hotbar.jpg

I thought i would share a better way to set the visibility and position of the Tooltip, I created this way because of a bug i was getting when some times the Tooltip would still be visible even when a slot wasn’t hovered.

b92ae5231f1630e6eb009cfe2329205ccac74d49.jpeg

Hey !

It’s awesome to see you’re still updating the project and posting patches !

I’m running into a small issue, I’m trying to do a 'starting equipment ’ function, by copying the ‘Load NPCEquipment’ one you have on the NPC character. However, I’m having an error with the Player Inventory Component node. Apparently it’s inherited on the NPC character, but I can’t find it when I open the parent, and even if my character and the NPC one have the same parent, I can’t seem to find it in mine by default.
Any idea what I could be doing wrong ? :slight_smile: 5c87652c7f7573c78b433e7e77378f4ccc2854c7.jpeg

Thats because its a component not a custom variable add it using the add component button.

Omg that worked <3 You sir made my day.

I’m glad you were able to get it resolved promptly :slight_smile:

Can this be modified to use for an first person survival game? For example instead of right clicking on a loot crate or body you press E on it instead to access the inventory?

Sorry for the noob question. Just want to be sure I’m buying the right thing considering it says “Action RPG”.

I’m not 100% how the system is set up, however, you can always just get the “on mouse hover” event and switch it out with a “OnEvent Action” + Line Trace (the character must look at it, for example)

Yep Pirate has made a tutorial on how to change interaction to a FPS style game here https://youtu.be/KYB8FnkydNE, but keep in mind this inventory is made for RPG games you will have to put quite a lot of time into it to change it to a Survival style inventory like have, i do all my testing in 3rd person as i like to see the character but my project is a first person game.

List of custom features in my project this just show you what is possible with this inventory system :D.

Hotbar inventory
Item equip on mouse wheel using the Hotbar
Crafting system with blueprints unlocks
Expandable inventory space using backpacks
Health, Food, Water and Energy/Stamina consumables substances.
Placeable world items
Filters for stashes
Item Durability

https://youtube.com/watch?v=ecRjoq0QmmI

There are many people like OverRated that are using this in a survival or FPS type game.

Although the Demo UI and controls are more setup to demo an RPG/MMO, the actual Inventory System is designed to be changed and enhanced by you the developer and can fit into any game type that needs an inventory.
If you want to use the Demo content you will need to make changes as it’s impossible to design a system that fits everyone’s own design for their game 100% out of the box. You will also find yourself making changes to the core inventory system to better suite your projects needs.

The more you know about Unreal, networking and blueprinting the easier this will be, but the Inventory System was built to be easy to understand, learn and modify for all skill levels.

Judging by your questions it sounds like you don’t have any experience with Unreal as things like changing controls and keybindings are very basic.
I would suggest first following some of Epic’s tutorial series to learn more about unreal and blueprinting before buying anything on the marketplace.

This will let you see if game development is something you enjoy doing and help you make more informed choices when buying assets off the marketplace.

Hello Pirate,

I recently bought the inventory system and so far it is a lot of fun. Great job!

I have a request/question. Not sure if it’s been brought up yet or not. What would it take to make a container type item? Like a bag or box that can go in your inventory but then open into yet another sub-inventory? Maybe this is already done and I just couldn’t figure out how? If not, it would be a great feature t add to a later version.

Thanks
Jake

Yeah it has been brought up before its a lot easier just adding slots to the inventory as the logic’s there already which is what im doing.

Has anyone else tried to set this up when using a dedicated server?

My current problem is when I press E to pick up an item, the item does not get picked up. And it seems I’m getting a None error for Player Inventory when the player connects and I initialize the character. I believe the E problem is stemming from the None error.

This used to work when in PIE using the Run Dedicated Server and Auto Connect to Server flags, but now that I’m running my own processes and only connect via Join Session, it does not work.

Any ideas?

4971856e2aa0ef3a6e5bde9d4a986a8423922666.png

The ‘None’ means that the PlayerInventory reference used by the InventoryManagerComponent is NULL and not set.
This reference should be set when your Player Controller initializes the Inventory System to your Player’s InventoryComponent (EquipmentInventoryComponent)
You can see how this is setup in the original Demo content in this screenshot.

Also in 4.11+ please make sure in your Project Settings you have the correct Global Default Server Game Mode setup.
You can see where to set the Server Default Map and Game Mode in this screenshot.

If all that is fine, I think what could also be causing the issue is Event BeginPlay. Event BeginPlay is not very multiplayer friendly and in the InventorySystem I added a delay to give the server time to replicate to the client before initializing components. This was a simple fix to avoid over complicating things by adding in a Game State Management Framework which is way out of scope for an Inventory System.

For now increase the delay to give the server more time to load in the client before trying to initialize components during Event BeginPlay.
Create a proper loading/management system for your clients using the Game Mode class and overriding events like OnPostLogin, OnRestart Player, etc… (In the Western Multiplayer Shootout example Epic provides an example of setting this up) and replace using Event BeginPlay with your own Custom Event for initializing YourPlayerController.

Yes, I override OnPostLogin, and I have the server do something similar to what Multiplayer Shootout does in that it gets the Player Start, spawns my Character there, and has the Player Controller Possess that new Character. Right after Possess, I call an init function on the owning client with the player controller as the target, which in turns starts the setup of the Inventory in the Player Controller.

The HUD shows up correctly, but the error occurs with the PlayerInventory and I can’t pick up items.

As a note, I’m still in 4.10.

Nevermind about the delay in the OnPostLogin, it didn’t work.

If you have a proper setup in your project then you shouldn’t need a delay.

It’s hard to say for sure what is causing the issue in your project, but the inventory system works just fine on dedicated server.
Best to try and see what is causing the PlayerInventory Null Reference in your initialize because if the player doesn’t have an inventory it can’t pickup items :slight_smile:
try putting some print strings to see if your init function is finishing properly.

If you have a proper setup in your project then you shouldn’t need a delay.

Best to try and see what is causing the PlayerInventory Null Reference in your initialize, because if the player doesn’t have an inventory it can’t pickup items :slight_smile:
Try putting some print strings to see if your init function is finishing properly.

OK, I think I found the problem.

For starters, I checked both the Inventory Manager Component and the Player Inventory Component on my Player Controller and they both were not NULL.

Next, I decided to replicate the Player Inventory variable and initialize it with a server RPC instead of what you showed in your screenshot above.

This removed the Accessed None errors on the server.

However, I still can’t pick up anything.

I think this is because the server doesn’t know where to look when doing the line trace. I was dealing with server/client line traces in another thread. Essentially, here, when you press E, you call the Server_OnActorUsed function, which is a server RPC which will then call OnActorUsed. OnActorUsed will then call GetUsableActor, which is where the line trace happens. So in the Get Usable Actor function it uses the Character Reference and uses that reference’s Follow Camera and Camera Boom to create the two vectors needed for the line trace. However, Follow Camera and Camera Boom aren’t replicated, so the server will have no idea where to start and end the line trace. In fact, I put a Print String right after the Is Valid check on the character reference on the Is Not Valid side and it printed a string on the server, meaning the character reference is NULL.

So I think to fix this, I’m going to have to make sure that Character Reference and Equipment Character Reference are both replicated and initialized with RPCs similar to PlayerInventory. And then I’m going to need to fix the Server Line Trace to use the proper location and rotation of the cameras, which will require either setting up replicated camera variables or just passing in the start and end trace vectors through the RPC.

Awesome to see your progress OverRated_AU ! It’s cool to see all that’s possible with this system.

You were right Pirate about using the UpdateStats function to add events on item equip, that worked wonders.

I started working a bit on lootable enemy characters, and for some reason I realized I can’t loot either Tandy or Muppet anymore. I seem to be able to loot everything else ( items, skeletons and pots), just not characters for some reason. Any idea where that might come from ?

Edit : (I’m getting an error from the ‘characterreference’ node in the getusableactor, which probably is the source of the error ? )