How to script sequences in RMMV?

Hello everyone. I have come across a situation beyond my limited programming skills.

I must check if switches 400 to 500 are ON, as a condition to reward the player with badge X. And switches 501 to 600 to badge Y.

How do I script conditions like this into RMMV condition script box?

Thank you for your time.
Hello everyone. I have come across a situation beyond my limited programming skills.

I must check if switches 400 to 500 are ON, as a condition to reward the player with badge X. And switches 501 to 600 to badge Y.

How do I script conditions like this into RMMV condition script box?

Thank you for your time.
Quickest way would be with a for loop. So for the first one, your condition input would be

let condition = true; for (let i = 400; i <= 500; i++) { if (!$gameSwitches.value(i)) { condition = false; break; }; condition
let condition = true; for (let i = 400; i <= 500; i++) { if (!$gameSwitches.value(i)) { condition = false; break; }; condition

Thanks for the tip. Unfortunately, I'm not being able to replicate it here.

Can you be more clear/didactic?
Thanks for the tip. Unfortunately, I'm not being able to replicate it here.

Can you be more clear/didactic?
I'm afraid you'll need to be more clear, because Trihan gave you the exact code you'd copy and paste into the Conditional Branch -> Script field to check for switches 400-500 to be on.

So if it's not working for you, you'll need to post screenshots of your event so we can see what might be wrong.

The only thing I notice (that shouldn't stop it from working) is you don't need the semicolon after the closing brace, before the last condition.
let condition = true; for (let i = 400; i <= 500; i++) { if (!$gameS

Thank you 2 for the assistance. Somehow it isn't detecting the switches. I just tested several times here:

1647116766656.png


A fast translation from Portuguese terms is listed below:

"Exibir escolhas" --- "Show Choices"
"Quando" ---- "when"
"Se" --- "If"
"O grupo tem" --- "the group has"
"Ciclo" --- loop
"Quebrar loop" --- break loop
"Não" --- No, not
It worked now. I just had to adjust the loop. Thank you 2.
What adjustment did it need?
What adjustment did it need?
Actually, it didn't work. When I tested a null hypothesis, it failed.

Is the logic that I established right? (take a look at the print, please)

A curious question I always had about you: why trilobites? Are you a paleontologist too?
Actually, it didn't work.
that is a bad answer, because it didn't tell us what happened.

your conditional branches in that event have three different outputs. Which one did happen?
and have you confirmed the values of the switches with the testscreen ingame for that result?
that is a bad answer, because it didn't tell us what happened.

your conditional branches in that event have three different outputs. Which one did happen?
and have you confirmed the values of the switches with the testscreen ingame for that result?

Thank you for your interest as well, Andar.

All switches are working appropriately. I triple-checked them. They have been working just fine in-game so far. I use SRD's super tools for playtesting and I ensure that all switches requested for that condition are ON.
The thing is that the condition always returns negative. "Your DinoDEX is incomplete to retrieve your badge." It is the third condition. I will also add some translations bellow the picture in Portuguese. Maybe it helps.
Thank you for your interest as well, Andar.

All switches are working appropriately. I triple-checked them. They have been working just fine in-game so far. I use SRD's super tools for playtesting and I ensure that all switches requested for that condition are ON.
The thing is that the condition always returns negative. "Your DinoDEX is incomplete to retrieve your badge." It is the third condition. I will also add some translations bellow the picture in Portuguese. Maybe it helps.
So switches 401 to 428 are ALL on and you're not getting into the true section of the first branch? I'll double check the condition works on my end.

To answer your question, I called my brand Trilobytes because it's the start of Trihan, and I try to write lo-byte code (in other words, concise and efficient). 🙂

Edit: Just tested the condition in MZ (which should work identically to MV) with switches 1-10 and this works fine. First branch runs if I turn all 10 switches on, second one runs if I don't.

1647134206012.png
let condition = true; for (let i = 400; i <= 500; i++) { if (!$gameSwitches.value(i)) { condition = false; break; }; condition
If I count right, there is a } missing in that sequence.
Oh, you're right, I forgot the outer curly bracket, well spotted!
Andar was right. The code worked properly now. I just had to reconfigure the logic of the condition layers as in the picture below:
1647181344083.png

A fast translation from Portuguese terms is listed below:

"Exibir escolhas" --- "Show Choices"
"Quando" ---- "when"
"Se" --- "If"
"O grupo tem" --- "the group has"
"Ciclo" --- loop
"Quebrar loop" --- break loop
"Não" --- No, not

Thank you 2 for this solution. I will add your names in the Acknowledgments section of the Credits in Dino Hazard: Chronos Blackout.

May you have a nice weekend.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-script-sequences-in-rmmv.145640/