Using eventing to make combinations?

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
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?
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,176
Reaction score
385
First Language
Dutch
Primarily Uses
RMMV
you 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.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,343
Reaction score
330
First Language
German
Primarily Uses
RMMV
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:
Code:
$gameVariables.setValue(1,  [($gameVariables.value(2)*100) + ($gameVariables.value(3)*10) + $gameVariables.value(4)]);
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.
 
Last edited:

deveras111

Veteran
Veteran
Joined
Dec 29, 2018
Messages
39
Reaction score
5
First Language
English
Primarily Uses
RMMV
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:
Code:
$gameVariables.setValue(1,  [($gameVariables.value(2)*100) + ($gameVariables.value(3)*10) + $gameVariables.value(4)]);
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.
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!
 
  • Like
Reactions: Bex

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly with some Witcher 3! Feel free to drop by!
Helldivers is so much fun!
Suitemate: "Do you have detergent"
Me: "Ya, the spray kind"
Me: *realizes he said detergent, not deodorant*
Me: "Guess I'll die!"
If there's one thing I hate about myself, it's that I procrastinate. Ever since I started looking stuff up on how to properly balance and create armour, weapons and skills; I've let myself down in progress.
So I was at the dentist yesterday and she said,"I'm gonna propose to Dr. Anderson...(Then she paused as she thought what to say). And I said,"I think he is a little old for you." She laughed good naturedly. Then she jabbed sharp things in my mouth for the next 3 hours.

Forum statistics

Threads
94,612
Messages
922,326
Members
124,489
Latest member
phihhim
Top