Quote:
|
Originally Posted by Stefan
You can overload already, or what do you mean exactly ?
|
Something in the sense where you can have a function of the same name with different sets of parameters, and the function that is called is the one with the correct amount of parameters. It probably wouldn't be that useful in gscript since you can't declare variable types though (but I actually enjoy this flexibility).
like:
function test(String s, int n) vs. function test(int n, String s), but still, if you didn't want to necessarily use all of your parameters it might be useful
In essence (although you probably wouldn't use it this way):
NPC Code:
function test(param1) {
chat = param1;
}
function test(param1,param2) {
chat = param2;
headimg = param1;
}
function test(param1,param2,param3) {
chat = param3 @ param2;
headimg = param1;
}
It would also be neat if you had an option of doing:
serverside function onCreated() {}
clientside function onCreated() {}
rather than
function onCreated() {}
//#CLIENTSIDE
function onCreated() {}