LGS changes.

Hi!

First engine update of 2014:
HUD (healthbars and whatnot) are now rendered using HTML.
LGS scrip language received a new compiler.

Some sample code changes:


/*
A brief description of the new language features in LGS.
Here follow a short script to explain how LGS code works.
NOTE: @import "core" can be removed from all scripts, it is deprecated.
NOTE: #model etc require quotes ("") around the filenames.
NOTE: The $ character in front of variables is no longer required,
it can still be used to mark something as an identifier that would otherwise be read as someting else.
(2xcombo is read as Number(2) Variable(xcombo), $2xcombo is read as Variable(2xcombo) )
NOTE: functions can now return variables.
NOTE: Expression parsing is much more flexible: you can now call to functions and use the result in an expression.
NOTE: The new compiler worries less about ;'s at the end of statements. They are still recommended though.
*/
//This line loads a model and defines the variable "sheep" to hold the result.
#model "data/models/sheep.xml" as sheep

//function main is the entry point for LGS scripts.
function main () {
//Define a new variable myBigNumber and put 10*20 in it.
int myBigNumber = 10*20;

//define an array myArray and fill it with numbers: you can assign multiple variables to an array using {Expression,...}
int myArray[10]={1,myBigNumber,3,4,5,6,7,8,9*2,10};

//You can define a function inside a function
function getBiggestFromArray(int array[10]/*Accept an int array of size 10*/) return int /*Return a single INT*/ {
int Largest = 0;
//The index for a foreach no longer needs to be defined first.
foreach(array index i) {
if(array>Largest) {
Largest = array //Oops, i forgot the ; here, should work fine though! :D
}
}
return Largest;
}

//Call the function, put it's result + 10 into BiggestNumber
int BiggestNumber = getBiggestFromArray(myArray) + 10;

//Call a function, compare the result with BiggestNumber and display if BiggestNumber is larger.
if(BiggestNumber > getBiggestFromArray(myArray)) {
//Print 210 on console:
prn(BiggestNumber);
}


}