How can I set the minimum digit of input text?

soramon

Warper
Member
Joined
Dec 16, 2018
Messages
1
Reaction score
0
First Language
Korean
Primarily Uses
VNM
I'm completely newbie.

I want to let the player uses the user name directly through the input text. I'd like to show message that 'You should input at least one character' if nothing is entered. but I don't know how to check and control the digit of text variables stored in the input text.
What should I do in this case?
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,050
Reaction score
4,260
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to VNMaker Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Wavelength

Pre-Merge Boot
Global Mod
Joined
Jul 22, 2014
Messages
4,622
Reaction score
3,885
First Language
English
Primarily Uses
RMVXA
I've never tried VN Maker, but if its Eventing is anything like RPG Maker's, under "Conditional Branch" you should be able to check whether an Actor (Character) has a certain "Name" applied. Choose that option and enter nothing in the text box. If the Branch is true, tell the player they should enter a name, and present the Name Input box again.
  • If that Name option isn't available but "Script" is available, then you could use a script line to check whether the character's name is equal to "" (an empty string). Someone else would need to give you the code; I don't know what coding language VN Maker uses.
Once you've got that done, you can put it in a loop so it will keep asking until a valid name is entered. The way you do this is you use a Loop event command, and inside that Loop you place that Conditional Branch. Make sure to Check the checkbox for Set Handling When Conditions Don't Apply. I've already told you above what to do if the condition is True, but if it's not (the "Else" branch), place a "Break Loop" command. This will leave the loop as soon as a valid name has been entered.
 

Kentou

Admin
Admin
Joined
Jan 20, 2014
Messages
202
Reaction score
48
Hi, you can just use the Condition command. Basically, what Wavelength said is what you have to do. Except that there is no checkbox for an else branch, you have to drag and drop the "Else" command. Also, make sure that the commands are nested under the Loop, Condition command and also under the Else branch. You can use the left and right arrows keys to do that if it doesn't happen automatically. So that it looks like this:

Code:
Loop
  Condition
    Some Commands
  Else
    Break Loop
The entered name is stored into the variable you have selected for the Input Text command. So you use that variable in the Condition command.

Let me know if that helps you out.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

A friend told me to stop making nomnom or gulping noise when eating or drinking. Plot twist of my life. I thought people can't hear that!
Inside you are two wolves. They take in oxygen while getting rid of the Co2 gas in your body...
Ah wait, sorry. Lungs. Not wolves. that'd be silly. Wolves are huge. You probably couldnt even fit one wolf inside you.
Tag: hack and slash | gameplay: point and click. Me: "How tf two are related to each other?"
I picked up For The King in a Humble Bundle sale, and one mechanic that stuck out to me was a physical change to the world map when finishing a side quest. That got me thinking about special map-effect rewards for certain side quests in my game.
Stream will be live shortly with some Witcher 3! Feel free to drop by!

Forum statistics

Threads
94,403
Messages
920,690
Members
124,192
Latest member
Cremo
Top