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.
    • RogerCooperR Offline
      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

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

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

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

            @rogercooper

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

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

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

                RogerCooperR B TheDogT 3 Replies Last reply Reply Quote 0
                • RogerCooperR Offline
                  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
                  • 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

                                            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