limiting production of a unit for the whole game
-
I want a unit to be build only once or a few times in a game, doesn't matter by whom.
reaching that limit auf builds should end this production option forever for everyonean example would be:
Switzerland is neutral with a factory
who captures Switzerland will get the mountain troops via a trigger, e.G. for Germany
..
<option name="productionRule" value="productionGermany:mountain troops"/>
...
I want to have a total limit of 3 units of those mountain troops to be build in the whole game.let's say Germany captures Switzerland and builds all 3 of them
later Switzerland captured by UK. How do I prevent that UK also builds those units?So any <option name='uses' value='1'/> will not help.
It limits one nation (e.g. Germany), while another one (Italy) can still use it.same with <option name='maxBuiltPerPlayer' value='1'/>
that will also limits only one nation.<option name='unitPresence' value='mountain troops' count='1'/>
on the whole map is also useless, the 3 build units might have been taken as casualities in a battle, so this would allow to build new ones.I need a variable that is 0 at the start of the game and will finally reach 3.
So I could make a condition out of it.Any Idea how to solve this this?
-
Not to hard. I would use a 'switch' condition to insure that only one player received the captured unit, and a limited 'resource' to build that captured unit.
<!-- Add to the resourceList --> <resourceList> ... <resource name="CapturedMountainTroops"/> </resourceList> <!-- Add to production --> <production> ... <productionRule name="buyCapturedMountainTroops"> <cost resource="PUs" quantity="4" /> <cost resource="CapturedMountainTroops" quantity="1"/> <result resourceOrUnit="Mountain troops" quantity="1"/> </productionRule> ... </production> <!-- The 'switch' trigger --> <attachment name="conditionAttachmentCapturedMountainTroops" attachTo="Switzerland" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="switch" value="true"/> </attachment> <!-- If Germany captures the factory --> <attachment name="triggerAttachmentGermanyCapturesSwisFactory"attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <!-- Add 'switch' conditions --> <option name="conditions" value="...:conditionAttachmentCapturedMountainTroops"/> <!-- Give Germany 3 resources --> <option name="resource" value="CapturedMountainTroops"/> <option name="resourceCount" value="3"/> <!-- Change 'switch' to false --> <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentCapturedMountainTroops"/> <option name="playerProperty" value="switch" count="false"/> </attachment>
Because every player should check the same 'switch' once its false it will block all other players and the resource will insure only a certain amount of units will be built.
Next...
Cheers...