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

    Units That Popping Up Randomly

    Scheduled Pinned Locked Moved Map Making
    26 Posts 5 Posters 4.5k Views 5 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.
    • SchulzS Offline
      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 Online
        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"

        SchulzS 1 Reply Last reply Reply Quote 0
        • SchulzS Offline
          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 Online
            beelee @Schulz
            last edited by

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

            1 Reply Last reply Reply Quote 0
            • TheDogT Offline
              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.

              https://forums.triplea-game.org/tags/thedog
              https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

              SchulzS 1 Reply Last reply Reply Quote 1
              • SchulzS Offline
                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?

                TheDogT 1 Reply Last reply Reply Quote 0
                • TheDogT Offline
                  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.

                  https://forums.triplea-game.org/tags/thedog
                  https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

                  SchulzS 1 Reply Last reply Reply Quote 0
                  • SchulzS Offline
                    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
                    • wc_sumptonW Offline
                      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...

                      SchulzS 1 Reply Last reply Reply Quote 2
                      • SchulzS Offline
                        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
                        • wc_sumptonW Offline
                          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...

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

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

                            RogerCooperR 1 Reply Last reply Reply Quote 0
                            • wc_sumptonW Offline
                              wc_sumpton
                              last edited by

                              @Schulz

                              Not sure what you are asking. If only certain territories are controlled then the newly placed sub can move? Otherwise Germany can not move these newly placed subs.

                              As to making the 'stepProperty' trigger dependent, it can not be done.

                              Cheers...

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

                                @wc_sumpton I mean these units will be spawned each round only if the owner of these units control certain territories.

                                1 Reply Last reply Reply Quote 0
                                • wc_sumptonW Offline
                                  wc_sumpton
                                  last edited by

                                  @Schulz
                                  Gotya'.

                                  So if the units are not spawned, the 'stepProperty' would have not effect, even though it is still part of 'germansCombatMove'.

                                  So again my question, 'Why do you want to control when 'stepProperty' fires?'

                                  Slightly confused

                                  Cheers...

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

                                    @schulz You can have multiple conditions. Check Pact of Steel 2.

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

                                      @wc_sumpton

                                      I though having these subs being spawned wouldn't make sense if Germany defeated or controls no coastal territory.

                                      I don't know how to deal with "<stepProperty name="resetUnitStateAtStart" value="true"/>" even if these units stop being spawning temporarily.

                                      1 Reply Last reply Reply Quote 0
                                      • wc_sumptonW Offline
                                        wc_sumpton
                                        last edited by

                                        @Schulz

                                        I think I understand what you are saying. You do not need to "turn off" '<stepProperty name="resetUnitStateAtStart" value="true"/>'. All this does is reset/clear Unit states, which is also done at the end of Non-Combat Movement by default.

                                        The only change to game play will only appear when units are spawned, this will allow then to move during the same turn that they appear. If the units do not spawn, that's ok, there should be no effect.

                                        '<stepProperty name="resetUnitStateAtStart" ' value can not be changed with triggers. But from what I understand by what you are describing that should be okay.

                                        Cheers...

                                        1 Reply Last reply Reply Quote 1

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