Limit digits on Input Number command

NoMoshing

Villager
Member
Joined
Mar 28, 2013
Messages
10
Reaction score
1
First Language
English
Primarily Uses
Hey there.

Put a couple of clock-based puzzles in my game, which involve setting the hands of a clock to diferrent numbers. But my testers had some trouble with these puzzles, partly because the input number command allows any number from 0-9 in all columns.

Is there a way to limit the maximum number you can enter in a specific column, so that you can't even see the higher numbers? For my purposes, I need the numbers to stop at 0-1 for one column, 0-2 for another, and 0-5 for the last.

Thank you for your time.
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
710
Reaction score
228
First Language
English
Primarily Uses
I'm not sure if there's a way to change it so you can't see the numbers at all. However you can look for a script.
Or you can use eventing to give messages that won't allow numbers greater than or equal to  126, and say something when they put something in that's not correct. For example:
 
Event: Clock
Lablel:n
Input number: Varible:123 3 digits
Conditional Branch: control variable: variable:123 >=126
    Incorrect input.
    Try again
    Jump to label:n
Else
     Conditional Branch: control variable: variable:123=123
        Correct.
     Else
            Conditional Branch: control variable: variable:123>123
                 Incorrect input.
                 Try again
                 Jump to label:n
            Else
                      Conditional Branch: control variable: variable:123<123
                            Incorrect input.
                            Try again
                            Jump to label:n
                      Else
                      branch end
branch end
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
You could probably script a version of the Input Number command to limit digits to different maximums.  I'm not really interested in taking this on, since the applicability of it is so narrow.

In addition, if the numbers are as low as you've described here, you could just do Show Choices commands.  Ask the player to choose "0" or "1" for the first choice, then ask them to choice "0", "1", or "2", and for the last one have them choose "0", "1,", "2", or "More Choices", which leads to the choice between "3", "4", "5", or "Original Choices".  You'll want to track each digit with a separate variable or switch, and if they're all correct, the player has solved the puzzle.

Finally, you could use the Input Number command but give a special message if the number is greater than 125 OR between 26 and 99 OR has a modulo 10 value (the standard "Control Variables" command allows you to find a Modulo result) greater than 5, such as "You've entered an invalid number.  Select a number 0-1 for the first digit, 0-2 for the second digit, and 0-5 for the third digit."
 

NoMoshing

Villager
Member
Joined
Mar 28, 2013
Messages
10
Reaction score
1
First Language
English
Primarily Uses
The thing about using variables for this is that that can still create incorrect results. If I bind things by a conditional that checks if variable x > 1259, 1169 is still an incorrect result. I'm hoping for a elegant, script-based solution like Wavelength said- a script version of input number to limit the digits to different maximums.

I'm working on a alternate solution using a different GUI entirely- having the player set the hands of the clock with the directional keys, and using show picture to overlay images of the hands on an image of the clock face- but still hoping someone else will help me out.
 

Fimbulvinter

Villager
Member
Joined
May 29, 2014
Messages
38
Reaction score
1
First Language
English
Primarily Uses
Why not just use a script to give you more options, and take FF6's clock method?

"The clock has stopped."

"Set the hour?"
"Set the minutes?"

"Set the seconds?"

For the last 2 options, obviously, it used intervals of 5 to make it not too unweildly.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
If I bind things by a conditional that checks if variable x > 1259, 1169 is still an incorrect result.
You can check for all incorrect results.  If you want to set a clock, you can check for x > 1259, x < 100, and x % 100 > 59 (% is the "Modulo" operator).  This would disqualify numbers like 1169 along with 0013, 2841, and 9999.

I personally like your idea of graphically displaying the hands on the clock and having the player use Left and Right to set them, though!
 

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

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top