Navigation

    TripleA Logo

    TripleA Forum

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

    Major Powers taking over neutrals

    Map Making
    3
    11
    170
    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.
    • RogerCooper
      RogerCooper last edited by

      I am working on a mod where a number of different powers may take control of neutral areas through a random event. Neutral areas may have varying numbers of neutral units.

      I am looking for code that would allow me change the territory owner and all the neutral units in the territory. The event should not fire if the territory is not neutral. Changing the owner looks easy, but the changing the unit-ownership looks tricky.

      1 Reply Last reply Reply Quote 2
      • W
        wc_sumpton last edited by

        @RogerCooper

        Please review this topic.

        Cheers...

        RogerCooper 1 Reply Last reply Reply Quote 3
        • RogerCooper
          RogerCooper @wc_sumpton last edited by

          @wc_sumpton Thank you, I will check it out.

          RogerCooper 1 Reply Last reply Reply Quote 1
          • RogerCooper
            RogerCooper @RogerCooper last edited by

            As of now, I am just trying to get territory ownership to change.

               <attachment  name="triggerAttachmenttest" attachTo="Soviet_Union" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                  <option name="conditions" value="conditionAttachmentEveryTurn" />
                  <option name="players" value="Soviet_Union" />
                  <option name="chance" value="1:1" />
                  <option name="chanceIncrementOnFailure" value="1" />
                  <option name="when" value="before:Sovet_UnionPurchase" />
                  <option name="changeOwnership" value="Ireland:Non_Aligned:Soviet_Union:false"/>
                  <option name="uses" value="1"/>
                </attachment>
            

            Other events are firing correctly. Is there something I need to set to allow territory ownership changes?

            B 1 Reply Last reply Reply Quote 1
            • B
              beelee @RogerCooper last edited by beelee

              @rogercooper

              I think you need it set to true instead of false on the changeOwnership line

              Edit
              hmm ... I don't think that should matter though

              Edit 2
              well Idk what boolean captured means.
              Screenshot from 2025-06-24 21-26-40.png

              I have both true and false triggers. I went through all the properties and didn't see anything standout that would need to be turned on.

              I guess you could try setting to true and see what happens otherw ise wc probably know

              RogerCooper 1 Reply Last reply Reply Quote 1
              • RogerCooper
                RogerCooper @beelee last edited by

                @beelee It didn't make a difference.

                B 1 Reply Last reply Reply Quote 2
                • B
                  beelee @RogerCooper last edited by beelee

                  @rogercooper

                  Try without chance and see if it'll fire

                  Edit
                  Here's a couple that I have that work but Idk if as said something else needs turned on

                  Screenshot from 2025-06-24 21-34-37.png

                  RogerCooper 1 Reply Last reply Reply Quote 1
                  • RogerCooper
                    RogerCooper @beelee last edited by

                    @beelee It still doesn't fire.

                    B 1 Reply Last reply Reply Quote 1
                    • B
                      beelee @RogerCooper last edited by beelee

                      @rogercooper

                      well bummer. Guess we best ping @wc_sumpton 🙂

                      Edit
                      yea I think the captured thing is for your Allies as if a Allied capital is conquered then your Allie takes controlled and then if it's a enemy they just take control. The true false part

                      But you probably knew that 🙂

                      RogerCooper 1 Reply Last reply Reply Quote 2
                      • RogerCooper
                        RogerCooper @beelee last edited by

                        @beelee I figure out the problem. There was a spelling error in a different forEach loop. When I fixed, that everything works.

                        B 1 Reply Last reply Reply Quote 2
                        • B
                          beelee @RogerCooper last edited by

                          @rogercooper RightArm.png

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