Hello, I would like to ask for any advice about using string type variables - those which store text in in. We use then while naming the character, but is there any way to give value to the variable in the code, instead of letting user input it? The user input is great for customs, but sometimes I would really use a variable which I set up myself, because it would make the code much cleaner. For example for pronouns, If I let the player choose gender, I would set pronouns and then use them in the code, like this:
NARRATOR
Do you want to play as a man or a woman?
choice (gender)
“Man” {
[nom_pron] = “he”
[akuz_pron] = “him”
[pos_pron] = “his”
}
“Woman” {
[nom_pron] = “she”
[akuz_pron] = “her”
[pos_pron] = “her”
}
And in the code
CHARACTER1
I don think [nom_pron] would like the idea of you eating [pos_pron] sandwich. I bet it’ll upset [akuz_pron].
instead of
if (gender = “Man”)
{
CHARACTER1
I don think he would like the idea of you eating his sandwich. I bet it’ll upset him.
}
else
{
CHARACTER1
I don think she would like the idea of you eating her sandwich. I bet it’ll upset her.
}
I know here it doesn’t make big difference, but in the story it would lead to basically having to script the whole story twice, changing just the pronouns, which is some real mess. And there is lot of more use of this than just for pronouns.
So, if you know any way to give value to a variable, please let me know, Thank you.
Alternatively, the closest I could think of to not double code the script is to create characters: NOMPRON, AKUZPRON, POSPRON as the value, and let readers input their pronouns with typed-in choices.
label gender
input What is your pronoun? | What is your pronoun? He/She | Done (NOMPRON)
if (NOMPRON is “He”){ } elif (NOMPRON is “She”){ } else{ NARRATOR Please try again. goto gender }
Then ask the readers to input the rest of the pronouns for AKUZPRON (him/her) and POSPRON (his/hers). So that whenever you need to insert the reader’s pronoun in the dialogues, you just have to code in the script name (for NOMPRON, AKUZPRON or POSPRON).
Example the script name I have for NOMPRON is NOMPRON1:
NARR
[NOMPRON1] is blah blah blah.
The result will be:
He is blah blah blah ← For those readers who input their pronouns as “He”
She is blah blah blah ← For those readers who input their pronouns as “She”
I was thinking about this too, but wanted to find better solution. But I thought about another one - is it possible to change display name of a character in the code? if yes, it would help a lot. I saw some stories where the name got changed like that.
I tried to use the @character becomes @anothercharacter, but it didn’t work completely. If I wanted to use the name [character] is still displayed character, not anothercharacter.
If you want to change the name to [anothercharacter] then you should go the the character creator page of @character and change the display name to [anothercharacter]. Because the becomes command only duplicates the appearance and that also happens only for the characters of the same gender.