PHP Code:
function onActionServerSide(action:string):void {
if (action == "hello")
player.triggerclient("weapon", this.name, "goodbye");
}
//#CLIENTSIDE
function onCreated():void {
triggerserver("gui", this.name, "hello");
}
function onActionClientSide(action:string) {
if (action == "goodbye")
player.chat = "*fistbump*";
}
PHP Code:
//#CLIENTSIDE
function onCreated():void {
var window:GuiWindowCtrl = new GuiWindowCtrl("Example");
window.profile = findobject("GuiBlueButtonProfile");
window.x = window.y = window.width = window.height = 100;
var button:GuiButtonCtrl = new GuiButtonCtrl("ButtonExample");
button.profile = findobject("GuiBlueButtonProfile");
button.x = button.y = button.width = button.height = 10;
window.addcontrol(button);
button = new GuiButtonCtrl("ButtonExample2");
button.profile = findobject("GuiBlueButtonProfile");
button.x = button.y = button.width = button.height = 30;
window.addcontrol(button);
}
The idea with tools is this:
We finish the scripted level editor by combining some of the best scripted/online editors, and convert it to GS3. This can be available online and we are also able to convert it to other scripting languages to import it into other development platforms. So we can also possibly offer new offline editors in the future.
So there are several additional advantages:
Graal script will not be a black box anymore, it will possible to bring it to faster scripting engines and platforms.
It will also be more close to other scripting languages, so you your knowledge will be more interesting for "real life" purposes, and more programmers from outside of Graal could be able to script in GS3. A lot of head-aches with variable lookups and such things are gone.
For script help normally /scripthelp is working quite fine, all new functionality is automatically added to /scripthelp or to the list you get by starting Graal with the "-listscriptfunctions" command-line option. The documentation on wiki.graal.net could be reorganized a little bit after we introduce GS3, although most global functions and GUI objects will be the same.