Subcategories

  • 2
  • 3
  • 22
  • 2
  • 4
  • 6
  • 4
  • 2
  • 10
  • 6
  • 14
  • 8
  • 2
  • 1
  • 5
  • 5
  • 5
  • 6
  • 6
  • 7

Recent Posts

  • W

    @thedog said in Buying Tech as Units:

    Adding the 10th or 11th+ player was not a chore any more.

    This is why I pointed to you. I've learned a lot just by reading your xmls.

    @gregorek said in Buying Tech as Units:

    I chose the replacement path versus adding/removing rules.

    If you still want to do it this way, then create a frontier for each evolution:

    <productionFrontier name="production"> <frontierRules name="buytyrannosaurus"/> <frontierRules name="buystegosaurus"/> <frontierRules name="buytriceratops"/> <frontierRules name="buyankylosaurus"/> <frontierRules name="buycoelophysis"/> <frontierRules name="buyiguanodon"/> <frontierRules name="buypachycephalosaurus"/> <frontierRules name="buyornithomimus"/> <frontierRules name="buyplateosaurus"/> <frontierRules name="buyparasaurolophus"/> <frontierRules name="buypterodactylus"/> <frontierRules name="buysharovipteryx"/> <frontierRules name="buytylosaurus"/> <frontierRules name="buyliopleurodon"/> <frontierRules name="buydiplodocus"/> </productionFrontier> <productionFrontier name="feathersProduction"> <frontierRules name="buytyrannosaurus"/> <frontierRules name="buystegosaurus"/> <frontierRules name="buytriceratops"/> <frontierRules name="buyankylosaurus"/> <frontierRules name="buycoelophysis"/> <frontierRules name="buyiguanodon"/> <frontierRules name="buypachycephalosaurus"/> <frontierRules name="buyornithomimus"/> <frontierRules name="buyplateosaurus"/> <!-- <frontierRules name="buyparasaurolophus"/> Removed for feathers evolution --> <frontierRules name="buypterodactylusFeathered"/> <!-- added for feathers evolution --> <frontierRules name="buypterodactylus"/> <frontierRules name="buysharovipteryx"/> <frontierRules name="buytylosaurus"/> <frontierRules name="buyliopleurodon"/> <frontierRules name="buydiplodocus"/> </productionFrontier>

    Now change the trigger to swap frontiers:

    <attachment foreach="$GamePlayers$^$Evolutions$" name="triggerAttachment_@GamePlayers@_@Evolutions@" attachTo="Kimmeridgian" javaClass="TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_@GamePlayers@_@Evolutions@"/> <!--Change to Evolutions frontier --> <option name="frontier" value="@Evolutions@Production"/> <!-- Removes Evolutions unit --> <option name="removeUnits" value="all:@Evolutions@" count="1"/> <!-- To be done after the place phase. Maybe? --> <option name="when" value="after:@GamePlayers@Place"/> <option name="uses" value="1"/> </attachment>

    And there you go. You would still need GamePLayers and Evolutions but not AddUnit and RemoveUnit.

    Cheers...

    read more
  • @wc_sumpton said in Buying Tech as Units:

    How's it going? @TheDog is great at using variables and for each and this process is a good candidate.

    It certainly is!.

    My use of foreach all stemmed from Shogun Advanced politics, it started out with 8 players then expanded piecemeal to a final 15 players. Along the way I learnt how to use Foreach and cut thousands of line of code to hundreds. 🙄. Adding the 10th or 11th+ player was not a chore any more. 😁

    read more
  • W

    @GREGOREK

    How's it going? @TheDog is great at using variables and for each and this process is a good candidate.

    <variableList> <!-- This is a list of players minus Tithonian --> <variable name="GamePlayers"> <element name="Kimmeridgian"/> <element name="Oxfordian"/> <element name="Callovian"/> <element name="Bathonian"/> <element name="Bajocian"/> <element name="Aalenian"/> <element name="Toarcian"/> <element name="Pliensbachian"/> <element name="Sinemurian"/> <element name="Hettangian"/> </variable> <!-- A list of evolutions --> <variable name="Evolutions"> <element name="feathers"/> </variable> <!-- The unit effected by the above evolution --> <variable name="RemovedUnit"> <element name="pterodactylus"/> </variable> <!-- Unit created by the above evolution --> <variable name="AddedUnit"> <element name="pterodactylusFeathered"/> </variable> </variableList> <!-- This list is positioned above the <map> section --> <map> <!-- Territory Definitions --> <territory name="Da"/> <territory name="Db"/> <territory name="Dc"/> ... </map

    Now some trigger ideas.

    <!-- Check the whole map for evolutions by player --> <!-- $GamePlayers$ is the list of players --> <!-- $Evolutions$ is the list of evolutions --> <!-- The joining "^" create statements for each player and each evolution --> <!-- @GamePlayers@ and @Evolutions@ takes the next value from each list --> <attachment foreach="$GamePlayers$^$Evolutions$" name="conditionAttachment_@GamePlayers@_@Evolutions@" attachTo="@GamePlayers@" javaClass="RulesAttachment" type="player"> <option name="directPresenceTerritories" value="map" count="1"/> <option name="unitPresence" value="@Evolutions@" count="1"/> </attachment> <!-- The joining ":" create statements for each evolution with AddedUnit and RemovedUnit --> <!-- So, this will only work as long there is a one to one relationship between values in each list --> <attachment foreach="$GamePlayers$^$Evolutions$:$AddedUnit$:$RemovedUnit$" name="triggerAttachment_@GamePlayers@_@Evolutions@_@AddedUnit@" attachTo="Kimmeridgian" javaClass="TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_@GamePlayers@_@Evolutions@"/> <!-- Adds AddedUnit to production --> <option name="productionRule" value="@GamePlayers@Production:buy@AddedUnit@"/> <!-- Removes RemovedUnit and Evolutions from production --> <option name="productionRule" value="@GamePlayers@Production:-buy@RemovedUnit@"/> <option name="productionRule" value="@GamePlayers@Production:-buy@Evolutions@"/> <!-- Removes Evolutions unit --> <option name="removeUnits" value="all:@Evolutions@" count="1"/> <!-- To be done after the place phase. Maybe? --> <option name="when" value="after:@GamePlayers@Place"/> <option name="uses" value="1"/> </attachment>

    The above will create the following;

    <attachment name="conditionAttachment_Kimmeridgian_feathers" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Oxfordian_feathers" attachTo="Oxfordian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Callovian_feathers" attachTo="Callovian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Bathonian_feathers" attachTo="Bathonian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Bajocian_feathers" attachTo="Bajocian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Aalenian_feathers" attachTo="Aalenian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Toarcian_feathers" attachTo="Toarcian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Pliensbachian_feathers" attachTo="Pliensbachian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Sinemurian_feathers" attachTo="Sinemurian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="conditionAttachment_Hettangian_feathers" attachTo="Hettangian" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="1:map"/> <option name="unitPresence" value="1:feathers"/> </attachment> <attachment name="triggerAttachment_Kimmeridgian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Kimmeridgian_feathers"/> <option name="productionRule" value="KimmeridgianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="KimmeridgianProduction:-buypterodactylus"/> <option name="productionRule" value="KimmeridgianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:KimmeridgianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Oxfordian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Oxfordian_feathers"/> <option name="productionRule" value="OxfordianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="OxfordianProduction:-buypterodactylus"/> <option name="productionRule" value="OxfordianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:OxfordianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Callovian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Callovian_feathers"/> <option name="productionRule" value="CallovianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="CallovianProduction:-buypterodactylus"/> <option name="productionRule" value="CallovianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:CallovianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Bathonian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Bathonian_feathers"/> <option name="productionRule" value="BathonianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="BathonianProduction:-buypterodactylus"/> <option name="productionRule" value="BathonianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:BathonianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Bajocian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Bajocian_feathers"/> <option name="productionRule" value="BajocianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="BajocianProduction:-buypterodactylus"/> <option name="productionRule" value="BajocianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:BajocianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Aalenian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Aalenian_feathers"/> <option name="productionRule" value="AalenianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="AalenianProduction:-buypterodactylus"/> <option name="productionRule" value="AalenianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:AalenianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Toarcian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Toarcian_feathers"/> <option name="productionRule" value="ToarcianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="ToarcianProduction:-buypterodactylus"/> <option name="productionRule" value="ToarcianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:ToarcianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Pliensbachian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Pliensbachian_feathers"/> <option name="productionRule" value="PliensbachianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="PliensbachianProduction:-buypterodactylus"/> <option name="productionRule" value="PliensbachianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:PliensbachianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Sinemurian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Sinemurian_feathers"/> <option name="productionRule" value="SinemurianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="SinemurianProduction:-buypterodactylus"/> <option name="productionRule" value="SinemurianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:SinemurianPlace"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachment_Hettangian_feathers_pterodactylusFeathered" attachTo="Kimmeridgian" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Hettangian_feathers"/> <option name="productionRule" value="HettangianProduction:buypterodactylusFeathered"/> <option name="productionRule" value="HettangianProduction:-buypterodactylus"/> <option name="productionRule" value="HettangianProduction:-buyfeathers"/> <option name="removeUnits" value="1:all:feathers"/> <option name="when" value="after:HettangianPlace"/> <option name="uses" value="1"/> </attachment>

    To add another Evolution, "spike_tail" for ankylosaurus to create ankylosaurusSpikedTail, spike_tail would be added to Evolutions and ankylosaurus added to RemovedUnit and ankylosaurusSpikedTail to AddUnit.
    Of course, "spike_tail" and ankylosaurusSpikedTail would need to be added to units, production and attachments.

    Hope this is helpful.

    Cheers...

    P.S. foreach can only be used in the <attachmentList> section. In "mega_new_elk" I use foreach to create the territoryAttachment. This can also be done with unitAttachment and Evolutions.

    <attachment foreach="$Evolutions$" name="unitAttachment" attachTo="@Evolutions@" javaClass="UnitAttachment" type="unitType"> <option name="maxBuiltPerPlayer" value="1"/> </attachment>

    Cheers...

    read more
  • W

    @gregorek

    Nice, tested and works.

    @gregorek said in Buying Tech as Units:

    I chose the replacement path versus adding/removing rules.

    That's okay if you're only doing a couple of evolutions and each evolution updates most/all units. But doing more than 3 or 4 might make the production harder to manage.

    As always, we are to help.

    Cheers...

    read more