Error with Trigger Attachment



  • I am getting an error with the following attachments.

        <attachment name="conditionAttachmentTurn1" attachTo="British" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
          <option name="rounds" value="1"/>
        </attachment>
        
        <attachment name="triggerAttachmentTest" attachTo="British" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
          <option name="conditions" value="conditionAttachmentTurn1"/>
          <option name="placement" value="Celtic Sea Zone:Battleship"/>
          <option name="when" value="before:germanPurchase"/>
        </attachment>
    

    I receive the error "Unexpected Exception while setting values for attachment: TriggerAttachment attached to: Player Id named: British with name:triggerAttachmentTest.

    What I am doing wrong


  • Moderators

    @RogerCooper I might be overlooking something, but looks all good to me. Assuming the zone and unit names are correct, maybe see if you have another trigger called "triggerAttachmentTest" in that xml.


  • Admin

    @RogerCooper

    Which version of the game are you using? 1.9 or 2.0

    Could you attach a full XML zipped attachment for us to look at?

    Are you getting more information in the console window or an option to report the error if 2.0?



  • @Cernel It should have been

        <attachment name="triggerAttachmentTest" attachTo="British" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
          <option name="conditions" value="conditionAttachmentTurn1"/>
          <option name="placement" value="Celtic Sea Sea Zone:battleship"/>
          <option name="when" value="before:germanPurchase"/>
        </attachment>
    
    

    There is no error message, but it still does not fire. Is there a way of testing whether conditionAttachment is being met or a trigger firing?



  • @LaFayette I fixed the syntax error but it is still not firing. I am using 2.0 and no error is appearing in the console window.


  • Admin

    Will probably need a zipped copy of the map to dig into this.


  • Moderators

    @RogerCooper said in Error with Trigger Attachment:

    @Cernel It should have been

        <attachment name="triggerAttachmentTest" attachTo="British" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
          <option name="conditions" value="conditionAttachmentTurn1"/>
          <option name="placement" value="Celtic Sea Sea Zone:battleship"/>
          <option name="when" value="before:germanPurchase"/>
        </attachment>
    
    

    There is no error message, but it still does not fire. Is there a way of testing whether conditionAttachment is being met or a trigger firing?

    Either:

    • You have another condition called "conditionAttachmentTurn1".
    • You have another trigger called "triggerAttachmentTest".
    • The "when" is not referring to the phase you are looking at (the "when" is not validated, so it might even be an inexistent phase).

  • Moderators

    Of course, still as long as the zone and unit names are correct. Are you sure that "Celtic Sea Sea Zone" is not, maybe, "Celtic Sea Zone"? However, if there are any issues in any of them and you are not getting errors, I guess that's a problem too.



  • @Cernel Of course the issue was that I forget to set "Use Triggers" to true.


Log in to reply
 

37571
1788
2105
Who's Online
Visitors Today