• 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.

4 Random Units in Group... Except they're always the same

Status
Not open for further replies.
Level 7
Joined
Nov 18, 2012
Messages
272
I made a command that looks something like this:
  • Unit Group - Pick 4 Random Units in Unit Group and Do Actions
Except, it always picks the same 4 units.

Is it because it only runs once? It's not at map initialization...

Should I use variable?
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
I tried testing the map again but it's still the same units.

that's what i said, when you're testing the map again and again, it will just picks the same units. but if in the game, the trigger runs more than once, the first one are the same units, but the rest will pick another random units.

it's different though when you start the map outside the editor (directly open them from warcraft). for every game you start, the picked unit will be different.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Well I tried setting variable.
  • Set reverseheroes = (Random 4 units from (Units owned by Neutral Passive matching (((Picked unit) is A Hero) Equal to True)))
Is "Picked Unit" correct for this?

Picked unit is when the unit is already picked, when you do the pick action, the unit haven't been picked yet, so the right one is Matching unit.

anyway, i think setting the group into a variable won't help at all. but testing them yourself is always a good idea.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
I think I know why, I had a problem with randomised events once before. The randomised events only malfunction
during the "Test map" feature, but not in actual games. Go to:

File - Prefrences - Test Map (Tab)

And deselect "Use Fixed Random Seed"

I'm not 100% sure why this option exists though.
 
Status
Not open for further replies.
Top