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

How to make a random thing?

Status
Not open for further replies.
Level 9
Joined
Aug 27, 2004
Messages
471
I need to know the trigger that makes the game realize you havent picked a hero and need one.
Also im wondering how to make it so that the hero given is random but not a hero thats been chosen already (im guessing this is a big trigger)
 
Level 3
Joined
Aug 21, 2004
Messages
57
This is simple enough to do.

1)Make a Boolean variable for each player. Call it something like [HasHero], and have it's default value to be "False".

2)I'm guessing that your Heroes will already be on the map from the start. Right at Melee Initialization, Add all of your Heroes into a Unit Group, let's call it [Heroes} for now.

3)Make a trigger for each player that has the Condition: (HasHero=False)=True. The Action would be to Pick a Random Unit from Heroes and then change that unit's ownership to that player, then remove that unit from the Heroes Unit Group. **For these triggers, I think they shouldn't occur simultaneously.**

4)Test is out.

Good luck.
 
Status
Not open for further replies.
Top