Twine Version: 2.3.16
Story Format: 2.36.1
Being rather inexperienced with Twine, I may be going about this all wrong, but…
I want the player of my game to be able establish certain stats before playing. Pretty standard so far, I assume.
Then I want to have code on each new passage, which weeds out the options that aren’t part of the selections, so that the player only sees material allowable to their specific current character.
So I have this in my StoryInit:
<<set $Orientation to 0>>
<<set $Orientation_max to 100>>
<<set $Orientation_min to 0>>
And this in my StoryCaption:
Orientation: <<if $Orientation lt 33>>Hetrosexual
<<elseif $Orientation gte 33 and $Orientation lt 43>>Bi-curious
<<elseif $Orientation gte 43 and $Orientation lt 67>>Bisexual
<<elseif $Orientation gte 67>>Homosexual
<</if>>
My character can choose their gender, sexual orientation, politics and religion. All of which will determine which choices they can make or have options available to them.
Plus I had this set in StoryInit:
<<set $Fatigue to 0>>
<<set $Fatigue_max to 100>>
<<set $Fatigue_min to 0>>
The next passage is simply the usual disclaimer, then a passage with some more choices.
Before you proceed any further, you will need to establish a few details before you begin.
Depending on your choices, different paths will be available to you. Some doors will be open to you, others will be closed.
<<textbox "$name" "Enter your first name here" autofocus>><span id="name"></span>
<<textbox "$surname" "Enter your family name here" autofocus>><span id="surname"></span>
<<nobr>>
<div class="row">
<div class="column">
<h3>Gender</h3>
<p><label><<radiobutton "$gender" "male">> <<set $gender to 'male'>>Male</label></p>
<p><label><<radiobutton "$gender" "female">> <<set $gender to 'female'>> Female</label></p>
</div>
<div class="column">
<h3>Politics</h3>
<p><label><<radiobutton "$politics" "left">> <<set $politics to 'left'>>Left</label></p>
<p><label><<radiobutton "$politics" "right">> <<set $politics to 'right'>> Right</label></p>
<p><label><<radiobutton "$politics" "centre">> <<set $politics to 'centre'>>Centre</label></p>
<p><label><<radiobutton "$politics" "apolitical">> <<set $politics to 'apolitical'>> Apolitical</label> </p>
</div>
<div class="column">
<h3>Religion</h3>
<p><label><<radiobutton "$religion" "agnostic">> <<set $religion to 'agnostic'>>Agnostic</label></p>
<p><label><<radiobutton "$religion" "atheisist">> <<set $religion to 'atheisist'>> Atheisist</label></p>
<p><label><<radiobutton "$religion" "old gods">> <<set $religion to 'old gods'>>Old Gods</label></p>
<p><label><<radiobutton "$religion" "new gods">> <<set $religion to 'new gods'>> New Gods</label> </p>
</div>
</div>
Because the player is inputting this info themselves, I can’t add it into the StoryInit, because that would make it preset info, instead of player choice. Unless I’m wrong, and there is a way to do this?
Then I have a character confirmation passage:
<img @src="'img/people/' + $gender + '.jpg'" class="float-left">My name is <<print $name>> <<print $surname>>. I am an <<print $age>> year old <<print $gender>>.
I prefer a <<print $Orientation>> relationship.
I prefer the <<print $politics>> side of politics.
I prefer the <<print $religion>> side of religion.
Currently all of this info appears in the sidebar so I can track it. Later I will probably remove some of it, as the player won’t need to know some stuff.
The issue I am having , based on all of the above is this. How do I write a passage, whereby all of the choices are whittled down to what was selected, so only the appropriate responses appear?
In a passage I have dedicated to testing things, I tried this:
<<if $gender is 'male'>>
I am a boy
<<else>>
I am a girl
<</if>>
<<if $Orientation lt 33>>Hetrosexual
<<elseif $Orientation gte 33 and $Orientation lt 43>>Bi-curious
<<elseif $Orientation gte 43 and $Orientation lt 67>>Bisexual
<<elseif $Orientation gte 67>>Homosexual
<</if>>
I want to add successive << if >> and << else >> for the political and religious stats.
But the game tells me:
I am a girl (which is correct)
and nothing else, not even an error message.
Am I attempting something that is beyond the cope of Twine, or, more likely, am I going about this the wrong way?
Do I have to nestle subsequent if elses within the previous if else, like a list within a list in html5?
If this is not clear, please let me know.