ChoiceScriptDev Wikia

Introduction:
While browsing this forum in the “ChoiceScript Help” section, I’ve noticed a thread, made in 2011, that was about a wiki:


I said to myself, why shouldn’t I do one? Since people were talking about one since 2011, there surely wasn’t anyone developing one currently. So, I requested help from Vendetta with the wiki, and we both started editing it. Every day, we added pages, edited the current ones to make them more comprehensive… After that, CJW and JimD joined our Admin Staff; CJW being experienced in JavaScript/CS and JimD with ChoiceScript (you surely know him…Zombie Exodus).

Link:

Explanation:
This wiki was done with the purpose of being an easy way for beginners to learn ChoiceScript, or even for advanced ChoiceScript users that just need some clarifications on certain subjects. It has comprehensive description for each basic command of CS, and some clarifications and explanations on other subjects.

Always remember; any suggestions, corrections and/or questions about the wiki are going here, on this thread; the wiki doesn’t have its own forum, and we, the admin staff, don’t think that it actually needs one. Please, also feel free to post comments on the wiki’s individual pages.

This is still a work in progress; more pages will be added as time passes. If you think that there is anything the wiki is lacking, feel free to tell us here on the forum discussion! We’re always open to suggestions.

3 Likes

First and foremost thank you good sir for this.

@AlexCosarca @Vendetta @CJW @JimD

Thank you all for putting forth the effort to do this. It’s an extremely helpful (and long overdue) contribution to the community. I know a lot of people will benefit greatly from this.

YAY!!!

A new person joined the admin team: @Reaperoa !

Brilliant stuff, your entry on handling the if statement alone is excellent - I was struggling this morning to figure out not equal to (I was typing <> rather than !=). In the end I discovered the *if not command on the old choicescript google group. I shall be bookmarking this and making use of it, many thanks to all involved!

It would be great if we could get this stuck/made an announcement.

1 Like

It would be indeed, although I don’t think it will.

Props, guys. I also love the gray background, makes it easy on the eyes to look at. Well my eyes in this case. Thanks muchly.

@FcA, Those were our thoughts when we changed the default white background of the wiki to dark grey ^^

@AlexCosarca

is italics and bold tied to a specific version of choicescript as it doesn’t work in my version.

I think that the release on 26th of March had it (and again, I’m not sure; I started my game on 29th of July and Bold&Italics worked fine).

I’ll download the current version and test it out as I can’t remember when I downloaded the version I have at the moment.

Re the entry on *fake_choice - I believe that the *set command can be used directly after a *fake_choice decision, as can a *goto scene label. I don’t think another *fake_choice can be used after a *fake_choice though. I don’t know if this is dependant on the version of choicescript being used, but my current wip uses quite a few *fake_choice that have *set and *goto that follow it.

But then, what’s the point of *fake_choice if *set and *goto are allowed? (I know they are allowed as I saw that in another WIP game’s code, but that’s not something that should be encouraged to be done) You could simply use *choice for that, and a *goto/*label for each choice; inside of a *fake_choice using any commands but text isn’t recommended. Also, why did you use *fake_choice if you use commands inside it? (i.e. why didn’t you use *choice instead) ^^

@bawpie Intriguing! I’m guilty of taking the CoG tutorial on the subject too literally, i.e.

*fake_choice: This convenience command behaves exactly like *choice, but no commands are allowed in the body of the choice; thus no *goto/*finish is required.”

. . . So I never investigated further. Given your own experience of using the command, however, I shall now investigate more closely and see just what else is actually possible with that command! Thanks for the tip. :slight_smile:

@AlexCorsica
You can ‘fall’ out of a fake_choice statement, whereas a choice statement won’t let you do this (each choice has to end with a go_to).

So for example you can do this:

*fake_choice
#1
You smile.
#2
You frown.
Continue.

You can’t do this with a *choice with the latest build without it failing (though I think it’d pass an autotest).

There’s no reason to use fake_choice if you want to use *goto though - I just noticed I’d accidentally coded in a fake_choice that did result in *goto and it work though I’ll probably change it to a regular choice statement just in case.

As my story is fairly linear, a lot of the choices don’t result in a go_to. I’m not sure what the fake_choice can’t do - I think functionality has been added to it though as I’m fairly sure a while back it couldn’t set variables and I think I mentioned it on the google group as a shame.

I’ve whipped up a demonstration here: https://dl.dropbox.com/u/11379019/COG/Test/web/mygame/index.html

Test 4 fails as it should end in the ‘Fallout’ line but doesn’t. This is basically if you’ve coded a *choice statement without ending it in a *goto.

To me, it’s fairly essential that I’m able to use *set following a *fake_choice - I want my game to remember any choices made, but I don’t always want that choice to actually branch the game (i.e. being forced into a *goto).

@Vendetta
I also followed the CoG documentation, but I think it’s very out of date now (which is why the wiki is a god send!). I did doubt what I was doing at first, but I’ve noticed other users have encountered it to, so thought it was worth bringing up.

*fake_choice, as far as I know, is a carbon-copy of *choice - There’s no difference. The idea behind it is that as you say, you don’t HAVE to use commands in a *fake_choice - because they’re only intended to be used when the player’s choice won’t affect the games progression.

The reason you DO have to use commands in a normal choice isn’t anything technical, it wouldn’t break if you somehow disabled the error message, it’s more of a warning saying “Hey you do realize this is a pretty pointless choice/answer right now, don’t you?”

*fake_choice originally could not handle anything other than text, and would report an error if there was anything. If it can now handle *set or other commands, that is a change from earlier versions (whether or not it was intentional or not, I cannot say). *fake_choice was originally for cutting down the size of a *choice which had no impact other than the immediate text, such as the number of legs choice in CoD.

This becomes a fake choice thread…
I think *fake_choice doesn’t allow *if (condition) #yourchoicetext, and the same is likely for *selectable_if although I haven’t tested it. Yes, parameter setting like the *set will go through with *fake_choice.

Re the *choice has to have commands following, I know that it demands for a *goto as a minimum, whereas the fake will just carry on to whatever there is below. The way I see it now, *fake_choice isn’t really fake… it’s useful to keep the lines down if you’re not doing a huge branching out and/or some serious calculations going. In which case, the *choice is useful.