How many levels of <<if else>> can I have?

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.

I’m curious about this too. I don’t know if it’s related but I’ve noticed it seems like Sugarcane ignores <<else>> for text variation even though it’s in the documentation.

There have been a couple times I had to specify, like in your code

<<if $gender is 'male'>>
I am a boy
<<elseif $gender is 'female'>>
I am a girl
<</if>>

Does it work if you try that? If so, I’m not understanding whether plain “else” only works with non-printable items, or if I’m imagining this.

note: You didn’t state which Story Format you are using, only its version, but based on the facts you mention the StoryInit special passage and the syntax of the macro language I will assume it is SugarCube.

SugarCube does not assign a default value to any Variable that hasn’t been initialised by Author.

None of the code examples you provided assign a value to the $Orientation variable, which means none of the conditional expressions associate with your <<if>> and <<elseif>> macro calls will evaluate as true unless you are assigning a Number to that variable else where.

If you want to such debugging information in your project you could change it you something like…

<<if ndef $Orientation>>None selected yet
<<elseif $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>>

…which uses the ndef operator of the <<if>> macro to check if the variable still hasn’t been assigned a value (undefined).

Sorry if I wasn’t clear. Yes, I am using SugarCube, yes the initial male/female parts works just fine.

I have answered my own question as far as whether I can have four levels of choice, but have discovered a new problem.

This code does indeed give me the variation of interaction I was after, but as you can see, typing, or even copy/pasting this for every interection is going to make for a very large passage, even if not much is actually going on.

A better question now, is can all of this:

<<if $gender is 'male'>>
I am a boy
  <<if $Orientation is 'hetrosexual'>>
    <<if $Politics is 'left'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'right'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'centre'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'apolitical'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <</if>>
  <<elseif $Orientation is 'bi-curious'>>
    <<if $Politics is 'left'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'right'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'centre'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'apolitical'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <</if>>
  <<elseif $Orientation is 'bisexual'>>
    <<if $Politics is 'left'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'right'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'centre'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'apolitical'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <</if>>  
<<elseif $Orientation is 'homosexual'>>
    <<if $Politics is 'left'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'right'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'centre'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'apolitical'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <</if>>  
  <</if>>
<<elseif $gender is 'female'>>
I am a girl
  <<if $Orientation is 'hetrosexual'>>
    <<if $Politics is 'left'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'right'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'centre'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'apolitical'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <</if>>
  <<elseif $Orientation is 'bi-curious'>>
    <<if $Politics is 'left'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'right'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'centre'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'apolitical'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <</if>>
  <<elseif $Orientation is 'bisexual'>>
    <<if $Politics is 'left'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'right'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'centre'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'apolitical'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <</if>>  
<<elseif $Orientation is 'homosexual'>>
    <<if $Politics is 'left'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'right'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'centre'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <<elseif $Politics is 'apolitical'>>
      <<if $Religion is 'old gods'>>
      <<elseif $Religion is 'new gods'>>
      <<elseif $Religion is 'agnostic'>>
      <<elseif $Religion is 'atheist'>>
      <</if>>
    <</if>>  
  <</if>>
<</if>>

be somehow simplified into a shorthand version of itself?

Should I start a new question entirely for this?