unit Spwaning help

E

edward3455

Guest
ok i'm haveing troubles finding the tect for this: For every barracks owned by player 1, spawn 6 footmen every 60 seconds at this specific region.

Lets say player 1 has 2 barracks, then spawn 12 footmen every 60 seconds or when player 1 has 3 barracks, then spawn 18 footmen every 60 seconds. this is why i want it that way.

How do I make this work?
 

OneBadPsycho

10100111001
Reaction score
93
Code:
Spawn
    Events
        Time - Every 60.00 seconds of game time
    Conditions
    Actions
        Set TempPlayers = (All players)
        Player Group - Pick every player in (TempPlayers) and do (Actions)
            Loop - Actions
                Unit - Create (6 x (Number of units in (Units owned by (Picked player) of type Barracks))) Footman for (Picked player) at ((Picked player) start location) facing Default building facing degrees
        Custom script:   call DestroyForce (udg_TempPlayers)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
This leaks several unit groups.

More importantly though:
> Set TempPlayers = (All players)
> Custom script: call DestroyForce (udg_TempPlayers)

You are destroying "All players" (which doesn't leak btw).
This will only work once...


Set UnitGroup = Units of type Barracks
Pick every unit in UnitGroup and do
- Set Point = Start location of (Owner of (Picked unit))
- Unit - Create 6 Footman for (Owner of (Picked unit)) at Point facing Default
- Custom script: call RemoveLocation( udg_Point )
Custom script: call DestroyGroup( udg_UnitGroup )
 

deathsite

New Member
Reaction score
1
Player Group - Pick every player in (TempPlayers) and do (Actions)
i only see leaderboard.i dont see loop anywhere
 

Sil3nt

SUP?
Reaction score
134
Code:
Untitled Trigger 001
    Events
        Time - Every 60.00 seconds of game time
    Conditions
    Actions
        Set TempPlayers = (All players)
        Set TmpPoint = (Center of (Playable map area))
        Player Group - Pick every player in TempPlayers and do (Actions)
            Loop - Actions
                Set TmpGroup = (Units owned by (Picked player) of type Barracks)
                Unit - Create (6 x (Number of units in TmpGroup)) Footman for (Picked player) at TmpPoint facing Default building facing degrees
        Custom script:   call DestroyGroup (udg_TmpGroup)
        Custom script:   Custom script: call RemoveLocation (udg_TmpPoint)

This spawns the units only in 1 region. Use a region/point array if you want it to spawn in their own locations
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
lol maybe show it to him without leak removal (no one understands that :p)

Code:
Untitled Trigger 001
    Events
        Time - Every 60.00 seconds of game time
    Conditions
    Actions
       Player Group - Pick every player in (All Players) and do (Actions)
            Loop - Actions
                Unit - Create (6 x (Number of units in (Units owned by (Picked player) of type Barracks))) Footman for (Picked player) at (Center of your Region) facing Default building facing degrees
 
E

edward3455

Guest
i can't find that part out, gow do i get to that?

(6 x (Number of units in (Units owned by (Picked player) of type Barracks)))
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
arithmethic-->count units in unit group-->units owned by player of type
and then ok ok ok^^
 

Sim

Forum Administrator
Staff member
Reaction score
534
Arithmetic should've provided that.

> arithmethic-->count units in unit group-->units owned by player of type

Doing this should leave behind something like "1 + (Number of units in (Units owned by (Picked player) of type Barracks))"

Replace 1 with 6, and "+" with "x".
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top