• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Random Hero probelm

Status
Not open for further replies.
Level 9
Joined
Sep 20, 2015
Messages
385
Hello. I have in my map a circle of power hero selection system. There is also the Random Hero option.
To do that i created a unit-type array variable, and in map initializaion i set all the variables with the hero type i want like

Set Customhero[x] = Archmage


When a unit enter the circle the command is

Unit - Create unit-type of CustomHero[random integer between 0 and Y]

It seems to work but the problem is when i start the map and i enter the circle there is always the same hero. The numbers are 0 -13. Even if it's random the game create always the 12 integer hero. I tryed many times and it always create the 12 integer hero.

Can someone tell me why? and how to fix this?

Also, i discovered there is always the same sequances of integers. The first is 12 after 8 and 5. Always the same every time i start the map.

Thank you
 
Level 15
Joined
Aug 31, 2009
Messages
775
If you're wondering what the purpose of this is, basically it allows you to do some really funky stuff like play a battle out PRECISELY the same every time you launch the map, because the random seed is exactly the same, then even things like the unit's variable damage will be the same for every hit each time.

It's really bizarre to see a battle go exactly the same multiple times, but can be interesting if you change one tiny little thing and see how much it changes.

It's like learning about the butterfly effect...
 
Status
Not open for further replies.
Top