Civ Modding Wiki

Search

Search IconIcon to open search

Game.GetRandNum

Last updated Aug 2, 2022 Edit Source

# Game.GetRandNum

this function is a member of Game this method can be invoked with .


# Usage

UIScriptReturnsFunctionArguments
RandomInteger [number]Game.GetRandNumMaxInteger [number]
Reason [string]

# Notes

Returns a random integer between 0 and MaxInteger [number] - 1 inclusive. So if you feed in 2 as a parameter, it returns either 0 or 1.

If MaxInteger [number] is a float, it is rounded down. If it is negative, then it loops around to some unknown positive integer, perhaps 65,535? (max 16 bit digit).


Interactive Graph