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

Spawning a random unit

Status
Not open for further replies.
Level 7
Joined
May 30, 2018
Messages
290
Hey guys, so I now have this following trigger, which choses a random unit from an area on the map, where every possible unit is placed (@RG00 helped me out a lot here)
upload_2019-2-14_22-54-11.png

but now I need a trigger through which a random unit, that gets chosen, actually spawns for every player. Maybe someone could help me out

Thanks in advance !
 
Level 12
Joined
Dec 11, 2014
Messages
665
  • Actions
    • Set TempUnitGroup = (Units in Region 000 <gen>)
    • Set TempUnit = (Random unit from TempUnitGroup)
    • Unit - Create 1 (Unit-type of TempUnit) for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
Pretty much like this. This example leaks a group and a location, but works. You can read more about leaks here and here.
 
Status
Not open for further replies.
Top