Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

SugarCube / Twinescript Problem with nested ifs

Hello together,

I am having a problem with nested ifs, or so I believe. I am using Twine 2.0.10 offline with Sugarcube 2.1.0.

This here is the script that I wrote.
<<if $talkcounter gt 3>>
Countdown
<<else>>
<<if $talksorbet == false>>
PreGesprächSorbet
<</if>>
<<if $talkcrew == false>>
PreGesprächCrew
<</if>
<<if $talkcheckequipment == false>>
PreCheckEquipment
<</if>
<<if $talkcheckmission == false>>
PreCheckMission
<</if>>
<</if>>

And it gives me the following error
Error: child tag <</if>> was found outside of a call to its parent macro <<if>>
This error appears 2 Times - I have no idea why only two times either.

Does anybody have an idea?

The sugarcube documentation (http://www.motoslave.net/sugarcube/2/docs/macros.html#macros-if) shows the usage of nested ifs - so I am also not sure if it is connected to them either.

Thanks for reading

Comments

  • You're missing one of the right angle brackets on two of your closing <</if>> (i.e. <</if> is not <</if>>). Specifically, these two:
    <<if $talkcrew == false>>
    [[Mit der Crew treffen|PreGesprächCrew]]
    <</if>
    <<if $talkcheckequipment == false>>
    [[Equipment überprüfen|PreCheckEquipment]]
    <</if>
    
  • I had like 4 people look over it - and nobody saw this... I want a nice editor with syntax check for this...

    Thank you!
Sign In or Register to comment.