Fake_Choice Help

I know there are posts explaining *fake_choice, and I understand it! However, when testing in CSIDE, I get an error saying line 6 conflicts with line 8. I numbered the lines so it makes a little more sense.

(1)This is a test for coding.
(2)
(3) [technically lines where it would be double spaced]
(4)**strong text**Hello there.
(5)*fake_choice
	(6)#Will the text appear after this?
		(7)Oh, so it did. But what about the next?
	(8)#Will the text appear after this?
		(9)Oh, so it did. But what about the next?
(10)It looks like it worked!

So, then I tried, even knowing it probably wouldn’t work, adding an extra indent to the second option. It looked like this:

This is a test for coding.


Hello there.
*fake_choice
	#Will the text appear after this?
		Oh, so it did. But what about the next?
		#Will the text appear after this?
			Oh, so it did. But what about the next?
It looks like it worked!

But then the second option was gone entirely. Yet I’ve read the posts, and the CS tutorial, saying how I’ve typed it in the first box is correct. So, why is CSIDE saying it conflicts? What am I doing wrong? :joy:
EDIT: Also, could someone explain multireplace? It seems super helpful but no matter how I look at it, it’s incredibly confusing.
Edit 2: fixed which line numbers were conflicting, as it’s the two choices

Maybe @CJW could explain what happened to the CSIDE.

Here’s a really simple example of multireplace

*temp hair_color 0
she  had sum hair it was:
*fake_choice
    #black
        *set hair_color 1
    #white
        *set hair_color 2
    #sunny
        *set hair_color 3
    #limp
        *set hair_color 4
        
she had @{hair_color black|white|sunny|limp} hair.

*ending

If the variable, in this case “hair_color”, is numeric, you can then use the multireplace feature in the form:

@{[your variable][option 1|[option 2|[option 3]|[option 4}

to display any one of options 1 through 4 seperated by a vertical bar, |, depending on the numeric value of your variable 1 through 4, thus if [your variable] = 3, the displayed text will be [option 3]

2 Likes

From what i remember the choice options can’t have equal text.

The explanation of multireplace by @Alice-chan was pretty good, there is also the wiki if you want more info.

Another useful thing is that any boolean variable can be used for multireplace. With the [option 1] being what to do if true and [option 2] what to do if false.

Either a boolean variable or an inline conditional statement (parenthesis are required).

@{(player_money > 100) You have enough money|You do not have enough money}.

https://choicescriptdev.fandom.com/wiki/Multireplace

3 Likes

What do you mean by equal text? Like the same text repeated in each choice option?
Also,@Alice-chan’s explanation made a surprinsg amount of sense. I looked at the wiki page but it went over my head, so I figured someone could dumb it down more for me here :joy:

1 Like

I’m not sure what was meant … But you certainly can have different choices equating to the same value. So this is fine:

*temp hair_color 0
she  had sum hair it was:
*fake_choice
    #black
        *set hair_color 1
    #white
        *set hair_color 1
    #sunny
        *set hair_color 1
    #limp
        *set hair_color 4
        
she had @{hair_color black|white|sunny|limp} hair.

(Obviously the output is nonsense, as white & sunny can never be set!)

Yes, having the same text in the choice option will lead to an error.

7 Likes

Why could it not be set? :thinking:

@GoldenSilver It works! Of course, so simple. If it said that you couldn’t have the same dialogue I likely missed it. :woman_facepalming: I’m assuming you can’t but I’ll ask anyway. For multiple choice, can you use *fake_choice or can it be done for *choice only? But I get this thing were I have text leading into the multiple choice meshing with the text in the answer scene to whatever the player chooses. Does that make sense?

What GoldenSilver posted is the issue. There can’t be duplicate #options.

2 Likes