Alright, I’ve deleted all of the standalone trigger onces, and found some redundant code to disable too
Unfortunately, it didn’t change anything. Everything still doubles regardless
I’ve disabled all of the events that I thought were the culprit, but to no avail. Nothing I tried worked
So I decided to try testing your theory on spending items to remove them from the inventory. However, yet another problem arose (Note: That Trigger Once in the events is no longer there):
As you can see. for now, I just have the code removing any item you click, regardless of what it is. The code on the way bottom, just above the external event makes it so that if there’s nothing in that slot at all, change the animation back to empty, and set the quantity to zero
Unfortunately, when I boot the game up, EVERY slot is empty. When I try to load, the items saved from before show up for a splint frame, then vanish again. So apparently, the game it TRYING to load everything back in, but this code isn’t changing the ID variables back and deleting everything again
I tried to see if the values were increasing correctly in the debugger, but now a third problem arose. The debugger doesn’t work anymore for some reason, so using the debugger is out of the question:
First, I need to fix that issue with the code that sets the slots to empty when there’s nothing in them, but I don’t know how to fix it
(Also, disabling this event and clicking on items DOES remove them, but the animation never switches back to empty. Also, the load problem still isn’t fixed either)
=====================================================
EDIT: After looking through the pre-made inventory example bundled into GDevelop, as well as another inventory example I made a while back (I’m starting from scratch with an improved version if that makes sense), I’ve noticed in both that they and I both used strings to track items, as well as using animation NAMES instead of NUMBERS to track data.
Truth be told, I have an older inventory example similar to this one I’m working on now, I wanted to remake it from the ground up to smooth over the flaws, enhance it with new features, and just give it a facelift (I even tried the function in the old version, which doesn’t work right. Getting the function working in this version might work in the old version if I make the changes).
The example I’m working on right now, I’m trying to switch to integers instead of strings because I figured numbers would be easier to work with.
Both the bundled example and my old version work just fine and don’t have the issues I have right now, and since the expression:
Inventory::Count(string, string)
requires two strings, I feel like trying to convert them to numbers might be more trouble than I thought.
I added names for the animations of the items and inventory cells just in case. Would you recommend I use primarily STRINGS for an inventory over INTEGERS?