equal
deleted
inserted
replaced
8 <wiki:toc max_depth="3" /> |
8 <wiki:toc max_depth="3" /> |
9 |
9 |
10 == Initialization == |
10 == Initialization == |
11 === <tt>onGameInit()</tt> === |
11 === <tt>onGameInit()</tt> === |
12 This function is called before the game loads its resources. One can read and modify various [LuaGlobals#Game_variables game variables] here. These variables will become globally available after `onGameInit` has been invoked, but changing them has only an effect in `onGameInit`. |
12 This function is called before the game loads its resources. One can read and modify various [LuaGlobals#Game_variables game variables] here. These variables will become globally available after `onGameInit` has been invoked, but changing them has only an effect in `onGameInit`. |
13 Most game variables are optional, but for missions, `Theme` must be set by the scripter if you want to use a random map, rather than an image map. All other variables do not need to be set by the scripter and have default values. |
13 |
14 |
14 Most game variables are optional, but for missions, `Theme` must be set by the scripter if you want to use a random map, rather than an image map. All other variables do not need to be set by the scripter and have default values. For a list of game variables that can be set here, see [LuaGlobals#Game_variables]. |
15 For a list of game variables that can be set here, see [LuaGlobals#Game_variables]. |
15 |
|
16 If you want to add teams or hogs manually, you have to do it here. If you want to draw your own map using `AddPoint` and `FlushPoints`, you have to do this within this function as well. |
16 |
17 |
17 === <tt>onGameStart()</tt> === |
18 === <tt>onGameStart()</tt> === |
18 This function is called when the first round starts. |
19 This function is called when the first round starts. |
19 |
20 |
20 Can be used to show the mission and for more setup, for example initial target spawning. |
21 Can be used to show the mission and for more setup, for example initial target spawning. |