Navigation

    TripleA Logo

    TripleA Forum

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

    Problem with TriggerAttachment using placement option

    Map Making
    trigger
    4
    12
    534
    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 receiving the error "Unexpected error while setting values for attachment..." The error disappears when I remove the placement option. The values reference are valid "<player name="Americans" optional="false"/>" & "<unit name="airfield"/>". What am I doing wrong?

      <attachment name="triggerAttachmentAmericansBuildAirfieldAtGuadacanal" attachTo="Americans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
            <option name="trigger" value="conditionAttachmentAmericansCanBuildAtGuadacanal"/>
            <option name="when" value="after:americansPlace"/>
            <option name="placement" value="Americans:airfield"/>
      </attachment>
      
      
      redrum C 3 Replies Last reply Reply Quote 0
      • redrum
        redrum Admin @RogerCooper last edited by

        @RogerCooper can you post the error message?

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

          games.strategy.engine.data.GameParseException: map name: 'file:/C:/Users/Roger/triplea/downloadedMaps/Guadacanal/games/Guadacanal.xml', game name: 'Guadacanal', Unexpected Exception while setting values for attachment: TriggerAttachment attached to: PlayerId named:Americans with name: triggerAttachmentAmericansBuildAirfieldAtGuadacanal

          redrum 2 Replies Last reply Reply Quote 0
          • redrum
            redrum Admin @RogerCooper last edited by

            @RogerCooper any additional details? Otherwise I'd need to see the XML file.

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

              @RogerCooper said in Problem with TriggerAttachment using placement option:

              I am receiving the error "Unexpected error while setting values for attachment..." The error disappears when I remove the placement option. The values reference are valid "<player name="Americans" optional="false"/>" & "<unit name="airfield"/>". What am I doing wrong?

              <attachment name="triggerAttachmentAmericansBuildAirfieldAtGuadacanal" attachTo="Americans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                    <option name="trigger" value="conditionAttachmentAmericansCanBuildAtGuadacanal"/>
                    <option name="when" value="after:americansPlace"/>
                    <option name="placement" value="Americans:airfield"/>
              </attachment>
              
              

              I'm almost sure "trigger", if still working, is a very long time deprecated option, in favour of same-behaving "conditions".

              @redrum @LaFayette @RoiEX Is there a place were deprecated items are kept track of? Did veqryn let you know about any list he made. I know since @redrum deprecates, they are kept track of in pos2, until removed, but, before redrum, deprecates were not kept in there (quite reasonable, as that is a guide, so no need telling people any deprecated elements they should never use anyways), so I assume veqryn and whoever else before were tracking them somewhere else.

              ?

              Captain Crunch redrum 2 Replies Last reply Reply Quote 0
              • Captain Crunch
                Captain Crunch Banned @Cernel last edited by Captain Crunch

                @Cernel I'm seriously giving Dislikes for blatant overuse of commas now 😜

                Cernel put 8 commas in 1 sentence rooofl

                1 Reply Last reply Reply Quote -1
                • redrum
                  redrum Admin @Cernel last edited by

                  @Cernel POS2 is where they are tracked but for anything done before my involvement, they might not be included.

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

                    @RogerCooper Anyways, what that option is doing is trying to place 1 (default count) unit called "airfield" in a zone called "Americans". The only way it can not work is that you don't have one of these.

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

                      @RogerCooper As @Cernel points out, I believe the issue is you need to specify the territory not player in the "placement" option like this:

                      <attachment name="triggerAttachmentAmericansBuildAirfieldAtGuadacanal" attachTo="Americans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                            <option name="trigger" value="conditionAttachmentAmericansCanBuildAtGuadacanal"/>
                            <option name="when" value="after:americansPlace"/>
                            <option name="placement" value="Guadacanal:airfield"/>
                      </attachment>
                      
                      C 1 Reply Last reply Reply Quote 2
                      • C
                        Cernel Moderators @redrum last edited by

                        @redrum said in Problem with TriggerAttachment using placement option:

                        @RogerCooper As @Cernel points out, I believe the issue is you need to specify the territory not player in the "placement" option like this:

                        <attachment name="triggerAttachmentAmericansBuildAirfieldAtGuadacanal" attachTo="Americans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                              <option name="trigger" value="conditionAttachmentAmericansCanBuildAtGuadacanal"/>
                              <option name="when" value="after:americansPlace"/>
                              <option name="placement" value="Guadacanal:airfield"/>
                        </attachment>
                        

                        And, if I'm right that the option "trigger" was deprecated ages ago, it would rather be this:

                        <attachment name="triggerAttachmentAmericansBuildAirfieldAtGuadacanal" attachTo="Americans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
                              <option name="conditions" value="conditionAttachmentAmericansCanBuildAtGuadacanal"/>
                              <option name="when" value="after:americansPlace"/>
                              <option name="placement" value="Guadacanal:airfield"/>
                        </attachment>
                        

                        I personally also specify a count, in these cases, despite the default being 1 (not sure if this is a good or bad practice, writing useless counts equal to default?).

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

                          @redrum Guadacanal.xml

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

                            @Cernel Thank you, I will fix it.

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