So, I'm trying to make a little mini-game about making coffee where you pick the size, the type of coffee, and the type of cream. There are 3 types of each of these choices and a total of 27 combinations. How could I make that work through only eventing? I was trying to do it by making every choice turn on a switch, and having 27 separate events with corresponding conditions that add the correct coffee to the player's inventory. However, there is no space for three switches in an events conditions, so I made the size (Small, Regular, Large) a variable. But I've found that it still isn't working correctly. Every time I try to make a drink with the large size it doesn't dispense the drink. Any advice?
Using eventing to make combinations?
RPG Maker MV Supportyou can use switches, but you also make sure switches goes off, you can also use only variables and reset to 0
This example is for cream only as example with small coffee which can work.
control variable "coffee" = 0
control variable "cream" = 0
"add choice: small, medium, large"
if small: variable coffee = 1
if medium: variable coffee = 2
if large: variable coffee = 3
conditional brance: if coffee = 1
do stuff here (choice for cream end with self switch A,)
conditional brance: if coffee = 2
do stuff here (choice for cream end with self switch B,)
conditional brance: if coffee = 3
do stuff here (choice for cream end with self switch C,)
it might be complicated, but make sure you turn off the self switch on the end or failed
or it will stuck on an empty page or event page that run with intneracting.
whatever you place on page 2, 3, 4 is up to you, but you can continue with cream or in the same if coffee is 1, cream small / medium
than you need more pages to go too.
if you have an event page, put them in a spoiler and we can see where you can change a few things if need.
This example is for cream only as example with small coffee which can work.
control variable "coffee" = 0
control variable "cream" = 0
"add choice: small, medium, large"
if small: variable coffee = 1
if medium: variable coffee = 2
if large: variable coffee = 3
conditional brance: if coffee = 1
do stuff here (choice for cream end with self switch A,)
conditional brance: if coffee = 2
do stuff here (choice for cream end with self switch B,)
conditional brance: if coffee = 3
do stuff here (choice for cream end with self switch C,)
it might be complicated, but make sure you turn off the self switch on the end or failed
or it will stuck on an empty page or event page that run with intneracting.
whatever you place on page 2, 3, 4 is up to you, but you can continue with cream or in the same if coffee is 1, cream small / medium
than you need more pages to go too.
if you have an event page, put them in a spoiler and we can see where you can change a few things if need.
You could use Variables 2 and 3 and 4 to store the value 1 or 2 or 3.
Than you could use the Script Call inside Eventcommand Script to add them together:
Than you could make conditional Branches for the 27outcomes:
if var1 equal to 111 (112, 113, 121, 122, 123, 131, 132, 133, 211, 212 ... 333).
Iam sure there are better solutions, but maybe this one is helpful to you.
Edit: You could also not make 27 Conditional Branches, and add the correct Item with Help of Variable1, but than all your coffees would need to be on the correct Database Item Ids between 111 and 333. I would do the 27 conditional Branches, just wanted to mention it.
Edit2: LOL like always i went the most complicate route first. muahahahaha...
All is possible with one variable.
Cream add +1 or +2 or +3
Size add +10 or +20 or +30
Special add +100 or +200 or +300
Than you dont need a Scriptline and just 1 Variable and the conditional Branches.
Than you could use the Script Call inside Eventcommand Script to add them together:
Code:
$gameVariables.setValue(1, [($gameVariables.value(2)*100) + ($gameVariables.value(3)*10) + $gameVariables.value(4)]);
if var1 equal to 111 (112, 113, 121, 122, 123, 131, 132, 133, 211, 212 ... 333).
Iam sure there are better solutions, but maybe this one is helpful to you.
Edit: You could also not make 27 Conditional Branches, and add the correct Item with Help of Variable1, but than all your coffees would need to be on the correct Database Item Ids between 111 and 333. I would do the 27 conditional Branches, just wanted to mention it.
Edit2: LOL like always i went the most complicate route first. muahahahaha...
All is possible with one variable.
Cream add +1 or +2 or +3
Size add +10 or +20 or +30
Special add +100 or +200 or +300
Than you dont need a Scriptline and just 1 Variable and the conditional Branches.
Heck yeah!!! Thank you so much, I've been trying to get this to work for a couple days now, but now it seems to work perfectly!
Original thread: https://forums.rpgmakerweb.com/threads/using-eventing-to-make-combinations.109984/