Action RPG Inventory System

How are you adding the items to the inventory? to me it sounds like your not using the right function, if your not casting to the players IMC then thats why the UMG variant isn’t being updated, you should be using the tryaddtoinventory function when adding items.

I am replacing the entire inventory array at load, maintaining slot position. TryToAddItemToInventroy places a single item in the next available space, which would not be suitable for my future purposes.

The Server_RefreshInventorySlots event called from inside the IMC calls the private function RefreshInventorySlots whose comment says “Clear Client Inventory UI and Refresh Client UI From Server Inventory” which is exactly what I want to do.

However, the Client_ClearInventroySlotItems function fails because the IMC UserInterface variable InventoryUI returns None.(Client_ClearInventorySlotItems ->ClearInventorySlotItems)

Somehow, the InventoryUI variable in the IMC is not getting set or is getting reset and I don’t understand why. As far as I can trace the execution flow, it should be fine.

My current thought is that I have not called the refresh inventory slots function in the correct way to make it propagate down to the client. If I understand correctly, the server has no UI and therefore I suspect that the InventoryUI variable on the server would be None by default.

Then your going to have to create a new function so the clients UMG gets the item info also, as replacing the array doesn’t pass the data to the UMG inventory slots and there is no function to sync this info, what i did was add the inventory slot to the inventory item this mite help you add your items back to there original positions, i also had a similar problem when creating a campfire as it added the item to the inventory array of the container, i ended up making a function to update the info once the container was opened.

Hi AU

Where do I find the version number for Action RPG?

I copied ItemIntelligence to a new macro called ItemScale and wired that output to a float called ScaleValue. Both macros take inventory item as an input. I know the value is set back in my itemlist but when I use ScaleValue nothing comes back.

Thanks,

Arthur

Go to your projects folder and ActionRPGInventorySystem\Config\DefaultGame.ini and check the ProjectVersion, search for make inventory item and much sure all the wires are connected.

You AU… If I haven’t said it before I’ll say it now… YOU DA MAN!!!

I missed a few locations where I forget to connect up the new struct items! Thanks! This one had me pulling my hair out and there ain’t much left to pull out!

BTW I’m running 1.5.

Hi im back with the same issue though i have adavanced a little bit in what i have done with creating extra slots, so as i posted in the last post i have created the slot in the equipment UMG, along with adding a entry into both equipmentslots and equipmentSlotType Enum, Along with making the OnRep function in the EquipmentCharacter and ading an extra skelatal mesh componet i have then found after a few hours of going through all the funuctions i have found i needed to add it to The UpdateEquippedMeshes Funuction and Get Equipment slot by type Function then in the Inventory layout i have added the inventoryslot 14 in this case to the array, now im not getting any errors from the blueprints so all this bit seems to work fine but if i am using the demo classes in will places the first inventory item in that slot so eg the Apple if the warrior was chosen then if interacted with it will dequip/equip Items for the head slot and nothing will change in that slot (14), so my basic conclusion is i havent definded that slot 14 should be slot 14 But after a few days of going over all the Blueprints i cant seem to find where that is either im blind which is the most probable or i have come to the wrong conclusion as to what is wrong. Thanks for any help i could also get a few images/ videos if that would help explain the situation better than what i have here

Make sure you add your new slot into the Enum EquipmentSlots so that the inventory backpack count will start at 15 when Get number of entries in EquipmentSlots is used in the Logic to figure out how many of the slots are equipment before starting the inventory.

b95e7fd6468c9729838595be145f07bd55dc9d03.jpeg

Also in the UI InventoryLayout you need to add the new Equipment UI Slot into the array and that will fix it from being off when it’s translating from Inventory Slot # to UI Inventory Slot #.
All the Equipment slots that are in your Equipment window must be added here and the remaining backpack slots are created on init based on inventory size and added to this array automatically.

7773701b7168a59775934a8fd850eac29ba71ed1.png

Pretty sure the 2nd part is your issue. Let me know how it goes.

Thanks For the reply Pirate I had done both of thoose,


This is how things are looking in a blank project as you can see theres a fern in the added slot if the class item spawing is enabled seems to be the first item in the list from the class.
Along with this as youll see in the next image while the mouse is hovered over the added slot it belives its over the head slot sorry for the text was done with the Snip tool.

Make sure your equipment slots in the equipment umg widget are numbered correctly, and that they match the same slots are your equipment slots Enum and your make inventory array, all 3 need to follow the same order.

Yep all of them are numbered correctly


its 14th in the enum starting from 0 as head. Named 14th here in the equipment.

Then in the array its 14th as well

Thanks for the help though

Oh I know what the issue is.

In InventoryPlayerController in the ServerLoadPlayerItems function you need to add another pin for the new equipment slot. It’s this function that is loading the Inventory Item into the wrong slot.

LoadItems.png

To get the load items logic to work with your changes it requires hooking up your new Equipment Slot and making sure it exists in the right place/order in the NPCItems struct.

Not sure why it thinks it’s the head slot on hover though, but lets see what happens once it’s loading the item into the right slot.

Yep Thanks pirate That fixed the loading of items from the load logic but the slot still thinks it the head slot unfortunately as in if i move any item there it says it can not be equiped but if i move a head item there Then it equips it but it slots the item into the actuall head slot also it the new slot is right click it dequips the head slot if that makes any sense

You need to update the Switch in the InventoryManagerComponent->GetEquipmentTypebySlot function.
Since you have this new Equipment Slot you need to return the new Equipment Type that fits it.
In the Enum the HEAD type is #0 that’s why it thinks your new slot is a head slot as it’s getting a null value (0).

There are only two switches for EquipmentSlots and the other is in the EquipmentInventoryComponent->Update Equipped Meshes function which handles replicating and updating the changes onto the Character when an item of that EquipmentType is equipped.

Yeah i had doen both of thoose



I think both of theese are corrently done is there anywhere else that delcares what each slot is or similar
*Edit ok so my item now equips in the slot but does not show up in game but if i unequip it it unequips the head slot not the selected slot also when nothing is in the head slot it still does not unequip

Hi LLews, are you also assigning your new slot with a slot number in its details under inventory slot in widget?

Yep that worked i cant belevie i missed that Thanks Overrated slots now work as intended.
Thanks for all the help its been great

Adding another entry to the ToolTipInfo Struct compiles without errors and runs ok… but wont let me cook and package…

I added a simple integer “Regeneration” variable under the intelligence variable

here are the errors in the log file

LogProperty:Error: UStructProperty::Serialize Loading: Property ‘StructProperty /Game/InventorySystem/Blueprints/Components/InventoryManagerComponent.InventoryManagerComponent_C:SetToolTip.ToolTipInfo’. Unknown structure.
MainFrameActions: Packaging (Windows (32-bit)): UE4Editor-Cmd: [2016.07.06-19.34.55:737] 0]LogInit:Display: LogProperty:Error: UStructProperty::Serialize Loading: Property ‘StructProperty /Game/InventorySystem/Blueprints/Components/InventoryManagerComponent.InventoryManagerComponent_C:GetItemToolTip.K2Node_MakeStruct_ToolTipInfo’. Unknown structure.
MainFrameActions: Packaging (Windows (32-bit)): UE4Editor-Cmd: [2016.07.06-19.34.55:738] 0]LogInit:Display: LogProperty:Error: UStructProperty::Serialize Loading: Property ‘StructProperty /Game/InventorySystem/Blueprints/Components/InventoryManagerComponent.InventoryManagerComponent_C:Client_SetToolTip.ToolTipInfo’. Unknown structure.
MainFrameActions: Packaging (Windows (32-bit)): UE4Editor-Cmd: [2016.07.06-19.34.55:739] 0]LogInit:Display: LogProperty:Error: UStructProperty::Serialize Loading: Property ‘StructProperty /Game/InventorySystem/Blueprints/Components/InventoryManagerComponent.InventoryManagerComponent_C:ExecuteUbergraph_InventoryManagerComponent.K2Node_CustomEvent_ToolTipInfo’. Unknown structure.
MainFrameActions: Packaging (Windows (32-bit)): UE4Editor-Cmd: [2016.07.06-19.34.55:740] 0]LogInit:Display:

I immediately went to the SetToolTip function in the InventoryManager component to see if there was anything obviously wrong but there wasn’t… I did a “refresh nodes” to see if that would help…

but its like the struct gets broken when I add a new entry to the “ToolTipInfo” Struct (even if I delete the entry and put it back to exactly what it was before… it no longer works and always gives me that error during packaging)

(using 1.5 version and ue4 4.10.4 version)

Do I need to do something else? Thanks

Can anyone help me on wihy this is happening I have tried everything to get this to work and its driving me insane

Please see previous reply (thread up 2 threads)… but its giving errors if I change the “Inventory Item” Struct also… and try to package game

Error: UStructProperty::Serialize Loading: Property ‘StructProperty /Game/InventorySystem/Blueprints/Components/InventoryComponent.InventoryComponent_C:GetInventoryItems.InventoryItems.InventoryItems’. Unknown structure.

is there a trick to refreshing the struct after editing it?

because it seems like if I add an entry to the struct… it then becomes an “unknown structure”