How To Input Negative Variables

Hello, I'm trying to work on a way to script an event, a sort of math quiz into my game. So far at it's base the script works fine. I have the math robot ask the player a random math question, a "number input" process is run and the player inputs the answer and the script checks if the answer is right or wrong. The problem I quickly came to realize is that the "number input" command does not allow for negative numbers, which is a problem since I want to make the questions challenging and negative numbers are a good way to throw a player off their guard.

Is there perhaps a workaround that will allow the game to check for negative inputs, since checking for negative variables is something the system can actually do? Here is the format that I currently have running except that the player cannot input a negative number. I'm not opposed to using plugins but I would prefer a solution without one as the Yanfly plugins I'm currently using don't seem to play nice with a LOT of other plugins.
Screenshot 2023-02-02 21.12.48.png
Screenshot 2023-02-02 21.12.56.png
The default Input Number command/window only handles positive inputs. If you want to use that, you will need a plugin to allow it to handle negatives as well.

Some event-only alternatives for negative number input:
  1. Use a Show Choices command before (or after?), asking whether the answer should be positive or negative.

  2. Program your own number input system using event commands. E.g. have 1 picture per input digit (and 1 for the sign), then have an Autorun event that makes use of Conditional Branch -> Button checks to effect the appropriate changes, e.g.
    This kind of thing is also possible with map events instead of pictures: same logic, just use event triggers instead of "is button pressed" checks.

  3. Combine 1 & 2: have an input-checking Parallel event that swaps a picture between plus and minus signs, and just use the Input Number command to get the magnitude.
Some event-only alternatives for negative number input:

Program your own number input system using event commands. E.g. have 1 picture per input digit (and 1 for the sign), then have an Autorun event that makes use of Conditional Branch -> Button checks to effect the appropriate changes, e.g.
This kind of thing is also possible with map events instead of pictures: same logic, just use event triggers instead of "is button pressed" checks.

  1. Combine 1 & 2: have an input-checking Parallel event that swaps a picture between plus and minus signs, and just use the Input Number command to get the magnitude.
Thank you a ton for that link to the picture based menu! I made the base menu used in the tutorial and it really does seem like the best possible choice. I can even make the event look like a sort of calculator with some extra effort.

I had no clue the solution was so simple but I know it will work as like I said the menu works just fine. Thank you again!
You're welcome, happy RPG Making~ 😂
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/how-to-input-negative-variables.154649/