Greeetings,
You all probably know that I’m still working on that inventory from before.
I have 2 issues here. For now, let’s focus on issue 1 first.
Issue 1:
I want to have a maximum amount of equips for the player. Basically, in this example here, the player can only equip 2 trinkets so far. They will not be able to equip any more than 2 (Until upgrade is found).
It’s only half working right now, once 2 trinkets are equipped, clicking on another trinket rolls the counter that keeps track of how many trinkets you have on now down to -1 (In the debugger), allowing an extra to be equipped, which isn’t what I want.
Here’s the code:
And here’s the issue:
Clicking on a third trinket with 2 already equipped (Which in this case is that heart charm with the face), silently equips it, rolling the trinket counter down by 1, thus opening up an extra slot (3 in this case). The other 2 trinkets were unequipped for the demonstration, and the debugger displays the slot with the heart as equipped too
So basically, when I hit the max amount of trinkets I can wear at once, the counters keep moving. How can I get them to freeze once all the equips remaining are filled?
Issue 2:
I have the save system up and running for the trinkets. Since they each have their own dedicated slots, it’s an easy read and write to JSON code. No problem.
But since my game will have equippable trinkets, how can I make it so that the save system remembers that trinkets are equipped? Is the built in inventory system capable of handling this? Or do I have to reinvent the wheel and rewrite the trinket inventory with an array instead?
Thanks