Coding name reactions

Ok so im trying to code reactions for the names in my game. I have a bunch of already prechosen names and im pretty solid on how to code the reactions for them its when i get to the player input name that im not sure what to do. Heres and example of one of the coded name

*if (name = “Cain”)
*goto cain
but im not sure what to put for the player imput name would it be something like
*if not
*goto so and so?

The wording is kind of hard to understand, are you trying to get the player to select a name they can use?

No the players have already chosen their names in the beginning of the game. This part they are introducing themselves and I want coded reactions to names they chose. I got the default names sorted its when im trying to code for the pleyer typed name im struggling to code

Try to use it/elseif/else commands:

*if (name = “Cain”)
    *goto cain
*elseif (name = "Abel")
    *goto abel
*else
    That's a unique name!
    *goto next_label

Depending on what’s more convenient for your code, you could put reactions right there under *if commands instead of making more labels:

*if (name = “Cain”)
    Cain, huh?
    *goto next_label
*elseif (name = "Abel")
    Abel? Interesting!
    *goto next_label
*else
    That's a unique name!
    *goto next_label

You can also display a variable, so the text will display the name a player has put in:

*if (name = “Cain”)
    Cain, huh?
    *goto next_label
*else
    Hello, ${name}!
    *goto next_label
2 Likes

You can also put in a sentence by putting a *if under a label. But it requires some fiddling with variables.

Blockquote
*label machoice
*if clariceknown = true
The smile she already brought brightened at your taking the time to call her by the proper name instead of just ‘Miss’.
*elseif nerv1 = true
She nearly chuckles in surprise at your nervousness

1 Like

I totally forgot about the else command! Thanks so much!

3 Likes

Thank you for the help!

1 Like

If you are using text input instead of a choice, I would recommend adjusting the variable check a little:

*if "$!!{name}"="CAIN"
  *goto cain
*elseif "$!!{name}"="ABEL"
  *goto abel

It will allow to check the variable regardless of how the name was written by the player. For example, the usual *if (name=“Cain”) won’t be triggered if the name is inputted as cain or cAiN.

3 Likes