Best practice -- *choice vs *fake_choice

You mean “arrays”, right? :wink::joy:

2 Likes

Just to clarify: That’s a comment on whether ICF will cause more bugs, due to the higher chance of user error. It’s not a comment on the “ICF” behaviour itself containing bugs. Though the argument stands.

2 Likes

I’ve never used a *choice before(and I’m three games in), but I don’t remember the last time I made a fake choice. I don’t know why I do that, though. I guess I just enjoy the irony of it.

1 Like

Wait, am I reading this correctly, lol? Or is this a joke that flew over my head? :sweat_smile:

It’s true. I always write *fake_choice instead of *choice, but I always end each individual choice with a *goto.

Oh, I was being dumb–I thought you were saying you’ve never done a *choice, but you also don’t remember the last time you did a *fake_choice (like the actual command), so I was like, “…but then how do you program your… choices?”

I’m an idiot, just ignore me

I’ve also been doing *fake_choice in place of where *choice is traditionally used lately, and I have implicit control turned on (and it’s a lifesaver)! I don’t use *goto unless it’s going to actual separate branches anymore, it’s been very nice in terms of saving time.

6 Likes

I predominantly use ICF and *choice because my choices don’t tend to branch out far until the middle and the end. I can focus more on writing than trying to route code through labels, and it looks better than *fake_choice. I usually recommend the ICF-*choice combo to those who consider themselves more of a writer than a coder. By no means am I talented coder, and the less I have to futz with code, the better!

2 Likes

I use implicit control flow because it massively neatens up my *if / *elseif / *else stacks, which I like to use rather than a stack of *ifs for more precise bug finding and typo avoidance. Because of using ICF, I tend to go for *choice if I’m doing a lot of nesting or using *goto to go somewhere wildly elsewhere in the file. But if it’s a set of options with stat changes and different text that then leads to the same place, I’d use *fake_choice.

8 Likes

I also use ICF, as it makes CS behaves closer to what I expect, and it also keeps my scene files neater. I used to use *fake_choice as much as I could before ICF, but now that I can use *choice exclusively, it makes it marginally easier to write (and, imo, easier to reread your own code, since you don’t have all those *goto commands sending you on a wild goose chase).

Additionally, it makes it far easier to keep track of all the labels in a scene, as there are fewer you need to remember, which in turn makes it easier to navigate the scene. I think it just keeps things from getting too cluttered and helps me stay organized.

It’s an entirely personal preference.

7 Likes