Categories and/or tags


  • Admin

    PR: https://github.com/triplea-game/triplea/pull/4791

    As soon as that's merged, you can test it in the pre-release.


  • Admin

    This is now available in the pre-release. I've updated the first post to reflect examples of how to use it and will be adding similar ones to POS2 XML.


  • Admin

    @redrum I am looking forward to testing 😃

    Question: Can the names of the variableLists be used instead of unit listing in attachments like targetsAA, repairsUnits, unitType etc.? Like:

    <option name="targetsAA" value="PlayerLandUnits:AILandUnits"/>
    Or
    <option name="repairsUnits" value="1:PlayerHeroUnits:PlayerMultipleHPUnits:Dragon"/>


  • Admin

    @Frostion Yes. Though I updated the original proposal slightly. Any time you reference a variable you need to put $variableName$. So for you example it would be like this:

    <option name="targetsAA" value="$PlayerLandUnits$:$AILandUnits$"/>
    

    Here is an example I'm doing for some mystery map in development 🙂

            <variable name="MajorPlayers">
                <element name="Bolsheviks"/>
                <element name="France"/>
                <element name="Britain"/>
                <element name="Russia"/>
                <element name="Germany"/>
                <element name="Austria-Hungary"/>
                <element name="Ottomans"/>
                <element name="Usa"/>
                <element name="Italy"/>
            </variable>
    
            <attachment name="unitAttachment" attachTo="RecruitmentCenter" javaClass="UnitAttachment" type="unitType">
                <option name="movement" value="0"/>
                <option name="attack" value="0"/>
                <option name="defense" value="0"/>           
                <option name="isInfrastructure" value="true"/>
                <option name="canBeDamaged" value="true"/>
                <option name="maxDamage" value="10"/>
                <option name="maxOperationalDamage" value="8"/>
                <option name="destroyedWhenCapturedBy" value="$MajorPlayers$"/>
                <option name="canDieFromReachingMaxDamage" value="true"/>            
                <option name="isConstruction" value="true"/>
                <option name="constructionType" value="rcProduction"/>
                <option name="constructionsPerTerrPerTypePerTurn" value="1"/>
                <option name="maxConstructionsPerTypePerTerr" value="1"/>           
            </attachment>
    

  • Donators

    @redrum
    Been playing around with this on the 'Invasion U.S.A.' map.

    Real nice Job!!

    Have you thought anymore on being able to do a 'foreach' inside a 'foreach'?

    Cheers...


  • Admin

    @wc_sumpton A little bit. Most likely it'll only allow 2 levels of foreach (any more than that is just generating probably more attachments then you should be). It'll look something like this:

    <attachment foreach="$Players$^$Territories$"/>
    

    Where if I had say 5 players and 100 territories then this would loop over each of those to create 500 attachments, 1 for each pair of player and territory.


  • Donators

    @redrum
    Yep, have the players territories loop. Sounds good thanks for the quick answer!

    Cheers...


  • Admin

    @redrum I have tried to implement this new feature but I cant get it to work. There are no errors but the rules that I set do not seem to be taken into account during play. This is the top code I have in the XML:

    <?xml version="1.0"?>
    <!DOCTYPE game SYSTEM "game.dtd">
    <game>
      <info name="World of War Heroes" version="0.0.1"/>
      <loader javaClass="games.strategy.triplea.TripleA"/>
      <triplea minimumVersion="1.9"/>
      <diceSides value="10"/>
    
        <variableList>
            <variable name="PlayerLandUnits">
               <element name="Irregulars"/>
               <element name="Footmen"/>
               <element name="Pikemen"/>
               <element name="Bowmen"/>
               <element name="Crossbowmen"/>
               <element name="Cavalry"/>
               <element name="Ballista"/>
               <element name="Catapult"/>
               <element name="Trebuchet"/>
               <element name="Battering-Ram"/>
               <element name="Siege-Tower"/>
               <element name="Alliance-Footmen"/>
               <element name="High-Elves"/>
               <element name="Dryads"/>
               <element name="Horde-Footmen"/>
               <element name="Blood-Elves"/>
               <element name="Ogres"/>
               <element name="Ent"/>
               <element name="Bombard"/>
               <element name="Water-Elemental"/>
               <element name="Fire-Elemental"/>
               <element name="Earth-Elemental"/>
               <element name="Air-Elemental"/>
               <element name="Fel-Elemental"/>
            </variable>
            <variable name="PlayerSeaUnits">
               <element name="Workboat"/>
               <element name="Troopship"/>
               <element name="Warship"/>
               <element name="The-Moonspray"/>
            </variable>
            <variable name="PlayerAirUnits">
               <element name="Gryphon-Transport"/>
            </variable>
            <variable name="PlayerHeroUnits">
               <element name="Arthur"/>
               <element name="Khorman"/>
               <element name="Marryk"/>
               <element name="Ayanna"/>
               <element name="Thrall"/>
               <element name="Gart"/>
               <element name="Sevis"/>
               <element name="Sian-tsu"/>
            </variable>
            <variable name="AILandUnits">
               <element name="Outlaws"/>
               <element name="Worgen-Stalkers"/>
               <element name="Centaur-Outrunners"/>
               <element name="Defias-Thugs"/>
               <element name="Draenei-Mutants"/>
               <element name="Ettin-Giant"/>
               <element name="Fel-Beasts"/>
               <element name="Wraith"/>
               <element name="Gnoll-Brutes"/>
               <element name="Worgen-Raiders"/>
               <element name="Harpy-Witches"/>
               <element name="Kobold-Miners"/>
               <element name="Mad-Furbolgs"/>
               <element name="Murloc-Tiderunners"/>
               <element name="Naga-Warriors"/>
               <element name="Pirate-Goons"/>
               <element name="Pirate-Ship"/>
               <element name="Satyr-Minions"/>
               <element name="Oozes"/>
               <element name="Trogg-Savages"/>
               <element name="Enraged-Wildkin"/>
               <element name="Wretched-Monks"/>
               <element name="Zombie-Walkers"/>
               <element name="Red-Dragon"/>
               <element name="Blue-Dragon"/>
               <element name="Bronze-Dragon"/>
            </variable>
            <variable name="AISeaUnits">
               <element name="Pirate-Ship"/>
            </variable>
        </variableList>
    
        <map>
          <territory name="Aboraz Beach" water="true"/>
          <territory name="Abyssal Sands"/>
          <territory name="Aerie Peak"/>
          <territory name="Agamagor"/>
    

    For example these two settings do not work while playing:

           <attachment name="territoryEffectAttachment" attachTo="Mountains" javaClass="games.strategy.triplea.attachments.TerritoryEffectAttachment" type="territoryEffect">
               <option name="noBlitz" value="$PlayerLandUnits$:$PlayerHeroUnits$:$AILandUnits$"/>
           </attachment>
    
           <attachment name="supportAttachmentGhost" attachTo="Wraith" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType"><option name="faction" value="enemy"/>
               <option name="faction" value="enemy"/>
               <option name="side" value="offence:defence"/>
               <option name="dice" value="strength"/>
               <option name="bonus" value="-2"/>
               <option name="number" value="1"/>
               <option name="unitType" value="$PlayerLandUnits$:$PlayerAirUnits$:$PlayerHeroUnits$:$AILandUnits$"/>
               <option name="bonusType" value="Fear"/>
           </attachment>
    

    I am pretty sure all other variableList code does not work either. What am I doing wrong?


  • Admin

    @Frostion Looks alright. Do you get any errors?

    If you can send me the XML or zip then I can do a quick test to see. You should also be able to go to Export > Game Xml (or something like that) to export the game XML which will show the variable values added into the attachments.

    Also your support attachment has "faction" defined twice (1 hanging out at the end of the first line).


  • Donators

    @redrum
    Been playing around with this in 'Invasion U.S.A'. So far I have reduced the code line count from over 21000 to less then 7000. This makes the xml easier to read and debug. Great improvement!!

    Cheers...


Log in to reply