x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Persistence with random stats on weapons in inventory

Hi,

I am using this inventory system by UnrealGaimeDev https://forums.unrealengine.com/showthread.php?121268-Complex-slot-based-inventory-system.

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, Daz

Product Version: UE 4.15
Tags:
more ▼

asked Jun 08 '17 at 10:45 AM in Blueprint Scripting

avatar image

dazuk1978
42 10 16 21

avatar image dazuk1978 Jun 16 '17 at 10:16 AM

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!

avatar image Xnar Jan 19 '18 at 06:43 PM

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

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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: https://www.youtube.com/watch?v=BQ6Eu3QM7Lg

Here is a link to my question with an nice answer explaining different implementations: https://answers.unrealengine.com/questions/668629/dynamic-inventory-system-c.html

Hope it helps

more ▼

answered Jun 20 '17 at 07:33 AM

avatar image

Deltamike276
13 1 3 5

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question