[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:
 
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
 
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.
Back
Top