Status
Not open for further replies.

theweirdnerd

Villager
Member
Joined
Oct 9, 2020
Messages
21
Reaction score
5
First Language
English
Primarily Uses
RMMV
I'm looking to create a gambling minigame where the player must guess if a six sided die will land on even or odd. If they guess right, they win the pot, guess wrong and they lose the bet. That can be done easily with the default editor and a randomized variable, then a conditional branch.
But what I really want to do is display a text box where players can input the amount of gold they want to bet; then that gold is increased, or taken from their inventory depending on if they win or not. How would I go about doing this? I don't know much javascript so any advice helps!
 

Hyouryuu-Na

Very very lazy
Veteran
Joined
Jun 15, 2017
Messages
1,100
Reaction score
2,855
First Language
Not English
Primarily Uses
RMMV
By default there's no text input scene. You can try the name input scene but it's inconvenient. Best would be to use plugins. Maybe try one of these:

Edit: I wasn't paying attention so I thought you were talking about general text not numbers lol so I linked a bunch of text input plugins. But you should do as Shaz said down below.
This above one is for name windows but you can set a variable to get the value once it's entered and then set the name back to what it was.
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,320
Reaction score
15,149
First Language
English
Primarily Uses
RMMV
You don't need a plugin or javascript knowledge for that. Just use the Number Input event command to let them put the bet amount into a variable. Do a check to see that they have that much gold (might need a second variable and then a conditional branch). Then just Change Gold to add or subtract the amount based on whether they win or not.
 

Hyouryuu-Na

Very very lazy
Veteran
Joined
Jun 15, 2017
Messages
1,100
Reaction score
2,855
First Language
Not English
Primarily Uses
RMMV
... Omg yes XD I completely disregarded the fact that they're talking about numbers *facepalm* I must not be thinking straight today ^^;
 

theweirdnerd

Villager
Member
Joined
Oct 9, 2020
Messages
21
Reaction score
5
First Language
English
Primarily Uses
RMMV
After some tinkering, it works now! I had to set a variable that was equal to the player's gold to check if they had enough, then created a loop that breaks if they bet an amount they actually have. I'll include some screenshots in case if it helps anyone else later down the line. Thanks for the help folks!
 

Attachments

  • AMW Dice Game1.PNG
    AMW Dice Game1.PNG
    122.4 KB · Views: 3
  • AMW Dice Game2.PNG
    AMW Dice Game2.PNG
    94.3 KB · Views: 3

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,320
Reaction score
15,149
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Working in the IT industry:
- "How long does it take?".
- "It takes 1 month".
- "What if we add more people to the project?".
- "It would take 2 months".
Doing RPG Maker News for 16th September 2021

Stream is live! I am currently doing pixel art and will be practicing shading! Feel free to drop by!
wow, Surface Tension is really one MF of an FPS level huh
So, I got let go from my current job because my skill set didn't align with the department's goals anymore. I have some hope, because I am currently in contact with a manager from a different department, and they are desperate for more employees. We'll see what happens... :kaoswt:

Forum statistics

Threads
115,120
Messages
1,087,371
Members
149,606
Latest member
Jake_Combe
Top