Implicit_control_flow not working

I’m having a problem with the implicit overflow and I can’t understand why. The quicktest in CSIDE doesn’t give any errors:

And yet, someone sent me this screenshot:

That specific part is a bit chaotic, so I’ll strip it down to the bare minimum to show the code; line 12362, by the way, isn’t even a “line of code,” just an empty line between two paragraphs. The choice being flagged, however, is the “#"I… uh…"” one. I added __s, to make a little easier to identify the different portions of code.

*if Michael_rel=1
__*label micklovetalk
__*if ((((Michael_love>=25) and (Michael>50)) and ((((Kay_int)+Divya_int)+Max_int)=0)) and (Michael_rel_lock=0))
____*fake_choice
______#"@{mick_lovetalk I... have a crush on you, ${Mick}, yes|No, it hasn’t changed at all, ${Mick}}."
________[...]
________*fake_choice
__________#"Of course I will!"
____________[...]
__________#"I… uh…"
____________[...]
______# "I’m sorry, Mick."
________[...]
*elseif (((Michael_love>=25) and (Michael>50)) and (Michael_rel_lock=0))
__[...]
*elseif (Michael_love=0) and ((((Kay_int)+Divya_int)+Max_int)>0)
__[...]
*elseif (Michael_love=0) and ((((Kay_int)+Divya_int)+Max_int)>0)
__[...]
*else
__[...]

I don’t understand why this is happening, in any case, given that at the beginning of my startup I have *create implicit_control_flow true.

I’m quite confused… What am I missing?

Funny enough, your stripped-down version of your code confuses me more than actual code. However I bet the issue is this:

With the control flow set to true, there must be something in the choice. It just doesn’t require a *goto or *finish, it doesn’t turn it into a *fake_choice, which doesn’t need anything. I’d try to add something and see if that fixes it.

1 Like

You can’t nest a fake_choice inside another fake_choice. The outer one needs to be a choice.

There is something in there—two paragraphs. The error refers to the empty line between them! :sweat_smile:

The problematic empty line is the second one. I’ve highlighted the whole so that you can see how it still has tab spaces! :slight_smile:

I’m pretty sure that’s not it; I’ve always nested fake choices, basically all my dialogues are structured like that.

1 Like

Weird theory but did the tester in question have a save from before you implemented implicit_control_flow?

1 Like

I…
…haven’t asked them, actually :man_facepalming:

I’ll keep you updated!

That’s my guess too and I’m fairly confident. It sucks, but if you change anything in startup, it’s better to start the game over. Their save probably doesn’t have the control flow variable.

@will, @cup_half_empty: alas, the reader said it’s a new save.

You actually should be able to nest fake_choices, but doing so without a goto will cause that exact error. I recommend just adding a label after the fake_choice blocks and using a goto statement with the 2nd level fake_choice. Should resolve the issue

1 Like

That’d be the first time in +2mln words, but I’ll try, thanks!

1 Like

What a bummer. And you can’t reproduce the error, right? What’s the WIP with the error?

1 Like

I’ve only tried quick tests and code checks so far. Unfortunately, I’m in hospital today and won’t be back until tomorrow morning. The connection here is terrible, and I can’t do a full run. The WIP is After Dark (scientifically accurate apocalyptic horror) UPDATE 21 DEC [+275k words], and the problem is at the end of it, so I have to play through the whole thing :sweat_smile: I’ll try again in an hour or so!

1 Like

I think you disabled code peek, so I won’t be able to help much.

1 Like

The code is what I posted, I’ve simply removed the text to make it shorter. I can DM you the whole part though, no problem.

1 Like

I might be crazy, but I’m pretty darn sure I’ve nested fake choices with no problems before, and I don’t even use implicit_control_flow.

1 Like

I’ve added the Implicit_control_flow only very recently, and I’ve always nested fake_choices, so I’m with you on this.

2 Likes

I’m going off documentation on the ChoiceScript wiki which is listing this exact issue. It’s entirely possible (plausible, even) that the wiki is wrong or it’s an inconsistent error.

If you can send me the startup.txt and that scene file, I can test it out for you quickly and see if I can replicate and/or fix it while I’m on lunch.

Alternatively if you enable code viewing on CoGdemos, I can pull it from there myself

2 Likes

I don’t remember where exactly I saw that it said not to use nested fake_choice, but it was probably in one of the ChoiceScript tutorials I went through last month. Maybe it didn’t say you couldn’t use them, but that you shouldn’t, and I don’t recall the reason.

2 Likes

One key difference between *choice and *fake_choice, however, is that with the latter, trying to nest another *fake_choice (without *goto) will cause an error. [… It] will crash your playthrough with the error message, “It is illegal to fall out of a *choice statement.” This will also fail the automatic testers. For nested choices, *goto commands on at least one level are still necessary.

From the ChoiceScript Wiki

4 Likes