Jass documentation Database

JASS Documentation Database REFORGED


Results for the query "SetRandomSeed" as a "function"

The search keyword must be a single word (no spaces).

Function SetRandomSeed

Line: 3404
Location: common.j
Constant? no
Type: native
Arguments: integer seed
Returns: nothing

Preview

Extra spaces may have been removed from the original file to show the function in a comfortable way.
  1. native SetRandomSeed takes integer seed returns nothing

Information about SetRandomSeed

Information contributed by City17
on February 23, 2022, 01:27:17 PM.
sets the internal PRNG's seed.

Useful for testing or when you want a repeatable outcome. WorldEdit has an option to run test maps with a fixed seed, you can achieve the same result with this.
Code: [Select]
SetRandomSeed(42)
GetRandomInt(0, 18) --> 12
GetRandomInt(0, 18) --> 2
SetRandomSeed(42)
GetRandomInt(0, 18) --> 12

Desyncs! The random number generator is a global, shared resource. Do not change its state in local blocks asynchronously.

See: GetRandomInt, GetRandomReal
Page loaded in 0.1038 seconds.
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...