Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    new production unit - barracks

    Map Making
    6
    84
    11.5k
    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.
    • N
      Numetalfan last edited by 29 Sept 2020, 11:27

      Hi,

      I got an error message:

      Sep 29, 2020 1:10:56 PM games.strategy.engine.data.GameParser parseMapProperties
      SCHWERWIEGEND: SAXParseException: game: WW2v4-1941, line: 2825, column: 8, error: Element mit "buyFactoryUpdate" ist im Dokument erforderlich.

      but <i thought to have done all right with that new production unit:

      ....
      <unit name="SmallFactory"/>
      <unit name="Shipyard"/>
      <unit name="FactoryUpgrade"/>
      </unitList>

      ...
      <productionRule name="buyFactoryUpgrade">
      <cost resource="PUs" quantity="8"/>
      <result resourceOrUnit="FactoryUpgrade" quantity="1"/>
      </productionRule>

      ...
      <productionRule name="buySmallFactory">
      <cost quantity="8" resource="PUs"/>
      <result quantity="1" resourceOrUnit="SmallFactory"/>
      </productionRule>
      <productionRule name="buyShipyard">
      <cost quantity="8" resource="PUs"/>
      <result quantity="1" resourceOrUnit="Shipyard"/>
      </productionRule>

      ..
      <repairRules name="repairSmallFactory"/>
      <repairRules name="repairShipyard"/>
      <repairRules name="repairFactory"/>
      </repairFrontier>

      ...
      <frontierRules name="buyShipyard"/>
      <frontierRules name="buySmallFactory"/>
      <frontierRules name="buyFactoryUpdate"/>
      </productionFrontier>

      ...
      <!-- FactoryUpgrade -->

      <attachment name="unitAttachment" attachTo="FactoryUpgrade" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">

      <option name="isFactory" value="true"/>

      </attachment>

      <attachment name='unitAttachment' attachTo='FactoryUpgrade' javaClass='UnitAttachment' type='unitType'>

      <option name='consumesUnits' value='1:SmallFactory'/>

      </attachment>

      <attachment name='unitAttachment' attachTo='FactoryUpgrade' javaClass='UnitAttachment' type='unitType'>

      <option name='consumesUnits' value='1:Shipyard'/>

      </attachment>

      <!-- SmallFactory -->

      <attachment name="unitAttachment" attachTo="Smallfactory" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">

      <option name="isFactory" value="true"/>

      </attachment>

      <!-- Shipyard -->

      <attachment name="unitAttachment" attachTo="Shipyard" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">

      <option name="isFactory" value="true"/>

      </attachment>


      what is missing?

      B 1 Reply Last reply 29 Sept 2020, 16:25 Reply Quote 0
      • B
        beelee @Numetalfan last edited by 29 Sept 2020, 16:25

        @Numetalfan said in new production unit - barracks:

        <frontierRules name="buyFactoryUpdate"/>

        Looks as if "Upgrade" and "Update" got mixed up.

        1 Reply Last reply Reply Quote 0
        • N
          Numetalfan last edited by 29 Sept 2020, 16:29

          True. How simple.
          Thx

          B 1 Reply Last reply 29 Sept 2020, 16:30 Reply Quote 1
          • B
            beelee @Numetalfan last edited by 29 Sept 2020, 16:30

            @Numetalfan I've done it many a time myself 🙂

            1 Reply Last reply Reply Quote 0
            • N
              Numetalfan last edited by 30 Sept 2020, 06:56

              Next topic,

              everything works now, but not perfect:

              <!-- SmallFactory -->

              <attachment name="unitAttachment" attachTo="Smallfactory" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">

              <option name="isFactory" value="true"/>

              </attachment>

              <!-- Shipyard -->

              <attachment name="unitAttachment" attachTo="Shipyard" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">

              <option name="isFactory" value="true"/>

              </attachment>

              all ground units are coded that way:

              <attachment name="unitAttachment" attachTo="cruiser" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                <option name="movement" value="2"/>
                <option name="isSea" value="true"/>
                <option name="attack" value="3"/>
                <option name="defense" value="3"/>
                <option name="canBombard" value="true"/>
                <option name="hitPoints" value="1"/>
              

              <option name="requiresUnits" value="factory"/>
              <option name="requiresUnits" value="Shipyard"/>
              </attachment>

              I expected that now cruiser can only be build in countries that contain either a factory or a shipyard.
              But it is not - I could build it in a small factroy too.

              vice-versa the same problem:

              I could build an armour in a country with only a shipyard, but no other factory, even the armour is coded:

              <attachment name="unitAttachment" attachTo="armour" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                <option name="movement" value="2"/>
                <option name="transportCost" value="3"/>
                <option name="canBlitz" value="true"/>
                <option name="isLandTransport" value="true"/>
                <option name="attack" value="3"/>
                <option name="defense" value="3"/>
              

              <option name="requiresUnits" value="factory"/>
              <option name="requiresUnits" value="Smallfactory"/>
              </attachment>

              what is wrong?

              B 1 Reply Last reply 30 Sept 2020, 18:37 Reply Quote 0
              • B
                beelee @Numetalfan last edited by 30 Sept 2020, 18:37

                @Numetalfan so the "isFactory" is what is allowing that. I'm not 100% sure how to do what you want but it may be possible. I have something similar but probably not quite what you want.

                So make your Shipyard without "isFactory" and require the Naval units to have it and you will only be able to build where a Factory and Shipyard are. Then make something that the Armor requires as well, I'll just call it "ArmorProduction" for now. So then you can only build the Armor with a factory and a ArmorProduction.

                I don't remember what you had for smallFactory. But if you don't want something being built there just make sure you don't have the required unit there.

                1 Reply Last reply Reply Quote 0
                • N
                  Numetalfan last edited by 30 Sept 2020, 18:58

                  Thx. I will try that. I coded them with "is factory" to allow enemy bombers to do SBR.
                  Means to remove that that strategic bombing is no longer possible to that units?

                  B 1 Reply Last reply 30 Sept 2020, 19:10 Reply Quote 0
                  • B
                    beelee @Numetalfan last edited by 30 Sept 2020, 19:10

                    @Numetalfan yea so you need to have "isInfrastructure" so they can be bombed. Here's an example:

                    <!-- Harbour12 -->
                    <attachment name="unitAttachment" attachTo="harbour12" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                    <option name="isInfrastructure" value="true"/>
                    <option name="canBeDamaged" value="true"/>
                    <option name="maxDamage" value="6"/>
                    <option name="maxOperationalDamage" value="2"/>
                    <option name="repairsUnits" value="battleship:carrier:battleship-damaged"/>
                    <option name="isConstruction" value="true"/>
                    <option name="constructionType" value="harbour12_structure"/>
                    <option name="constructionsPerTerrPerTypePerTurn" value="1"/>
                    <option name="maxConstructionsPerTypePerTerr" value="1"/>
                    <option name="movement" value="0"/>
                    <option name="givesMovement" value="1:transport"/>
                    <option name="givesMovement" value="1:transportC8"/>
                    <option name="givesMovement" value="1:submarine"/>
                    <option name="givesMovement" value="1:destroyer"/>
                    <option name="givesMovement" value="1:destroyerC5"/>
                    <option name="givesMovement" value="1:cruiser"/>
                    <option name="givesMovement" value="1:carrier"/>
                    <option name="givesMovement" value="1:EscortCarrier"/>
                    <option name="givesMovement" value="1:EscortCarrierASW"/>
                    <option name="givesMovement" value="1:battleship"/>
                    <option name="isAAforBombingThisUnitOnly" value="true"/>
                    <!--<option name="canBeGivenByTerritoryTo" value="British"/>-->
                    </attachment>

                    So isConstruction allows it to be placed without a Factory. You can have it do it's move support and be bombed etc...but if you don't have a Factory there as well you can't build units there. And if the unit has the requiresUnits thingy you would need both present.

                    You need all the images too. The "_hit image" etc..

                    1 Reply Last reply Reply Quote 0
                    • B
                      beelee last edited by 30 Sept 2020, 19:26

                      Also for requiresUnits I don't think you need to have factory. In this case just the "harbour12" in your unitAttachment. If you do need it, do it like "factory:harbour12" in one line. It'll require both then. Separate lines is either/or.

                      1 Reply Last reply Reply Quote 0
                      • W
                        wc_sumpton last edited by 30 Sept 2020, 20:56

                        @Numetalfan

                        Did you reset this property:

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

                        With the requiresUnits on seperate lines as in the example, means Shipyard or factory for the cruiser. If you use one entry '"requiresUnits" value="factory:Shipyard" would require both to place the cruiser.

                        Cheers...

                        1 Reply Last reply Reply Quote 0
                        • N
                          Numetalfan last edited by 1 Oct 2020, 19:36

                          no they were set false,

                          now - after changing it - the smallfactory and the shipyard work,

                          solved one problem - created the next one:
                          now placing chinese infantry rewards does not work anymore !!

                          the infantry was coded this way:

                             <!-- 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"/>
                          

                          <option name="requiresUnits" value="FactoryUpgrade"/>

                          <option name="requiresUnits" value="factory"/>

                          <option name="requiresUnits" value="SmallFactory"/>

                          <option name="requiresUnits" value="barracks"/>

                          after removing the <option name="requiresUnits" value= codes

                          things changed:

                          now it is possible to place those chinese infantry...

                          but - solved one, created the next ones:

                          • it is possible to place more than 3 units in a chinese country - that is forbidden by the rules
                          • it is now possible to build infantry in a shipyard as infantries have no coding that forbids that

                          damn, this is a hard task.

                          1 Reply Last reply Reply Quote 0
                          • N
                            Numetalfan last edited by 1 Oct 2020, 19:40

                            even more bad news

                            <!-- SmallFactory -->

                            <attachment name="unitAttachment" attachTo="SmallFactory" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">

                            <option name="isFactory" value="true"/>

                            </attachment>

                            I can build it in any countries

                            --

                            <!-- Barracks -->

                            <attachment name="unitAttachment" attachTo="barracks" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">

                            <option name="isFactory" value="true"/>

                            </attachment>

                            <attachment name='unitAttachment' attachTo='barracks' javaClass='UnitAttachment' type='unitType'>

                            <option name='canProduceXUnits' value='2'/>

                            </attachment>

                            I can build it only in countries containing a factory - why??WW2v4-1941.xml

                            B 2 Replies Last reply 1 Oct 2020, 23:01 Reply Quote 0
                            • B
                              beelee @Numetalfan last edited by 1 Oct 2020, 20:05

                              @Numetalfan yea it can be frustrating but don't get discouraged. I think you're close to being there. Just to make sure were on the same page, would you summarize how you want the factories, shipyard and barracks to work again.

                              I'll look at what you have so far

                              1 Reply Last reply Reply Quote 0
                              • N
                                Numetalfan last edited by 1 Oct 2020, 20:08

                                sure

                                factory - builds any unit
                                small factory - any ground unit, no ships, no aircraft
                                shipyard - any naval unit, no air, no ground
                                barracks - only infantry

                                and chinese placement should work as always

                                1 Reply Last reply Reply Quote 0
                                • B
                                  beelee last edited by 1 Oct 2020, 20:15

                                  @Numetalfan right on. I'm having trouble accessing your xml. Can you put it in a zip file an upload it ? I forget how to change it the way it currently is 🙂

                                  F 1 Reply Last reply 1 Oct 2020, 21:49 Reply Quote 0
                                  • N
                                    Numetalfan last edited by 1 Oct 2020, 20:16

                                    sure, thxWW2v4-1941.zip

                                    B 1 Reply Last reply 1 Oct 2020, 20:42 Reply Quote 1
                                    • B
                                      beelee @Numetalfan last edited by 1 Oct 2020, 20:42

                                      @Numetalfan hey you wanna just upload the whole game ? The new units will be needed for testing. It's a World War II v3 1941 mod correct ?

                                      1 Reply Last reply Reply Quote 0
                                      • N
                                        Numetalfan last edited by 1 Oct 2020, 21:02

                                        the zip file has now a size of 13,6 MB - too large to attach it here -any idea what to do?

                                        1 Reply Last reply Reply Quote 0
                                        • F
                                          ff03k64 last edited by 1 Oct 2020, 21:03

                                          I use google drive (or something similar) for things like that.

                                          1 Reply Last reply Reply Quote 0
                                          • N
                                            Numetalfan last edited by 1 Oct 2020, 21:11

                                            yes, its a v3-41 mod - I did not get the meaning of the google drive , how to use it?

                                            B F 2 Replies Last reply 1 Oct 2020, 21:46 Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 3 / 5
                                            41 out of 84
                                            • First post
                                              41/84
                                              Last post
                                            Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums