thanks for the email with tips, it helped a lot. I didn't know that count gets put ahead of value, with a : in between them. That makes sense though, as I had previously read through the national objectives and wondered why count was first.
I was able to complete the re-write of "productionPerXTerritories" and also a re-write of "NoPuPurchase" delegate, feel free to double check my work. I tested it on 3 different maps, and couldn't find any bugs.
which would give 1 goblin per 2 territories and 1 ogre per 4 territories
if you do it the old way:
option name="productionPerXTerritories" value="2"
then it will automatically become:
option name="productionPerXTerritories" value="infantry" count="2" when the XML gets parsed.
also, i found a bug in the old way of doing things inside the NoPuPurchase delegate, which basically meant that productionPerValuedTerritoriesRestricted would not work properly if combined with productionPerXTerritories.
Now it works fine.
if you have ValuedRestricted turn on, but don't have a productionPerXTerritories set, then you automatically get 1 infantry for each territory you own that has a PU value > 0. (so in other words, this works and is backwards compatible for pacific original)
The only big things left to do now are:
1. Shipyards fix
2. Support Attachment that gives +1 movement to a specific unit, if it begins the turn in the same territory.
3. AA guns that only shoot at conventional attackers, and AA guns that only shoot at Strategic Bombing that targets a specific unit.
4. Escorts and Interceptors
5. Unit attachments: "isNonCombat" and "isCapturable". I think Kev is working on these two.
6. Factories patch re-work. Must be done after Kev finishes w/e he is working on. (I already did the can't place on islands bit earlier, too).