LuaAPI.wiki
changeset 629 d4ccc5e79e58
parent 628 c6d08e074223
child 630 596458ef4649
equal deleted inserted replaced
628:c6d08e074223 629:d4ccc5e79e58
   132 Lua scripts are supposed to _define_ these functions to do something. The functions are then _called_ by Hedgewars when a certain even has occoured.
   132 Lua scripts are supposed to _define_ these functions to do something. The functions are then _called_ by Hedgewars when a certain even has occoured.
   133 
   133 
   134 === <tt>onGameInit()</tt> ===
   134 === <tt>onGameInit()</tt> ===
   135 This function is called before the game loads its resources. One can modify various game variables here:
   135 This function is called before the game loads its resources. One can modify various game variables here:
   136  * <tt>Seed = 0</tt> - sets the seed of the random number generator
   136  * <tt>Seed = 0</tt> - sets the seed of the random number generator
   137  * <tt>!GameFlags</tt> - all !GameFlags combined as a bitmask. See [#GameFlags_functions] for easier manipulation of !GameFlags
   137  * <tt>!GameFlags</tt> - all !GameFlags combined as a bitmask. See [LuaAPI#GameFlags_functions] for easier manipulation of !GameFlags
   138  * <tt>Ready = 5000</tt> - the ready timer at the start of the round (in milliseconds)
   138  * <tt>Ready = 5000</tt> - the ready timer at the start of the round (in milliseconds)
   139  * <tt>Delay = 0</tt> - delay between each round in ms
   139  * <tt>Delay = 0</tt> - delay between each round in ms
   140  * <tt>!GetAwayTime = 100</tt> set the retreat time in percent
   140  * <tt>!GetAwayTime = 100</tt> set the retreat time in percent
   141  * <tt>!TurnTime = 60000</tt> - set the turn time in ms
   141  * <tt>!TurnTime = 60000</tt> - set the turn time in ms
   142  * <tt>!CaseFreq = 0</tt> - frequency of crate drops
   142  * <tt>!CaseFreq = 0</tt> - frequency of crate drops