So say I want reader to answer two questions; what is their character’s name and what is their character’s friend’s name. How do I check if they put the same name twice? I’d like a custom response if they try to make the name the same for both characters. This is just an example.
Here’s the code I am dealing with:
NARRATOR
She looks lovely.
What is her name?
label name_input
input What’s your character’s name?|What’s your character’s name?|Done(NAME)
if (NAME is “”){
NARRATOR
Please input a name.
goto name_input
} else {
continue
}
NARRATOR
I have another question for you.
What is YOUR name, reader?
label readername_input
input What is YOUR name?|What is YOUR name?|Done(READERNAME)
if (READERNAME is “”){
NARRATOR
Please input a name.
goto readername_input
} else {
}
if ([READERNAME] = [NAME]) {
NARRATOR
Ah…
You named your character after yourself, didn’t you?
Or maybe you didn’t want to give me your real name…
Either way, how interesting.
} else {
You can probably ask @Dara.Amarie about this because i remember others ask the same thing and i think this girl know how to do it. I’m not entirely positive btw, its a maybe. Plus this girl have a lot of cool stuff to learn and know
Okay so I just tested some things and it looks like you can’t compare two inputs, just one. The only solution for this is that you don’t let them choose a name for the bf and then do it like this:
label choose_name
input What's your name? | What's your name? | Done (YOU)
if (YOU is "Hannah") {
NARRATOR
You can't have the same name as your best friend... Sorry.
goto choose_name
}else {
NARR
Hello, [YOU]. Welcome to the story!
}
Do you have a solution for if I want the reader to input two things?
I’ll show you my code:
NARRATOR
She looks lovely.
What is her name?
label name_input
input What’s your character’s name?|What’s your character’s name?|Done(NAME)
if (NAME is “”){
NARRATOR
Please input a name.
goto name_input
} else {
continue
}
NARRATOR
I have another question for you.
What is YOUR name, reader?
label readername_input
input What is YOUR name?|What is YOUR name?|Done(READERNAME)
if (READERNAME is “”){
NARRATOR
Please input a name.
goto readername_input
} else {
}
if ([READERNAME] = [NAME]) {
NARRATOR
Ah…
You named your character after yourself, didn’t you?
Or maybe you didn’t want to give me your real name…
Either way, how interesting.
} else {
}
This code doesn’t work. It displays the custom response regardless of if the names match or not.
You don’t need the part with “”. The reader can’t press “Done” without entering at least one character.
Yeah that’s because you can’t compare two inputs, like I said
You can only check if one input is “Something” or not. This really hurts my programmer soul