Scenario: Counter for total units produced

Hi again, while i was bored I created a scenario for test purposes, where 2 CPU controlled factions fight against other with units being created continuosly. What i need to do is make a counter for units created so when it hits a certain number, it stop of producing.
Im not talking about controlled units, instead is the total of units created, I dont find a trigger for that
im using ScmDraft 2

If the two computer players are genuine computer players in that they are free to build and attack at will, then that will be difficult (to my perhaps limited knowledge). If you had triggers to spawn units, then it would be easy.

What is easy to do is to count deaths. With only knowing the limited info you provided, it would seem to me that if you only want them to be able to create a certain number of units (“x”), then although it won’t be as accurate, you could get a rough thing going by stopping the AI script when they have suffered “x - 40” (for example) deaths.

Feel free to provide more info, then I can try writing a better response!

Well thanks, what im doing is like for ie “5000 marines vs 5000 zealots” i have seen videos of it on SC2, but on SCR it wont work putting all the whole units at once, so im creating them in groups much more smaler, ans as soon they appear they are ordered to attack to the opossing direction. The only thing i need to do is when to stop production.

Well that sounds much easier then. A couple of options:

Either create the units at set time intervals, for example every 30 seconds 100 zealots are created.
Or create a bunch of new units when they have suffered a number of deaths of the unit (e.g. suffer 50 deaths of Zealot, create 100 more).

Then try this:

Set switch 1.
Set deaths of unit (that is not being used on the map): set to 0 deaths.
Note: deaths work really well as a counter, and that’s what I’m setting up here.

Switch 1 is set.
Condition based on time or deaths of units, as mentioned above.
Create units.
Modify death count of unit (that is not being used on map): add 1 deaths.
Preserve trigger.

Player has suffered [number of] deaths of unit (that is not being used on map). Remember that this number will be the number of multiples of units created/killed as set out in the trigger above.
Clear switch 1.

For example, let’s say you want 100 Marines being sent forth every 30 seconds (you need time to let them clear the spawn area!). You would then add 1 deaths to a unit such as a Zergling or Defiler (something not being used… even critters can be used here) every time the Marines are spawned. The final trigger would then be when 50 deaths of that unused unit is reached (50x100 = 5000), clear the switch. No more units are produced.

Well thanks for your guidance, using deaths as a counter is a nice workaround, have read about it before.
I was wondering using “player X commands 100 units” or “player bring X units in spawn area” but need to sum all them up to reach the desired whole number, then i can put a leaderboard showing total of units being produced by both sides.

UPDATE: The Leaderboard Units score does just what i need, just that each unit have different score points. If only there would be a way of modifyin these values…

Maybe set up a custom score? Or the Modify Score trigger? That way you might be able to set the score to 1 for each unit.

Thats sounds good, until there is a way to set all units score value to 1