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

    UnitAttachment Which Allows/Requires Another Unit To Move

    Scheduled Pinned Locked Moved Feature Requests & Ideas
    58 Posts 5 Posters 28.7k Views 4 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.
    • redrumR Offline
      redrum Admin @Hepps
      last edited by

      @hepps The way it is specified in the XML actually means there needs to be either an entrenchment OR engineer (not AND). Since it consumes entrenchment as well, that is required no matter what so it should allow you to upgrade without an engineer present.

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

      HeppsH 1 Reply Last reply Reply Quote 0
      • HeppsH Offline
        Hepps Moderators @redrum
        last edited by Hepps

        @redrum Well that's not how the game works. You cannot build a fortification with a material and no engineer. Better people than me have tried.

        "A joyous heart sours with the burden of expectation"
        Hepster

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

          @hepps Ha. Well I'm guessing if you try it then engine will allow you to upgrade without the engineer present (nobody probably ever tried since its clearly in the game rules).

          I believe this would be the correct and most concise way for attachment (don't need entrenchment as required unit since it is a consumed unit):

          <attachment name="unitAttachment" attachTo="spanishFortification" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
            <option name="movement" value="0"/>
            <option name="attack" value="0"/>
            <option name="defense" value="10"/>
            <option name="hitPoints" value="2"/>
            <option name="isConstruction" value="true"/>
            <option name="constructionType" value="Fortr"/>
            <option name="constructionsPerTerrPerTypePerTurn" value="1"/>
            <option name="maxConstructionsPerTypePerTerr" value="3"/>
            <option name="consumesUnits" value="1:spanishEntrenchment"/>
            <option name="consumesUnits" value="1:Material"/>
            <option name="requiresUnits" value="spanishCombatEngineer"/>
          </attachment>
          

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

          HeppsH 1 Reply Last reply Reply Quote 0
          • HeppsH Offline
            Hepps Moderators @redrum
            last edited by

            @redrum Yes its been tried... and often people have to do edits to move the engineer they forgot to move in.

            "A joyous heart sours with the burden of expectation"
            Hepster

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

              @redrum Can you please run a search and give me the full list of games now (if it is an easy thing for you to do). Then I can do all the push requests that you can merge anytime thereafter.

              I really think that the compatibility issues are a minor matter here. I'd get around doing this right away, I suggest. At most people will need to do a few edits and self-enforcing rules and you might have a couple bug reports to close; but probably not even that.

              Once we have the full list, we can see what would be the matter with compatibility.

              Doing the stuff in illogical ways is just a recipe for having confusions and bugs in the future, as your last discussion here I'm sure it's confirming to you.

              As I said; that thing is only for "spanishFortification", "swedishFortification", "turkishFortification", "brazilianFortification", not for the big boys; so, it works fine for all the "normal" players; thus this is really a smaaaalllll matter, but it gives you the idea. I'll fix that too, np.

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

                @cernel @Hepps Ah, yeah its only the neutrals that have the unitAttachment error, the rest do it the way I specified above. I don't have an easy way to get the list of maps as I don't have them all downloaded locally at the moment.

                @cernel I think we should probably think about the best way to do AND and OR for options across the board before making any changes. I'm not that convinced that just inverting the 2 to be like consumesUnits is really that much better. I don't believe consumesUnits has anyway to do OR so you can only specify a single list of AND units that are required.

                EDIT: Its probably best to make a new feature/refactor thread to continue this discussion as to not lose the discussion in this thread. For now this feature is essentially complete and a refactor would be done later on with an incompatible release anyways.

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

                C 2 Replies Last reply Reply Quote 0
                • HeppsH Offline
                  Hepps Moderators @Cernel
                  last edited by

                  @cernel Now I remember why this is written as it is for TWW

                  It is because the neutral nations were written in a very specific manner for when they we still neutral.

                  "A joyous heart sours with the burden of expectation"
                  Hepster

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

                    @redrum No problem. You will give me the list when you can, then.

                    Do you want me to make all the push in advance? Please, confirm, if so.

                    I've seen that no regular games, comprising Global, would be influenced by this matter. So I think it would be only TWW and CW and maybe a couple others. I really think we can do this with very little worries about compatibility; but that's your call, of course.

                    I think we should probably think about the best way to do AND and OR for options across the board before making any changes. I'm not that convinced that just inverting the 2 to be like consumesUnits is really that much better.

                    Inverting was what @RoiEX said. My proposal is actually not just inverting, but needing the additional "count" equal to 1 for having the "OR". This also means, as I said, that if you have only 1 occurrence of "requiresUnits" in the attachment, then nothing changes (it is AND in old and new alike), which limits the compatibility problems really to like nothing.

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

                      @redrum said in UnitAttachment Which Allows/Requires Another Unit To Move:

                      I don't believe consumesUnits has anyway to do OR so you can only specify a single list of AND units that are required.

                      Yeah, it would be really good if you can have a "OR" for consuming units (for example, upgrading a "paratrooper" from "infantry" or "elite"); but that would also require a selection window.

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

                        @hepps I saw that, due to the purchase limits of the old Fodder AI", with the triggers bringing back the stuff, when it is going to be assigned to the players. But this is another matter yet. As I said, the two "requiresUnits" here are just useless. You could remove them both, and nothing would change, for those units. As I said, this is really a marginal matter, we/you can solve any ways you prefer (most likely, what is wanted is removing the first occurrence only), doesn't really matter and it's no problem; it was really not the focus of my post.
                        As a matter of my proposal, if you want just to keep it as it is, the change would be this one (but this would equal not having it):
                        <option name="requiresUnits" value="spanishEntrenchment:spanishCombatEngineer" count="1"/>

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