LuaAPI.wiki
changeset 381 87b3dcfe11cc
parent 380 b9bd613524ca
child 382 5b90c6ef1f62
equal deleted inserted replaced
380:b9bd613524ca 381:87b3dcfe11cc
    65 === <tt>onGameInit()</tt> ===
    65 === <tt>onGameInit()</tt> ===
    66 
    66 
    67 <blockquote>This function is called before the game loads its resources. One can modify various game variables here:
    67 <blockquote>This function is called before the game loads its resources. One can modify various game variables here:
    68 </blockquote>
    68 </blockquote>
    69  * <tt>Seed = 0</tt> - sets the seed of the random number generator
    69  * <tt>Seed = 0</tt> - sets the seed of the random number generator
    70  * <tt>!EnableGameFlags(gfSolidLand, gfArtillery)</tt> - sets the GameFlags (just 2 of them in this example), see above for the available flags
    70  * <tt>!EnableGameFlags(gfSolidLand, gfArtillery)</tt> - sets the !GameFlags (just 2 of them in this example), see above for the available flags
    71  * <tt>!TurnTime = 60000</tt> - set the turntime in ms
    71  * <tt>!TurnTime = 60000</tt> - set the turntime in ms
    72  * <tt>!CaseFreq = 0</tt> - frequency of crate drops
    72  * <tt>!CaseFreq = 0</tt> - frequency of crate drops
    73  * <tt>!HealthCaseProb = 35</tt> - chance of receiving a health crate
    73  * <tt>!HealthCaseProb = 35</tt> - chance of receiving a health crate
    74  * <tt>!HealthCaseAmount = 25</tt> - amount of health in a health crate
    74  * <tt>!HealthCaseAmount = 25</tt> - amount of health in a health crate
    75  * <tt>!DamagePercent = 100</tt> - percent of damage to inforce
    75  * <tt>!DamagePercent = 100</tt> - percent of damage to inforce
   605 
   605 
   606 == Other Functions ==
   606 == Other Functions ==
   607 
   607 
   608 === <tt>!ClearGameFlags()</tt> ===
   608 === <tt>!ClearGameFlags()</tt> ===
   609 
   609 
   610 <blockquote>Disables *all* GameFlags
   610 <blockquote>Disables *all* !GameFlags
   611 </blockquote>
   611 </blockquote>
   612 
   612 
   613 === <tt>!DisableGameFlags(gameflag, ...)</tt> ===
   613 === <tt>!DisableGameFlags(gameflag, ...)</tt> ===
   614 
   614 
   615 <blockquote>Disables the listed GameFlags, without changing the status of other GameFlags
   615 <blockquote>Disables the listed !GameFlags, without changing the status of other !GameFlags
   616 </blockquote>
   616 </blockquote>
   617 
   617 
   618 === <tt>!EnableGameFlags(gameflag, ...)</tt> ===
   618 === <tt>!EnableGameFlags(gameflag, ...)</tt> ===
   619 
   619 
   620 <blockquote>Enables the listed GameFlags, without changing the status of other GameFlags
   620 <blockquote>Enables the listed !GameFlags, without changing the status of other !GameFlags
   621 </blockquote>
   621 </blockquote>
   622 
   622 
   623 === <tt>!GetGameFlag(gameflag)</tt> ===
   623 === <tt>!GetGameFlag(gameflag)</tt> ===
   624 
   624 
   625 <blockquote>Returns true if the specified gameflag is enabled, otherwise false
   625 <blockquote>Returns true if the specified gameflag is enabled, otherwise false