Persistent Item-System with definite deletion
How would one design a system where Items (Actors) in the world can be picked up and thus permanently deleted from the level and added to the inventory. This deletion needs to persist a restart of the game. I`m thinking of Item-systems like the ones in Fallout here. The way i see it, i have two options:
Are there other ways, and how could i efficiently construct such a system? If i were to dynamically spawn every Item in the world, this could have a big impact once i spawn tens of thousands of items, equally, if i save the level, it becomes unusable for any other players with different SaveGames. Both ideas have problems so i`m wondering if anyone has experience with those kind of systems and could help me out here.
asked Oct 31 '18 at 07:25 PM in Blueprint Scripting
I'd recommend checking out some of the tutorials for a standard inventory system to get a baseline for what you're looking for.
You'll basically want a data structure that holds all of the data that makes an item (id,name,description,icon,stats,meshes,etc). That data structure can be passed to an actor in a level when spawned and then be given to the player when they interact with the item. Your inventory item will essentially be the data structure and the actor will just be a stage that handles how the item is interacted with. From there you can use the basic save game class to store everything you need. You might need to create mutlitple classes but you'll be able to save locations, items state, etc...within that class.
I'm not at my device right now but I'll have screen shots if needed later.
I hope this helps!
answered Oct 31 '18 at 10:32 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here