"It is illegal to fall in to an *else statement"


#1

After testing, I don’t believe it is possible, but I wanted to know if you can add multiple ifs to the same page.

I know that you can do *if (egg =1) and (grape=1) you could put “you have an egg and grape.”

But would it be possible, in the same page, to do them like:

*if egg=0
You have no egg
*if egg = 1
You have an egg

*if grape = 0
You have no grape
*if grape = 1
You have a grape

Or something of the sorts? Mostly because I want to put a text under each possibility. And consedering it is multiple things, rather than 2, it would be simpler to write like that.


#2

Your problem are quite similar to mine some time ago.
Let me link you my thread about that.


#3

You see, unless I am dumb ( I might be) I don’t believe it is the same problem.

I’m going to explain my reasoning. Basically, it’s part of my stat page. I wanted to be creative and give a small description of each stat in each stage. So, let’s say, with charisma zero, theres a certain description. With charisma one, a different one.

And thus i wrote.

Charisma
*if charisma = 0
(0) You are uncharismatic by nature, and lack the charm to impress people. They’ll likely want to communicate with a door instead.

*elseif charisma = 1
(1) You have started to create the attractiveness that allure people to you, but you have a long path.

*elseif charisma =2
(2) Although there is a lot to learn, you have enough charisma to allure most fools.

However, this doesn’t work, because

choicescript_stats line 11: It is illegal to fall in to an *else statement; you must *goto or *finish before the end of the indented block.

And you see, I could put finish under each elseif, but charisma isn’t the ONLY stat supposed to be on the page. And if I do put finish, as I saw before, it only displays charisma and no other stat.

So I wanted to know if I could put, for example, two ifs like that under each other.

It would look kinda like this:

[b] Charisma [/b]
*if charisma = 0
  (0) You are uncharismatic by nature, and lack the charm to impress people. They'll likely want to communicate with a door instead.

*elseif charisma = 1
  (1) You have started to create the attractiveness that allure people to you, but you have a long path.

*elseif charisma =2
  (2) Although there is a lot to learn, you have enough charisma to allure most fools.


[b] Dance [/b]
*if dance = 0
  (0) You don't dance, period.
*elseif dance = 1
  (1) Even if you do lack the confidence to dance in public, you can do on the privacy of your room.

*elseif dance = 2
  (2) You're sure you won't step on your partner's toes. You focused solving that problem for a while now.

But as I said before, it won’t work. So my question is, if theres another way I can do it.


#4

After each if or elseif, you can have a *goto linking to the next section.

[b] Charisma [/b]
*if charisma = 0
	(0) You are uncharismatic by nature, and lack the charm to impress people. They'll likely want to communicate with a door instead.
	*goto Dance
*elseif charisma = 1
	(1) You have started to create the attractiveness that allure people to you, but you have a long path.
	*goto Dance
*elseif charisma =2
	(2) Although there is a lot to learn, you have enough charisma to allure most fools.
	*goto Dance

*label Dance
...

#5

AAhh thank you, yes, that did seem to solve the problem. I thought it woundn’t, seeing as labels tend to change the page, but it didn’t! Thank you!!!


#6

Labels only change the page if you use *page_break.

Glad I could help!


#7

Ahh… right. My post isn’t exactly answered your problem :stuck_out_tongue_winking_eye:

Anyway, if what you’re wondering is whether you can use multiple *if on a single vignette/section (as you mentioned on the 1st post), then yes, you can :ok_hand: