[Tool] Chronicler - ChoiceScript Visual Code Editor

Hey folks, sorry its been so long since the last update. Between school and work, I’ve just lacked the motivation to do more than relax in the evenings. However, I’ve got a couple months break from university, and weekends off! (:
So I intend to get back to Chronicler and spend at least 4 hours a week on it.


My first order of business is to finish up the new CS compiler. I feel like I’m so close, yet somehow lacking something. I’ve managed to chronologize the bubbles based on their connections, but my algorithm has a few flaws, if a choice loops back to a previous bubble, it causes an infinite loop. I tried to circumvent this by marking bubbles that had already been tested so they wouldn’t be tested again, but that potentially meant a bubble would be chronologized much earlier in the timeline than it actually was.

My next attempt will be to only allow a bubble to be tested once by each bubble that connects to it. Hopefully that will solve both problems.


Next I plan on remaking the Stats screen editor, which currently is the only part that must fully be written in CS code. I plan on making it look exactly like the stats screen that your players will see.
For Chronicler developers, that means you will have a toolbox on the side from which you can drag text, and various stats bars into slots. Each slot can then be modified to include the variables to display.

What do you guys think?


anyway, just letting you know I’m back, expect an update sometime tomorrow. (:

4 Likes

Version 1.4.4 is up!

The new CS compiler is now standard. (You don’t have to use the Save As dialog anymore)

Well after many hours of fruitless testing last night, I came up with a solution that works. The produced CS code is significantly more readable than it was previously, but still far from perfect. During testing, I realized that there was certain instances where one would wish a bubble to be ordered sooner rather than later. Of course, Chronicler is unable to recognize these instances, and extra code to detect them would more than likely cause false positives.

As such, I have decided to add a small textbox to each bubble with a number representing their order in the flowchart of your game. Chronicler will calculate an initial value for each new bubble, and they will be updated as bubbles are added or removed. If one so desires, a toggleable “lock” button will exist to disable automatic order updating for that bubble.

1.4.5 will be out either tonight, or sometime in the coming week. Thinking more seriously about it, I have a feeling that it will require more than a slight amount of work. haha

1 Like

This looks fantastic. I started a project yeaaars ago, then got disheartened when I found it difficult to create a visual map to keep track of things in choicescript (I had a bash at trying to do this manually/or using flow chart software but it felt like duplication). This appears to be the solution to my problem, as it’s just allowed me to load my old project and straight away it’s done what I wanted (provide a clear, visual way of looking at my project - which has actually terrified me!).

Obviously I have just discovered this, but can see from your notes that you mentioned there were some issues with fake_choice being picked up, is this something that’s likely to be fixed in the future? I tend to use a lot of fake_choices, so for chronicler to pick them up would be brilliant.

Regardless, I’m going to have a poke around with it and see what I can do. I’m less concerned about building using chronicler, but it’s the maps that I really like, especially as it allows me to track variable changes etc. What I’ve seen so far is just brilliant though, I wish I’d known about this a lot sooner!

Edit: Just been trying to actually build a short test via Chronicler, and I have to say it’s very good, even better than I’d hoped! Really excellent work!

It’s been in dev since January, so you’re not too late to the party (:

Well, the fake_choice is an issue with my parser. I had a method for detecting, but it proved unreliable. :confused:
I plan on looking into it at a later date, but for now it’s not too difficult to find the generated choices and hook them up manually. (annoying, I know)

If you plan on building your project separately and just using Chronicler to map it, I suggest you try @CJW’s IDE its pretty sweet. Also, @Flurrywinde11 wrote a CS parser that generates a graph of your project using GraphViz: http://herbaloutfitters.com/cs2gv/cs2gv.php. those tools might be more suited to your needs (:

Thanks for the praise! My job’s been a little draining lately, but I just installed GM:S on my work pc yesterday and my boss gave me permission to work on Chronicler during breaks or if things are going a little slow. The company blocks access to dropbox and this forum though, so I’ll have to save it to USB and upload changes when I get home.

2 Likes

@BenSeawalker, thanks for your response, and for your helpful suggestions! I remember CJW’s IDE, but I think it seems a lot more developed than when I was last active around here. It’s very nice for quickly testing something online, and seems to have some other useful bits built in too. I tried the Graphviz thing but got an error - honestly, having played around with Chronicler a bit this afternoon, I’ve found it very nice for actually ‘building’ as well as viewing, I think I did it a disservice earlier by dismissing the building part so lightly. I do think I might have found a bug when building though, it’s a bit of an odd one to explain so I’ll provide the link for the chron file here.

Basically, I’ve just tested scripting a dialogue out (based on a conversation in Dragon age - none of this is my work) and it seems to work fine, right until I generate the choicescript.

Basically, at line 68 in the startup.txt created by Chronicler, the choice ‘#Choice 3’ appears to have no outcome. Yet in Chronicler, it’s definitely connected to the bubble titled ‘cc_blush’. #Choice 2 in the same choice block also connects to this bubble (cc_blush), but I don’t think this should be an issue - in fact I tested it in scene 2, and it seems to work fine having choices linked to the same bubble. I have noticed it’s not making reference to the bubble label at all, which seems a bit odd, as in the rest of the choice script generated, the bubble labels are referenced. I think it could be something to do with it being a choice nested within a choice, but again, this is just a guess! I tried re-ordering and re-writing the choices but to no avail. I can get the choicescript to generate properly if I link choice 3 to a different bubble, but they just don’t seem to want to link to the same one!

Now, I do wonder if I’ve misunderstood something about how to build something using Chronicler (and wouldn’t be surprised if I’ve missed something), so it could be that. But thought it was worth mentioning.

Also, apologies if this is already covered somewhere in your thread, but I’ve not been able to read through it all yet (although I’ve made a start, and the upcoming features mentioned at the end of March look really promising).

Once again, thanks for your work on this, it’s given me hope that I might be able to finish what I started all those years ago (although honestly, I’m so badly disciplined I’m sure I’ll find another way to not finish it!) I can certainly understand it when you say that it’s sometimes tough to find motivation, especially if work is tough at the moment.

@bawpie Yes, you are correct that it is indeed a bug. One that I overlooked. Basically, with the new CS compiler, it checks each route to a bubble, if more than one bubble is connected to it (or all choices link to the same bubble), then it generates the label and throws goto statements in.

In this case, there is more than one connection to CC_blush, but they are both from the same bubble, and that bubble doesn’t connect ALL choices to CC_blush. Therefore, it treats CC_blush as if it only had one connection, and nests CC_blush’s contents into #choice 2.

(this wouldn’t be an issue with the old compiler which used label’s and goto’s for everything instead of nesting like a human would.)

Also, no problem. I don’t mind people using other methods for creating their projects. In fact, I encourage it! Programming is a good skill to have in this day and age.

Thanks for pointing out this bug. I’ll look into it, and hopefully have a patch out this weekend. (:


EDIT: I’ve fixed the issue. However, it’s tied in with some unfinished features for the next update. As soon as I’ve polished up those, I’ll upload it. (:

Is the issue with *fake_choice that it doesn’t have to contain a *goto_scene or *finish?
I can see how that might prove problematic.

@bawpie - Welcome back by the way!

@BenSeawalker that’s great, thanks for looking into that and addressing it so quickly (and explaining the cause too!). Will continue to play round with this (I haven’t tried any of the conditional stuff yet), and see what else I can do,

@CJW thanks! It’s nice to see there are still some familiar faces around here, good to see you! :slight_smile:

Apologies for double post, but having read through the thread in its entirety, some thoughts:

It would be lovely to have an option to change the font type/size. I presume this is something that could be included in the settings menu (currently unavailable), but it would be nice as a future feature.

Monetisation: I think you’re perfectly entitled to try and use the program to earn some extra cash, especially considering that you’re at uni and working as well. You could consider adopting a model which allows users to have a ‘lite’ version of the software, and a ‘licensed’ version of the software. I remember years ago ADRIFT used this model, and seemed to work reasonably well, but I’m unsure as to how easy/difficult this would be to develop (if I recall correctly, ADRIFT had a room size limit in the lite version, meaning the games you could produce would be smaller). That said, if including ads in the launcher is more straightforward, I’d go with that and allow users to buy an ‘ad free’ version. If you feel uncomfortable about ‘charging’ for a alpha/beta product, you could always go with the Minecraft model and charge an early access price vs a higher price when the product is complete. I’m aware that there a lot of young users of choicescript, but a lite version would allow people to try before they buy, or at least build ‘smaller’ projects without cost.

Also, as an aside, it might be worthwhile adding Chronicler to sites like AlternativeTo - as a viable alternative to inklewriter/twine/choicescript for instance. I actually spent a lot of time with Twine, but I could never get along with it as much as I could with choicescript, and I do think Chronicler marries the best of both worlds…I’m quite happy to do this for you, but didn’t want to go wading in if you weren’t happy to do this yet.

My cs2gv project had to be backburnered, and I don’t know when I’ll be able to get back to it. It’s not complete, but if you, @bawpie (or anyone else), want to play with the code, it’s there. It shouldn’t take too much more to make it map out all the possible choices and show exactly what the stats do down different paths.

@CJW Indeed. It’s not that they don’t have to, they, in fact, can’t contain anything other than the #choice text
The game then proceeds to the line following the choices.

I recall simply trying to link *fake_choice choices with the next parsed object in the list, but due to my recursive algorithm, the next parsed object isn’t always equivalent to the next line of CS. I guess I could set a flag during the initial phase of parsing similar to how I handle nested choices and *if’s. I’ll look into it. For right now, I really want to update the stats screen editor with an actual UI.


@bawpie For future reference, there is an “edit post” button to the left of the reply button if you wish to avoid double posting. I personally don’t care so long as the next post is not a continuation of the previous. (:

Changing Font and Size is certainly doable, and is on my todo list that I’m constantly adding things to. XD

I had not known about AlternativeTo. If you wish to spend the time to recommend Chronicler on there, I would be much obliged.

MONETISATION: I am content with simple donations. At the moment I am not particularly hurting for money and I didn’t begin development of Chronicler with the intention of “getting rich.” It is a tool to help the community produce amazing games that I personally would enjoy playing.

I have already decided against ads as they honestly would only earn me a few dollars or even less per month and could potentially introduce viruses despite how carefully I chose my providers (which would be another headache altogether).

As for a lite version, I could set it up so that one would be limited to 3 scenes (which would also affect importation of projects). This presents the problems of deciding on a fair price for Chronicler. Honestly I would only charge $5.00 but I feel that some would argue that was too low haha. Furthermore, I would have to take Chronicler down from being open source or put the source code behind a pay wall (which would last only until someone chose to upload it to a file sharing site.)

So, as I stated previously, donations seem to be the best option as it allows others to put a price on my work that fits their budget. Whether they be a highschool student with no income, or an adult struggling to make ends meet, but want to create a work of art, then I have no problem providing Chronicler to them for free. (:

As a side note: It is stated in that invisible contract you unknowingly signed upon downloading Chronicler that you must send me a free copy of any completed game created with Chronicler. :wink:


@Flurrywinde11 Glad to see your still around. (:
I’d probably enjoy looking into it. Last time I did, I was impressed with the cleanliness of the code. (Unlike my own… But GM is really conducive to “hacker” programming which I fall into more often than not. haha)

Yeah, still around, but unfortunately pretty busy these days. As for my code, thanks, but I write the spaghetti code right along with the rest of us hackers sometimes. That’s why I had to take a break actually–once I started trying to track stats, it was so complex I took a lot of shortcuts, and it got hacky. I’ll get back to it, though. (Unless one of you beats me to it!)

@Flurrywinde11 - I did briefly give your program a bit of a whirl but I got an error message when I hit submit, so wasn’t sure if I was misunderstanding how to use it or if there was actually a problem. Error code was this: Fatal error: Call to a member function addedge() on a non-object in /home/herbal7/public_html/cs2gv/cs2gv-class.php on line 768 and I got it after adding this brief scene text. I’m no coder I’m afraid, so whilst I can identify the line it’s referencing, I have no idea what the problem is!

@BenSeawalker - the *fake_choice thing isn’t a priority for me but I mentioned it because I do use it a lot when I write in choicescript. I can see how it would be problematic though. Still if you write in chronicler, I guess your choicescript code would never contain it.

Re monetisation, it’s fair enough just to ask for donations, it’s true things like this are never going to get you rich. I honestly think $20-$30 would be a fair price, but you’d probably get a lot more people paying $5 than you would $30! I just wanted to say I don’t blame anyone who does want to get something back for their work :slight_smile: I’ll see if I can get Chronicler added to AlternativeTo - I think I just need to write a simple entry and the site will approve it, so I can’t see why they wouldn’t.

I figured out the problem. Since I use tabs, not spaces, my code doesn’t parse spaces properly. Your test case works once I indented with tabs instead of spaces. I’ll have to fix this problem once I resume working on this project.

EDIT: Oh wait, I think it still doesn’t work. *choice nested in another *choice doesn’t seem to work yet either, dang it. But take that out, and it will work.

@Flurrywinde11 Thanks for checking this out, you’re right about it disliking the spaces (and nested choices). This is very neat though!

Version 1.4.7 is up!

I have decided to go ahead with a midweek update. Unusual, but I feel it is necessary.


The new CS compiler has been polished to a gleaming sheen.
Running some comparison tests, the CS it produces is almost a mirror duplicate of human written code. I am quite pleased with this development. (:

Labels have been fixed, and no longer include an _# tacked onto the end (unless there are two bubbles with the same label, or are Condition / Action bubbles). I have also made it so an Action bubble that contains a *label action will use that instead of its generated one.

Finally, I have added an “Order” textbox to every bubble. The contents of which display where exactly in the timeline a bubble is. This value can be changed by toggling the little lock icon in the top right of the box. The produced CS will remain fully functional regardless of the value. However, one may wish to decrease the value in order to make the generated CS look better.

Furthermore, an icon in the right column of the main (top) menu has been added. Pressing it will toggle the visibility of these new order boxes. As stated above, one can safely ignore these values, they exist solely for the purpose of providing some control over the generated CS code.


I discovered an issue where changing the resolution of the Chronicler window would result in stretched graphics. This is no longer the case. A larger window gives you more screen space to work with, rather than stretching the original image.

I also fixed the issue that @bawpie mentioned in post 125. Where multiple, but not all, connections leading to the same bubble would not compile correctly.


EDIT: Forgot to mention that I also updated the “Dragon Intro” example with a few locked order values, and removed the old examples contained in the Launcher download.

2 Likes

@BenSeawalker - sounds like you’ve been busy! Of course, I eagerly jumped into my project to see what happened with the multiple connections issue, but the behaviour still seems to be the same, unless I’m missing something? The launcher updated to the new version, and I tried creating a new example (i.e. 3 choices, 2 lead to 1 outcome of ‘Goes here’, 1 leads to a different outcome - ‘Goes there’), but the code it generates looks like this:

*title Test
*author Your Name Here
*choice
    #Option 1
        *label 
        Goes here.
        *finish
    #Option 2

    #Option 3
        Goes there.
        *finish

It should look like this:

*title Test
*author Your Name Here
*choice
    #Option 1
        *label 
        Goes here.
        *finish
    #Option 2
       *goto label
    #Option 3
        Goes there.
        *finish

Anyway, thanks again for all the hard work! :slight_smile:

@bawpie well, aint that just the darndest thing :confused:

It must be a side effect of working on it at work, and working on it at home. Clearly I missed something. I’ll release a fix hopefully this evening.

well, technically it should look more like this:

*title Test
*author Your Name Here

*choice
    #Option 1
        *goto here
    #Option 2
       *goto here
    #Option 3
        Goes there.
        *finish

*label here
Goes here.
*finish

@BenSeawalker haha, no worries! And yes, my choicescript skills, which were never great to begin with, are a little rusty…

@bawpie Oh, I was referring to the way Chronicler should produce the code, not necessarily how it should be written. haha

On a side note, I managed to fix the bug and upload it. It was literally one wrong variable name. XD

In any case, I don’t feel it is a big enough update to warrant a version change. To get the update: hold CTRL and it will unlock the download button on the launcher. (: