Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    1. Home
    2. Popular
    Log in to post
    • All categories
    • News
    •      Donation Drive 2025/26
    • Player Help
    • Bug Reports
    •      (ARCHIVED) Bug Reports
    • Feature Requests & Ideas
    • The War Club
    • Maps & Mods
    • Map Making
    •      XML Options Browser
    • Development
    • AI
    • Play By Email
    • Play By Forum
    • Tournaments
    •      Revised Tournament Of Champions
    •      V341 - 42 (AA 50 Anniversary)
    •      Revised TECH ONLY Tournament
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics
    • All Time
    • Day
    • Week
    • Month
    • Panther

      Quick connection fix needed in ww2v2
      Bug Reports • • Panther

      4
      1
      Votes
      4
      Posts
      102
      Views

      Panther

      @beelee said in Quick connection fix needed in ww2v2:

      @panther

      hmm ... I thought this had been fixed. Maybe that was for a mod. Anyway @RogerCooper has the power.

      I checked the current repo's xml files before posting.

    • RogerCooper

      Problem with foreach
      Map Making • • RogerCooper

      4
      1
      Votes
      4
      Posts
      109
      Views

      RogerCooper

      @rogercooper I want to post my complete solution as it has some tricks people might want to use. I was surprised that you can use both a cartesian join "^" and a standard join ":" in the same foreach structure.

      Another neat trick is that you can use Export/Export game.xml file to resolve all the for eaches. Useful if you want to check that the result is correct or if you need to customize some entries.

      <variableList> <variable name="MajorPower"> <element name="Britain"/> <element name="Soviet_Union"/> <element name="United_States"/> <element name="Western_Europe"/> </variable> <variable name="NeutralArea"> <element name="Afghanistan"/> <element name="Borneo/Celebes"/> <element name="Ethiopia"/> <element name="Finland"/> <element name="Iran"/> <element name="Ireland"/> <element name="Java"/> <element name="Rio de Oro"/> <element name="Spain"/> <element name="Sumatra"/> <element name="Sweden"/> <element name="Switzerland"/> <element name="Thailand"/> <element name="Tibet"/> </variable> <variable name="NeutralSetup"> <element name="infantry"/> <element name="infantry"/> <element name="infantry:infantry"/> <element name="infantry:infantry:infantry"/> <element name="infantry:armor:fighter"/> <element name="infantry"/> <element name="infantry"/> <element name="infantry"/> <element name="infantry:infantry:infantry:infantry:armor:fighter"/> <element name="infantry"/> <element name="infantry:infantry:infantry:armor:fighter"/> <element name="infantry:infantry:infantry:fighter"/> <element name="infantry:infantry"/> <element name="infantry:infantry"/> </variable> </variableList>

      and

      <attachment name="conditionAttachmentEveryTurn" attachTo="United_States" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="rounds" value="1-100"/> </attachment> <attachment foreach="$NeutralArea$" name="conditionAttachment@NeutralArea@Non_Aligned" attachTo="Non_Aligned" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" value="@NeutralArea@" count="1"/> </attachment> <attachment foreach="$NeutralArea$" name="triggerAttachment@NeutralArea@RemoveUnits" attachTo="Non_Aligned" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="players" value="Non_Aligned"/> <option name="uses" value="1"/> <option name="removeUnits" value="@NeutralArea@:All" count="5"/> </attachment> <attachment foreach="$MajorPower$^$NeutralArea$:$NeutralSetup$" name="triggerAttachment@MajorPower@@NeutralArea@" attachTo="@MajorPower@" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentEveryTurn"/> <option name="conditions" value="conditionAttachment@NeutralArea@Non_Aligned"/> <option name="players" value="@MajorPower@"/> <option name="chance" value="1:80"/> <option name="chanceIncrementOnFailure" value="1"/> <option name="when" value="before:@MajorPower@Purchase"/> <option name="placement" value="@NeutralArea@:@NeutralSetup@" /> <option name="changeOwnership" value="@NeutralArea@:Non_Aligned:@MajorPower@:false"/> <option name="activateTrigger" value="triggerAttachment@NeutralArea@RemoveUnits:1:false:false:false:false"/> <option name="uses" value="1"/> </attachment>
    • 1 / 1