Events
Unit - Any Unit construction progress is Completed
Local Variables
Conditions
(Unit type of (Triggering unit)) == Barracks
(Owner of (Triggering unit)) == 1
Actions
Variable - Set Variable = (Variable + 1)
With that simple method, the Variable will = the # of Barracks.
You could also add Conditions to check other crap.
Now with that Variable you can create a trigger for spawning like this:
Events
Timer - Every 5.0 seconds of Game Time
Actions
Unit - Create Variable Zergling for player 2 at (Center of (Playable map area)) facing 270.0 degrees (No Options)
The Create Variable part would just create Zerglings = to the number of Barracks owned by Player 1.]
You could easily make a mathematical formula to work with whatever you had in mind for spawning.
One example: Create 10 + (Variable / 2) Zerglings
^ Using the Arithmetic (Integer) option in this case, 10 Zerglings + 1/2 of Variable (1/2 of Barracks owned by Player 1 in this case) will spawn. Say Player 1 has 10 Barracks, then 15 Zerglings will spawn (10 + 1/2 of 10).
Well the layout for this didn't work out, but hopefully this will still make sense :)
@Diablito816: Go
You could create something like this:
Events Unit - Any Unit construction progress is Completed Local Variables Conditions (Unit type of (Triggering unit)) == Barracks (Owner of (Triggering unit)) == 1 Actions Variable - Set Variable = (Variable + 1)
With that simple method, the Variable will = the # of Barracks. You could also add Conditions to check other crap.
Now with that Variable you can create a trigger for spawning like this: Events Timer - Every 5.0 seconds of Game Time Actions Unit - Create Variable Zergling for player 2 at (Center of (Playable map area)) facing 270.0 degrees (No Options)
The Create Variable part would just create Zerglings = to the number of Barracks owned by Player 1.] You could easily make a mathematical formula to work with whatever you had in mind for spawning.
One example: Create 10 + (Variable / 2) Zerglings
^ Using the Arithmetic (Integer) option in this case, 10 Zerglings + 1/2 of Variable (1/2 of Barracks owned by Player 1 in this case) will spawn. Say Player 1 has 10 Barracks, then 15 Zerglings will spawn (10 + 1/2 of 10).
Well the layout for this didn't work out, but hopefully this will still make sense :)