Inventory using a TXT file... Is it possible?

This is merely theorycrafting, but is it possible? Also, how would it be made ideally? I am very new to programming inventory systems and have not got much experience with Arrays and Lists. Ideally I would like it to have a limited amount of slots, equipping, a dictionary so only that item can be placed in that slot, stacking, consumables, etc… Would it be possible?

Thanks in advance! :smiley:

NOTICE: Seeing as moderators might take this post down as they would normally do with people asking for scripts, this is not a begging post. I am gathering others’ experience and opinions on the topic in order to begin working on it myself.

It is possible to do it using a TXT file although it will be a lot of headache since first you have create a format to store all your required data in that txt file and then write a parser to parse that data to load and save into the file. This is just a lot of work.

You can try using a pre-defined formats like XML or JSON since they will make your job easier since you just have to figure out how you should fit your data into that format and you have readymade parsers available for these formats.

Suppose you decide to use XML you will have a parent node for your inventories list which will contain all the inventory items as its child nodes with their attributes and values. You can then read the file and load this into a List and use in the game. While saving you can just put your items from List to the file.

or you can use local database for example this free solution from the asset store:

didn’t check it my self but it should work.