LuaAPI.wiki
changeset 572 dd27ba1f54a6
parent 567 17cf8a0c007f
child 573 aa505738aff0
equal deleted inserted replaced
571:76d662d04947 572:dd27ba1f54a6
   131 
   131 
   132 === <tt>onGameInit()</tt> ===
   132 === <tt>onGameInit()</tt> ===
   133 This function is called before the game loads its resources. One can modify various game variables here:
   133 This function is called before the game loads its resources. One can modify various game variables here:
   134  * <tt>Seed = 0</tt> - sets the seed of the random number generator
   134  * <tt>Seed = 0</tt> - sets the seed of the random number generator
   135  * <tt>!EnableGameFlags(gfSolidLand, gfArtillery)</tt> - sets the !GameFlags (just 2 of them in this example), see above for the available flags/
   135  * <tt>!EnableGameFlags(gfSolidLand, gfArtillery)</tt> - sets the !GameFlags (just 2 of them in this example), see above for the available flags/
       
   136  * <tt>Ready = 5000</tt> - the ready timer at the start of the round (in milliseconds)
       
   137  * <tt>Delay = 0</tt> - delay between each round in ms
       
   138  * <tt>!GetAwayTime = 100</tt> set the retreat time in percent
   136  * <tt>!TurnTime = 60000</tt> - set the turn time in ms
   139  * <tt>!TurnTime = 60000</tt> - set the turn time in ms
   137  * <tt>!CaseFreq = 0</tt> - frequency of crate drops
   140  * <tt>!CaseFreq = 0</tt> - frequency of crate drops
   138  * <tt>!HealthCaseProb = 35</tt> - chance of receiving a health crate
   141  * <tt>!HealthCaseProb = 35</tt> - chance of receiving a health crate
   139  * <tt>!HealthCaseAmount = 25</tt> - amount of health in a health crate
   142  * <tt>!HealthCaseAmount = 25</tt> - amount of health in a health crate
   140  * <tt>!DamagePercent = 100</tt> - percent of damage to inforce
   143  * <tt>!DamagePercent = 100</tt> - percent of damage to inforce
   141  * <tt>!MinesNum = 0</tt> - number of mines being placed (before 0.9.14 !LandAdds)
   144  * <tt>!MinesNum = 0</tt> - number of mines being placed (before 0.9.14 !LandAdds)
   142  * <tt>!MinesTime = 3000</tt> - time for a mine to explode from activated (in milliseconds), -1000 for random
   145  * <tt>!MinesTime = 3000</tt> - time for a mine to explode from activated (in milliseconds), -1000 for random
   143  * <tt>!MineDudPercent = 0</tt> - chance of mine being a dud
   146  * <tt>!MineDudPercent = 0</tt> - chance of mine being a dud
   144  * <tt>Explosives = 0</tt> - number of explosives being placed
   147  * <tt>Explosives = 0</tt> - number of explosives being placed
   145  * <tt>Delay = 0</tt> - delay between each round
       
   146  * <tt>!SuddenDeathTurns = 30</tt> - turns until sudden death begins
   148  * <tt>!SuddenDeathTurns = 30</tt> - turns until sudden death begins
   147  * <tt>!WaterRise = 47</tt> - height of water rise at sudden death in pixels
   149  * <tt>!WaterRise = 47</tt> - height of water rise at sudden death in pixels
   148  * <tt>!HealthDecrease = 5</tt> - amount of health decreased on sudden death
   150  * <tt>!HealthDecrease = 5</tt> - amount of health decreased on sudden death
   149  * <tt>Map = "Bamboo"</tt> - the map being played
   151  * <tt>Map = "Bamboo"</tt> - the map being played
   150  * <tt>Theme = "Bamboo"</tt> - the theme to be used
   152  * <tt>Theme = "Bamboo"</tt> - the theme to be used
   151  * <tt>Ready = 5000</tt> - the ready timer at the start of the round (in milliseconds)
       
   152  * <tt>!MapGen</tt> - type of map generator. One of `mgRandom`, `mgMaze`, `mgPerlin`, `mgDrawn`.
   153  * <tt>!MapGen</tt> - type of map generator. One of `mgRandom`, `mgMaze`, `mgPerlin`, `mgDrawn`.
   153  * <tt>!TemplateFilter</tt>
   154  * <tt>!TemplateFilter</tt>
   154  * <tt>Goals = "Jumping is disabled"</tt> - if you want to add info to the game mode dialog, use "|" to separate lines
   155  * <tt>Goals = "Jumping is disabled"</tt> - if you want to add info to the game mode dialog, use "|" to separate lines
   155 
   156 
   156 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.
   157 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.