(MMV) Scripts for interactable text boxes?

Status
Not open for further replies.

theweirdnerd

Villager
Member
Joined
Oct 9, 2020
Messages
8
Reaction score
1
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,072
Reaction score
2,538
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
41,231
Reaction score
14,251
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,072
Reaction score
2,538
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
8
Reaction score
1
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
41,231
Reaction score
14,251
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 Profile Posts

Jatopian wrote on war40k's profile.
What did you find for your plugin request?
Progress on my game for RSE is almost done! I should be able to release it next week.
Pfft! If other people would stop replying to threads, I could DOMINATE the Latest Posts box!
After so many hours of debugging, losing data to crashes, and slight adjustments.
BlackJack now deals cards perfectly! Time to adjust the background and implement the game logic so you can actually play it.BlackJack.png

Forum statistics

Threads
109,062
Messages
1,041,754
Members
141,553
Latest member
japanjacksin
Top