8998: new scripting.

Hi! folks!

I just uploaded a new version of LBZ.
I’ve worked on this one for quite some time.
A while back we decided to do something special (coming soon), and with it I decided for myself that I wanted to do this new feature completely in LGS… the scripting language built into LBZ.
Coding a new feature in a scripting language you designed yourself can be quite a challenge it turns out.
Over the course of last weeks i discovered flaw upon flaw in the LGS language, as well as discovering that a couple of things were hard to write.

Long story short, this update marks a complete overhaul for the LGS scripting language:

Bugs fixed:
* glColor4f(random(),random(),0,1);// the second random() call would overwrite a value so that both random() calls always end up the same…
* Recursive functions would overwrite stack variables
* child objects could be deleted and yet still be accessed by scripts… causing crashes or undefined behavior.
* Temporary values were not released soon enough, resulting in higher memory requirements for each script.
* foreach would not work correctly for dynamic arrays inside objects.
* events executed from inside objects would get executed with wrong objects
* strings with \n and stuff like that would not be parsed correctly

New features:
* Specify objects at creation time with JSON. For example: object test = {“name”: “Menne Kamminga”, “age”: 33};
* extractor and subscript now implemented as operators, allowing for very flexible expressions. myFunction(0)->extractedFunction(1);
* Much faster object construction.
* Editor highlighting is much smarter.
* can now use objects much like PHP arrays. For example: object test; test[“name”] = “Menne Kamminga”;
* break statement to escape from loops.
* auto keyword to automatically guess variable type from initialization.
* Support for more OO features… (final class, “final” members, private and public data hiding) * New [1,2,3] syntax to initialize arrays.
* VM that runs your LGS code is several times faster!

2 thoughts on “8998: new scripting.”

Comments are closed.