Action RPG Inventory System

I think in his case he has to possess a new class so he created a child of inv character as the one to possess. But if the mount doesn’t need inventory equipment slots I think it should just parent character or pawn.

I tried doing both of those and neither one would use the input from the player controls I could not get anything to fire

I searched the thread but i could not find anything relevant, had anyone implemented animations based on what weapon is equipped ? I was going to make an enum with my player states, unnarmed, 1hand, 2hand, ect and switch this enum when ever the player equipes a weapon and have this enum be read within the animationBP and switch on the enum. Thing is, im having a hard time figuring out where i should put this enum. i guess it can be put anywhere but where would it make most sense to add this enum at?

I would say put it in the PlayerCharacter. That way when you are equipping a weapon you can set it up to assign this ENUM and replicate what weapon animation state the character is in. The Animation BP can then easily read it in the anim graph and play the right animation state per character.

What i did was add a weapon type to the inventory list, then i did a onrep of the inventory item which i created in equipment character, then from here i set the weapon type which the anim bp casts to the the owning pawn and gets the animation type. the rep equipped inventory item replaces the onrepmainhand, the reason i added it to the inventory item list rather than just doing a check is because just seemed logical when setting up a new item.

Is there a document somewhere with directions on how to use the Inventory system? I’m not looking for a programming guide just some basic information on what goes where.

I’m still going through the add Item tutorial, but I’m unsure what the best method is to customize the various inventory elements. Actually to start with I only want to use the inventory box and the hot slots. I’m not even going to use the equipment box at this point. The various RPG elements armor, strength, etc, aren’t really applicable to my game. I just going to use a very scaled down version of the inventory system.

I’m not actually using the character equipment mesh either since right now my game is a FPS only.

One problem I’m running into is the BOX armor, a leather band keep popping up on the equipment mesh and I can’t figure out where they’re coming from. I have the equipment visibility turned off so this stuff is just floating around my main character. Can you guide me as to how that stuff is ending up on my mesh?

I also can’t get the outline to show around the items and/or pick them up at this point. I can bring the inventory system up no problem but using the supplied inventory player controller I can not interact with the objects.

Does the inventory system save between games by default or is that my responsibility?

For starters simply removing the Equipment Window will prevent all of the equipment features from being used. Removing the stats is as simple as editing the Structs and deleting the properties. You will need to clean up a few simple errors for missing variables in the InventoryManagerComponent UpdateEquippedStats function and also you can remove those stat variables from there as well. Then you will need to make changes to the UI Equipment and ToolTip widgets that will be reading from those deleted variables.

Structs in blueprint can be a bit tricky, I would simply delete the variables you don’t want. If you start reordering things or removed something and added it back you will need to search through all your blueprints to make sure you didn’t break some struct logic. Doing a simple search for “Break InventoryItem” will show you all the spots in the code it’s used. Also check “Make InventoryItem”

In the InventoryPlayerController there is an example of how to load with starting gear in the InitializePlayer function. Simple unhook the node and plug it into the one above like so.

Since you will not need equipment meshes you won’t need to use the EquipmentCharacter class. So it should be pretty easy to cut this out by not parenting your character class to it. If you get any errors solve them by editing the EquipmentInventoryComponent function UpdateEquippedMeshes. But since you will not be performing any equipment logic since you have no Equipment Window you probably don’t even need to do anything with the UpdateEquippedMeshes function.

I am not sure what you have changed that would break this logic as it’s fairly basic. Do you have the PostProcess effect setup? can you add a print string to the use button and see if it’s firing the logic in your player controller.

It is a modular Inventory System, so it does not provide you with game saving logic. It does it make it easy to Get/Set Inventories, so you can simply get all the inventory items and save it out however you please and load the list of items.

Its been awhile since i have posted a video up, this is what i have been working on lately on and off.

[MENTION=331197]Lord Caine[/MENTION] my game is also a FPS but you have to remember if its MP other people are going to be able to see items your wearing.

Hi Over,

Thanks for sharing that with me. I’ve been watching your other videos too. Remnants looks like it is coming along fine.

I’m taking a modular approach to my game. The first level will not have any multiplayer in it. This affords me the chance to learn the unreal environment while building a game. I’ve spent the past couple of year learning LUA and although it was fun I’m enjoying the power of the Unreal environment.

I hope I can get to where you are with the inventory system soon. Right now I just have the HUD working. I need to try some of the things Will mentioned in the previous post tonight.

Regards,

Lord Caine

Sounds like a plan its always best to start off small :slight_smile: , I also come from a lua scripting background used it for 6 years, i also prefer the visual scripting in unreal over lua haha.

Making Progress

Hi Will,

I tried reparenting my character back to the base character class and then unreal crashed everytime I hit the play button. I got tired of that and just removed the init equipment code in the initialize user and that worked fine.

I’ve tweaked my inventory layout so it is pretty much where I want it.

I’m getting all of these runtime errors about my character references being none and my hud references being none. I’m basically going into the routines that are failing and replacing the references with casts just so I can get it to work. Any idea why the references would be failing?

Hi there,

I’ve hit another road block. I have no inventory slots now and can not add any new slots.

I still can’t interact with anything I’ve dropped on the map. Here are the error messages I’m getting on the inventory slots:

LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [14/0]!
PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
PIE:Error: Error Blueprint Runtime Error: Attempted to assign to None from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [14/0]!
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [15/0]!
PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
PIE:Error: Error Blueprint Runtime Error: Attempted to assign to None from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [15/0]!
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [16/0]!
PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
PIE:Error: Error Blueprint Runtime Error: Attempted to assign to None from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent


LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [32/0]!
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [33/0]!
PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
PIE:Error: Error Blueprint Runtime Error: Attempted to assign to None from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [33/0]!
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [34/0]!
PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
PIE:Error: Error Blueprint Runtime Error: Attempted to assign to None from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [34/0]!
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [35/0]!
PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
PIE:Error: Error Blueprint Runtime Error: Attempted to assign to None from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [35/0]!
LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [36/0]!
PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent
PIE:Error: Error Blueprint Runtime Error: Attempted to assign to None from function: ‘AddInventorySlot’ from node: Set ItemInformation in graph: AddInventorySlot in object: InventoryManagerComponent

LogScript:Warning: Attempted to get an item from array InventorySlots out of bounds [41/0]!
LogAnimMontage:Warning: Playing a Montage (FirstPersonFire_Montage) for the wrong Skeleton (EldarV1_JustHands_Skeleton) instead of (SK_Mannequin_Arms_Skeleton).

I deleted some of the redundant error messages.

For the map, make sure it draws it on a layer above the Inventory Layout UMG Widget.

The other errors are because since you are no longer using the Character class anymore in your player controller InitializePlayer function the cast is failing and preventing the inventory from running the Init logic.

Simply connect the cast failed into the next node and then you can clean up the character stuff by removing it after you have everything working again.

The Action RPG Inventory System, Multiplayer TopDown Kit and Advanced Social System will be on sale from May 23rd to June 1st at 15% off.

I’m not sure why you said I’m not using the character class anymore. I was unable to unparent my character from the equipment character so nothing has changed in that regard. I made the change you suggested but my inventory box is till coming up with no slots and I am getting those same errors as above

The EldarCharRef is my main FPS character.

Sorry I meant to say the demo Inventory/Equipment Character class.

The issue is then something in your logic that just isn’t letting the Inventory Initialize. I would suggest working through that function and making sure everything is firing off. There is a green section where it initializes the client inventory UI and passes in the HUD Reference to the InventoryManagerComponent. I would start there and use breakpoints and print strings to figure out what is happening.

Also check your InventoryHUD Class as that is where the HUD Layout is loaded and the InventoryPlayerController gets the HUDReference from the InventoryHUD class at runtime.

Animations based on weapon type

I made a video for anyone looking to add this functionality to their project.

Nice for you to spend the time to make that, what i do is use a blend poses using the Animation Type variable which is done in the AnimGraph, and from here you can also use a Two Bone IK to correct your animations like the problem you show in the video.

Not for every game but container equipment slots.

Hey guys,

I’ve been having an issue for a while now. Since I updated, I can’t seem to be able to view updated stats or gold in the UI. I’ve set a print string in ‘add gold’ (my game has scrap instead of gold, hence the different title there), and even though the character seems to locally be fine ( see '105 gold '), those changes do not appear in my UI. Same thing for other stats. It seems like every time it refreshes the stats everything stays at 0 :(. Been trying to avoid posting here about it since I’m sure it’s something I didn’t update correctly, but it’s been a few weeks and I still haven’t managed to pin point where it’s coming from.
Many thanks.

Have you edited inside the UMG widgets? There are functions that read your values so if you have changed gold to scrap you might not have anything being read. Also make sure your new variables for these values are replicated. If that doesn’t help I’ll need a bit more information. Please send me an email suppprt@vanguardinteractive.com and I will try and give you some more pointers.