(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,530
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,149
Reaction score
14,206
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,530
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,149
Reaction score
14,206
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

The light has gone out of my life.

About time they finally press the kill switch button for older makers.
Sorry everyone, I am here sporadically. After 6 years of delays after delays in my life, I try to do all mat once and that means that I spread thin everywhere because it just is impossible to crunch 6 years in one or even two, but I try! I wish many of that I would already given you and put behind but... well...
I'm looking for an experienced gamer who has played a few games created with RPG Maker, who knows what an alpha build is, who may remember the old days when cliché was the favorite word on Creation Asylum, who, if a reviewer, would ask for my permission before making a review to post on YouTube, or whatever, since I will be messaging you a 10 minute, or so, DEMO based on an alpha build of Effervesce Fallacy™.
No matter how many times I listen to him, I know this is Joker speaking, but my brain can only hear Dagda.

Forum statistics

Threads
108,821
Messages
1,039,803
Members
141,279
Latest member
SawYuuki
Top