[Tool] - Online Choicescript Tester

UPDATE
I no longer update or actively support the Online Choicescript Tester.
Please see the Choicescript IDE instead.


I’ve wanted to do something like this for a while now, but only just got around to it.
It’s a very simple tool in both design and purpose - it basically allows you to copy and paste choicescript code into a textbox on a web page and ‘run’ that code straight away in your browser, saving you the hassle of opening up your text editor and messing around with files or making fresh copies of choicescript.

It’s really intended for just quickly testing out simple code, perhaps an example someone posted in a thread or some standalone stuff on the wiki (my mini-scenes system will run in it for e.g.: http://choicescriptdev.wikia.com/wiki/System_mini-scenes).

It really is just a tool of convenience I wanted for personal use, but I thought I may as well share it with everyone else too.

It has its limitations of course, you can’t set (and thus, use) global variables, scene navigation (*finish, *goto_scene etc). Apart from that, it uses a proper a up to date version of CS to run the code, I’ve just changed where it sources the code from, so everything should work just fine (and has for me so far).

If you’re curious and want some examples, feel free to copy and paste the following code snippets into the tester (it runs fine even with the pre tag generated line breaks, though formatting is unavoidably weird).

Capitalization


*temp var
*set var "capitalization is cool"

${var}
$!{var}
$!!{var}


A Simple Loop


*temp n
*set n 0

*label loop
*set n + 1
${n}
*if (n < 10)
 *goto loop


A Choice


What is your favourite colour?
*fake_choice
  #Red
  #Blue
  #No! Yell-

Very good.


And here’s the link: https://dl.dropbox.com/u/7840892/CJW/choicescript/tools/online-cs-tester/mygame/input.html

Sick u rock

@hyperguy Thanks, is it useful?

Also I forgot the pre tags on the loop snippet:


*temp n 
*set n 0 

*label loop 
*set n + 1 
${n} 
*if (n < 10) 
 *goto loop 

I added an option to automatically remove blank lines, so it handles copy and pasta from the forums better (the pre tags add extra line breaks).

If anyone has any further ideas for additions or adjustments, please do let me know! :slight_smile:

You rock as always.

@CJW You a web developer or something? You seem really good at this code stuff.

That is very nifty, thank you.

@lordirishdas @HoraceTorys Thanks!

@fanntom An aspiring one, perhaps.
Thank you for the vote of confidence! :slight_smile:

Would anyone prefer this if it displayed the game and code side by side, as opposed to opening the game in a new window?

@CJW It would be good if the code was shown on the bottom and the game opened above it.

@archene There’s a side-by-side version here now. I’m not sure having the text below it would look as good, if you had a lot of lines of code you’d be constantly scrolling back and forth.

This is fabulous.

Way easier to test ideas with this. And map out ChoiceScript stuff in general.

Bookmarking it for sure.

@Caddmuss - Thanks! Glad you like it.
Please let me know if you have any suggestions for improvement! :slight_smile:

I love this tool.

@FairyGodfeather
I’m really glad people are finding this useful! I thought for a while that I was the only one… x)
Again, please do let me know if you think of any potential improvements!

Without really thinking, I’d say something like integrating your syntax highlighter into it, but that would be like gilding a lily. This is perfect the way it is.

@Caddmuss That’s definitely something I’ll consider, thanks for the feedback! :slight_smile:

I’m bumping this because it’s such a useful tool. I find it extremely helpful for doing small sections of code.

The side by side version isn’t working anymore though. Can that be fixed?

My bad, I restructured my dropbox a while back and never updated the link! Here you go :slight_smile:
https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/tools/online-cs-tester-side-by-side/mygame/input.html

Thanks for the bump, always good to know when things are proving useful! :smiley:

Edit: The side by side one seems borked, I’ll look into (sorry!)…
Edit2: And fixed, though I’m not sure how up-to-date the testers are so if anyone experiences any problems using the new commands, please let me know and I’ll update them!

Yay, the 2nd version’s fixed. I noticed it went offline a while back, but since the original was working, I just used that one.

Bumping this thread back to the main page since I just linked it to a couple of people. The choicescript tester is amazing! I think it’s one of the most valuable tools for coding out there.