Navigation

    TripleA Logo

    TripleA Forum

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

    How to limit Factory/Facility Placement

    Map Making
    3
    8
    579
    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.
    • VictoryFirst
      VictoryFirst last edited by VictoryFirst

      I want this type of factory to only be placed in originally controlled territories that are worth "2" or more. However, the game engine allows this factory to also be placed in territories worth "1". What did I do wrong?

      <attachment name="unitAttachment" attachTo="medium_factory" javaClass="UnitAttachment" type="unitType">
            <option name="isFactory" value="true"/>
            <option name="maxConstructionsPerTypePerTerr" value="99"/>
            <option name="constructionsPerTerrPerTypePerTurn" value="99"/>
            <option name="canProduceXUnits" value="5"/>
            <option name="canOnlyBePlacedInTerritoryValuedAtX" value="2"/>
            <option name="special" value="canOnlyPlaceInOriginalTerritories"/>
      </attachment>
      W 1 Reply Last reply Reply Quote 1
      • W
        wc_sumpton @VictoryFirst last edited by

        @victoryfirst

        Do you have the following game option set:

        <!-- Unit Placement Restrictions are restrictions on the placement of units: unitPlacementRestrictions, unitPlacementOnlyAllowedIn, canOnlyBePlacedInTerritoryValuedAtX, requiresUnits, -->
        <property name="Unit Placement Restrictions" value="true" editable="false">
          <boolean/>
        </property>
        

        Cheers...

        VictoryFirst 1 Reply Last reply Reply Quote 4
        • VictoryFirst
          VictoryFirst @wc_sumpton last edited by

          @wc_sumpton

          Thank you very much, that worked!

          I have now stumbled on another problem. The medium factory should allow 5 units to be placed, however, the game engine only allows a number of units up to the production value of that territory. Here are some of the properties I have set:

          <property name="More Constructions with Factory" value="false" editable="false">
            <boolean/>
          </property>
          <property name="More Constructions without Factory" value="false" editable="false">
            <boolean/>
          </property>
          <property name="Unlimited Constructions" value="false" editable="false">
            <boolean/>
          </property>
          <property name="Territory Turn Limit" value="false" editable="false">
            <boolean/>
          </property>
          <property name="maxFactoriesPerTerritory" value="99">
            <boolean/>
          </property>
          <property name="Placement Restricted By Factory" value="true" editable="false">
            <boolean/>
          </property>
          B 1 Reply Last reply Reply Quote 2
          • B
            beelee @VictoryFirst last edited by

            @victoryfirst

            check the properties for EXP or G 40 2nd edition

            They allow you to place whatever the unitAttachment allows

            1 Reply Last reply Reply Quote 1
            • VictoryFirst
              VictoryFirst last edited by

              @beelee

              I have tried that and added all kinds of properties that had to do with factories, placements, and production that appeared in G40, but it hasn't worked so far.

              1 Reply Last reply Reply Quote 0
              • VictoryFirst
                VictoryFirst last edited by

                I don't understand this at all. In the tooltip, it shows the factory unit can produce 5 units, yet when placing units you can only place 4 (because that's the IPC value of the territory). I have copied the exact code for the factories and the properties of Global 1940, and also gave the territory a unitProduction of 5, but it still doesn't work.

                W 1 Reply Last reply Reply Quote 0
                • W
                  wc_sumpton @VictoryFirst last edited by wc_sumpton

                  @victoryfirst

                  At this point it is very hard to determine what may be causing this problem. There are other options that can cause limits to placement.

                  placementLimit in playerAttachment and unitAttachment. Also, the property "Unit Placement Per Territory Restricted" might need to be changed to false. Likewise, if you use both "production" and "unitProduction" in territory attachments, "unitProduction" must come after "production", otherwise the "production" value will overwrite "unitProduction".

                  There may be another reason for this problem. At this point, without the more information, we are just shooting in the dark.

                  I am sorry about this. I hope that the above gives you some ideas.

                  Cheers...

                  1 Reply Last reply Reply Quote 3
                  • VictoryFirst
                    VictoryFirst last edited by

                    @wc_sumpton

                    I believe I finally found out the issue... I was searching online for the answer and I couldn't find it at first, until I finally came across a thread where someone had a similar problem, and the solution was to add the property Damage From Bombing Done To Units Instead Of Territories. That for some reason makes the canProduceXUnits to work.

                    1 Reply Last reply Reply Quote 4
                    • 1 / 1
                    • First post
                      Last post
                    Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums