Navigation

    TripleA Logo

    TripleA Forum

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

    EnemyPresence Trigger not working

    Map Making
    3
    14
    111
    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.
    • R
      RogerCooper last edited by

      The following code is supposed to give the Japanese 1 PU for every territory that contains an enemy unit. It does not seem to be firing. What is wrong?

      <attachment name="conditionAttachmentJapaneseEnemyUnitPresent" attachTo="Japanese" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
        <option name="enemyPresenceTerritories" value="all" count="each"/>
       </attachment>
       
       <attachment name="triggerAttachmentJapaneseEnemyUnitCount" attachTo="Japanese" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
        <option name="conditions" value="conditionAttachmentJapaneseEnemyUnitPresent"/>
        <option name="resource" value="PUs"/>
        <option name="resourceCount" value="1"/>
        <option name="when" value="before:JapaneseBidplace"/>
       </attachment>
      
      

      This scenario assigns the players randomly between 2 alliances, so I don't know the number of enemy territories in advance.

      C 2 Replies Last reply Reply Quote 0
      • C
        Cernel Moderators @RogerCooper last edited by

        @RogerCooper If you are getting no error, it should be something not validated. For example, are you sure the phase is called exactly as "JapaneseBidplace" (instead of, say, "japaneseBidPlace").

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

          @Cernel You were right on the capitalization issue, but fixing it did not solve the problem.

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

            @RogerCooper said in EnemyPresence Trigger not working:

            for every territory that contains an enemy unit.

            For this, you need a "map" value, instead of an "all" value, or the full list of territories ("all" doesn't actually mean all).

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

              @Cernel I put "map" in, but is doesn't help.

              Could the issue be the definition of "enemyPresenceTerritories"? There no preset alliances in the scenario, so enemy would be defined only through relationships.

              <attachment name="relationshipTypeAttachment" attachTo="War" javaClass="games.strategy.triplea.attachments.RelationshipTypeAttachment" type="relationship">
                    <option name="archeType" value="war"/>
                    <option name="isDefaultWarPosition" value="true"/>
                  </attachment>
              
              R C 2 Replies Last reply Reply Quote 0
              • R
                RogerCooper @RogerCooper last edited by

                @RogerCooper I also tried the players option, but it didn't help.

                <attachment name="conditionAttachmentJapaneseEnemyUnitPresent" attachTo="Japanese" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
                  <option name="enemyPresenceTerritories" value="map" count="each"/>
                  <option name="players" value="Japanese:Germans:British:Italians:Chinese:Americans"/>
                 </attachment>
                
                
                B 1 Reply Last reply Reply Quote 0
                • B
                  beelee @RogerCooper last edited by beelee

                  @RogerCooper

                  Can you try "unitPresence" and then don't list Japan ?

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

                    @beelee Removing Japan does not make the trigger work.

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

                      @RogerCooper said in EnemyPresence Trigger not working:

                      @Cernel I put "map" in, but is doesn't help.

                      Could the issue be the definition of "enemyPresenceTerritories"? There no preset alliances in the scenario, so enemy would be defined only through relationships.

                      My assumption is that thing should look at everything owned by a player that is in an archetype "war" relationship with the attached player. So, if you have no fixed alliances, be sure to have that "War" relationship defined since before the trigger should fire (usually, with the relationships initialize).

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

                        @Cernel The war relationship is defined.

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

                          @RogerCooper It's not only the relationship that must be defined. It must also be assigned specifically to every couple of powers having it between one another. Normally this is done with the relationship initialize. Just trying to make sure.

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

                            @Cernel All the relationships are properly defined. I start with A&B at war with each other and everyone else neutral. Then this bit of code randomly distributes them into 2 alliances.

                                <attachment name="relationshipTypeAttachment" attachTo="War" javaClass="games.strategy.triplea.attachments.RelationshipTypeAttachment" type="relationship">
                                  <option name="archeType" value="war"/>
                                  <option name="isDefaultWarPosition" value="true"/>
                                </attachment>
                                <attachment name="relationshipTypeAttachment" attachTo="Allied" javaClass="games.strategy.triplea.attachments.RelationshipTypeAttachment" type="relationship">
                                  <option name="archeType" value="allied"/>
                                  <option name="alliancesCanChainTogether" value="true"/>
                                </attachment>
                                <attachment name="relationshipTypeAttachment" attachTo="Neutrality" javaClass="games.strategy.triplea.attachments.RelationshipTypeAttachment" type="relationship">
                                  <option name="archeType" value="neutral"/>
                                </attachment>
                                
                            <attachment name="conditionAttachmentTurn1" attachTo="A" javaClass="games.strategy.triplea.attachments.RulesAttachment"  type="player"><option name="rounds"  value="1"/></attachment>
                                
                              <attachment foreach="$TriggerPlayer$" name="triggerAttachment@TriggerPlayer@ToA" attachTo="@TriggerPlayer@" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                                  <option name="conditions" value="conditionAttachmentTurn1"/>
                                  <option name="relationshipChange" value="@TriggerPlayer@:A:Neutrality:Allied"/>
                                  <option name="uses" value="1"/>
                                  <option name="chance" value="1:2"/>
                                  <option name="when"  value="before:ABidPlace"/>
                            	</attachment>
                            
                            <attachment foreach="$TriggerPlayer$" name="triggerAttachment@TriggerPlayer@ToB" attachTo="@TriggerPlayer@" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                                  <option name="conditions" value="conditionAttachmentTurn1"/>
                                  <option name="relationshipChange" value="@TriggerPlayer@:B:Neutrality:Allied"/>
                                  <option name="uses" value="1"/>
                                  <option name="chance" value="1:1"/>
                                  <option name="when"  value="before:BBidPlace"/>
                            	</attachment>
                            
                            

                            What I am trying to do now is to automatically balance the sides by giving money based upon the number of enemy units. If I can get this working I will have a neat system for randomizing any map,

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

                              @RogerCooper To be tested by the other triggers, that should happen at a point before when the triggers testing such relationships may fire. Just to make sure both triggers are not firing at the same time.

                              Assuming the former is true, then the matter, here, is that I'm seeing only triggers changing "Neutrality" to "Allied". Are you sure there are the needed archetype "War" relationships in effect, when you need them? May you post a screenshot of what you get in Game/Show Politics Panel at the moment, or the closest next stable point, in which the wanted triggers should fire?

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

                                @Cernel Here is the panel

                                844c0c9d-d5a3-4dcb-b165-45d2ad417fa2-image.png

                                The trick is that A&B start at war and the real players randomly ally with A or B. A & B are nominal players with no territories or units.

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