• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Need help in a trigger to create units!!!!

Status
Not open for further replies.
Level 6
Joined
Jul 17, 2008
Messages
185
Hi...

basically what i want to do is to create 20 units in different random points of the map, but when i do this:

  • Unit - Create 20 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
This creates 20 mines only at 1 random position, so i changed the trigger:

  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
  • Unit - Create 1 Goblin Land Mine for Player 4 (Purple) at (Random point in (Playable map area)) facing Default building facing degrees
this seems a very ridiculous thing and i wanted to know how to do it in a better way

Help pls...
 
You have integer A and integer B because you may want to have a loop inside of a loop.

Using

  • For every (Integer A) from 1 to 6
    • Loop
      • For every (Integer A) from 1 to 6
        • Loop
          • *do your things*
Would not work too well. So you need to use integer B for the other.

And your trigger:
  • For every (Integer A) from 1 to 20
    • Loop
      • Set Temp_Loc_1 = (Random point in (Playable map area))
      • Unit - Create 1 *unit* at Temp_Loc_1 facing...
      • call RemoveLocation(udg_Temp_Loc_1)
 
Status
Not open for further replies.
Back
Top