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

    How to make a unit that does not require a factory to be built/placed.

    Scheduled Pinned Locked Moved Map Making
    6 Posts 3 Posters 1.0k 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.
    • SLW2000S Offline
      SLW2000
      last edited by

      Does anyone know how to make a unit (say infantry) that does not require a factory to be built or placed?

      Thanks.

      Shawn

      redrumR C 2 Replies Last reply Reply Quote 0
      • redrumR Offline
        redrum Admin @SLW2000
        last edited by

        @SLW2000 You can make any unit not require a factory and be placed anywhere by setting isConstruction to true. An example would be like bunkers in NWO/WaW:

            <attachment name="unitAttachment" attachTo="Bunker" javaClass="UnitAttachment" type="unitType">
              <option name="attack" value="0"/>
              <option name="defense" value="3"/>
              <option name="hitPoints" value="2"/>
              <option name="isConstruction" value="true"/>
              <option name="constructionType" value="bunker"/>
              <option name="constructionsPerTerrPerTypePerTurn" value="1"/>
              <option name="maxConstructionsPerTypePerTerr" value="1"/>
            </attachment>
        

        TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

        SLW2000S 1 Reply Last reply Reply Quote 1
        • SLW2000S Offline
          SLW2000 @redrum
          last edited by

          @redrum Thanks for the info and it works great.

          I had another question: how do you enable "More Constructions without Factory"? I wanted the unit to be buildable up to the territory value like other land units.

          Thanks.

          Shawn

          redrumR 1 Reply Last reply Reply Quote 0
          • redrumR Offline
            redrum Admin @SLW2000
            last edited by

            @SLW2000 You just need to add these 2 properties and set them to true to the properties list at the end of the XML:

                <!-- if true you may have a number of constructions up to the value of the territory, in territories with factories -->
                <property name="More Constructions with Factory" value="true" editable="true">
                  <boolean/>
                </property>
                <!-- if true you may have a number of constructions up to the value of the territory, in territories without factories -->
                <property name="More Constructions without Factory" value="true" editable="true">
                  <boolean/>
                </property>
            

            TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

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

              @redrum Those are stack limits, not placement limits.

              @SLW2000 What you want to do is not possible. However, you can have factories in all territories, then a unit that is required by all normally placeable units, except the units you would want to be placeable without factories.

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

                @SLW2000 Please, take a look at the descriptions. "Maps & Mods" says: "Talk about and work on specific Maps and Mods".

                Moving this thread to Mapmaking.

                When you will have your specific map or mod, feel free to open a thread about that in "Maps & Mods" (though I still suggest opening threads in Mapmaking for the technicalities, to keep your thread cleaner for general feedback).

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