Persistence with random stats on weapons in inventory


I am using this inventory system by UnrealGaimeDev Complex, slot-based inventory system - Community Content, Tools and Tutorials - Unreal Engine Forums.

I’ve changed a few little things but on the whole it’s a great system that’s really brought a lot to my little rpg game.

I have reached out to the developer to help me with a few things but he must be busy as I’ve had no response as yet and I really need to crack this issue so I can start creating tons of weapon and item variations.
I know it’s a long shot asking on here but there’s a chance the answer I need is more of a general thing rather than system specific, so here goes:

I roll random attributes on a weapon at runtime when it spawns into the world (As loot etc) but once picked up and equipped, these stats keep getting rerolled on that same item. This is due to the way the inventory system works in that it constantly destroys and respawns that item, therefore triggering the Construction Script and indeed the other Event Graphs relevant to it spawning.
I see two solutions, but don’t know how to tackle either.

1> Make it so that instead of destroying the items, it merely transfers them to the character physically (and perhaps hides them when they are unequipped and in the inventory?) so that the item never gets destroyed, even when dropped into the world or equipped/unequipped constantly.

2> When first picked up and placed in the inventory, we save the stats somehow and keep recalling that saved snapshot whenever we equip/unequip the item. This seems the most logical option to me, but I cannot think how to do so. There are many blueprints and widgets involved with this system and a lot of inter-dependencies so although I have some ideas, I doubt I could reliably make this change without a solid understanding of the whole picture.

Has anyone used this or a similar system and come across the issue that I have? Did you fix it? Can you share your ideas/solutions or suggestions with me please?

In the mean time, I am gonna watch all the videos of his making the system to see if I can find mention of this issue.

Thanks for your time,

I have spent all week trying to refactor this to work in my project and everything works great except for the stat persistence.

I have even changed the system from using a Pickup Actor (of Actor class) acting as the visible item in the world, to cutting that out and using a child of the base item as the pickup itself (seeing as I want to attach these to the character (invisible, no collision) when they pick them up, rather than destroy them. Then when in inventory and equipped I set them visible and active as the equipped item. Therefore I believe they never get destroyed and so the stats stay persistent. SO I’m almost there in terms of functionality but I just need to nail the bit where that item on the ground goes into the inventory array and doesn’t get destroyed.

Seriously, someone must take pity on me and guide my naive soul toward the light!

Hello dazuk

I’m struggling with a similar problem (Large Optimized Inventory System over a dedicated server). Here is what I found to help me accomplish my goal.

Here is a link to a tutorial that implements a database system containing all items so that a player only stores a reference to that item. This could be included inside your struct, I believe its the most optimal way of handling a large quantity of items. (I believe the game Skyrim implements a similar system)
Link: Crafting/Inventory System Tutorial in Unreal Engine - #1 - YouTube

Here is a link to my question with an nice answer explaining different implementations:

Hope it helps

Any progress on this question? I too am trying to figure out an inventory system where the item drops can have random stats or even increased stats with player interactions like crafting or leveling.

Off the top of my head this of this not practical way of doing it. I can fathom making Save Game Slots for each item in an Object Array. When an item is sent to an inventory array it saves the stats to a Save Game Slot. A Chestplate for example checks to see if Chestplate slot exists, if that save slot name already exists append 1…2…3, loop until a unique save name is found. Then when that Object is called that Object somehow calls the save slot at Begin Play to load the unique Stats. When the Object is deleted from the Array it also deletes the Save Slot.

It would probably be best if the Object index matches the save slot index…make an array of save games if that’s even possible… just my first thought on this