Navigation

    TripleA Logo

    TripleA Forum

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

    Units That Popping Up Randomly

    Map Making
    5
    26
    2155
    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.
    • Schulz
      Schulz last edited by

      I would like to having 5 submarines that popping up each round randomly in certain sea zones before German combat phase is it possible?

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

        @schulz You can definitely have units pop at random. Check out my Zombies-World War 2 scenario at https://forums.triplea-game.org/topic/2767/new-old-mods-for-triplea

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

          @rogercooper I couldn't open the game unfortunately but after having to take a look the XML I guess there are still differences.

          I would want to see having fixed amount of units being popped up in certain territories unlike here which seems like uncertain amount of units can pop up in every land territories

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

            @schulz I have a fixed amount of units as well. (I don't know of any way to have variable amount of units). You can use a variable to list the areas you want.

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

              @rogercooper

              How should I change foreach="$LandArea$ and @LandArea@ texts?

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

                @schulz You can rename LandArea to whatever you want (SeaArea maybe). At the beginning of the file, you can see how the LandArea file was defined.

                If you want a full explanation of variables, look in Pact of Steel 2

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

                  @rogercooper

                  It says "Attachment has invalid variables in forach : $SeaArea$

                  <attachment name="conditionAttachmentEveryTurn" attachTo="Germany" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                  <option name="rounds" value="1-100"/>
                  </attachment>

                  <attachment foreach="$SeaArea$" name="triggerAttachmentGermanygermanSubmarine@SeaArea@" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                  <option name="conditions" value="conditionAttachmentEveryTurn"/>
                  <option name="placement" value="@SeaArea@:submarine" count="1"/>
                  <option name="players" value="Germany"/>
                  <option name="chance" value="2:70"/>
                  <option name="when" value="before:germanyCombatMove"/>
                  </attachment>

                  <attachment foreach="$SeaArea$" name="triggerAttachmentGermanyBig@SeaArea@" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                  <option name="conditions" value="conditionAttachmentEveryTurn"/>
                  <option name="placement" value="@SeaArea@:submarine:submarine:submarine:submarine:submarine"/>
                  <option name="players" value="Germany"/>
                  <option name="chance" value="1:100"/>
                  <option name="when" value="after:usaPlace"/>
                  </attachment>

                  RogerCooper B TheDog 3 Replies Last reply Reply Quote 0
                  • RogerCooper
                    RogerCooper @Schulz last edited by

                    @schulz My first guess is that you did not define the variable correctly. If you post the XML, I will take a look.

                    If you have a small number of areas, you don't need to use variables.

                    1 Reply Last reply Reply Quote 0
                    • Schulz
                      Schulz last edited by

                      @rogercooper My intention is spamming 2 sub in North Atlantic 1 in Indian Ocean and 1 Pacific Ocean for Germany before germanyCombatMove each round.

                      And spamming 1 Austrian sub in Mediterranean before austriaCombatMove each round.

                      https://www.sendspace.com/file/4hz80b

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

                        @schulz said in Units That Popping Up Randomly:

                        It says "Attachment has invalid variables in forach : $SeaArea$

                        If this line is part of the error then try "foreach" instead of "forach"

                        Schulz 1 Reply Last reply Reply Quote 0
                        • Schulz
                          Schulz @beelee last edited by

                          @beelee My mistake to misspell it. The error came up with "foreach"

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

                            @schulz ahh...so much for an easy fix 🙂

                            1 Reply Last reply Reply Quote 0
                            • TheDog
                              TheDog @Schulz last edited by

                              @schulz
                              I have the random code working in your xml, here is the extract

                              <!-- this goes before map -->
                              <variableList>
                              <variable name="SZGermanySubs">
                              <element name="SZ 4"/>
                              <element name="SZ 5"/>
                              <element name="SZ 6"/>
                              <element name="SZ 7"/>
                              </variable>
                              </variableList>

                              <!-- this goes before attachmentList -->
                              <attachment name="conditionAttachmentEveryTurn" attachTo="Germany" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                              <option name="rounds" value="1-100"/>
                              </attachment>

                              <attachment foreach="$SZGermanySubs$" name="triggerAttachmentSZGermanySubs@SZGermanySubs@" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                              <option name="conditions" value="conditionAttachmentEveryTurn"/>
                              <option name="placement" value="@SZGermanySubs@:destroyer" count="1"/>
                              <option name="players" value="Germany"/>
                              <option name="chance" value="1:2"/>
                              <option name="when" value="before:germanyPurchase"/>
                              </attachment>

                              You will have to change the bold text, but hopefully its just a copy and paste.

                              Schulz 1 Reply Last reply Reply Quote 1
                              • Schulz
                                Schulz @TheDog last edited by Schulz

                                @thedog Thank you it worked though if subs pop up before movement phase they can't move. How to make them move and attack?

                                TheDog 1 Reply Last reply Reply Quote 0
                                • TheDog
                                  TheDog @Schulz last edited by

                                  @schulz
                                  In short I dont know.
                                  Maybe use a false delegate, like Politics delegate your not using that, put it before the germanyCombatMove and have the submarines appear before Politics delegate, then they might appear, move and attack?

                                  However, appearing, then moving and attacking , to me is not a fair mechanic. You will get the 'fear' factor in the player as they know the subs can appear in several areas, that should be good enough?

                                  The AI of course is fearless.

                                  Schulz 1 Reply Last reply Reply Quote 0
                                  • Schulz
                                    Schulz @TheDog last edited by

                                    @thedog
                                    I just created fake tech phases before Combat phase it didn't work unfortunately.

                                    It is true I would want Central Powers having this unfair advantage but Entente will be compensated by other factors like higher incomes, not being able to use captured factories or took enemy incomes after capturing their capitals.

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

                                      @Schulz

                                      To have the subs move after being placed use 'stepProperty':

                                      <step name="germansCombatMove" delegate="move" player="Germans">
                                         <stepProperty name="resetUnitStateAtStart" value="true"/>
                                      </step>
                                      

                                      Cheers...

                                      Schulz 1 Reply Last reply Reply Quote 2
                                      • Schulz
                                        Schulz @wc_sumpton last edited by Schulz

                                        @wc_sumpton

                                        Thank you it worked. Does it work for only country?

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

                                          @Schulz

                                          It will only affect Germany. Combat stats are reset normally at the end of the players Non-Combatmove. That is why the placed units don't move.

                                          Cheers...

                                          Schulz 1 Reply Last reply Reply Quote 0
                                          • Schulz
                                            Schulz @wc_sumpton last edited by

                                            How could I make this feature dependent to controlling some territories?

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