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
2,895
Reaction score
1,029
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,492
Reaction score
408
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

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top