This allows you specify how many squads/buildings can be built with respect to another squad/building count.
Here's how to install it:
download the scar file and the lua file to your "mod/Data/Scar/winconditions/" directory.
Here's how to add your entries into the scar file:
you can open the scar file with notepad(not wordpad). There is a table at the top of the file called "unitRatio_list" and it has entries in the form:
{"bluePrint", n, "bluePrint", m}
You can add as many of these as you wan't, I'm pretty sure but make sure you are using a squad or entity blueprint(as they are so named in the attribute editor).
you must also divide entries with a coma.
heres how to run it:
Run your mod and go to game options and "enforce unit ratios" should be on the list of game rules. You can make it a mandatory rule(so others can't unclick it) by going to the lua file(notepad) and changing always_on to true.
extra notes:
Any scar errors will make the game stop, you can look at the console to see what they are and then close it.
The entries I have in the file currently enforce 1 marine squad per generator and one assault marine squad per space marine squad.
As this uses a rule that is called without an interval(because it enforces unit production) it may add a little overhead or lag. You can fix this(but make it possible to add to production between cycles) by changing the "Rule_Add(Rule_EnforceUnitRatio)" to "Rule_AddInterval(Rule_EnforceUnitRatio, seconds)" I have not yet confirmed if this scar will cause sync errors etc. I make no guarantees etc etc.
If you wan't to give me credit you can but not required.
Comments or suggestions please post.



