• 🏆 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!

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