0 votes
by (120 points)
Hello,

I'm attempting to allow players to choose the gender of one of the love interests in my story, but I cannot for the life of me figure how to put it into variable form.

 

I would like players to choose, and then use just one variable in the story to allow them to see the pronouns of what they choose.

So, if someone chooses that the love interest is "boy", the variable changes it to "he" in future passages. If someone chooses "girl", the variable changes it to "she".

Can anyone offer me any advice on how to go about this without making separate passages, because it'll get tedious and there will be way to many passages to manage.

 

Thanks!

2 Answers

+1 vote
by (159k points)

Please use the Question Tags to state the name and full version number of the Story Format you are using, as answers can vary based on that information. I will assume you are using Harlowe v2.1.0 which is the Twine 2 application's current default.

You can use a (link:) macro combined with a (set:) macro to achieve the effect you want, this combination is commonly knows as a Setter Link.

1. Place TwineScript like the following within the passage you want to ask the question.
note: The (go-to:) macros aren't required to achieve the effect you want, they are being used to help demonstrate the example.

Do you want your love interest to be a \
(link: "boy")[
	(set: $pronoun to "he")
	(go-to: "Result")
]\
 or a \
(link: "girl")[
	(set: $pronoun to "she")
	(go-to: "Result")
]?

2. You can test the effect by add the following to the Result passage.

Your love interest is a $pronoun

Obviously you can rename the $pronoun story variable to whatever makes sense within the context of your story. 

by (140 points)
This is a god send! I was trying to set bolean variables and give each variable a value, this is much easier and nicer! :)
0 votes
by (2.7k points)

Hello ohohisaiah,

I could imagine, that different passages of your story need different words depending on the choice.

If you do not want to have a seperate passage used as a kind of dictionary, it might be possible to define exactly those words in the certain passages, which are really needed.

In that case, the choice setter routine would not set the word(s) itself, but more in general the choosen gender ($love_interest). Each passage then defines the required variables/words with `(if: )`. The Start passage itself needs a 'him' or 'her', so $him_her is set within the choice setter.

Start itself needs 'him' or 'her' for the introductory sentence

Are you interested in\
|question>[\
           (link: "boys")[(set: $love_interest to "male")
                          (replace: ?question)[boys!]
                          (set: $her_him to "him")
                          (show: ?LetTheStoryBegin)] \
       or \
           (link: "girls")[(set: $love_interest to "female")
                          (replace: ?question)[girls!]
                          (set: $her_him to "her")
                          (show: ?LetTheStoryBegin)]\
          ? ]

|LetTheStoryBegin)[Let the story begin to find $her_him ...



You have a [[StoryDate<-date]].
Your mobile [[rings->StoryPhoneCall]].

]

StoryDate needs 'boy'/'girl'  and 'She/He':

(if: $love_interest is "male")[(set: $Person to "boy", $Pronoun to "He")]
(if: $love_interest is "female")[(set: $Person to "girl", $Pronoun to "She")]

The $Person, you are looking for, is in front of you.
$Pronoun is smiling at you.

StoryPhoneCall needs a name for the calling person and 'her'/'him'.

(if: $love_interest is "male")[(set: $Person to "Pete", $pronoun to "him")]
(if: $love_interest is "female")[(set: $Person to "Susy", $pronoun to "her")]
It's $Person on the phone. You wonder, if you would like $pronoun ...

I have issues with handling temp variables, so I used global ones here overall.

The 'show: hidden_hook' thing might be a bit off topic to this question, but may prevent the story player from stumbling into situations which he/she was not prepared for ... :-)

Have fun!

Jherek

...