We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
I don't recommend cycling because it usually takes many trigger cycles which can cause conflicts leading to bugs.
Use binary countoffs to double every single unit the computer controls. Like that:
C: If P1 (computer) brings at least 512 zerglings to anywhere
C: If Force 2 (humans) has suffered at least 1 death of unlocked
A: create 512 zerglings for P1
A: give 1024 zerglings to P11
C: If P1 (computer) brings at least 256 zerglings to anywhere
C: If Force 2 (humans) has suffered at least 1 death of unlocked
A: create 256 zerglings for P1
A: give 512 zerglings to P11
... etc. for 128, 64, 32, 16, 8, 4, 2, 1 zerglings
And make the same trigger for every unit P1 can control that should get doubled.
This requires a lot of repeated/similar triggers, so maybe you want to use a trigger duplicator.
End the duplication process with this trigger
C: If P1 controls at most 0 men
C: If Force 2 (humans) has suffered at least 1 death of unlocked
A: Give all men from P11 to P1
A: Set deaths of unlocked for Force 2 to 0
All this happens within a single trigger loop so you don't have to fear many side effects.
---
However my personal recommendation is to keep it simple. Instead of trying to dynamically accurately double all unit counts (no player is looking at the replay and counting unit numbers) do it statically.
Play a few games and estimate the point in time when players unlock their tech and then estimate unit numbers and then have 1 simple trigger (condition is still unlocked) that creates a flat amount of zerglings, hydras, mutas, etc.
Post has been edited 1 time(s), last time on Apr 18 2011, 12:13 pm by NudeRaider.