[Tool] Chronicler - ChoiceScript Visual Code Editor

I was planning on a single bubble that holds a group of choices, rather than 1 bubble = 1 choice. Thats why the link buttons need to be on the side next to their respective choices. I think it’ll be fine. I just really need to get around to improving the link drawing algorithm so it doesn’t go through other bubbles or stack multiple lines on top of each other.

Ah yes. I had that thought as well. Prolly just have to test it and try it out!

Have you seen Inklewriter? That’s how I’d do it. You can just go along typing as if you were writing a linear story. Saves a ton of time when you don’t have to worry about either code OR clicking!

@Flurrywinde11 I checked it out, and while I do like the interface, I feel that it lacks a lot of the power available in ChoiceScript. I don’t understand what you mean by “no clicking.” The whole interface relied on “clicking” (or tapping on mobile). Also, there was a part where they had to type some, frankly, confusing code (for beginners anyway) to check the status of variables. And said variables are merely boolean flags. They can’t store numbers or text… So, if you wanted to keep track of the money your character has, that would be next to impossible in that program.
I also think it would be hard to see where all of your story branches go since it stacks them all on top of each other…
(one of the main reasons I created Chronicler)

I will say this though:
It natively supports facebook and similar sites, which is a big plus in my book. CS should be for big projects. But big projects take a lot of time and effort. If you have a quick story ready to share with the world, then I would heartily recommend using Inklewriter instead of ChoiceScript.

So, if one would like to create a simple CYOA without much overhead, then by all means check it out! (:
http://www.inklestudios.com/inklewriter/



As for Chronicler, do you mean the choices should still be attached to bubbles, just that they be stacked vertically rather than horizontally? As well as adding a few more hotkeys for working with them. Like hitting tab on a choice will take you to the bubble it’s connected to, and another key will create a new choice?

Or do you mean I should add a “Simple Mode” without Action and Condition bubbles? Just the simple booleans on the side, and a more convenient way of checking them?

I’m not opposed to either of these suggestions.

As for saving time: http://en.wiktionary.org/wiki/haste_makes_waste
(;

Vertically stacked choices might be nice because it’ll let you see at a glance what they say, but ok, here’s what I meant:

  1. Keep the boxes and arrows. I didn’t mean that part to be like Inklewriter. The way you’re doing it is much like I remember Twine being or any flowcharter, which is going to be its main strength.

  2. I also didn’t mean to take away advanced stats. Definitely keep supporting all the things CS can support.

  3. By “no clicking” I meant that a person could type out a page of story text, hit a hotkey, type out a choice, hit another hotkey to type the text that choice led to, or hit a different hotkey to type another choice, hotkeys to move between the choices until you get to the path you want to follow, hit a hotkey to go to its story text, edit or create that one, and so on.

  4. I wasn’t even thinking about how actions should be handled, but thinking about it now, is it hard to attach one directly to a story text box? I’m thinking arrows should just be for choices and conditionals.

Oh, and a thought I had about layout of the choices just now is that maybe they should be bubbles of their own. There’d be the story text bubble and then the choices would come off it like branches below it. You could read the first part of each choice, and see the whole thing if you’re editing it.

I think the hard part, though, is organizing where all the bubbles go. If you play with graphviz, you find that if you change some connections, the position of the nodes (i.e. bubbles) can change dramatically to keep things from getting chaotic. I’d have trouble coming up with an algorithm to do this!

Put some CS in my graphviz maker thingie, and you’ll see that even a simple CS game makes a fairly complex diagram already. A complex CS game would be hard to organize without an algorithm like graphviz has. I wonder if there’s an open-source implementation of that algorithm you could use?

OTOH, people like and use Twine. I wonder how Twine solves this problem? Maybe people position their bubbles by hand?

@Flurrywinde11 Sorry if I sounded a little abrasive in my last post, I didn’t intend it to be that way, but I was writing it at 1:00am. XD

I see where you’re coming from, just make more hotkeys so development can flow. I like it, but coming up with a good combo is going to be difficult. It’s made harder by the fact that I didn’t write the textbox code, and while it is commented, I still have a hard time following it. (It’s 695 lines!)

I will work it out, but for now your stuck with good ol’ drag’n’drop or hitting the 1,2,and 3 keys. *shrugs

I also mentioned a post or two back that I’m turning choices into their own separate bubble. I’m not sure whether to add them into the side menu, or as a unique button on text bubbles?


Making actions attached to text bubbles is interesting, but ultimately impractical because it precludes the use of *label actions. (which will be necessary with CS import)


Good news though! I made most of the animations independent of framerate. and fixed a few more bugs of course. I think I’ll go ahead and upload it today as a small update.

  • Next will be variable refactoring and a code completion box.
  • Then either a menu for actions (which might be unecessary with the code completion)
    or the new “choice bubbles”
  • I’m also thinking of doing away with the bubble you’re dragging shoving other bubbles out of the way. it’s kind of annoying. I just have to deal with layering, so you can’t get two bubbles “stuck” on top of each other while trying to drag them.

EDIT: I checked out the Twine editor. Good heavens it was confusing… (the online one anyway)
Yes, you arrange all the bubbles by hand.

1 Like

No, no, you didn’t sound abrasive at all. No worries!

I once saw an online flowchart maker: https://bubbl.us/mindmap Maybe you can make it like this? The bubble has two buttons. The one on the side makes a new sibling, i.e. a new choice option, and the one on the bottom makes a new child, i.e. where the choice goes. With hotkeys. I like it!

Version 1.3.3 is up.

I have to apologize folks, I was doing some testing and forgot to take out a few things before the last upload… Namely pressing “P” would pause the program.

After fixing that I spent the last couple of days adding in the following features:

  • Code completion popup.
    Displays actions and variables.
    Esc to toggle on or off, otherwise it pops up while typing.
    Up & Down Arrow Keys to change selection
    Tab to insert selection into text.
  • Variable refactoring.
    Changing the name of a variable in the variables screen will intelligently update it in bubbles that it appears in.
  • Bubbles no longer push each other out of the way while you are dragging them. You should also notice a performance increase since bubbles no longer have to check for collisions with each other all the time.

Note on the code completion (CC from here onwards): it will pop up if you start typing a valid action or variable. To see a complete list of all options, hit the Escape key on a blank space. Hit Esc again to hide it. Pressing Tab will insert the highlighted selection into the text.

Let me know what you think. I’m hoping that this will replace the need for a separate clickable menu. Most of the CS actions are self explanatory, but I plan on adding notes for each one in the CC for the next update.

2 Likes

Hmm. I get an error on start-up now.


ChoiceScript Visual Code Editor has stopped working.

A problem caused the program to stop working correctly.
Please close the program.

[ → Close the program ]


Did a fresh install, new directory, downloaded update. Same thing. :confused:

Oh, I’m on Windows 7, 64-bit, by the way.

Ran okay for me. Minor thing just upon first inspection, when you press up/down to cycle through the CC options, it also moves the cursor in the bubble you’re working on. Might want to figure out a way to detect if the user is in the CC list and disable cursor movement in the bubble.

@JTAL
Since it doesn’t give any more information about the error, then it sounds like an issue in the loading feature, and since it happens on startup, it must be the auto load. Your last opened project became corrupted in some way… (or maybe it was moved?) I run a check to see if the file exists but it may not be working. I’ll look into it.

To fix it:
go to C:\Users\Your Username\AppData\Local\Chronicler
and delete “settings.ini”

I think I’ll add a “clear cache” option to the launcher. That may help.

EDIT: Does it happen a second after the project loads or immediately? If it’s a second later then it’s an issue with autosave. I would like to know so I know where to look.

@stainedofmind
I originally had it like you suggested but it got kind of annoying when trying to navigate the text.

EDIT: I tried it out again, and feel that you are right. I’ll change it back, and if you want to navigate the text, just hit Esc. that should be fine.


speaking of which, I’m working on making the code completion a bit smarter. Like in Condition bubbles, it will auto suggest “>=” or “and” etc. if the previous word is a variable. I also realized that I forgot to add several CS actions to the list…

@BenSeawalker, Tested with the changes, I think it flows a lot better this way. Great job so far and keep up the good work!

Edit: Don’t know exactly what I did, but I had a moment where I pressed escape and the CC list poped up for all the bubbles on the screen at once. Tried a bunch of things to try and duplicate the issue, but to no success.

I’ve had the same problem. The Chronicler loads, but a second later it immediately crashes. I am on windows 8.

@QondasDyablo

This is a temporary fix. but it should work.

Just released a hotfix for v1.3.3.

I believe that I may have fixed the crashing bug mentioned above.

Added a few more actions to the CC.
Pressing Up and Down while the CC is open no longer moves the cursor in the textbox.
Fixed the arrow on the side of the screen for scenes not appearing.
Fixed laggy animation on color picker.

If you have already downloaded v1.3.3: Run a forced update (hold ctrl) to retrieve hotfix.



The crashing bug appears to be caused by attempting to save a list with “undefined” values in it. The undefined values in question come from loading older project files that didn’t have the latest features.

It was incredibly difficult to track down because as you have noticed, it just crashes without any useful error messages. I can circumvent this by wrapping the variables I wish to save with the string() and real() functions. Effectively converting null values to either an empty string ("") or 0 (zero) respectively.

In any case, I submitted a bug report to YoYo games so that they can display a proper error message.

@BenSeawalker – Ah, that did it. I thought it would be something about settings or the old (dummy) project, but I didn’t know where the files were kept. :relaxed:

It did ask if I wanted to load the old save (Chronicler didn’t shut down properly since it crashed) but it did not matter which one I picked, same helpful error every time. Hope that info helps, I meant to include it my post but I must have been too tired. :flushed:

Works now. Now I will have to sue it for a bit and see how I like it. :wink:

Lets try this again shall we?

I added (removed?) another feature to the hotfix: hovering over choices no longer expands them. It was rather awkward…

so, if you downloaded the previous hotfix (and want the above mentioned feature), DO IT AGAIN. xD


@JTAL Glad it seems to be working now. (:

It’d be nice to be able to look at the Choicescript and the visual version at the same time in a split-screen format. My friend uses a software like that to build websites. Those who know coding can code and look at the map simultaneously, while those who are absolutely useless at programming (like me) can use it to try and learn Choicescript.

Oh, and it really helps to be able to move the screen around using the space bar. The mousepad on my laptop has issues, and there’s no room on my desk for a regular mouse.

@Mirabella
Well, using this program to learn CS is not a good idea I’m afraid. The generated code was made to work not look pretty haha.

It basically generates a unique *label over each action, text, condition etc. and then uses “goto label” for each connection to said bubble. It’s efficient to generate, and it just works when you run your CS game in the browser, but it’s not a good way to learn programming.

In case you aren’t aware, the far right button on the file menu will display the generated CS code for the currently active scene. (just not in a splitscreen)
If you have the code editor Notepad++ it will automatically refresh any opened file that’s been modified. So, if you open the generated .txt file in N++, every time you save your project, the code changes will show up on there. Making it kind of a hacky way to get splitscreen. lolz


Too bad about your desk :confused:
but yes, I had the same problem when working on my laptop, which is why I added the spacebar controls. (:
I believe it was @stainedofmind who suggested arrow key movement and zoom using Q and E a few posts back as well.


Now, I have been planning on rewriting the CS generation code. If I break the project down into a tree-list first, then follow each branch individually, I can produce CS code that could potentially represent what a real human being would write. This is all theoretical and floating around in my head though.


To be able to look at the code and either modify it or the project and have them affect each other is going to be really difficult to implement. Not saying that it’s not possible, or that I’m not willing to do it, just that I feel it would be impractical and a little beyond the scope of why I created Chronicler. If you want to write your own CS code, I highly recommend @CJW’s editor. [Tool] ChoiceScript Development Environment - #155 by lordirishdas

copy and paste this hosted Choice of Dragon source into it and mess around. CS is quite straitforward once you get the hang of it. (:
https://www.choiceofgames.com/dragon/scenes/startup.txt


Having said all that, a splitscreen view of the code is not overly difficult to implement, if you (or anyone else) still feels that it would be a good addition, I can add it to my planned features list.



So, how would ya’ll feel is the best use of time for the next update?

  • A separate bubble for choices.
  • A rewrite of the CS code generation.
    OR
  • Finishing the CS code import function?
1 Like

The more controls to move the screen around the better. Not only thinking user-controls available but also preferences. So kudos for doing that. :relaxed:


Bobble, Seaess or Imp Ort… :neutral_face:.oO( cogs turning )

I’ll get back to you on that. :grin: