• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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 14
Joined
Aug 31, 2009
Messages
774
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