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

[Trigger] Creating units at regions

Status
Not open for further replies.
Level 9
Joined
May 30, 2008
Messages
430
i need trigger that create 1 unit at center of 47 regions (1 unit at center of every region) at map initialization (regions are set as variable also the units). I can't think the trigger at the moment don't know why but i am tired and i don't wonna create 47 triggers "create unit at region" so please help :wink:
 
Level 3
Joined
Jan 30, 2005
Messages
38
Ok, dont know what your unit variables are doing.. was it what we were doing last week?
Also, what player are they being created for?

Use a simple loop.

Do this:
Assign your regions to variables, which you said you've done..
  • Regions
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set SetRegion[1] = SpawnSite1 <gen>
      • Set SetRegion[2] = SpawnSite2 <gen>
etc etc..

Then do creation:
  • Create
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 47, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at (Center of SetRegion[(Integer A)]) facing Default building facing degrees
 
Level 9
Joined
May 30, 2008
Messages
430
i was thinking to try this with intiger A but i still don't know for what is using this exactly i will try it now tnx for responding NoMAd :grin:

Edit: tnx again for the help, the trigger is ok
 
Last edited:
Level 9
Joined
May 27, 2006
Messages
498
i was thinking to try this with intiger A but i still don't know for what is using this exactly

Integer A is an action, that loops (repeats) actions you declared inside it as long as it reaches the second number you entered.

  • For each (Integer A) from 1 to 47 (the second number you set) [...]
In this case it would do the actions 47 times.
This action is very useful if you have many same actions you have to do for each player or to create many units.
 
Status
Not open for further replies.
Top