How many "Or" statements can RPG Maker handle?

I am having fun with the engine, coming up with a Clue style game. I am having 6 murder weapons, so I am designating each NPC member a "card".

I created an if statement to check if the variables match. If any of the variables match then it will loop until it has its own individual number.

However, when I input the if condition for NPC 6 the variable will match another's NPC's variable #.

There is 6 "or" statements to 1 condition, which I am not sure the engine is able to process 6 or statements. If so, I will just have to change the murder weapons to 6 to 5 along with the person and rooms.
indefinitely
However, when I input the if condition for NPC 6 the variable will match another's NPC's variable #.
that means that you made a mistake in your event logic, it has nothing to do with an OR limit as the engine can handle as many ORs as you can fit into the line
To figure out what you did wrong, we would need to see your event. You would also have to copy and paste the condition (do not retype it, as you might add or miss typos - we need to see it exactly as you have it).
Needs screenshot to understand more.


If you use IF/ELSE with six IFs, you can also try omitting the else to make a pseudo-switchcase (much more neater and less prone to error) and only the last IF must contain ELSE.
If you need a switch-case statement you can also use my SwitchCommand plugin.
If you need a switch-case statement you can also use my SwitchCommand plugin.
I'm interested in that plugin. Mind sharing the link? I'm in trouble finding it 😅
Here is my code to assign a random number to NPC 6.

1625416069819.png




1625416094139.png
Here is my code to assign a random number to NPC 6.

The loop is unbreakable, and will loop forever, add condition to break the loop first. Self-switch doesn't end loop afaik.

I suggest using common event to assign unique random number to NPC is much more reliable.

The structure I can think is like this:
Control Var: var 1 = rand. 1..6
Loop
_Control Var: var 2 = rand. 1..6
_If var 2 !== var 1;
__Break loop
_End if
Repeat above
Loop
_Control Var: var 3 = rand. 1..6
_If var 3 !== var 1 || var 2;
__Break loop
_End if
Repeat above
...etc
I'm interested in that plugin. Mind sharing the link? I'm in trouble finding it 😅
It's in my signature, but since I don't know if the forum allows you to hide signatures, here.
It's in my signature, but since I don't know if the forum allows you to hide signatures, here.
I'm on mobile so that's probably why I can't see your signature. Thanks!
Here is my code to assign a random number to NPC 6.
you never check for variable 2, is that intentional?

and your first problem is that you should have structured your script line with () to make it better readable for both the computer and yourself.

The second problem however is that this loop is extremely badly designed, because the last randomizer might loop hundred of times before getting the last variable.

A much better way would be to create an array with one element of each number, then choose a random position of the array, copy the element value and remove the element, then loop.
no need to check for doubles at all and after six calls the array is empty.
I agree the loop is badly designed. It could hypothetically loop a hundred and one times. I’ll look into arrays as it will probably look cleaner but be more efficient for the computer to assign the murder weapon.

After some brainstorming I figured it out. I’m an idiot. The last loop was getting stuck because it wasn’t able to assign itself a number since all were taken. If there is 6 murder weapons then only 5 NPCs can provide clues to the real murder weapon.

Original thread: https://forums.rpgmakerweb.com/threads/how-many-or-statements-can-rpg-maker-handle.138100/