[Tool] ChoiceScript Development Environment

@CJW I have another possibly useless request for a feature. Would it be at all possible when “running” the code in the right panel and you have the cursor over something, say some text or a choice, the relevant code on the left is highlighted?

@CJW Works good, the selection area is now adjusting accordingly when the right panel is pulled in / pushed out of the way.

@fantom I like the general idea, although I suspect it may be a little difficult / resource-heavy to work on ‘mouse-over’. It may however be possible to highlight the code for the entire currently-displayed page of the game, or even perhaps just focus the code window on that particular section (from a particular line number down), so it scrolls / moves with you as you’re testing. Some users may not like it doing that though – it would probably need to be a specific on / off setting like line wrapping.

@Vendetta what does “resource heavy” mean?

@fantom This is where we get into the realm of “never ask a non-programmer to explain about programming”. :smiley:

In layman’s terms: as best I understand it (and I’m sure @CJW or some others here could do a better job of it), to use ‘mouse-over’ for something like what you’re suggesting, the IDE would have to be running an extra routine in the background which is constantly checking precisely where your mouse is pointing and then determining what, if anything, it’s supposed to do about that (e.g. highlight something in the code window). Anything running constantly like this is therefore using “resources”, of which there is only a finite amount available before things start to run very slowly indeed.

@fantom @Vendetta
Glad to hear it’s fixed, thanks again for bringing it to my attention! :slight_smile:

Would it be at all possible when “running” the code in the right panel and you have the cursor over something, say some text or a choice, the relevant code on the left is highlighted?

Short answer: No, it wouldn’t.

Long answer: It is possible, most things are.
The main problem is that neither the IDE nor Choicescript were really designed to handle that sort of a relationship between the code and running game elements.

Very few programming or scripting languages are actually capable of this, it’s more common for markup languages, like HTML.

Think of it like this:
*input_text my_text_var

When Choicescript “reads” that line it knows that it needs to create a text input field for my_text_var, and it does so. However after this, the line is completely forgotten and it just carries on reading subsequent ones.
Thus there is no sort of “link” between the line that creates that on-screen element and the on-screen element itself.

As for the Resource Intensiveness, in JavaScript it wouldn’t be bad at all - it’s an OO(ish) language with event-driven elements and I think an ‘event loop’ - long story short, it’s designed for handling that sort of thing.

It is really just the aforementioned reason.

Resource intensiveness generally refers to how much of a computer’s or system’s resources something needs to run. This is why some games won’t run on certain older computers, they don’t have the “resources (read: hardware)” necessary to handle the processing demands.

More complex (or poorly written) software == Bigger, better computer needed.

@CJW Just recently implemented your excellent save system in the Vendetta online demo but noticed that it can have an odd effect when testing within the IDE when it reaches a checkpoint save page. The presence of smPlugin.js-related commands within code may need to be something to bear in mind for the next version of the IDE itself?

Considering the forthcoming dropbox integration, would it perhaps also be possible to actually support / encourage smPlugin.js use more directly, e.g. when ‘publishing’ a WIP to the Public folder?

@Vendetta
What odd effect would that be?
If you’re referring to save overlaps, you can just change the game name in sm_init to make sure your IDE testing doesn’t interfere with the hosted game’s saves and vice versa.

I can certainly allow people to use smPlugin from within the IDE and then make sure the mod is ‘packaged’ with the game when you publish it - if that’s what you mean?

@CJW The “odd effect” is that the presence of such as *sm_save commands in development code causes a run-stopping error in the IDE (showing a blank page, with just the standard email stuff visible) and so preventing testing beyond that point in the game.

While it would be easy enough to comment out all smPlugin.js-related commands while in development, and then remove the comments when those files go live, I’m wondering if it might not be easy enough / less hassle for devs if the IDE itself effectively included a version of smPlugin.js which essentially just ignores those particular commands – or whatever method you deem best to achieve that particular result.

In essence, “Yes, please!” is the answer to your second paragraph question… if it’s easy enough to implement. :slight_smile:

@Vendetta
I’m not getting those errors in the public version of the IDE, the sm commands should work fine as I’ve already included smPlugin.

Updates

  • Fixed a “smartIndent” double indentation bug when using *if with *choice
  • Added some experimental sharing code*

*You can now tell the IDE to try and load a scene file from anywhere on Dropbox, provided you know the public link. Useful for ‘this is how you do it’ or ‘help me with this’ situations. The behaviour doesn’t have any sort of interface control at present as I’m merely wanting to test the method out before incorporating something more comprehensive in the large update/overhaul (the development of which still goes on).

This works by simply appending the scene’s url to the IDE’s via url parameters.
https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/tools/IDE/main.html?url=myScenesPublicDropboxUrl&autorun=true

Example: http://bit.ly/1gUCqiu

You can drop the &autorun bit if you don’t want your code to execute upon loading.
Of course, as, if and when I ever implement this properly, I’ll try to incorporate a tiny url-esque framework, as I realise the share URLs are looking rather painful at the moment.

Any changes made to shared code will be lost on reloading/resharing - they’re only referenced from the original file (so you’d need to change that in order to change the code).

As always any feedback on the above, or the IDE in general. Suggestions for the update - everything and anything - they’re all very much appreciated :slight_smile:

@CJW Just out of curiosity, do you have a time frame for the next update? Or is that more of a “When it’s ready” type thing? Also, what purpose does the “var” screen serve? I haven’t used the IDE extensively yet, hence why I ask.

@fantom
I had originally intended to release it for Christmas, but suffice to say things haven’t gone quite according to plan. I’m still hopeful for an early 2014 release though, but I’ll refrain from giving myself a precise date.

I promise though, it’ll be well worth the wait!

The variable tracker let’s you ugh, track variables.
You can use it whilst running your code to see where values are (or aren’t) changing, you can also edit variable values on the fly in order to immediately test out specific scenarios without restarting the game or editing the code.

@fantom I use the ‘var tracker’ mostly for thorough ‘alpha testing’. For example, with a game like Vendetta it’s easiest to test every route properly using an overpowered protagonist (i.e. better skilled than any player would ever be at that point). However, to test that specific fails are also working / reading properly, it’s much easier just to temporarily change that specific stat at that point using the var tracker, rather than edit the basic character stats themselves and run yet again – especially when it has to succeed at a slightly earlier point in order to reach this fail point… if that makes sense. :smiley:

In effect, the more complicated your game, the easier var tracker makes it to still thoroughly test every possible route / outcome, if only to make sure that you’ve at least eradicted all actual basic scripting bugs (indent errors, bad labels, etc.) before making those files live. This allows your playtesters to focus on such as gameplay and narrative consistency instead, rather than always be finding your basic, game-stopping scripting errors and themselves having to restart over & over…

@CJW Code sharing is a really great idea and suits the IDE perfectly. Very cool, and very useful here in the forum to help solve coding problems and share ideas.

If anyone using Firefox clicked the earlier link three posts up, note that it wasn’t properly working for this browser before, but is now. Try it again to see how code sharing will work from links posted here in the forum.

http://bit.ly/1gUCqiu

I think my adblockers or my browser settings or something are interfering with how this works. I can run it in a clean copy of firefox but nothing else. Once I got it working though it was great. Thanks.

@FairyGodfeather
I’m really glad you like it and finally got it working in one browser at least!
If you want some help troubleshooting it in others, feel free to send me a PM, I’m sure between us we can work it out.

As I very much doubt that either adblockers or the browser settings would stop the IDE from performing its basic functions.

@Vendetta
Sorry, I missed this earlier!
I’m quite pleased with how it’s working so far too, I’ll definitely be looking into implementing it as a full feature (hopefully with automatic url shortening) in the next update.

I’m still hard at work on the update, but it’s taking much longer than I expected.
As always, all I can say is that I really think it’ll be worth the wait - please bear with me! :slight_smile:

Is there a bug report function embedded into this IDE? Great job on creating one by the way. This is enormously useful.

@_jl
For bugs in the IDE itself? No there isn’t currently, but that’s a very good idea.
It’ll be hard to implement with it currently lacking a back-end infrastructure though.
I’ll look into it at the very least, thanks for the suggestion :slight_smile:

EDIT: If you ask because you’ve found actually found a bug please post the details (as best you can) here in this thread.

@CJW Dumb question, but how come my browser spell check doesn’t notify me of misspells within the IDE? I’m guessing the spell check doesn’t work because it’s javascript and it just looks like regular text to us?

@fantom
A good question, and you’re actually not far off being right there.
The syntax highlighting requires additional markup. Text Areas and input fields don’t support interior markup, they only support text.
Most browser based spellcheckers will only spellcheck text within textareas and input boxes.

Long story short, they don’t recognise the IDE’s editing field as a text field.

There are a couple of possible work arounds.
The first involves using a JS spell checking library, the con being that they’re rather data heavy.
The second would be having a ‘raw’ button that copied your current scenes text into a plain bog standard text area (no tabbing, no highlighting etc.) where the browser spell checker would kick in. You could make some minute changes in that view and then revert back to the full editor.

Neither option appeals to me greatly, though the latter is slightly more tempting, but if you like the sound of one over the other, let me know.

@CJW Well if it’s something you’re already considering, then I’d say probably the second as well, at least from my limited understanding of what you just said :slight_smile:

@fantom
I just threw the most basic and hideous implementation of the second one into the current build, just to show proof of concept.

You’ll need to type in the browser’s console:

openRaw()

Then edit your work, if the spell-checker doesn’t kick in, try hitting enter while focussed on the textarea.
Once you’re finished type

closeRaw()

in the console.

It’s hideous, but if you think you can work with that concept, I’ll look into a tidier, button based solution :slight_smile:

Example: http://gyazo.com/d2c12decf697b41d201f4e18e52e9685.png