Learning ChoiceScript
- Part 1: Playing “My First ChoiceScript Game”
- Part 2: Choice, Finish, and Ending
- Part 3: Scenes
- Part 4: Using Variables
- Part 5: Text Formatting and Images
- Part 6: Fairmath
- Part 7: Inputs
- Part 8: Labels and Subrountines
- Part 9: Meta Commands
- Part 10: Customizing the Stat Screen
ChoiceScript is a scripting language from Choice of Games LLC for creating choose-you-own-adventure games.
Text Formatting
Through tag-like commands, ChoiceScript supports formatting text in different ways.
Bold
To bold text, put the opening bold tag, [b], before the text and end it with the closing tag, [/b].
Italics
Like using bold tags, italics works the same way but with the [i], opening, and [/i], closing tags.
Line Breaks
Because ChoiceScript will read text as run-together, the command *line_break can be used to break text into multiple lines.
Images
ChoiceScript supports more than just text. Images can be used through the *image command.
When included images will fill the available space and will have default alignment of “none”.
Other alignments can be set using the keywords “left”, “right”, or, the default, “none”.
Note: Images must be in the same folder as the other files during development. When using the ChoiceScript IDE, go to Project –> Open folder in Finder (on Mac) to easily find and open the folder.
GitHub Gist Version:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*title Example | |
*author Dan Cox | |
*scene_list | |
startup | |
house | |
*create choices 0 | |
(You've currently made ${choices} choices.) | |
[b]Where will we visit?[/b] | |
*choice | |
#The woods | |
*image woods.jpg | |
We went into the woods! | |
It was a dark and scary place, but with our lantern, we were able to make our way deeper. | |
Deep in the woods, we came across a river. [b]Did we try to cross it?[/b] | |
*set choices +1 | |
*choice | |
#Cross river | |
We did not make it across the river and were swept downstream to our doom! | |
*goto_scene badendings | |
#Did not cross river. | |
We didn't bother with the river and made our way along the path deeper and deeper into the woods. | |
*set choices +1 | |
*finish | |
#The mountains | |
We went into the mountains | |
*set choices +1 | |
*finish | |
#The lake | |
We went to the lake | |
*set choices +1 | |
*finish | |