Action RPG Inventory System

When Rightclicking an Equipped Item it seems it just calls MoveItem, and as such Unequip Item is not called, while a drag and drop calls Unequip Item.

Fixed it to use UnequipItem instead, can’t really see why it used MoveItem? I had added some custom code to equip and unequip otherwise I wouldnt have noticed it tbh.

It calls UseEquipmentItem() when right clicking from inventory(to equip) or from equipment (to unequip). If unequipping through right click to use the unequip path then calls MoveItem() to move it out of an equipment slot (Inventory Slot 0-13) back to a non-equipment slot (14+). There is different logic for right clicking than for the normal drag and dropping.

Right click to use is based on the item type. The server checks what it is and figures out what to do based on where it is.

Where as with drag and drop you tell the server you want to move something from X and put it in Y at location Z. Then it checks what it is and where it’s going and figures out what to do.

So for example if you were drag and dropping it would be more complicated because if you dropped on an item it would have to check if that item could swap and equip. But with the simple right click to unequip it just checks to see if you have a free space to equip it to and doesn’t need all the fancy unequip/swap/equip logic.

Really enjoying the system so far and looking forward to the Multiplayer TopDown Kit!

I have a question, although it may be a little beyond the scope of what the package offers so feel free to not answer :slight_smile:

The player stats (such as Strength, Dexterity, etc) in the demo are tied only to the Controller’s Inventory Manager Component (IMC), correct? Am I correct in that you want to pass these variables up to the Controller if you’re going to have game logic involving them, such as using a skill that deals extra damage based on Intelligence? I imagine it would be best to update the HUD to use the Controller values then, considering the Controller class may have base stats etc. I’m imagining that the effect of item properties (i.e. any “stat-like” variable in the IMC) is to serve as a bonus to the player rather than form the basis of the player’s attributes. Maybe it would then be easiest to bundle “stat-like” variables in the IMC to a Struct or something to push to the player as part of a buff system. I’m also imagining that item properties will have some more exotic effects that affect the way skills, player damage, etc. work (rather than simple stat boosts). Any inclination to how best to start moving this Inventory system into that direction? So far it has been a little tiresome to add even one or two additional stats items can have, since it’s your system I thought I’d ask. This is starting to sound like a do my designing for me! post…

How can we add new item quality for our items?

I would be very interested in seeing this as well. Btw great job on it looking forward to purchasing when the money comes in.

I’m a begginer and i’m getting lost in all those blueprints. Could somebody tell me how to add items to a container actor. I’d like to make item stack in container increased on trigger. How do i add custom array to specific actor.
Best regards.

You can store them wherever you want Controller, Character, PlayerState, etc. You just need to change InventoryManagerComponent->UpdatePlayerStats() and the Equipment UI Widget to reference the variables from the new place.

You can easily have them in a struct and add the equipment tally onto a player base type stat total if you want. It should be pretty simple once you figure out your design and create the attribute system you want. All you need to change in the inventory system is in those two places (IMC->UpdatePlayerStats() function & Equipment UI)

As for enhancing the inventory system a lot of the things people seem to want to do don’t really have anything to do with the inventory system. You should design your new system and when it’s working figure out how to make it work with the inventory. For example someone was talking to me about how they were limited with weapons because all it does is spawn a mesh.

Yes when you equip a weapon it simply puts a weapon mesh in your hands. Now you might ask well… what if I want that weapon to fire/attack/shoot fireworks/etc or be more than just a pretty mesh?
You might start thinking the inventory system is limited in some way and will prevent you from doing what you want.
But it’s not limited and it won’t limit you. The issue here is that you need a weapon system. It is an inventory system that deals with items if you don’t have a weapon system how can we hook it up to make weapon items use a weapon system that doesn’t exist. So how do we solve this issue? Easily :slight_smile: We create a weapon system.

So we go ahead and create this amazing blueprint weapon system that makes your game feel like Battlefield/Halo/something.
Now you have these awesome blueprint weapons that are really fricken cool. But when you equip a weapon it still just spawns a mesh into the character hands… Easy fix… now we that we have a weapon system we can integrate it.

So lets give our weapon Item a new property to store a weapon actor reference and set it to one of our new awesome blueprints. Then we need to change the logic when it equips a weapon so that it knows we want to spawn and equip a weapon actor and not just simply our weapon mesh. This is easy enough, we can even feed in info to that weapon system when spawning a weapon actor with properties from our item (Name, Damage, Stats, Mesh, Etc).

I guess my point is instead of making an inventory do everything you want in your game, you first need to design the other systems and only integrate them into the inventory system in a way that makes sense from an inventory/item position.

So for your stat system you would be much better off designing an actual stat system and then creating buff items and hooking it up into the parts where the demo content shows stat examples. (calculating equipped stats).

Been adding items today and started merging the StaminaHungerSystem into the inventory system for my own needs screen shot below.

http://media.indiedb.com/images/games/1/48/47696/Screenshot03.jpg

[QUOTE=OverRated_AU;469102]
Been adding items today and started merging the StaminaHungerSystem into the inventory system for my own needs screen shot below.

awesome!

Is that a hint, on an upcoming new project? :stuck_out_tongue: :stuck_out_tongue: lol

There are a few systems in development but not sure if they will be released on the marketplace yet.
Blueprint only is pretty limiting so I need to see how these do first before I make any plans to release more.

Indeed the problem came from the Loot_HERO blueprint which requested a minimum of 9 loot item, when deleting most of the provided item, this seems to have caused a loop problem, i pulled this down to 0 and it works.

Excelent

expected it to work like with the npcs. thanks.

I’ve been battling errors trying to build my dedicated server with Jenkins and today I finally determined that the cook errors are all associated with the content from the ARPGINV.



LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:GetInventoryItems.InventoryItems.InventoryItems'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:LoadInventoryItems.CallFunc_Array_Get_Item'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:LoadInventoryItems.Temp_struct_Variable'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:LoadInventoryItems.InventoryItems.InventoryItems'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:IncreaseInventorySize.Temp_struct_Variable'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:GetInventoryItemCount.CallFunc_Array_Get_Item'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:GetEmptyInventorySpace.CallFunc_Array_Get_Item'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:ClearInventoryItem.Temp_struct_Variable'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:SetInventoryItem.InventoryItem'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:GetInventoryItem.InventoryItem'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:GetInventoryItem.CallFunc_Array_Get_Item'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:InitInventory.Temp_struct_Variable'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/InventoryComponent.InventoryComponent_C:Inventory.Inventory'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/EquipmentInventoryComponent.EquipmentInventoryComponent_C:UpdateEquippedMeshes.CallFunc_GetInventoryItem_InventoryItem'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/EquipmentInventoryComponent.EquipmentInventoryComponent_C:SetInventoryItem.InventoryItem'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/EquipmentInventoryComponent.EquipmentInventoryComponent_C:GetEmptyInventorySpace.CallFunc_Array_Get_Item'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/ThirdPersonCPP/Blueprints/Components/EquipmentInventoryComponent.EquipmentInventoryComponent_C:InitInventory.Temp_struct_Variable'. Unknown structure.
LogProperty:Error: UStructProperty::Serialize Loading: Property 'StructProperty /Game/InventorySystem/UI/Blueprints/Inventory/DragItem.DragItem_C:DraggedItemInformation'. Unknown structure.



Any suggestions?

Does cooking normally work for you?, it must just be something specific to your dedicated server cook. Did you package in the editor first?

Can you please provide the full steps you took to prepare the project to build the dedicated server and then your steps for cooking the dedicated server.

Hi Pirate,

thx for this awesome inventory system. I allready started my own one, but after i bought your system i know that i would just reinvent the wheel :D. I implemented a Weapon/Damage System and it works great with your system. Thx for all the work.

One thing - not really a problem, more a “what the heck did if miss” - i stumbled over is the integration of new variables to the InventoryItem. You have to update the “Make Inventory” Node on the InventoryManagerComponent (and in the demo content like InventoryPlayerController, World Actor etc, if you use it) or else the item gets the default value defined for the new variable. Just as a notice, if someone else encounter this problem. Maybe it would be a nice addition to move these into a function library for easy access, because only the amount value does change.

The next step on my list is the implementation of a item depencies like a ammunation system. What do you think would be the best starting point for integrate this? After i equip a weapon i can cylce through the inventory Items and look for Ammo Items the weapon can use, basicly the same way the “UpdateEquippedStats” function does it, right? And after i fire a shot i would reduce the amount of the first ammo item of that type i encounter in the list. Or is there another way which would be better?

Yes, I’ve been running Jenkins to build and cook my server and client for some months without this problem.

I confirmed that it is the new content that fails the cook process by trying to package the client in the editor.

At the moment, my strategy is to recompile and save all the parts of the ARPGINV in an attempt to clear up the reference issues.

Edit: Recompiling all the offending ARPGINV parts cleared up the errors and allowed me to cook in the editor.

It’s very strange it’s tripping up on that one struct and only through Jenkins. It only seems to be having trouble finding the InventoryItem struct from the logs you posted.

I am very interested in finding out what caused this issue so we can get it reported to Epic. There are enough issues with Blueprint structs already that need addressed.
Another thing you could do and might take you less time is to rebuild the struct in c++. But it’s probably better to find out why it’s not referencing your blueprint struct during cook.
I’ve had re-directors trip up my cook in the past on other projects.

We finally got internet restored today after a week offline at the office so when I catch up on some things I will try and give Jenkins a try.

Referring back to this post: What specifically needs to be done to fix the issue of dragging one UI on top of another?

The recompiling cleared up the cook errors in the editor.
My expectation is that his will also fix the cook errors in Jenkins.

There was a lot of little UI changes, that’s why that fix was released as soon as possible.
But basically you want to migrate the changes from the OnDrop() functions and you also want to make sure when you drop the Widget you are adding it to the canvas panel and not just back to the viewport.
If you add it simply to the viewport it won’t belong to a layout and won’t have an overridden OnDrop() function. If you are using the UI from launch day and have not made many changes to the UI in your project I would highly recommend migrating the UI with the changes.

I’m happy you were able to solve the issues, please let me know if it cleared up your continuous build system cook errors.