MV Adding multiple right answers for a riddle?

So I have several riddles in my game that allows you to type the answer in. The mechanic works fine, but I know that there are people out there that might misplace a capital letter or right in all caps or all lower case. I would like to add these variations to the answers in order to allow the player to get the right answer even if they don't get it exactly...

I tried this:
◆Plugin Command:InputBlank 29 What Hour is This?
◆Comment:Devils Hour
◆If:Script:$gameVariables.value(29) === "The Devils Hour" || "the devils hour" || "THE DEVILS HOUR" || "The devils Hour"
This didn't work... It made it so that none of the answers were right.

I tried doing this as well:
$gameVariables.value(29).toLowerCase()
Then made the answer lower case as well... but that didn't do anything...

Is there a way to do this without doing a highly complicated array variable?
I guess a quick and easy way would be something like this:

JavaScript:
["option 1", "option 2", "option 3"].contains($gameVariables.value(29).toLowerCase())

The other option would be to just have a separate if condition for each of the possible answers. Or you could use a regular expression, if all the answers fit a common pattern (as is the case in your example).

By the way, you probably also want to consider answers with an apostrophe to be correct, like "the devil's hour".
I would go for the about or check if the out is a string than to lowercase.
or something like this if 1 anser is possible:
$gameVariables(29) === "Your anser".toLowerCase();

or

$gameVariables(29).toString().toLowerCase() === "Your anser";

this ensure its always a string (even if its a number to ensure it wont crash =)

I also made a conditionalBranch plugin => out is always to lowercase
if not to uppercase as you can also add multiple answers in there.
you can found it [here] in case you need it a lot, its easier to write,
for single or multiple.
As mentioned above, using .toLowerCase() is definitely important. This accounts for any variation of capitalized letters in the answer. Variations that you haven't already accounted for. Like "Devil's hour".

Accounting for the apostrophe for the possessive is also important.

In addition, you probably want to account for answers that do or don't use the leading word "the" in the answer and answers that do or do not use punctuation. That is what .contains can help with.

You wouldn't want someone typing in "Devil's Hour" to be wrong if the answer is "The Devil's Hour" or vice versa. You need to make sure they are getting the important words correct and not necessarily words like articles that some languages don't have or the article is inferred in the language.

Same with "The Devil's Hour." being wrong.
As mentioned above, using .toLowerCase() is definitely important. This accounts for any variation of capitalized letters in the answer. Variations that you haven't already accounted for. Like "Devil's hour".

Accounting for the apostrophe for the possessive is also important.

In addition, you probably want to account for answers that do or don't use the leading word "the" in the answer and answers that do or do not use punctuation. That is what .contains can help with.

You wouldn't want someone typing in "Devil's Hour" to be wrong if the answer is "The Devil's Hour" or vice versa. You need to make sure they are getting the important words correct and not necessarily words like articles that some languages don't have or the article is inferred in the language.

Same with "The Devil's Hour." being wrong.
Yeah, the above example was just a small number of the options I added to make it right... Thanks.

I guess a quick and easy way would be something like this:

JavaScript:
["option 1", "option 2", "option 3"].contains($gameVariables.value(29).toLowerCase())

The other option would be to just have a separate if condition for each of the possible answers. Or you could use a regular expression, if all the answers fit a common pattern (as is the case in your example).

By the way, you probably also want to consider answers with an apostrophe to be correct, like "the devil's hour".
Would I put this in an if else branch? I'll try it out and see if it works.

As mentioned above, using .toLowerCase() is definitely important. This accounts for any variation of capitalized letters in the answer. Variations that you haven't already accounted for. Like "Devil's hour".

Accounting for the apostrophe for the possessive is also important.

In addition, you probably want to account for answers that do or don't use the leading word "the" in the answer and answers that do or do not use punctuation. That is what .contains can help with.

You wouldn't want someone typing in "Devil's Hour" to be wrong if the answer is "The Devil's Hour" or vice versa. You need to make sure they are getting the important words correct and not necessarily words like articles that some languages don't have or the article is inferred in the language.

Same with "The Devil's Hour." being wrong.
I'll have to spend some time figuring out that plugin in the link. Thank you.
I'm going to bump this... Since I don't know what I'm doing. I can't get any of the suggestions to work for me and I'm fairly certain I'm using them wrong.

@Solar_Flare @ShadowDragon @ZombieKidzRule if any of you can maybe give the instructions on how to use the suggestions, I would be eternally grateful.
can you show your even how you use it?
as what zombie said to contains in a conditional branch should work.

if its true, the first bit fires else the else branch.

if we can see what you did, it should work.

so if you use, conditional branch you can do:
JavaScript:
["devils hour", "devil's hour"].contains($gameVariables.value(29).toLowerCase())

in case you try out the plugin:
JavaScript:
GameCheck.has("var", [29], {equal: ["devils hour", "devil's hour"]});
and it checks it that way.

but without seeing your conditional branch/event we can't do much as it does work.
can you show your even how you use it?
as what zombie said to contains in a conditional branch should work.

if its true, the first bit fires else the else branch.

if we can see what you did, it should work.

so if you use, conditional branch you can do:
JavaScript:
["devils hour", "devil's hour"].contains($gameVariables.value(29).toLowerCase())

in case you try out the plugin:
JavaScript:
GameCheck.has("var", [29], {equal: ["devils hour", "devil's hour"]});
and it checks it that way.

but without seeing your conditional branch/event we can't do much as it does work.
This is the entire Conditional Branch and what leads up to it...
Code:
  ◆Plugin Command:InputBlank 29  What Hour is This?
  ◆Comment:Devils Hour
  ◆If:Script:["The Devils Hour", "The Devil's Hour", "Devils Hour", "Devil's Hour"].contains($gameVariables.value(29).toLowerCase())
    ◆Play SE:Chime1 (90, 150, 0)
    ◆Control Variables:#0271 SUNDIAL ANSWER += 1
    ◆Control Self Switch:B = OFF
    ◆
  :Else
    ◆Play SE:Buzzer1 (90, 100, 0)
    ◆Plugin Command:AllowPlayerMovement
    ◆Change Menu Access:Enable
    ◆Control Variables:#0271 SUNDIAL ANSWER = 0
    ◆Control Variables:#0029 Riddle Answer = ""
    ◆Plugin Command:ResetAllEventLocations
    ◆Set Event Location:Direction Crystal - East, (16,30)
    ◆Control Self Switch:A = OFF
    ◆Control Self Switch:B = OFF
    ◆
  :End
This makes it always come up as false... Not sure why.
I tried using your plugin for this, but unfortunately it doesn't play well with one or more of the plugins I'm using.


EDIT: I JUST NOTICED THAT YOU HAD THE ANSWERS IN LOWER CASE... I didn't do that. I thought they would automatically be turned lower case. But I was obviously stupid and didn't try that.

It works now.... Thanks
I tried using your plugin for this, but unfortunately it doesn't play well with one or more of the plugins I'm using.
was there a specific error? as it should collide to any plugin, not that I know off.
as it use a special way for checking, so if I know what kind of combability, I love to fix that.

but its mostly useful if you use checks a lot or armor checks, item checks etc, it makes things
easier.

good luck on your project.
was there a specific error? as it should collide to any plugin, not that I know off.
as it use a special way for checking, so if I know what kind of combability, I love to fix that.

but its mostly useful if you use checks a lot or armor checks, item checks etc, it makes things
easier.

good luck on your project.
There wasn't an error or anything... It's just that I use Yanfly's Menu and Common Events Menu. But when your plugin was active the menu showed the information where they were supposed to, but the list wasn't a list and I was unable to select anything. The same thing happened int he Common Event Menu. The menu was just a set of words on the screen... Here is a screenshot:
Menu 1.png

Here is what it's supposed to look like:
Menu 2.png

Like I said it only seems to happen with Yanfly's Plugins since the Load and Title screen seem to work as intended. But I didn't explore into which ones specifically.
I don't use the 2 you mentioned, but in case it happened, my base should be on top, and follow the tiers.
as I categorize them, each tier belong to a category, and best not set it on the bottom or below it as
other plugins may override other stuff.

but in case you use it, don't hesitate to notify me, I do my best to fix the issues ^^

as I did test it with a majority of YEP plugins I use.

if you don't need it, and works, good luck on your project.
I don't use the 2 you mentioned, but in case it happened, my base should be on top, and follow the tiers.
as I categorize them, each tier belong to a category, and best not set it on the bottom or below it as
other plugins may override other stuff.

but in case you use it, don't hesitate to notify me, I do my best to fix the issues ^^

as I did test it with a majority of YEP plugins I use.

if you don't need it, and works, good luck on your project.
Im not using the plugin for this project but i might it for another project in the future... who knows. Just fyi, i did have it at the bottom at first, but i moved it to the top of the list after i noticed the problem... it didnt seem to help. I had it above yanflys Core. I'll make sure i check the teirs in the future more closely.

Thank you for the help on this... I'll be releasing a demo of my game soon so i can get some fresh eyes on any bugs and grammar errors and so forth. So, look forward to that.

Original thread: https://forums.rpgmakerweb.com/threads/adding-multiple-right-answers-for-a-riddle.181648/