Can we use 2 variables in *selectable_if?

Good day folks this is my 2nd topic, please help me :sob:

I’m having trouble with a choice within a time loop

The error I’m getting is: the choice keep on appearing even though it’s not supposed to (I don’t want to)

My code looks like this:
*create day 0
*create time 0

*set day 0
*set time 0

*if time >= 6
*set day +1
*set time -6

*if day > 5
*goto outoftime

*label time_loop
You’re on day ${day} out of 5

Time: ${time}

Skip time
*choice
*selectable_if ((time > 0) or (time < 5)) #+1
*set time +1
*if time >= 6
*set day +1
*set time -6
*if day > 5
*goto_scene outoftime
*goto time_loop
#+2
*set time +2
*if time >= 6
*set day +1
*set time -6
*if day > 5
*goto_scene outoftime
*goto time_loop

The time loop does exist, but I want the choice #+1 to not be selectable when the time is ether 0 or 5. But as I use this code it’s not functioning, is my code wrong or what?

Thanks for even visiting this topic :pray:

Try and instead of or.

0 is less than 5, so it is selectable by the second criteria. 5 is greater than 0 so it is selectable by the first. You want it to be selectable only if both criteria are true (and).

3 Likes

Change or to and.

1 Like

I feel really stupid now, thanks for the answer. Sorry for the stupid question :pray:

Thanks, it works and I somehow feel stupid :joy:

1 Like

Don’t feel stupid, it’s an easy mistake to make if you don’t code a lot :blush: Good luck with your project!

3 Likes

THANK YOU !! :hugs:

NVM it worked my bad :joy:

Wait while we’re here, I got another problem, I just checking on the *selectable_if

This one works

*selectable_if (((job = "swordsman") or (job = "archer")) or ((job = "any") or (job = "mage"))) #swordsman & archer +1
	wow
	*choice
		#		+1
			*set time +1
			*if time >= 6
				*set day +1
				*set time -6
				*if day > 5
					*goto_scene outoftime
			*goto time_loop

But this one doesn’t work

*selectable_if (((job = "Swordsman") or (job = "Tanker)) or ((job = "Hero") or (job = "FallenHero"))) #swords
	What kind of sword?
	*choice
		#short sword & shield
			*set guildweap "sword & shield"
			*goto guildbattle
		#dual sword
			*set guildweap "dual sword"
			*goto guildbattle
		#long sword
			*set guildweap "long sword"
			*goto guildbattle
		#greatsword
			*set guildweap "greatsword"
			*goto guildbattle
		#katana
			*set guildweap "katana"
			*goto guildbattle

The second one says: Invalid string, open quote with no close quote: "))

Oh, it looks like you’re missing a quotation after = "Tanker and before the parenthesis there.

:scream: wow you have superb eye, I guess I’m too tired
I’ll sleep well now, thanks for the correction :sob:

1 Like

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