LuaGameplay.wiki
changeset 2006 75df3ddba09c
parent 1983 1098683f138f
child 2007 be514c1e3989
equal deleted inserted replaced
2005:017b57b75854 2006:75df3ddba09c
   467 === <tt>!GetMissionVar(varname)</tt> (1.0.0) ===
   467 === <tt>!GetMissionVar(varname)</tt> (1.0.0) ===
   468 Returns the value of the mission variable `varname` as a string. See also `SaveMissionVar`.
   468 Returns the value of the mission variable `varname` as a string. See also `SaveMissionVar`.
   469 
   469 
   470 == Randomness ==
   470 == Randomness ==
   471 === <tt>!GetRandom(number)</tt> ===
   471 === <tt>!GetRandom(number)</tt> ===
   472 Returns a randomly generated number in the range of 0 to number - 1. This random number uses the game seed, so is synchronised, and thus safe for multiplayer and saved games. Use `GetRandom` for anything that could impact the engine state. For example, a visual gear could simply use Lua’s `math.random`, but adding a regular gear should use `GetRandom`.
   472 Returns a randomly generated whole number in the range of `0` to `number - 1`. `number` must be a whole number >= 1. This random number uses the game seed, so is synchronised, and thus safe for multiplayer and saved games. Use `GetRandom` for anything that could impact the engine state. For example, a visual gear could simply use Lua’s `math.random`, but adding a regular gear should use `GetRandom`.