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

    Unit Option When Damaged Change Into Different Unit (Weakened Battleships)

    Scheduled Pinned Locked Moved Feature Requests & Ideas
    83 Posts 11 Posters 42.8k Views 10 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.
    • HeppsH Offline
      Hepps Moderators
      last edited by

      Just look at TWW 3..0

      It all works perfectly. Should work of any type of unit. The one thing that is tricky is the names of the unit images you need in the unit folder.

      But if you look at that then you should be good to go.

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

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

        @Frostion said in Unit Option When Damaged Change Into Different Unit (Weakened Battleships):

        setWhenHitPointsDamagedChangesInto

        You have 1 too many parameters. If you remove the count="1" then it should work. So should be like this:

        <option name="whenHitPointsDamagedChangesInto" value="3:false:Red-Dragon-Corpse"/>
        

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

        1 Reply Last reply Reply Quote 0
        • FrostionF Offline
          Frostion Admin
          last edited by

          Ahh ... yes. With the new pictures and the changing of...
          <option name="whenHitPointsDamagedChangesInto" value="3:false:Red-Dragon-Corpse" count="1"/>
          to
          <option name="whenHitPointsDamagedChangesInto" value="3:false:Red-Dragon-Corpse"/>
          ... it seems to work.
          Thanks to you guys! 😄

          Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

          alkexrA 1 Reply Last reply Reply Quote 0
          • alkexrA Offline
            alkexr @Frostion
            last edited by

            Can units still be changed into other units when they are already dead? Didn't work for me last time I was experimenting. It would be tremendously useful if it was possible.

            "For the world is changing: I feel it in the water, I feel it in the earth, and I smell it in the air."

            C 1 Reply Last reply Reply Quote 0
            • FrostionF Offline
              Frostion Admin
              last edited by

              @alkexr I cannot give you answer yet, as I have only just gotten my XML to work and have not really tested the Dragon out. If it works as I hope, the dragon has X HP and when they are killed it turns into a corpse. I cross my fingers. If not, I think I will make a request about a whenKilledTurnsInto feature 😁

              Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

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

                @alkexr I tried it too, but it doesn't work. It would be really cool if it does. @Frostion There is no need to add any other property, just the unit should not be killed if it can turn into another one at the current damage (that would be set equal to the total hitpoints).

                Also I believe it would be clearer if the option would talk in terms of remaining hitpoints, rather than current damage.

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

                  @Hepps I definitely prefer the current way to the alternative approach. The alternative approach is seriously limited in both influencing only 3 stats (the 3 main ones) and not allowing you to freely change the visual of the unit. Main case is that you may want to lower or remove the AA ability from a damaged unit.

                  The other cool thing that the current approach allows is having a unit able to absorb damage each combat round, by turning the damaged unit into the undamaged version of itself (for example, you can say that this unit absorbs/prevents 1 damage per round, healing at the end of each combat round).

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

                    @Cernel A simple work around to these issues is to give the unit +1 more hit point and have the last HP turn into a infrastructure unit that has neither combat values nor movement. Thus enabling you to create a corpse unit that could... under the right conditions be turned into a subsequently different unit upon capture by a specfic required unit.

                    I have not tested this... but I have to assume it would work. Getting hung up on how many remaining HP a unit has is kind of the real hurdle to making this work.

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

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

                      @alkexr @Frostion As Cernel stated, it doesn't work if the unit is dies (out of hit points) as dying overrides the check to damaged changes into. This could probably be changed and shouldn't be too difficult though I probably won't have time this week.

                      @Cernel I consider doing remaining hit points rather than damaged but most existing properties check damage so decided to go with that for consistency.

                      @Hepps That can work though I believe you'd need a player enforced rule to ban taking the final hit point during casualty selection.

                      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 1
                      • HeppsH Offline
                        Hepps Moderators @redrum
                        last edited by

                        @redrum Again while I haven't tested it.... the final hit point should be a moot point since once the unit hits the infrastructure level it should not be selectable as a casualty.

                        "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 Right but I think you can select multiple hit points in the same battle round casualty selection. So say I have a 2 HP unit that changes into infra at 1 damage, I could take 2 casualty hits in the same round and kill it rather than letting it change into the infra unit.

                          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 2
                          • HeppsH Offline
                            Hepps Moderators @redrum
                            last edited by

                            @redrum Ah yes.

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

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

                              PR to allow it to work for units with 0 HP left: https://github.com/triplea-game/triplea/pull/4720

                              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 4
                              • FrostionF Offline
                                Frostion Admin
                                last edited by

                                That sounds great! How exactly will this work? When units run out of HP, do they leave the battle and change afterwards (the winner getting ownership) or do they change during battle (where original owner can hold on to the changing unit and maybe use it during battle)?

                                I can imagine both behaviours being nice and useful, but changing after battle would probably be more simple.

                                Looking forward to testing this when I have the time ☺

                                Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

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

                                  @redrum That is really a solid addition, I believe, as a number of times I wished it would be possible mostly to leave some left overs, as infrastructures, to be retained or captured by the side owning the territory in which the battle took place. I was thinking to actually open a feature request about it once I had a finished thing on which to actually apply it forthright. It makes me also think to an old game, called "Total Annihilation", in which when you killed the enemy units a quantity of the iron it was used in their production would remain on the field, to be added to your stock of it (tho this would not work very well here, as I suppose all the attacking turned units would be able to retreat, that would not make sense (same story if you would use this for upgrading units to veteran status out of enemy casualties)).

                                  I see no issues if applied to defensive units only, and a possible application would be, for example, having "castle" units
                                  castle_newbe.png
                                  that can be "killed" by "trebuchets" units,
                                  trebuchets_newbe.png
                                  but actually turning into damaged or downgraded versions of themselves.
                                  castle_hit_newbe.png
                                  (since a trebuchet should not be able to completely disintegrate a castle out of existence)

                                  Will this immediately work for "air battles" too, right (and whatever case the unit would be preemptively removed, as well, like AA, subs and v2 naval bombardment)? For example, the trebuchets damaging castles would be good to have as an air battle before the regular battle. Would, then, the castles be turned for the regular battle, acting as per the abilities of the damaged/downgraded type, especially if they are supposed to make AA attacks?

                                  Another question would be how about the retreat for these units? Will the new unit, that is made out of a damaged/killed attacking unit, retain the acquired possibilities and limits (for example, unable to retreat if originated out of an unloaded unit)?

                                  Since the AA can kill a unit regardless of its hitpoints, will this work for such a case all the same as a unit reaching max damage by regular means (this needs to be documented)?

                                  I also wonder regarding the case of AA flyover attacks? Would it be possible to leave another unit where the one was shot down (during a movement phase)?

                                  1 Reply Last reply Reply Quote 0
                                  • FrostionF Offline
                                    Frostion Admin
                                    last edited by Frostion

                                    @Cernel and @redrum does
                                    the whenHitPointsDamagedChangesInto work with both infrastructure damage points as well as normal unit HP (land/sea/air)?

                                    Would be cool if it does. (And yes, I have not read this intire thread 😁 if it the answer should be here somewhere)

                                    Edit: And is strategic bombing / damaging of infrastructure hit points still restricted to be done by air units?

                                    Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

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

                                      @Frostion It works only for hitpoints, but this doesn't exclude infrastructures. In the example above, castle units may be infrastructures damaged by AA attacks from trebuchets.

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

                                        @Frostion The latter. The check of changes into is done at the end of each combat round. It now checks any damaged units and any units killed that round on whether they should change into a new unit.

                                        It only works on normal unit HP not bombing damage. A similar mechanism could be added for bombing damage so could be a new feature request. I believe bombing damage can be done by non-air units but not positive.

                                        @Cernel I don't believe changes into works for air battles as they have separate logic but haven't tested it. It should work for any part of a regular battle so AA, bombard, subs, etc.

                                        I believe for retreating it will keep existing possibilities but won't have any unload limitations since its a new unit.

                                        I believe it should work for AA that kill in one shot during normal battles.

                                        I don't think it'll work for flyover or strat bombing AA as those aren't regular battles with combat rounds.

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

                                        B C 2 Replies Last reply Reply Quote 3
                                        • B Offline
                                          beelee @redrum
                                          last edited by

                                          @redrum I know a lot of people have worked on this project over the years. You absolutely qualify for the triplea Hall of Fame. : ) Good Stuff !

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

                                            @redrum That retreat thing is a pretty major element, especially under default rules, in which if any of the units are unable to retreat, none can. It would at least need to be documented, as I don't think it may be expected.

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