Help with an item-based puzzle

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
16
Reaction score
5
First Language
English
Primarily Uses
RM2k3
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?
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
85
Reaction score
64
First Language
English
Primarily Uses
RMMV
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!
 
Last edited:

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
16
Reaction score
5
First Language
English
Primarily Uses
RM2k3
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,848
Messages
1,016,974
Members
137,562
Latest member
visploo100
Top