Small coding problem -Selectable if

I can’t seem to get my *selectable if statements working

The error I’m getting is: Expected no more tokens, found named operator AND

My code looks like this:

        *selectable_if ((Companions < 5) and (Guardsmet) and (not(TojinInCrew))) #Approach a large orc sitting with their puny, human-sized friend.
				*comment Tojin and orc
				*set Tojinmet true
				*goto TojinTalk

(If we’ve met the Guards already, and the orc isn’t in our crew, and we have space for more companions then we can approach them)

It looks like you’re missing a beginnging parenthesis. You only have two at the beginning, but you have three conditions

Edit: I’ve also had trouble in the past using not(variable) for some reason, so if you still have trouble after adding the parenthesis, it can’t hurt to try (variable = false) instead. You may not have to, just adding it in there since I’ve had this issue before

1 Like

And im not certain, but the (not(var)) might get wonky (happened to me)
If it works after adding the patanthesis, leave it as is, if not try changing it to (var = false)

Edit: svyagin beat me to it xD


I think this has fixed it, thanks!

I assumed I could’ve just used 1 bracket around each condition in addition to the 1 at the beginning and end, it appears I was mistaken

Yeah, this works perfect (and for the other 5 characters too!), thanks MP and Svi

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the @moderators.