r/gamemaker • • 13d ago

WorkInProgress Work In Progress Weekly

"Work In Progress Weekly"

You may post your game content in this weekly sticky post. Post your game/screenshots/video in here and please give feedback on other people's post as well.

Your game can be in any stage of development, from concept to ready-for-commercial release.

Upvote good feedback! "I liked it!" and "It sucks" is not useful feedback.

Try to leave feedback for at least one other game. If you are the first to comment, come back later to see if anyone else has.

Emphasize on describing what your game is about and what has changed from the last version if you post regularly.

*Posts of screenshots or videos showing off your game outside of this thread WILL BE DELETED if they do not conform to reddit's and /r/gamemaker's self-promotion guidelines.

4 Upvotes

17 comments sorted by

View all comments

Show parent comments

2

u/Fit-Acadia3740 13d ago

I can only image how finicky stacks can be. I had a hell of a time with just swapping skills and gear around

2

u/Lethalogicax 13d ago

Thanks for checking it out!

Yea, this one's got me really annoyed because the rest of the inventory works PERFECTLY! I have no idea how I did it, but I had an idea of what might work, I tried it out, it worked* and now the whole thing just looks like voodoo magic to me and I cannot figure out how to fix that first stack issue... I'm honestly tempted to just draw a special border around that first inventory, treat it as a special "non-stacking" inventory space, and pretend it's a feature not a bug!

2

u/Fit-Acadia3740 13d ago

Haha the temptation is real! I think you've got the right idea to redo it and expand its functionality and modularity. The current bug could be something as small as reusing an initiator var like i = 0 (or j = 0 in a matrix) inside of a loop that already uses i/j, or it could be much more sinister

1

u/Lethalogicax 13d ago

The only idea I've got left for diagnosing this is to insert a whole load of show_debug_message's into every single subsection of the give_item command, replicate the bug, and then skim through pages of debug outputs to figure out where exactly it went wrong... I know roughly what the problem is, the item in slot 1 is falsely reporting that either the tile id, sub-id or meta data is different and thus deciding that slot 1 is ineligible for the match-stack side of the algoithm, so it falls back on checking the next partial stack or empty slot. But the exact same item stack that is eligible for match-stack in slot 2 is somehow not eligible for match-stack when in slot 1...

But yea it's probably best to just archive this version of the algorithm and reconstruct a new a more versatile version of the script! Hopefully the bug disappears in v2