Trying to make a basic gambling minigame. Need event help, please.

PhoenixQuest

Veteran
Veteran
Joined
May 22, 2019
Messages
34
Reaction score
10
First Language
English
Primarily Uses
RMVXA
This is assuming something like this is actually possible lol



I call this little minigame Lucky Barrel. The idea is that the player pays Casino Tokens (which are stored in a variable) to have a crack at this minigame, to potentially win a whole bunch of Casino Tokens! As with any barrel in my game, you can smash barrels by inspecting them, revealing possible prizes inside. In this particular minigame, the player will be given 3 chances at smashing the barrels inside this room. One of the barrels pays back out the bet that the player paid to play. One of the barrels pays out double what they paid to play. And finally one last barrel pays out a whopping ten times what they paid to play! The other six barrels contain nothing. I would also like for the minigame to end when the player breaks a barrel with a prize inside, regardless of which one it is. So if you break the barrel to get back your bet on your first try, the game ends there, you don't get another chance to break any more barrels until you play again.

So... How do I do this...?

Specifically, how do I randomize the contents of the barrels each time the player speaks with the bunny girl to begin the minigame? I think I could handle doing the rest, but I haven't the faintest idea how to randomize which barrels contain which rewards, and which contain nothing.

For the record, this is what a typical empty barrel event looks like in my game, currently.



Page 2 is just the smashed barrel icon with nothing on the event page, and page 3 is a blank event.

If anyone could help me out, I'd really appreciate it!
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
596
Reaction score
367
First Language
Polish
Primarily Uses
RMMV
But... if I understood you, you can just randomize stuff in every barrel, then if you win the prize, disable option for randomize this reward-loot until you talk with bunny girl. You can just cheat the system, the player will think that the barrels are drawn randomly.
 

PhoenixQuest

Veteran
Veteran
Joined
May 22, 2019
Messages
34
Reaction score
10
First Language
English
Primarily Uses
RMVXA
But... if I understood you, you can just randomize stuff in every barrel, then if you win the prize, disable option for randomize this reward-loot until you talk with bunny girl. You can just cheat the system, the player will think that the barrels are drawn randomly.
*Smacks Self in head*

That's brilliant!

So basically I would roll for a random number between 1 and 9 on a variable for each barrel.

If the result is 1-6, barrel produces nothing and gives you an error buzzer and adds +1 to your attempts variable. If attempts variable hits 3, then the game is over. Fade out, teleport back outside, fade in.

If the result is 7, you get back your bet and it ends the minigame. Fade out, teleport back outside, fade in, get prize.

If the result is 8, you get back double, game ends, blah blah blah.

If the result is 9, you get the jackpot and game ends, blah blah.

Right?

Though... Doesn't this mean that it's possible that there will be NO winning barrels? XD

Maybe I should increase the number of potentially winning barrel rolls...
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
596
Reaction score
367
First Language
Polish
Primarily Uses
RMMV
If player can open all of the barrels and it must be at last one with the price, you can make a fail counter too :) If you have "badbarrels == 8", then the last one will be set on price barell :) Or you can make it more random, for example if you fail 5 times, then you have more chance to win price, and if still no luck with 8 barells, then the 9 will be the price barell. You can customize it for your needs :)
 

glaphen

Veteran
Veteran
Joined
Jan 13, 2019
Messages
326
Reaction score
120
First Language
English
Primarily Uses
RMMV
Use 3 variables at start of gamble, 1 for each prize, random them by number of barrels in order, then check between each if any of the previous rolls is equal to the new one, and loop reroll until false. For the barrel events give each one a different number mentally, so upper left 1, upper middle 2, check if any of the variables equal the prize barrel ID, if true end event and give prize based off which variable won.
 

PhoenixQuest

Veteran
Veteran
Joined
May 22, 2019
Messages
34
Reaction score
10
First Language
English
Primarily Uses
RMVXA
Use 3 variables at start of gamble, 1 for each prize, random them by number of barrels in order, then check between each if any of the previous rolls is equal to the new one, and loop reroll until false. For the barrel events give each one a different number mentally, so upper left 1, upper middle 2, check if any of the variables equal the prize barrel ID, if true end event and give prize based off which variable won.
Ooh, that sounds even better! :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,414
First Language
English
Primarily Uses
RMMV
Or you could just have the exact contents in each barrel to keep each event simple, and randomize their locations.

This would need you to create an array with [x,y] position pairs, then for each barrel, choose a random position pair, removing it from the array, and move the barrel to that location.
 

PhoenixQuest

Veteran
Veteran
Joined
May 22, 2019
Messages
34
Reaction score
10
First Language
English
Primarily Uses
RMVXA
Or you could just have the exact contents in each barrel to keep each event simple, and randomize their locations.

This would need you to create an array with [x,y] position pairs, then for each barrel, choose a random position pair, removing it from the array, and move the barrel to that location.
Er... How would I do that? Explain?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,214
Reaction score
452
First Language
English
Primarily Uses
RMVXA
I would have done it by making the events sort of the same.
Have each barrel with 11 tabs.
1-9 is active by a random number. reset counter to 0. reset all self switches.
have the prizes on different tabs, mix them up.
Do a random number draw when starting and have a counter add one each time a barrel is picked ending at 3. then reset the variable to 10 (the second last tab where there is no graphic or prize, just an empty event)
so each tab has the function of a prize or nothing plus adding to the counter then checking if the counter = 3, when it is 3 set variable to 10. All barrels disappear.
But how to make a barrel disappear when you pick it?
Use a self switch (the last tab with no graphic or prize). Then you would reset all self switches when starting the random draw.
$game_self_switches[[map_id, event_id, 'switch']] = false
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Playtesting for Battle Castle is done, demo time for me was roughly 6 hours and 20 minutes. I'm going to pass it on to a few friends first, and after getting some feedback will be posting an official topic.
There's another Humble Bundle available now for RPG developer assets, this time focused somewhat more towards pixel art style games.
Ive got a long lost half uncle. Thats real cool.
I forget what is bumping rule in this forum. Is anyone know? Thank you.
BCj
Ew, why does my blogpost on the rpgmaker.net site look like a garbled mess? Are html codes disabled or something?

Forum statistics

Threads
97,909
Messages
947,780
Members
129,148
Latest member
lemminace
Top