[Tool] Chronicler - ChoiceScript Visual Code Editor


Hey, in Chronicler once in a while it copies page_break several times so it looks like this " Page_breakPage_break " or "Page_breakPage_breakPage_break" Any idea what causes it?


@spytim oops, must have forgot a newline character somewhere. If you could email me at benseawalker@yahoo.com with an example project containing the issue that would be epic.

I’ll try to release an update for Windows and Linux within the next couple of days.


Hey all,

It turns out that, shockingly, trying to create an app with individual users that have many projects, and can also collaborate with other users while still being able to work offline is difficult.

I’ve devoted a significant amount of time trying to figure out how to make it work with Pouchdb. Pouchdb is a local database that runs in your browser. It allows easy replication between local state and a remote database. This sounds perfect in theory, but it is not a relational database, meaning everything is stored as a “document” in the same database. Obviously it would be really inefficient, and pose a security risk if everybody could access everybody else’s data.

The only solution to the above conundrum seemed to be creating a separate database for every project. Then also have a separate database containing user information such as identification, and links to the project databases the user owned or was marked as a collaborator on. The only way to access this database would be through a server that would use an identity provider service such as OAuth to verify the identity of the requester then return the relevant information to them.

From there, replication streams could be created for each database the user was a part of which would allow them to automatically sync changes made by them and other users.

Unfortunately this still posed a security issue as the only way to have the automated replication work with collaborating users is to allow ANYBODY to modify a project database provided they had the link to it. I would imagine there is some way around this, but despite hours of searching and several unanswered questions on StackOverflow, I was unable to come up with a satisfying solution.

Regarding the above difficulties, I’ve decided to do away with Pouchdb altogether in favor of a more traditional approach.

In other news, I unfortunately, had to give up on using Pegjs to automatically generate the parser. The main reason being that it is for Context Free languages, whereas ChoiceScript is Context Sensitive due to the indentation rules.

Giving up the futile effort, I resorted to hand-crafting a parser, and I’m actually very pleased with it.
I used the ideas presented in this article to roll my own set of parser combinators. These are basically functions that return parser functions, which can then be combined into more complex parser functions.

For example, I have defined a “Node” to be an optional *label followed by any number of lines of text or actions, ending in a “Link” which is one of the *goto variants, *finish, *if, or *choice.

With the parser combinators I wrote, I can represent the above as:

inOrder(optional(match(LABEL)), anyNumberOf(Text, Action), Link)

It doesn’t handle choices or if statements yet, but if anybody is curious the relevant code files are tokenizer, parser and CS parser.

I’m still considering how to implement it in such a way that it only relies on the CS files themselves. I can modify the parsing slightly to allow each node to be aware of the lines of code in the source file that represent it. Given this, the user could theoretically edit the source file directly and immediately see changes in the editor.

The only reliable method I can think of for implementing this is rather than specifying a specific node id in the browser bar (which would change every time the file is parsed), it instead uses the line number selected in the code view. When it goes to render the node view, it just finds the node that contains that line and renders it.

Anyway, there’s your wall of text update to wade through.
Perhaps a bit more technical than I intended, but the TLDR version is progress is being made.



Update: the parser now handles choices and if statements.

Up next, flatten out the parsed state tree into a list of nodes.
From there, just have to get the UI working. (which always ends up being way more difficult than it sounds)

Then I’ll setup the server, most likely through Heroku since it’s both free and works really well with Node.js so far.
Since Chronicler is being developed with the create-react-app, it has offline-first capabilities meaning so long as you don’t clear the cached data it will run without internet access. Accessing it from a mobile device will allow you to pin it to your homescreen like an app.


I still don’t understand how you create a stats page do i have code it separately and the add it to chronicler for it to work with my game?


@Classified please read the Play Testing section of the main post.


So with chronicler how could i insert if statements into choices?(mostly just for changing pronouns/names and whatnot)


@JatneLone Please see section 10 of the Chronicler Manual.

@everyone most questions are answered in the manual. If you are stuck, check there first. (:

EDIT: @JatneLone it may be more efficient to create variables for pronouns and set them based on the reader’s gender choice. Then you can reference them in text, choices, etc. as ${her}.
I use “her” as the variable name, but it doesn’t have to literally be set to the word “her”. If the reader picked male, you would set the variable to “his” like so.

*set her "his" 

Using “her” as the variable name will be easier to write and read the intent inside your CS code.
for example:

$!{she} looked at Jeff, expecting him to give ${her} back what was rightfully ${hers}.

The above would read as “He looked at Jeff, expecting him to give him back what was rightfully his.” if the variables were set to their male equivalents.


Hey all, I apologize for the long hiatus.

I’ve been visiting family in South Africa for the past month, and will be here until the end of this month.
Senior project this term is online and mostly involves lots of documentation work rather than actual programming work. It’s been difficult to keep up with that with the spotty internet out here as well as the whirlwind of adventure that seems to happen every day. Hence I haven’t been able to get much work done on Chronicler. :confused:

Anyway, just an update on what’s been going on. I’ll be back with (hopefully) better news regarding development in December.

Thanks for your patience!


And thank you for creating this handy utility for those of us that are code-challenged. :sweat_smile:


This application is really useful! +1 dude xD


Hey just for whenever you get back, Ive been having an issue where the application will no longer let me move the bubbles, sometimes I can select them sometimes not. Even one time it started spazzing out the bubbles around the screen! haha 0_o


Have you tried redownloading chronicler?


@spytim I’ll check up on that file you sent me and I’ll try to get back to you in a week. I’ve got a bunch of catching up to do on various tasks at home now that I’ve returned to the States.

Thanks for your patience!


Hey all, I’m back in the swing of things. Right now I have to get a simple prototype of the new version of Chronicler done and turned in, so my focus is on that right now.

In other news, I need money for the last couple terms of University and I’d rather not waste my time flipping burgers. Instead I’d like to make a “Choicescript Masterclass” on Udemy. The class will cover the basic concepts of Choicescript including ALL the actions with example use cases and gotcha’s for each of them.
I’ll also go in-depth into what it entails to make a game, including NPC character sheets, scene outlines, and story structure. For that section I’d like to contact some famous novelists on here and get quotes and advice from them.
From there I’d like to continue updating the course with FAQ scenarios such as “how to make an inventory system” with best practice guidelines and example code.

What do you guys think about that? Would anyone be interested? If so, what do you think would be a fair price? $10, $25, $50??? Most Udemy courses go for more than $100 unless they’re on sale, but that seems kind of like price gouging to me. Although, that’s still less than you’d pay for the same course at an educational institution.
¯\_ (ツ)_/¯

Oh, one last thing, yesterday was the 3rd year anniversary of the launch of “Tinker” the first version of Chronicler. Time sure flies doesn’t it?

Merry Christmas all and stay safe during your travels!


prepares to throw money at screen Go on…
@BenSeawalker Id be comfortable with 25 dollars though I know authors on here dont have too much money to spend so idk. Maybe make a poll?


I’m definitely interested in the masterclass; you’ve got one guaranteed buyer right here! As for price, I’ve bought a ton of classes from Udemy on a variety of topics, and the common factor among them is that they were on sale when I bought them. I rarely pay attention to the non-sale price for courses, and I imagine most of Udemy’s customers are the same. I think the “real” way to do it is base it on the length of the course and the amount of work you put into it. In reality, I think you can just pick a number.


Ack, three years? No wonder I am so outdated with my PC and all… These days kids have got their quantum flux VR AI phones, I bet. :dizzy_face:


Hi, I’m completely and utterly new to this community (this is my first post) and Choice Script in general, so pardon my ignorance, but is there someplace I can find the system requirements for Chronicler? It looks like it runs on all major OSes, but I can’t seem to find out which ones in particular (i.e. does it work on Mavericks? Sierra? Etc.). I’m currently running Apple OS X 10.9.5, and seeing as Chronicler wouldn’t launch, I suspect my OS may be a bit too old. Or maybe I just downloaded it wrong or something; I’m not super sure.


@Luke_Skytrekker Hello, and welcome to the Choicescript Community. We hope you enjoy your stay!

The Mac version of Chronicler is currently very janky unfortunately. I don’t own a Mac on which to build it and thus had to rely on the generosity of other forum members. Even then there was issues with it due to the differences in the file system versus Windows and Linux.
All that to say that I can’t provide support for the Mac version currently. Some users have no problems running it at all, but many others do have issues unfortunately. There is other solutions, you can look into dual-booting or using a VM such as Virtual Box to run Linux and hopefully Chronicler will run on that. (Virtual Box is how I manage to build it for Linux).

The other alternative is to simply wait until I release the new version of Chronicler for the web. In which case it should run on all devices including mobile. (A tentative release date is the middle of next year)

Or, I highly recommend the CSIDE by @CJW. It is a significantly more stable program than Chronicler as the developer prioritizes completeness over fast releases, unlike myself who throws updates around willy-nilly haha. It is a code editor though and you will have to learn Choicescript to use it. It has several tutorials built in, but the best place to look for more information is here and the wiki.

I am also working on an “Interactive Fiction Masterclass” that I will publish on Udemy. I was originally going to make it only about Choicescript itself, but then realized that the how of writing Choicescript novels was just as important, if not more-so, than learning the language itself. I have the script written for the first couple of lessons, but it needs ironed out and recorded. Since the first couple of vids are always free on Udemy anyway, I’ll post them on YouTube to gauge the community’s reaction, and if it is favorable I will write the rest of the course.

All the best, and welcome to Choicescript again. You will find the community to be one of the most friendly on the internet!

Merry Christmas!