slimecat

professional daydreamer
Member
Joined
Jun 7, 2017
Messages
15
Reaction score
11
First Language
Russian
Primarily Uses
RMMV
So I've made a little puzzle that requires the player to rotate blocks to complete the picture - upon completion a passage will be open in the wall.
Here's how it looks (just the first row but I hope you get the idea).


Not using any plugins for this, only cutsom map and events with character graphics as blocks.

Now the problem I've encountered: I need an event to be played upon completion of the puzzle. I haven't found a way to make it work. The puzzle is complete when every event is facing down, so I tried using conditional branches + variables but it doesnt seem to do the thing I need.

Thank you in advance :kaoluv:
 

falken14

Veteran
Veteran
Joined
Dec 6, 2016
Messages
77
Reaction score
47
First Language
English
Primarily Uses
Can you just do a nested conditional branch in a parallel process like:

If [EV001] is facing [Down]
If [EV002] is facing [Down]
If [EV003] is facing [Down]
....
If [EV00n] is facing [Down]
--> switch ON, or your 'puzzle complete' event sequence, then erase event? I can't test this now but I think that should be possible.
 

slimecat

professional daydreamer
Member
Joined
Jun 7, 2017
Messages
15
Reaction score
11
First Language
Russian
Primarily Uses
RMMV
Can you just do a nested conditional branch in a parallel process like:

If [EV001] is facing [Down]
If [EV002] is facing [Down]
If [EV003] is facing [Down]
....
If [EV00n] is facing [Down]
--> switch ON, or your 'puzzle complete' event sequence, then erase event? I can't test this now but I think that should be possible.
That's gonna be a helluvalot conditional branches :'D but I'll try it out now, thank you!

UPD: it works perfectly, big thank you :kaoluv:
 
Last edited:

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,448
Reaction score
2,153
First Language
Dutch
Primarily Uses
RMMV
there are 3 other ways to make it WAY shorter than nested.

methode 1:
use conditionalBranch+ to shorten it (you can make the checks in 1 line)

methode 2:
Variables (1 variable per block), than use scriptcall

(can be done without variables, but it works slightly different, but the same way)

for (i = 2; i < 12; i++) {
code here
}

I need to find the code that I have for the switches, but the entry check
can be either variable = ALL 4, if using 1, 2, 3, 4 per turn, or a way
to see if the images are facing [down], but that is something I need to
dig for, but with that scriptcall, it's way easier to control nested conditionals.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,624
Reaction score
502
First Language
German
Primarily Uses
RMMV
I can also think of a Workaround.

Everytime you Rotated a Block, that Block will execute one Time the following if statements.

Var2 set to direction of this event (this variable can be reused for every event, it just stores temporary data)
...I believe a Picture is easier:
gherguierhui45454.png
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,743
Reaction score
2,099
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!

You can make that check a lot easier using javascript(script on conditional branch).
Replace the numbers inside the brackets with the ids of all events you are using into the puzzle. Separating each one with a comma.
[2, 3, 4, 7, 8, 13].every(id => $gameMap.event(id).direction() === 2))

every method for reference.
 

CleanWater

Independent Developer
Veteran
Joined
Apr 8, 2017
Messages
735
Reaction score
902
First Language
PT-BR
Primarily Uses
RMMV
From my understanding, the easiest way is to create a event with a check for the variable you are using.

Let's say that you have 8 blocks. For each block facing down, you have +1 puzzleFaceDown variable.

In the door you want to open, the puzzleFaceDown must be 8 or more for it to be opened.
 

slimecat

professional daydreamer
Member
Joined
Jun 7, 2017
Messages
15
Reaction score
11
First Language
Russian
Primarily Uses
RMMV
From my understanding, the easiest way is to create a event with a check for the variable you are using.

Let's say that you have 8 blocks. For each block facing down, you have +1 puzzleFaceDown variable.

In the door you want to open, the puzzleFaceDown must be 8 or more for it to be opened.
Well, I tried it before but here's a thing, it will add 1 EACH time the block is facing down. So, instead of actually solving the puzzle you could rotate one block 8 times and the door will still be opened. That's unfair, duh :'D

I didn't try other methodsin this thread yet, falken14's method seems to work so far, maybe I'll test other methods later just for future users to check out
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,624
Reaction score
502
First Language
German
Primarily Uses
RMMV
here's a thing, it will add 1 EACH time the block is facing down. So, instead of actually solving the puzzle you could rotate one block 8 times and the door will still be opened.
That is taken care of in my example.
I could have even not used the variable for direction and directly ask the needed direction for this event.
 

pawsplay

Veteran
Veteran
Joined
Mar 29, 2012
Messages
495
Reaction score
265
First Language
English
Primarily Uses
RMMV
Common Event. It goes through all of the events, and if they are all facing the right way, it sets itself to true. Run this common event every time a block is rotated.

The "win" event is triggered by the completion switch being True. It then autoruns your "You win" message, then turns its self-switch. Last page triggers on self switch and does nothing.

This requires using only a single switch.
 

CleanWater

Independent Developer
Veteran
Joined
Apr 8, 2017
Messages
735
Reaction score
902
First Language
PT-BR
Primarily Uses
RMMV
Well, I tried it before but here's a thing, it will add 1 EACH time the block is facing down. So, instead of actually solving the puzzle you could rotate one block 8 times and the door will still be opened. That's unfair, duh :'D

I didn't try other methodsin this thread yet, falken14's method seems to work so far, maybe I'll test other methods later just for future users to check out

It depends on how you implement the "programming logic" in the said event.

You need to check "if it's facing down == Add +1" and "if not facing down == Sub -1" to said variable. For this, you can use Self Switches and such to do so.
 

Latest Threads

Latest Posts

Latest Profile Posts

Not sure why I'm a jack of all trades , master of none... Sigh. Album out 06/03/2022 on all ur favorite platforms. 10 tracks.
Hmm... Mushrooms, maybe they're not poisonous...
unknown.png
Hi, I'm a new and upcoming Indie Developer, and I could really use some help when it comes to system programming. Explorers can only go so far before needing a map, you know?
I made a comic strip with the characters of my game.Flor en la cola eng.jpg
Hey, what does it mean in settings, privacy, where it says allow users to: view your identities??????????

Forum statistics

Threads
122,050
Messages
1,146,152
Members
160,327
Latest member
Whitepard
Top