Stopped Before I Start

I went through the site ChoiceScript guide, but I feel like I am missing the most basic things. How do I set up the gender choice in the script, or have them input a name? I saw how to do a fake choice, but how do I do a choice that changes a variable yet doesn’t affect which story route is followed?

I’m asking because I am about finished with my outline for a game I want to write, but am not sure how to get going.

1 Like

First thing 1st, have you understand how to setup the work environment? Unpacking the .rar file, declaring variables, creating the .txt-s.

Yes. I did a very simple set-up with a couple of stats and one very basic choice path, to include one fake choice and one branching one, just nothing where a choice affected a name, gender, or ability.

Have you checked out the play-by-play tutorials on the wiki? They’re pretty helpful, and feature things like changing variables, etc.

6 Likes

I didn’t know about these links at all, thanks!

I always suggest this thread I made for my first game, I ask a lot of super basic questions that might be some of the ones you have.

I get the idea of having a thread for questions, but due to how this site displays threads, control+f doesn’t work in them, making them hard to search for questions.

Has anyone posted the code to one of the published games so I can see the code and context? Every published game has you choose a name and gender, yet somehow that isn’t addressed in the tutorial (a really frustrating oversight, in my opinion). Too many examples are one-line snippets which are as likely to confuse as explain.

If I can make a suggestion I would definately use CSIDE to write your game.

More about that here.

There’s a very in-depth interactive tutorial and handy game templates where you can easily see how the code and the game display interact.

2 Likes

I don’t think this is necessary, as character creation is as basic as assigning a value to variables.


In case of name

What is your name?
*choice
   #Bob
      *set name "Bob"
   #Not Bob
      *set name "Not Bob"
   #Enter your own name
      Type in your name
      *input_text name

For gender, simply use the same snippet, but swap all the variables and value to your need accordingly.

To call/print/display the value of a variable, use the ${variable} command in your normal text.

You can see the code for every game by bringing it up in the browser and adding
/scenes/startup.txt
Or
/mygame/scenes/startup.txt behind the games name.

In wips on dashingdon (or if you unlocked a published game on here) you can view all of the code available by replacing startup in the address bar with the scenefiles name (or choicescript_stats.txt) to view the stats file.
If you have not unlocked a published game on here, you can view all files not marked with $.

Edit.

  1. You can unlock a game you already bought elsewhere by sending the receipts to the support after creating a login on the page (not the same as having a forum account)

  2. Here’s as example the startup for The Hero Unmasked! : https://www.choiceofgames.com/hero-unmasked/scenes/startup.txt

And for my own game:
https://dashingdon.com/play/meltingpenguins/curious-cuisine/mygame/scenes/startup.txt

1 Like

Thank you so much for this. This walkthrough with an example for reference, was exactly what I needed. I downloaded it last night, and am a couple of lessons in now.

1 Like

No problem! I’m glad I could help.