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

    How to limit Factory/Facility Placement

    Scheduled Pinned Locked Moved Map Making
    8 Posts 3 Posters 1.6k Views 3 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.
    • VictoryFirstV Offline
      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>
      
      wc_sumptonW 1 Reply Last reply Reply Quote 1
      • wc_sumptonW Offline
        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...

        VictoryFirstV 1 Reply Last reply Reply Quote 4
        • VictoryFirstV Offline
          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 Offline
            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
            • VictoryFirstV Offline
              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
              • VictoryFirstV Offline
                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.

                wc_sumptonW 1 Reply Last reply Reply Quote 0
                • wc_sumptonW Offline
                  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
                  • VictoryFirstV Offline
                    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

                    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 / 1
                    • First post
                      Last post
                    Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums