Randomtest bugs


So I’m random testing Trial of the Demon Hunter and it keeps coming up with this error everywhere

non-existant command “selectable_if”

This bewilders me because I know for a fact that that’s a valid code. Can anyone help me with this?


It’s a long time since I used those test, but I experienced similar problems with ‘The Race’ where it was calling an error for code I knew to work.

What I did was ‘remove’ the code temporarily by adding *comment and bypassing it.
This allowed the bug test to continue.


The thing is, I need to have all errors fixed before I submit it to CoG


@Samuel_H_Young I never had this particular problem with randomtest, but one thought does occur: do all of the *choices where you use *selectable_if have at least one other option which is always valid / non-conditional? If every option in a particular *choice is conditional, I can see a vague possibility of randomtest stumbling there.


I make sure to always have at least one that’s choose-able no matter what.


@Samuel_H_Young ‘Choose-able’ and non-conditional are two different things! The tests ‘cheat’, so are capable of doing things in ways no actual player of the game would ever be capable of, thereby catching all possible scripting errors. In essence, just because a normal player MUST meet at least one of those #option conditions (and so would never error in actual play) does not necessarily mean that randomtest is able to meet at least one of those conditions when trying to make a choice. If there’s always a non-conditional option to choose, however, and no actual scripting errors, it should manage to continue.

This may not be the problem at all, but it’s worth looking into if you’re still struggling to get through.


That’s a good point. I’ll go and check it out. Thanks!


Could a moderator please close this discussion? Jason helped me find the errors that I needed to fix.


@Sanuel_H_Young Perhaps, before one does, you could take a moment to let the rest of us know what the problem actually was? It’s bound to come up again, given how difficult it was to identify the problem, and this topic header is ideally named for popping up in future searches on the subject.


^Very much this, just @ me or another mod when you’re ready for closing :slight_smile:


Basically, the line above the error was what was causing the bug. There were so many nested choices that my text editor was scrunching up the words so it appeared to be this

bla bla bla
*goto toad

But it was actually

Bla bla bla *goto toad

So it wasn’t interpreting the next line as a *choice, and since *selectable_if is only applicable to *choices, it was therefore not a valid command in that situation.


That’s good to know. The next time someone runs into a similar situation, we’ll be sure to ask for the code AROUND the error as well. :slight_smile: Thanks for sharing!


Cool, thanks for that Samuel! :slight_smile:


I just wanted to reiterate the advice on here about looking at other code beyond where the tests say the problem is.

I’m doing final checks on Trench right now and just ran into the exact same problem Sam was writing about last year – supposed errors with *selectable_if, and nothing I did could make the error go away. Each time I tried to fix it the report would just come back with a new error message about that same line.

Turned out to be a previous option in the choice that didn’t end properly, so the error actually had nothing to do with *selectable_if at all.


Exactly! Because *selectable_if doesn’t make any sense unless there’s actually something to select.