• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] True Random

Status
Not open for further replies.
Level 10
Joined
Jul 22, 2007
Messages
261
How would i make a truely random trigger becuase the Random Number function in WE isent really random and it will ruin the game I am working on if its not Ture Random.

  • Random Group
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TotalHeroes = 12
      • Set RandomCount = 12
      • Set HeroArray[1] = Paladin
      • Set HeroArray[2] = Archmage
      • Set HeroArray[3] = Blood Mage
      • Set HeroArray[4] = Mountain King
      • Set HeroArray[5] = Blademaster
      • Set HeroArray[6] = Tauren Chieftain
      • Set HeroArray[7] = Far Seer
      • Set HeroArray[8] = Shadow Hunter
      • Set HeroArray[9] = Crypt Lord
      • Set HeroArray[10] = Death Knight
      • Set HeroArray[11] = Lich
      • Set HeroArray[12] = Dreadlord
      • Set RandomData[RandomCount] = RandomCount
  • Random Sell
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Random Hero
    • Actions
      • Unit - Kill (Sold unit)
      • Unit - Create 1 HeroArray[(Random integer number between 1 and 12)] for (Owner of (Sold unit)) at ((Owner of (Sold unit)) start location) facing Default building facing degrees
      • Camera - Pan camera for (Owner of (Sold unit)) to ((Owner of (Sold unit)) start location) over 1.50 seconds
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
I always get a Deathknight first and it wont change in order as the game goes on.
Help Will be greatly appreciated :cool::grin::thumbs_up::wink:
 
Actually when you test the map, the random seed is always the same, if you checked "Use the Same Random Seed" under preferences... (It is checked by default)
Even when you change it, it tends to repeat, Warcraft randomness is not very random for me. If you want something really random, rely on a fact that depends of the player, like:

  • Elapsed Time when the trigger was activated (If no specific timed Events are used)
  • X/Y Coordinates of the game camera position (If not in cinematics, or other preset cameras usage happenings)
  • You can rely on the players name, but it is not recommended, like for testing the map (Always the same name)
  • Some other things as well...
  • The aritmethic combination between more than one of these facts
Then, you do some conversions to string to use just a number of characters via the Substring function and back to integer and there you have a 100% random number, no matter the random seed.
 
Level 1
Joined
Jun 2, 2009
Messages
2
File is the first tab, then preferences is near the bottom, then go over to the Test Map, and then under Player Profile is the Random seed option, uncheck it for your case.
 
Level 10
Joined
Jul 22, 2007
Messages
261
no Sh** i can find Prefecences its just i cant find where he means
Use fixed random seed

i put a shot of my prefs and its not there :confused:
 

Attachments

  • Prefs.JPG
    Prefs.JPG
    28.9 KB · Views: 95
Status
Not open for further replies.
Top