TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    new production unit - barracks

    Scheduled Pinned Locked Moved Map Making
    84 Posts 6 Posters 31.5k Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z Offline
      Zaroph
      last edited by

      I would also like to mention that this method works for sea units as well, if you want different shipyards to make different naval units.

      I initially thought it wouldnt because they are adjacent to factories in land territories, and the XOB option browser says this for them: "All units in the list are required to be present in the territory in order to place the attachTo unit there." but it does seem to work exactly the same as land units which is nice.

      1 Reply Last reply Reply Quote 2
      • N Offline
        Numetalfan @wc_sumpton
        last edited by

        @wc_sumpton

        Thanks alot !
        Yes I am a beginner in map designing, but I will try my best. THX for all the input.
        I will test that barracks input the next days.

        1 Reply Last reply Reply Quote 3
        • N Offline
          Numetalfan @wc_sumpton
          last edited by

          @wc_sumpton

          the next beginners question, sorry.

          the downloaded world_war_ii_v3-master is located on my computer C:\Users....\triplea\downloadedMaps

          now I made a local copy that folder is now named
          world_war_ii_v4
          the maps with all the barracks changes is called WW2v4-1941
          it is located C:\Users....\triplea\downloadedMaps\world_war_ii_v4\world_war_ii_v4 -master\map\games

          the question is:

          what has to be done to make this game run? Do I need a master zip file and a properties file in the \downloadedMaps folder? How to create them?

          1 Reply Last reply Reply Quote 0
          • wc_sumptonW Offline
            wc_sumpton
            last edited by wc_sumpton

            @Numetalfan
            What you are doing is making a mod for an existing map. So this is how I do this:
            Download the map 'World War II v3' and in the downloadedMaps directory I get world_war_ii_v3-master.zip and world_war_ii_v3-master.zip.properties.
            Open world_war_ii_v3-master.zip and drag the file world_war_ii_v3-master to the downloadedMaps directory. This will add that directory with the files unzipped, which makes it easier to work with. Then remove both world_war_ii_v3-master.zip and world_war_ii_v3-master.zip.properties. I also delete the '-master' for the unzipped directory, so all I have is an unzipped directory 'world_war_ii_v3'.

            After that setup I open the xml game file 'WW2v3-1941' with Notepad++ drop down to the info line and change the name:

            <game>
              <!--<info name="World War II v3 1941" version="1.7"/>-->
              <info name="World War II v3 1941 with Barracks" version="1.7"/>
            

            Then do 'file - Save As...' and add a notation to the file name ie: 'WW2v3-1941.xml' now becomes 'WW2v3-1941_barracks.xml'. So both files exist in the map directory, and I can open and refer to the original if necessary.

            You don't need the '.properties'. It just added with the download, and all of them can be removed.

            Otherwise your modified game xml can reside in the same folder. Just select the name from the 'Select Map' list.

            Hope this helps...

            And don't be sorry for asking. Mod, make mistakes, ask and get help, and mod some more. We all started by not knowing, so answering is fun and helpful. I also learned some things by doing this for you! So it was fun and helpful for me!

            Cheers...

            1 Reply Last reply Reply Quote 1
            • N Offline
              Numetalfan
              last edited by

              thx, that's what I did, but now there is an error....could not parse...
              the error message names the xml file.

              instead of World War II v3 1941 with Barracks I named it
              WW2v4-1941.xml

              I have right now

              a folder named world_war_ii_v4 -master
              in the C:\Users...\triplea\downloadedMaps

              and in the
              C:\Users...\triplea\downloadedMaps\world_war_ii_v4 -master\map\games
              a WW2v4-1941.xml file

              in that xml file
              ...
              <game>
              <info name="WW2v4-1941" version="1.7 edited BM"/>
              <loader javaClass="games.strategy.triplea.TripleA"/>
              <triplea minimumVersion="1.7"/>
              ...

              what might be the mistake?

              B C 2 Replies Last reply Reply Quote 0
              • B Offline
                beelee @Numetalfan
                last edited by

                Hi @Numetalfan

                So at the bottom of the xml where it says"mapName" that has to match exactly the name of the folder in the DL'd maps folder.

                1 Reply Last reply Reply Quote 0
                • C Offline
                  Cernel Moderators @Numetalfan
                  last edited by

                  @Numetalfan said in new production unit - barracks:

                  instead of World War II v3 1941 with Barracks I named it
                  WW2v4-1941.xml

                  This sounds like a name of a mod of "World War II v4" set somewhere in 1941, instead of in the spring of 1942.

                  1 Reply Last reply Reply Quote 0
                  • wc_sumptonW Offline
                    wc_sumpton
                    last edited by

                    @Numetalfan
                    I think I understand.
                    This is the game name and can be very descriptive:

                    <game>
                       <info name="WW2v4-1941" version="1.7 edited BM"/>
                    

                    You created a new directory for you map
                    "C:\Users...\triplea\downloadedMaps\world_war_ii_v4 -master"
                    Since it looks like its not a zip file, I would remove the " -master". (Don't for get the space before the "-") So the xml directory looks like "C:\Users...\triplea\downloadedMaps\world_war_ii_v4\map\games".
                    Now as to what @beelee is saying. Because you created a new directory you have to change the "mapName" property. Most of the time it is located at the bottom of the xml, just before the "notes" property and it need to equal the file name for you new map:

                        <!-- Map Name: must equal file name -->
                        <property name="mapName" value="world_war_ii_v4" editable="false"/>
                        <!-- notes appear in the notes menu in the main screen, format as html -->
                        <property name="notes">
                    

                    Hope this is helpful.

                    Cheers...

                    1 Reply Last reply Reply Quote 0
                    • N Offline
                      Numetalfan
                      last edited by

                      thanks to the freuquent support,

                      I feel I am close to what I want but still it there is the following error:

                      Jun 28, 2020 11:31:50 AM games.strategy.engine.framework.ui.GameChooserModel createGameChooserEntry
                      SCHWERWIEGEND: Could not parse: file:/C:/Users/.../triplea/downloadedMaps/world_war_ii_v4/map/games/WW2v4-1941.xml
                      games.strategy.engine.data.GameParseException: map name: 'file:/C:/Users/.../triplea/downloadedMaps/world_war_ii_v4/map/games/WW2v4-1941.xml', game name: '<unknown>', failed to parse XML document
                      at games.strategy.engine.data.GameParser.newGameParseException(GameParser.java:108)
                      at games.strategy.engine.data.GameParser.parseDom(GameParser.java:136)
                      at games.strategy.engine.data.GameParser.parseShallow(GameParser.java:127)
                      at games.strategy.engine.data.GameParser.parseShallow(GameParser.java:123)
                      at games.strategy.engine.framework.ui.GameChooserEntry.<init>(GameChooserEntry.java:36)
                      at games.strategy.engine.framework.ui.GameChooserModel.createEntry(GameChooserModel.java:168)
                      at games.strategy.engine.framework.ui.GameChooserModel.createGameChooserEntry(GameChooserModel.java:147)
                      at games.strategy.engine.framework.ui.GameChooserModel.populateFromDirectory(GameChooserModel.java:181)
                      at games.strategy.engine.framework.ui.GameChooserModel.lambda$parseMapFiles$0(GameChooserModel.java:62)
                      at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
                      at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
                      at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
                      at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source)
                      at java.util.concurrent.CountedCompleter.exec(Unknown Source)
                      at java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
                      at java.util.concurrent.ForkJoinPool$WorkQueue.execLocalTasks(Unknown Source)
                      at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source)
                      at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
                      at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
                      Caused by: org.xml.sax.SAXParseException; systemId: jar:file:/C:/Program%20Files/TripleA/bin/triplea-game-headed-1.9.0.0.13066-all.jar!/games/strategy/engine/xml/; lineNumber: 870; columnNumber: 3; Elementtyp "production" muss mit dem entsprechenden Endtag "</production>" beendet werden.
                      at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
                      at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
                      at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
                      at games.strategy.engine.data.GameParser.getDocument(GameParser.java:323)
                      at games.strategy.engine.data.GameParser.parseDom(GameParser.java:134)
                      ... 17 more

                      1 Reply Last reply Reply Quote 0
                      • wc_sumptonW Offline
                        wc_sumpton
                        last edited by

                        @Numetalfan so what I think this is saying is that there is no </production> tag. This could be miss leading because you do have the </production> tag. It also gives a line number which is way before the end of the xml. If you were missing the tag the line number would be something like 2200. So what you need to do is check you xml at line 870 to see if there is an extra closing tag, maybe 2 </productionRule> tags together or something similar.

                        Hopefully we get there soon.

                        Cheers...

                        P.S. You could post your xml so that it may be checked by others. (But I know the thrill of getting it right on my own!! :face_with_tears_of_joy: )

                        1 Reply Last reply Reply Quote 2
                        • N Offline
                          Numetalfan
                          last edited by

                          WW2v4-1941.xml

                          Hi,
                          I found some mistakes by myself, yet there still is not everything fine

                          1 Reply Last reply Reply Quote 0
                          • wc_sumptonW Offline
                            wc_sumpton
                            last edited by

                            Hello @Numetalfan, well I guess things got a little bit confusing. I am very sorry, I should have been clearer in my instructions. I assumed that since you had created 2 new properties, that you understood that properties appear at the end of the xml. That was my bad. So with that out of the way lets get to your xml:

                                <!-- Infantry -->
                                <attachment name="unitAttachment" attachTo="infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                                  <option name="movement" value="1"/>
                                  <option name="transportCost" value="2"/>
                                  <option name="isInfantry" value="true"/>
                                  <option name="isAirTransportable" value="true"/>
                                  <option name="attack" value="1"/>
                                  <option name="defense" value="2"/>
                                  <option name="artillerySupportable" value="true"/>
                            <!-- <property name="Unit Placement Restrictions" value="true" editable="false"> Remove -->
                               <!-- <boolean/> Remove -->
                            <!-- </property> Remove -->
                            <!-- </attachment> Remove -->
                             </attachment>
                            
                                <!-- Artillery -->
                                <attachment name="unitAttachment" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                                  <option name="movement" value="1"/>
                                  <option name="transportCost" value="3"/>
                                  <option name="attack" value="2"/>
                                  <option name="defense" value="2"/>
                                  <option name="artillery" value="true"/>
                             <option name="requiresUnits" value="factory"/>
                            <!-- <property name="Unit Placement Restrictions" value="true" editable="false"> Remove -->
                               <!-- <boolean/> Remove -->
                            <!-- </property> Remove -->
                            <!-- </attachment> Remove -->
                                </attachment>
                            

                            Please note that I am also removing one of the </attachment> tags. Again my bad.

                            You need to do this for all the units. Next to the Barracks. There are 3 - in the Barracks comment ie: <--- Barracks ---> and it should be only 2:

                               <!-- Barracks -->
                            <attachment name="unitAttachment" attachTo="barracks" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                               <option name="isFactory" value="true"/>
                            <!-- </attachment> Remove -->
                                </attachment>
                            

                            There is also an extra </attachment> tag to remove here also.

                            Now to properly add that property. Since the two properties you added are not doing anything, we will add the property there:

                                <!-- <property name="maxBarracksPerTerritory" value="1"/> Remove -->
                                <!-- <property name="Placement Restricted By Barracks" value="true" editable="false"> Remove -->
                                  <!-- <boolean/> Remove -->
                                <!-- </property> Remove -->
                                <property name="Unit Placement Restrictions" value="true" editable="false">
                                  <boolean/>
                                </property>
                            

                            So now lets load and test.

                            Cheers...

                            1 Reply Last reply Reply Quote 1
                            • wc_sumptonW Offline
                              wc_sumpton
                              last edited by

                              @Numetalfan looks like there are more problems. This happens sometimes. The error talks about a missing end properties tag at line 2250. Line 2250 is the bottom of the xml, which means its missing above this line. When you cut and copied the mapName line you replaced a </property> tag. It happens. Its a mistake, and we learn by finding and correcting those errors.

                                  <property name="Neutrals Are Blitzable" value="false" editable="false">
                                    <boolean/>
                                  </property> <!-- Add -->
                                     <!-- Map Name: must equal file name -->
                                  <property name="mapName" value="world_war_ii_v4" editable="false"/>
                              
                              

                              Now save and run again.

                              Cheers...

                              1 Reply Last reply Reply Quote 1
                              • wc_sumptonW Offline
                                wc_sumpton
                                last edited by

                                @Numetalfan and now another error. I going to blame us both for this. The version at the top can only be numbers. So if you want the ' edited BM' place it with the name or put it in comment brackets:

                                  <info name="WW2v4-1941" version="1.7"/> <!-- edited BM -->
                                

                                Doing good so far!! Lets save and run again!

                                Cheers...

                                1 Reply Last reply Reply Quote 0
                                • wc_sumptonW Offline
                                  wc_sumpton
                                  last edited by

                                  @Numetalfan now there is a whole list of errors! But before you throw you hand up in discuss please notice that all the JAVA error are not there, and if you look into the 'Select Map' list 'WW2v4-1941' is now listed. You can't select it, but it does show that progress is being made! (I think you are still using 1.9.0.0.xxxx, so you may not see the list like I do with the newer version. But you should still at least 2)
                                  So for the first error at line 883:

                                  <repairRule name="repairFactoryIndustrialTechnology">
                                        <cost resource="PUs" quantity="1"/>
                                        <result resourceOrUnit="factory" quantity="2"/>
                                        <!-- <repairRules name="repairBarracks"/> Remove -->
                                  </repairRule>
                                  
                                   <repairFrontier name="repair">
                                        <repairRules name="repairFactory"/>
                                        <repairRules name="repairBarracks"/> <!-- Add here -->
                                   </repairFrontier>
                                  

                                  The line was just added to the wrong area. And next re-comment out the Industrial Technology productionFrontier block:

                                  <!-- <productionFrontier name="productionIndustrialTechnology">
                                                          <frontierRules name="buyInfantryIndustrialTechnology"/>
                                                          <frontierRules name="buyArtilleryIndustrialTechnology"/>
                                                          <frontierRules name="buyArmourIndustrialTechnology"/>
                                                          <frontierRules name="buyFighterIndustrialTechnology"/>
                                                          <frontierRules name="buyBomberIndustrialTechnology"/>
                                                          <frontierRules name="buyTransportIndustrialTechnology"/>
                                                          <frontierRules name="buySubmarineIndustrialTechnology"/>
                                                          <frontierRules name="buyDestroyerIndustrialTechnology"/>
                                  			<frontierRules name="buyCruiserIndustrialTechnology"/>
                                                          <frontierRules name="buyCarrierIndustrialTechnology"/>
                                                          <frontierRules name="buyBattleshipIndustrialTechnology"/>
                                                          <frontierRules name="buyAAGunIndustrialTechnology"/>
                                                          <frontierRules name="buyFactoryIndustrialTechnology"/>
                                   </productionFrontier> -->
                                  

                                  Since the productionRule for Industrial Technology is commented out these should stay commented out. (you may have un-commented these while trying to find other problems, but that's ok).

                                  Again save and load!

                                  Cheers...

                                  1 Reply Last reply Reply Quote 0
                                  • wc_sumptonW Offline
                                    wc_sumpton
                                    last edited by wc_sumpton

                                    @Numetalfan if everything went right, you should now have a working map. Since there are no Barracks on the map you might have to Edit one in. Test the production by buying some infantry and other different units. You should be able to place infantry at both the barracks and factory, while the other units can only be placed at the factory!

                                    Are we good so far? Are you ready for your test! Test! TEST! No stinkin' TEST!

                                    But... yea...

                                    I think the artillery should be just like the infantry, and produced at both barracks and factory. What changes would you make? Hint -- You could remove just one line. Or for bonus points, you could add just one line!

                                    Cheers...

                                    1 Reply Last reply Reply Quote 0
                                    • N Offline
                                      Numetalfan
                                      last edited by

                                      @wc_sumpton

                                      thanks to your support, you invested a lot of time helping me, I appreciate that.

                                      Yet my xml still doesn't work. The parse error seems to be the part where the units, including the barracks, are defined. the syntax misses some </attachment>, but I don't see what is wrong. Maybe you find the error.

                                      while you fixed my problems the last days, I continued with my next goal:

                                      extend the map by a new sea zone

                                      that sea zone will be nr. 66, it will be located south of Italy and contain the islands Sicily and Malta.

                                      so far my xml was extend by me with the following code lines:

                                      <territory name="Sicily"/>
                                      <territory name="Malta"/>
                                      <territoryOwner territory="Sicily" owner="Italians"/>
                                      <attachment name="territoryAttachment" attachTo="Sicily" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory">
                                      <option name="production" value="1"/>
                                      </attachment>
                                      <resourceGiven player="Italians" resource="PUs" quantity="11"/>
                                      <unitPlacement unitType="infantry" territory="Sicily" quantity="1" owner="Italians"/>
                                      <attachment name="territoryAttachment" attachTo="Malta" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory">
                                      <option name="production" value="0"/>
                                      </attachment
                                      <territoryOwner territory="Malta" owner="British"/>
                                      <connection t1="66 Sea Zone" t2="Sicily"/>
                                      <connection t1="66 Sea Zone" t2="Malta"/>
                                      <connection t1="66 Sea Zone" t2="14 Sea Zone"/>
                                      <connection t1="66 Sea Zone" t2="13 Sea Zone"/>
                                      <connection t1="Sicily" t2="66 Sea Zone"/>
                                      <connection t1="Malta" t2="66 Sea Zone"/>

                                      hope this was so far fine, now the important questions:

                                      what has to be done to see this on the map, which files have to be manipulated?

                                      so far I added to the world_war_ii_v4\map\misc
                                      a Malta.pgn
                                      a Sicily.pgn
                                      a b66.pgn

                                      but I did not do anything in the baseTiles or reliefTiles folders. I need some help with this.

                                      WW2v4-1941.xml
                                      is my current file.

                                      1 Reply Last reply Reply Quote 0
                                      • wc_sumptonW Offline
                                        wc_sumpton
                                        last edited by wc_sumpton

                                        @Numetalfan whoa there cowboy! Hold your horses! I'm all for adding changes, even if its to the map. But lets take this on one item at a time. Your topic here is "new production unit - barracks", and you stated that your xml still does not work. Until you have a working barracks, you shouldn't be adding other items to the xml. Its nice to know that there is a list of items you might want to add or change, but each item should be discussed as a separate topic so that thing don't get to confusing as we go along. So back to the barracks.

                                        You started with a working map, "World War II v3 1941", WW2v3-1941.xml and you created a whole new map "WW2v4-1941", WW2v4-1941.xml. Which you add a barracks.png to each nation, otherwise the two directories are still the same. So lets go from there with you new xml.

                                        First off all references to Malta, Sicily or 66 Sea Zone need to be commented out or removed.

                                        Once that is done, you need to go back over your unit attachments. You removed all the extra </attachments> that was good but you left:

                                        <property name="Unit Placement Restrictions" value="true" editable="false"> 
                                           <boolean/>
                                        </property>
                                        

                                        Under each unit, armour, fighter, bomber, transport, battleship, cruiser, destroyer, carrier, submarine and don't forget the aaGun.

                                        Next lets talk about copying and pasting. You previous xml had:

                                            <property name="Territory Turn Limit" value="false" editable="false">
                                              <boolean/>
                                           </property>
                                            <property name="maxBarracksPerTerritory" value="1"/>
                                            <property name="Placement Restricted By Barracks" value="true" editable="false">
                                              <boolean/>
                                            </property>
                                            <property name="maxFactoriesPerTerritory" value="1"/>
                                            <property name="Placement Restricted By Factory" value="true" editable="false">
                                              <boolean/>
                                            </property>
                                        

                                        Your new xml looks like:

                                            <property name="Territory Turn Limit" value="false" editable="false">
                                              <boolean/>
                                           <!-- <property name="maxBarracksPerTerritory" value="1"/> Remove -->
                                            <!-- <property name="Placement Restricted By Barracks" value="true" editable="false"> Remove -->
                                              <!-- <boolean/> Remove -->
                                            <!-- </property> Remove -->
                                            <property name="Unit Placement Restrictions" value="true" editable="false">
                                              <boolean/>
                                            </property>
                                            <property name="maxFactoriesPerTerritory" value="1"/>
                                            <property name="Placement Restricted By Factory" value="true" editable="false">
                                              <boolean/>
                                            </property>
                                        

                                        What happened to the </property> tag under the "<property name="Territory Turn Limit" value="false" editable="false">" and "<boolean/>" lines? You highlighted and pasted over it. When you do that thing break. You have to be careful when you copy from the web and insert it into the xml. For now just add that tag back in, and lets see if we can get these barracks to work!!

                                        Enjoy.

                                        Cheers...

                                        P.S. As to making changes to the map, you could start a new topic so that may be discussed. I would be happy to help you with that!

                                        N 1 Reply Last reply Reply Quote 1
                                        • N Offline
                                          Numetalfan @wc_sumpton
                                          last edited by

                                          @wc_sumpton

                                          HI,

                                          I will start a new sea zone topic later.
                                          right now I commented all sea zone changes in the xml they should not bother us

                                          I guess my problem is still the same

                                          <!-- AA Gun -->
                                          <attachment name="unitAttachment" attachTo="aaGun" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                                            <option name="isAA" value="true"/>
                                            <option name="transportCost" value="3"/>
                                            <option name="movement" value="1"/>
                                          

                                          <option name="requiresUnits" value="factory"/>
                                          <property name="Unit Placement Restrictions" value="true" editable="false">
                                          <boolean/>
                                          </property>
                                          </attachment>
                                          </attachment>

                                          I have an unterstanding problem wit that </attachment> syntax - what is second </attachment> good for? we have a start
                                          <attachment name=...
                                          and an end </attachment> for that
                                          as well we have a <property name=.. start and </property> to end it.

                                          when we fix that I hope the game will run.
                                          my current version is attached
                                          WW2v4-1941.xml

                                          I will be online this evenig from about 8 p.m. than we may fix it live

                                          N 1 Reply Last reply Reply Quote 0
                                          • N Offline
                                            Numetalfan @Numetalfan
                                            last edited by

                                            @wc_sumpton

                                            Maybe I can't be online today. If you haven a xml working, please attach it. If it works on my triplea too, I will maybe find the problem, why my xml doesn't work

                                            Thx

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 4 / 5
                                            • First post
                                              Last post
                                            Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums