Difference between revisions of "Template:RNG/doc"

From RimWorld Wiki
Jump to navigation Jump to search
m (→Additional information)
 
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
Type <code><nowiki>{{RNG}}</nowiki></code> on the page to assume a seed of 0 and a limit of 100.
 
Type <code><nowiki>{{RNG}}</nowiki></code> on the page to assume a seed of 0 and a limit of 100.
 
<pre style="word-wrap:break-word">
 
<pre style="word-wrap:break-word">
NOTE: Setting a limit value to something greater than 1 000 000 WILL have an effect on the ra-ndomness of the result. Use two {{RNG}} templates instead.
+
NOTE: Setting a limit value to something greater than 1 000 000 WILL have an effect on the randomness of the result. Use two {{RNG}} templates instead.
 
{{RNG
 
{{RNG
 
|seed=(number)            -->Makes RNGs with different seeds unique to each other.
 
|seed=(number)            -->Makes RNGs with different seeds unique to each other.
|limit=(number)          -->Restricts the RNG to produce only numbers from 1 to {{{limit}}}.
+
|limit=(number)          -->Restricts the RNG to produce only numbers from 1 to limit.
 
}}
 
}}
 
</pre>
 
</pre>
 +
 +
Example:
 +
<pre>
 +
{{RNG
 +
|seed=1234
 +
|limit=5000}}
 +
</pre>
 +
results in: {{RNG
 +
|seed=1234
 +
|limit=5000}}
 +
<includeonly>[[Category:Utility templates]]</includeonly>
 +
<noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 12:35, 2 May 2023

Description[edit]

This template is used to generate random numbers in a relatively short time.

Usage[edit]

Type {{RNG}} on the page to assume a seed of 0 and a limit of 100.

NOTE: Setting a limit value to something greater than 1 000 000 WILL have an effect on the randomness of the result. Use two {{RNG}} templates instead.
{{RNG
|seed=(number)            -->Makes RNGs with different seeds unique to each other.
|limit=(number)           -->Restricts the RNG to produce only numbers from 1 to limit.
}}

Example:

{{RNG
|seed=1234
|limit=5000}}

results in: 1616