I apologize in advance for this relatively long winded question about to ensue but I just need someone to prove my theory or get some help getting me into the right path. This is the result of reading too much and not really getting it after a couple of days.
So I wish to make a inventory (shocking…), but I do not want to make it grid based. I want to achieve a carousel like inventory system that is used in Silent Hill 1 using 3D objects that rotate around a central axis.
image for reference
Taken from a Unreal Engine forum from a user that is trying to do the same thing but in c++ blueprint form so I don’t know if that can be translated into c#. Did I say I’m a noobie?
I’ve noticed that there all ready is a shared script to achieve the carousel effect here that I can download and dissect to get the effect I want.
The question becomes now on the basics of item handling, interacting and managing. I’ve now spent a couple of days looking into how items are created and handled and how people do it for RPG’s and other grid based systems, but I get completely lost whenever they start creating scriptableObjects and not really explaining what they truly are on how they are called when accessing an inventory. I can understand the fact that you can create a .asset file and just use that to (instantiate?) populate the game level with items with low effort.
So my line of thinking right now is this
- Have a database/list of all items.
- Get values, names, descriptions and amounts from that database for the items. (scriptableObjects?)
- Create a prefab of the specific item and world model. ( or is this the scriptableObject?)
3.a. Have the item prefab have the interaction code in it i.e. input.getkeydown(yada yada yada) call boolean from the player to play “pick up this item” animation and overlay UI saying “You got this weird thing, aren’t you happy?” - Place that picked up item inside a inventory list. A new list. Not the database of all lists and use the same world model for the carousel.
- When player presses the inventory key call an array and populate that array with the picked up items in a 360 degree array. (see above carousel and image reference).
- When an item is used remove the item from the inventory list. Get updated carousel.
In the end I would have in theory 4 scripts (Database, Inventory, Carousel and ItemPickup) and a prefab for each item with the ItemPickup script embeded.
Truly this is becoming a multipart question right now. I’ll numerate them too for easier understanding.
- Is this line of thinking right?
- Which part of this is the scriptableObject or should I just do it differently?
- Is the database a plaintext file of row’s and colums of item information or am I just insane.
- This is how all items should be handled? i.e. Health, key items, ammunation? Or should all three for example have their own subset of item declaration. As in Items/Health - Items/KeyItems - Items/Ammunation etc. etc. inside the database or SO.
Thank you in advance. Sorry for the long read and the possible headache.
P.S. I’ve searched these forums and others for a while not really getting a clear answer. Possibly because I don’t get a simple interaction or that the question differed in someway that didn’t work with my view.