• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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