Tiffypowers79

Villager
Member
Joined
May 11, 2021
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
Alright, so...I tried to code a puzzle in which you have to light the torches in a certain color order for it to work.
When you get the order right, it works as normal, activating the switch and stuff. When you get it wrong, however, the self switches don't reset, and then you're stuck. This isn't even the first time this has happened.

I thinking that maybe the way I did this is too over-complicated, but I'm not too sure.

puzzleproblem1.PNGpuzzleproblem2.PNGpuzzleproblem3.PNG


EDIT: Thank you so much. I'll just have to do an individual script call to turn off each self switch on each event. A bit tedious but thankfully, I only have to do it once.

EDIT-EDIT- One small problem, every time the sequence resets, the last light you lit inexplicably relights, making it impossible to try it again. Anyone can shed some light on this? (pun intended)
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,376
Reaction score
8,395
First Language
German
Primarily Uses
RMMV
that self-switch script looks strange - are you sure that it is supposed to be used like that?
the scripts that I remember needed every switch to be handled in its own command, it was not possible to set multiple switches in a single command.

That said, I would handle all sequentiel puzzles in a different way.

Use one variable for counting every step step of the puzzle, counting it up if the event is used in the correct order and resetting it if not.

so on the first event it is simply var += 1
on the second event it is conditional branch var=1 - if yes +1 else =0
on the third event it is conditional branch var = 2 - if yes +1 else =0

you can chain as many events as you want, even use some events multiple time with nested conditional branches, and the end of the puzzle is simply conditioned on the variable being higher or equal than the number of steps to reach that.
 

Tiffypowers79

Villager
Member
Joined
May 11, 2021
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
that self-switch script looks strange - are you sure that it is supposed to be used like that?
the scripts that I remember needed every switch to be handled in its own command, it was not possible to set multiple switches in a single command.

That said, I would handle all sequentiel puzzles in a different way.

Use one variable for counting every step step of the puzzle, counting it up if the event is used in the correct order and resetting it if not.

so on the first event it is simply var += 1
on the second event it is conditional branch var=1 - if yes +1 else =0
on the third event it is conditional branch var = 2 - if yes +1 else =0

you can chain as many events as you want, even use some events multiple time with nested conditional branches, and the end of the puzzle is simply conditioned on the variable being higher or equal than the number of steps to reach that.
The self switch script is a variation of Shaz's script for sequential switch puzzles:

The only thing that isn't correct is that the first event value should be 1 not 2. Even after fixing it still doesn't work. I've used this script in this same puzzle to get the torches to turn on and it works fine.

$gameSelfSwitches.setValue([75, 1, 'B'], true);

$gameSelfSwitched.setValue([75, 1 'A'], true);

And the puzzle needn't be activated in the right order. The colors that you set the torches to must be ordered, but you could activate the torches in any order you want.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,376
Reaction score
8,395
First Language
German
Primarily Uses
RMMV
The self switch script is a variation of Shaz's script for sequential switch puzzles:
variations of functions will NEVER work from themselves. If you want a variant of a function, you need to program in that function.

This:
$gameSelfSwitches.setValue([75, 1, 'B'], true);
will work, because the key [75,1,'B'] designates a single switch to be set to true.

[75,1,'A','B','C'] is NOT a key for a switch but is completely undefined, unless you added a plugin that programmed a function to dissassemble that string into several keys and use them.

So - have you added a plugin that allows you do change multiple self-switches with a single command, because that is NOT possible in the default as far as I know.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,988
Reaction score
570
First Language
English
Primarily Uses
N/A
Why not use variables? The first switch goes up if the variable is 0, otherwise, it resets the variable and the switches. The second torch raises the variable if the variable is 1, otherwise, it sets the variable to 0 and resets the switches. The third torch raiser the vairable if the variable is 2 otherwise...ect, ect

The last torch checks if the variable is = the number of variables before it. if it is, the puzzle is solved. if not, the variable is reset
 

Latest Threads

Latest Profile Posts

Why keyboards don't sleep? Because they have two shifts.
I realized a while ago my game was toooo big in scope. even now I wonder am I trying to do too much by myself. and that's after completely changing the format of the game.
Last week at SLC. Cali awaits. TBH I love SLC more than SF.
Back home now. I had a good time, but I had a checkup this morning so I had to come home for that. Now I'm just waiting for my therapist meeting tomorrow...
Decided to work on Wishful Wanda today. Since it's a BFB spinoff game, I decided to make the Huang brothers
Easter eggs! I'm actually pitching this to the BFDI team, btw.
I'm a bit perturbed that my two week project in a different engine is already shaping up to be far better than anything I've done in this one. It really calls into question my future plans. :kaoswt:

I guess I'll release whatever patches I made for Poppet Quest, then abandon it for my new project. I mean unless it somehow wins (I doubt it but hey sure). I'm not sure about And Remember Tomorrow.

Forum statistics

Threads
113,932
Messages
1,078,512
Members
148,042
Latest member
beanlad
Top