This is excellent! I was worried that there weren't enough examples/documentation for Wintermute but then I found this
Tiny errors I noticed in Chapter 2:
file test1.script
global a = 10;
Game.Msg(a); //prints 10
file test1.script
global a = a + 1;
Game.Msg(a); //prints 11, because the variable is valid for the whole game.
I'm pretty sure you meant the second one to say test2.script- There are two Syntax Rule no.4's and two no.5's
- At the end of 2.5 Includes, there is a seemingly unrelated snippet of code
And also I had a couple of questions:
BUG: Don’t use loops inside of the case branches. They don’t work. If you need, write a function (explained later) which will contain the loop. This workaround works.
So that's a bug with the Wintermute engine? What about using }else if{ instead of a switch, wouldn't that be quicker than writing a function?Never initialize your variables in the include files. They will get reinitialized with every inclusion of your script.
Is it a good idea to put your global variables in an include file (e.g. "global myVar;") so that you can get/set the value without having to remembering to write global before it the first time you reference it in each script?
Thanks!