Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Sugarcube 2: Nested If statement problem

$
0
0
Hi! I'm likely doing something terribly wrong, being more a writer than coder, but I do know enough about coding to stay afloat... most of the time. I'm having a problem in a project, with an IF statement that contains another IF statement.
It works fine with this...
<<if $Light eq true>>
&nbsp&nbspRoom Description
&nbsp&nbsp<center>[[Exit links here]]</center>
<<else>>
&nbsp&nbspDark Room Description
<<endif>>
<center>[[Always visible exit link here]]</center>

But as soon as i try to use this...
<<if $Light eq true>>
&nbsp&nbspRoom Description
&nbsp&nbsp&nbsp&nbsp<<if $Stat lt 34>>Nothing
&nbsp&nbsp&nbsp&nbsp<<elseif $Stat lt 67>>Comment on env. hint
&nbsp&nbsp&nbsp&nbsp<<else>>Identified env. hint
&nbsp&nbsp&nbsp&nbsp<<endif>>
&nbsp&nbsp<center>[[Exit links here]]</center>
<<else>>
&nbsp&nbspDark Room Description
&nbsp&nbsp&nbsp&nbsp<<if $Stat lt 34>>Nothing
&nbsp&nbsp&nbsp&nbsp<<elseif $Stat lt 67>>Comment on env. hint
&nbsp&nbsp&nbsp&nbsp<<else>>Identified env. hint
&nbsp&nbsp&nbsp&nbsp<<endif>>
<<endif>>
<center>[[Always visible exit link here]]</center>

...I get errors popping up that the first IF has no closing statement, or that the Else is on it's own. Is the code seriously thinking that the nested statement's close is the main statement's close as well? The nested parts are working fine...

Viewing all articles
Browse latest Browse all 1844

Trending Articles