So for the last couple of days, I have been researching and studying how to give the player an inventory.
I think I finally achieved that.
that works + saving (kind off)
The player doesn’t “physically” own anything. It’s all just values, which is loaded when player joins.
But now I need to give every NPC an inventory.
I’m thinking about a module script and a dictionary, but I’m not sure.
Also I’m not really familiar with dictionaries.
My first initial thought, was to give every NPC a folder called 'inventory".
But that seems insecure.
Also, every NPC is unique. They can have the same name, but they’re different.
2 dogs, different inventories
Please don’t mind the laughable dog model, it was my first time.
How would I implement such a thing?
I’m sure I can eventually figure it out, but the code would be so messy and inefficient.
Pretty sure the player’s inventory already took way too much lines.
I know time did lmao (4 days).
I honestly don’t know if I make any sense, it’s super late.
I’m not sure, but I think that script is adding items to the player inventory. I have no problem with that.
I just need to find a way to create inventories for NPCs.
My end goal is to allow the player to transfer items to an npc. My only problem is that im struggeling to make an inventory for every single npc in the game.
sort of backpack for npcs.
let me show what I have now.
Oh cool, it picked up my music. Enjoy the bg music lol.
I don’t know if that made it any clearer xd
But, I don’t want to jinx it, but I’m actually getting somewhere.
I would say you can make maybe a server sided script assign a value of what objects that NPC has and how much of it and just make it random for each one as it may be very annoying to assign a certain inventory for each NPC if you making a lot of NPCs.
This is intuitive for games with a small amount of values but would be inconvenient for a game which would have 20+ values, Otherwise You would Be getting the table from the player and NPC.