LuaAPI.wiki
changeset 628 c6d08e074223
parent 627 9a690b99f3e9
child 629 d4ccc5e79e58
equal deleted inserted replaced
627:9a690b99f3e9 628:c6d08e074223
   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>!EnableGameFlags(gfSolidLand, gfArtillery)</tt> - sets the !GameFlags (just 2 of them in this example), see above for the available flags/
   137  * <tt>!GameFlags</tt> - all !GameFlags combined as a bitmask. See [#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