LuaEvents.wiki
changeset 1948 e62b8461ec01
parent 1921 e65b834f2dd9
child 1949 36b81d9d8a65
equal deleted inserted replaced
1947:3cc17b9eed3f 1948:e62b8461ec01
     7 This page is a list of all supported event handlers in Hedgewars.
     7 This page is a list of all supported event handlers in Hedgewars.
     8 
     8 
     9 <wiki:toc max_depth="3" />
     9 <wiki:toc max_depth="3" />
    10 
    10 
    11 == Initialization ==
    11 == Initialization ==
    12 === <tt>onGameInit()</tt> ===
    12 
    13 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 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`.
    14 
    14 
    15 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 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].
    16 
    16 
    17 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.
    17 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.