EDIT: MiniScript is now available in the asset store!
(I’d posted about this in the General forum, but realized that this is probably a more appropriate place for it.)
I have been working for the last couple of months on a lightweight scripting language called MiniScript. It can be described fairly completely in a single page of documentation, so it is very easy to pick up and learn. And because it is written entirely in C#, it is trivial to embed in a Unity app.
MiniScript source code is compiled down to a bytecode, which is then run through an interpreter. You can tell this interpreter how many milliseconds to run before returning, and then have it pick up right where it left off in the next frame. The set of intrinsic functions even includes a “wait” command that lets a script pause for any number of seconds — all without causing a hiccup in the host game!
Feature highlights:
- clean syntax without a lot of unnecessary punctuation
- robust list, string, and map handling
- object-oriented
- safe (completely sandboxed)
Even though it’s fully sandboxed, it’s easy to integrate with your Unity objects. Unity code can simply reach into the context of any script, and get/set variables as you wish. Or, you can add new intrinsic functions, or entire classes, to the script environment.
I’ve put up a web demo that lets you play around with the language yourself — either in a read-eval-print sort of mode, or by writing a little script and running it. In either case, you have access to a “ship” map with x, y, and rot properties, that controls the position and rotation of a sprite on the screen.
I’m looking for feedback on the language design, as well as (of course) reports of any bugs you may find. In addition to the quick reference page, the demo page also includes a link to the regression test suite. That contains hundreds of lines of MiniScript code and the expected result, so that’s a good source of example code too.
I’d also love to hear any thoughts you have about how you could use a scripting language like this in your games (or other games you love).
Please give it a try, and let me know what you think!