Randomtest error with indentation - Resolved!

I ran randomtest and it presented this error:

RANDOMTEST FAILED
one_two_sub_pap line 1713: increasing indent not allowed, expected 2 was 4

Now, neither quicktest nor the actual game turn up the same error, and I checked the indentation several times.

I’m cutting out a couple of irrelevant choices because the block of text is really long, but here’s the code in question. All of the other options under this choice have the same indentation as this one does (two spaces) and they work beautifully. I was wondering if perhaps the stacked *hide_reuse and *selectable_if were causing a problem for randomtest?

Here’s the relevant section of code; the error indicates that the bad spacing is on that second line.

*choice
  *hide_reuse *selectable_if (educationcounter < 1) #I had a proper education at the rough hands of the masses. That's to say, it looked like a hard knock aside the head whilst living on the streets.
    *set littleboyblue true
    *set canny %+5
    *set educated %+5
    Ah, but how did you manage to meet the requirements for your position?
    *label allthosejobs
    *choice
      *if ((((actualage >= 42) and (steamshipexperience = false)) and ((apprenticeexperience = false) and (prioryexperience = false))) and (((balloonexperience = false) and (factoryexperience = false))))
        #Actually, I'm far too old to go into any detail about that, or about all of the jobs I've held. I'll just scribble off a quick list.
          *set experience %+40
          *set technical %+10
          *set personable %+10
          *set educated %+15
          *set perceptive %+10
          *if (agecounter = 4) 
            *goto endofthefirstlist
          *if (agecounter = 3)
            *if (actualage = 66)
              *goto agecounter2scribbles
            *if (actualage = 54)
              *goto endofthefirstlist

Any assistance much appreciated!

Tried to test a scene with similar formatting, but couldn’t replicate the problem, Maybe try switching the placement of the *hide_reuse and the *selectable_if commands?

1 Like

I tried that, and then randomtest gave me this:

RANDOMTEST FAILED
one_two_sub_pap line 1712: Couldn't parse the line after *selectable_if: (educationcounter < 1) *hide_reuse #I had a proper education at the rough hands of the masses. That's to say, it looked like a hard knock aside the head whilst living on the streets.

It’s interesting that it gave me a different error - not spacing, just parsing.

EDIT: I tinkered a little bit, and if I take out the *hide_reuse then randomtest gives me:

RANDOMTEST FAILED
one_two_sub_pap line 1712: Non-existent command 'selectable_if'

I also downloaded the latest version of choicescript again, just in case. No change.

ANOTHER EDIT: I found the problem! There was a nested choice in the option above which wasn’t finished properly - to do with my just using *if statements, I think, instead of a string of *else_if and then *else.

For some reason, quicktest didn’t notice I was dropping out of the choice. Randomtest, on the other hand, reported it as an error in spacing.

@fantom Thanks for taking a look. A fresh set of eyes always helps - and it was useful to know that the stacked option modifiers should work. Much obliged.

1 Like

Glad to help, even if it was in an indirect way, lol.