Howdy, Stranger!

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

Missing sugarcube

So i'm right at the end of a project and im apparently missing an <</if>> somewhere on the biggest page of code. Is there an easy way to find out where it is missing from?

Comments

  • Quickfind shows 118 instances of <<if and 118 of <</if>> which is confusing
  • This is driving me mad, ive found the <<if that is apparently missing its <</if however the <</if I intended to close the macro is where it should be and none of the <</if tags inbetween the two seem to be missing
  • <<if $depth eq -400>>\
    SURFACE - A green and pleasant land. 5

    Week: <<print $week>>
    Depth: 0 metres
    Gold: <<print $gold>>
    Foe: NONE


    Manpower: <<print $manpower>> (+ <<print $housing * 5>>)
    Force Strength: <<print $forcestrength>> (+ $training)
    <<if $warriortemple gte 1>>\
    Paladins: <<print $paladin>> (+ $warriortemple)
    <</if>>\

    (Next Week)

    <<if $manpower gte ($housingmulti +4)>>\
    25manpower
    (+25 Manpower/ Week) (Cost: <<print $housingmulti +4>> Manpower)
    <</if>>\

    <<if $manpower gte ($traininggroundmulti + 9)>>\
    10forcestrength
    (+10 Force Strength/ Week) (Cost: <<print $traininggroundmulti + 9>> Manpower)
    <</if>>\

    <<if $forcestrength gte ($paladintrainingmulti + 499)>>\
    1paladin
    (+1 Paladin/ Week) (Cost: <<print $paladintrainingmulti + 499>> Force Strength)
    <</if>>\

    SURFACE CAVES - It's not grave robbing if they bite.

    Week: <<print $week>>
    Depth: -100 metres
    Gold: <<print $gold>>
    Foe: NONE


    Manpower: <<print $manpower>> (+ <<print $housing * 5>>)
    Force Strength: <<print $forcestrength>> (+ $training)
    <<if $warriortemple gte 1>>\
    Paladins: <<print $paladin>> (+ $warriortemple)
    <</if>>\

    (Next Week)

    GREYSTONE CAVES - Gold hidden in the shadows.

    Week: <<print $week>>
    Depth: -200 metres
    Gold: <<print $gold>>
    Foe: NONE


    Manpower: <<print $manpower>> (+ <<print $housing * 5>>)
    Force Strength: <<print $forcestrength>> (+ $training)
    <<if $warriortemple gte 1>>\
    Paladins: <<print $paladin>> (+ $warriortemple)
    <</if>>\

    (Next Week)

    <<if $gold gte ($minemulti + 2499)>>\
    10000mine
    (+10000 Gold/ Week) (Cost: <<print $minemulti + 2499>> Gold)
    <</if>>\


    THE LABYRINTH - What purpose this place once had you cannot say. For us this place is but a home of treasures.

    Week: <<print $week>>
    Depth: -300 metres
    Gold: <<print $gold>>
    Foe: NONE


    Manpower: <<print $manpower>> (+ <<print $housing * 5>>)
    Force Strength: <<print $forcestrength>> (+ $training)
    <<if $warriortemple gte 1>>\
    Paladins: <<print $paladin>> (+ $warriortemple)
    <</if>>\

    (Next Week)


    THE RED CAVES - Deep scratches along the walls suggest this is the home of a great beast.

    Week: <<print $week>>
    Depth: -400 metres
    Gold: <<print $gold>>
    Foe: <<print $foe>>


    Manpower: <<print $manpower>> (+ <<print $housing * 5>>)
    Force Strength: <<print $forcestrength>> (+ $training)
    <<if $warriortemple gte 1>>\
    Paladins: <<print $paladin>> (+ $warriortemple)
    <</if>>\

    (Next Week)

    <<if $forcestrength gte ($smalldragonraidmulti + 19)>>\
    raidsmalldragon
    (Cost: <<print $smalldragonraidmulti + 19>> Force Strength)
    <</if>>\

    <<if $paladin gte 10>>\
    dig5
    (Cost: Guilt)
    <</if>>\

    \
    <</if>>

    So it's the first <<if that is flagging as missing its <</if
  • I'd say use test mode, but I'm guessing you're using SugarCube v1, rather than v2, so that's out.

    I'm assuming you're seeing the error when you test. Try hovering over the error. That will show a tooltip with the code of the initial <<if>>, which may help you track it down. The missing closing tag should belong to it or one of its child <<if>> macros (hopefully it won't have a ton of children).
  • Sadly I don't get a tooltip when I hover, my mouse gets a little ? but no tooltip actually shows
  • Strangely if i paste that section into a new passage and test it i dont get an error......
  • Ok I'm still none the wiser but apparently it is fixed now. No idea what I did but if it works..............
Sign In or Register to comment.