Filenames should be lowercase, and if they are made of two words, I'd use underscore _ .
I'd start functions with lowercase but make them camelcase, so it's basically what you wrote Elgan, but just start from lowercase:
local.lala = waitexec reborn/some_file.scr::doSomeStuff local.player[2]
This is a Java-like casing. Classes in Java are camelcase and start with first capital in uppercase, while methods/functions have first letter in lowercase.
Code:
class ThisIsMyClass {
public String getSomeData() {
return "data";
}
}
class App {
public static void main(String[] args) {
ThisIsMyClass thisIsMyClass = new ThisIsMyClass();
String data = thisIsMyClass.getSomeData();
system.out.printl(data);
}
}
Something like this.
Also I'd skip the comments about edits in the file header, because we have this in Git commit comments, together with date and time, and diff. But on the other hand, I don't have anything against if you really want them included in the scripts.
I think that the idea with storing functions in level variable is pretty nice, because it can make scripts shorter, and also it provides a nice possibility to override standard functions with own implementations and writing script-hooks instead of modifying original libs.
Fragment from math.scr
Code:
level.MATHS[avg] = global/func_maths.scr::calcAvg
Then later in the script you do:
Code:
local.average = waitexec level.MATHS[avg] local.numberArray 0
And modders can write hooks and their own implementations:
Code:
local.orig_avg = level.MATHS[avg];
level.MATHS[avg] = global/my_avg_that_calls_orig_avg.scr::avg
But instead of level.MATHS[avg] I'd do the same you did with files.scr so we would have
level.maths.avg, or $math.avg
This would be pretty cool.
Currently I've added scripts but they need rewriting to match our coding standards.