Help with an item-based puzzle

Hello all, I have run into a problem with coding a puzzle in my game. I wish to make it so that there are 8 stands in a room and 4 items. the items all count as individual components, if that is important. anyways, the items need to be placed on specific stands in order to solve the puzzle, which unlocks a cabinet. Normally I would try making a switch-based system, but every angle I go at it seems to fail. Specifically, I wanted to make it that you can place the items on the stands and it only is solved once all the items are in the right place, not sequentially (put an item in place, it activates a switch, etc etc). I don't know how to make the script perform the task... the item changes the Stand (its an event) to become visibly indicative of what is on it... so maybe somehow make it read if the stands are certain graphics? Again, I can't seem to figure it out.
Does anyone have any ideas as to how I can approach this?
Maybe switches + a variable representing the number of completed items.

Call it 'num_finished', for example.

Each time an item is correctly placed, increment num_finished +1

Add a conditional branch at each correct stand like:

If num_finished = 4:
Do the 'hey you got them all!" stuff.

else:

whatever happens when you place a correct item on a stand but haven't yet gotten all 4.


I can't think of why that wouldn't work, but there are always surprises when you actually roll out the logic.

Good luck!
Maybe switches + a variable representing the number of completed items.

Call it 'num_finished', for example.

Each time an item is correctly placed, increment num_finished +1

Add a conditional branch at each correct stand like:

If num_finished = 4:
Do the 'hey you got them all!" stuff.

else:

whatever happens when you place a correct item on a stand but haven't yet gotten all 4.


I can't think of why that wouldn't work, but there are always surprises when you actually roll out the logic.

Good luck!
Ah, see I was overthinking it... that makes a lot of sense! ill do just that and see if i can get it working.
It worked! thank you so much for helping me!! 😂
@
I would just use a different region id for each item, and draw with that region on the tile the item needs to go onto. Then on each item, do the move, then call a common event (the same one for each item). In the common event, check the region id for each event. If one is found that's not correct, exit the common event. If it falls through (all items are on the correct regions), the puzzle is solved and you can turn on a single switch that controls whatever happens next.
It worked! thank you so much for helping me!! 😂
@

Excellent!! :LZSjoy:

Sure thing, good luck with your game!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-an-item-based-puzzle.124844/