<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=Game.Rand_%28Civ5_API%29</id>
	<title>Game.Rand (Civ5 API) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://modiki.civfanatics.com/index.php?action=history&amp;feed=atom&amp;title=Game.Rand_%28Civ5_API%29"/>
	<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Game.Rand_(Civ5_API)&amp;action=history"/>
	<updated>2026-04-13T19:21:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://modiki.civfanatics.com/index.php?title=Game.Rand_(Civ5_API)&amp;diff=11254&amp;oldid=prev</id>
		<title>DonQuich: Bot update</title>
		<link rel="alternate" type="text/html" href="https://modiki.civfanatics.com/index.php?title=Game.Rand_(Civ5_API)&amp;diff=11254&amp;oldid=prev"/>
		<updated>2012-09-19T20:06:46Z</updated>

		<summary type="html">&lt;p&gt;Bot update&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Civ5 API Beta Banner}}&lt;br /&gt;
&amp;#039;&amp;#039;This page is a part of the [[Lua and UI Reference (Civ5)]].&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TypeInfos5|Function.png|This function is a member of {{Type5|Game}}.&amp;lt;br/&amp;gt;&lt;br /&gt;
This is a static method, invoke it with a dot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Usage=&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;#039;&amp;#039;&amp;#039;int&amp;#039;&amp;#039;&amp;#039; Game.Rand&amp;lt;b&amp;gt;(&amp;lt;/b&amp;gt;&amp;#039;&amp;#039;&amp;#039;int&amp;#039;&amp;#039;&amp;#039; max_num, &amp;#039;&amp;#039;&amp;#039;string&amp;#039;&amp;#039;&amp;#039; log&amp;lt;b&amp;gt;)&amp;lt;/b&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returned Value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:No description available.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
:{|&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|max_num:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;No description available.&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; style=&amp;quot;padding-right:6px;&amp;quot;|log:&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;| &amp;#039;&amp;#039;No description available.&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Source code samples=&lt;br /&gt;
&amp;#039;&amp;#039;Redundant occurences have been removed.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|TurnsRemaining.lua - DLC_02 DLC}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/DLC_02/Scenarios/NewWorldScenario/TurnsRemaining.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0106}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;if (Game.Rand(100, &amp;quot;Rolling for treasure&amp;quot;) &amp;lt; 80) then&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0110}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;if (Game.Rand(100, &amp;quot;Rolling for treasure&amp;quot;) &amp;lt; 70) then&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0114}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;if (Game.Rand(100, &amp;quot;Rolling for treasure&amp;quot;) &amp;lt; 60) then&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0118}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;if (Game.Rand(100, &amp;quot;Rolling for treasure&amp;quot;) &amp;lt; 50) then&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0324}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local iRandom = Game.Rand(20, &amp;quot;Delay between natural wonder treasures&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|TurnsRemaining.lua - DLC_04 DLC}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/DLC_04/Scenarios/1066Scenario/TurnsRemaining.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0577}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local iRand = Game.Rand(5, &amp;quot;Norman attack target&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0627}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local iRand = Game.Rand(5, &amp;quot;Danish attack target&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|TurnsRemaining.lua (G&amp;amp;K)}}&lt;br /&gt;
:&amp;lt;code&amp;gt;DLC/Expansion/Scenarios/FallOfRomeScenario/TurnsRemaining.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0426}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local iRandChoice = Game.Rand(iCounter, &amp;quot;Choosing which city to drop an army on&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|2208}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local iSwapIndex = Game.Rand(iNumMissions, &amp;quot;Scrambling mission order&amp;quot;) + 1;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{PseudoH4|WhosWinningPopup.lua}}&lt;br /&gt;
:&amp;lt;code&amp;gt;UI/InGame/Popups/WhosWinningPopup.lua&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CodeBegin5}}&lt;br /&gt;
{{CodeLine5|0068}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local iRand = Game.Rand(#g_tListOfDudes, &amp;quot;Rolling to determine Progress Screen dude.&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeBreak5}}&lt;br /&gt;
{{CodeLine5|0088}}&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;iRand = Game.Rand(#g_tListModeText+1, &amp;quot;Rolling to determine Progress Screen list type.&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{CodeEnd5}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Civ5 API Footer}}&lt;br /&gt;
[[Category:Civ5 Methods and Functions|Rand]]&lt;/div&gt;</summary>
		<author><name>DonQuich</name></author>
	</entry>
</feed>