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

    changing support attachments with triggers

    Scheduled Pinned Locked Moved Map Making
    8 Posts 2 Posters 1.2k Views 2 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.
    • F Offline
      ff03k64
      last edited by

      I am wondering how to do this. I can turn the attachment on with a trigger, but can't figure out how to change anything. At least not from reading POS2 xml.

      Alternatively, turning an attachment off could be useful as well. I could just turn one off, and another one on that has the changes already.

      B 1 Reply Last reply Reply Quote 0
      • B Offline
        beelee @ff03k64
        last edited by

        @ff03k64 I've never used it for a unitSupportAttachment but you could try "unitAttachmentName".

        Here's an example with it being used for unitAttachment:

        <attachment name="triggerAttachmentTransportCost8Changer" attachTo="Changer" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
        <option name="trigger" value="conditionAttachmentTransportCost8Changer"/>
        <option name="unitType" value="transport"/>
        <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
        <option name="unitProperty" value="attack" count="0"/>
        <option name="unitProperty" value="defense" count="1"/>
        <option name="unitProperty" value="isCombatTransport" count="true"/>
        <option name="when" value="after:changerCombatMove"/>
        <option name="uses" value="1"/>
        </attachment>

        So that changes the unitAttachments for the transport to what is listed. You could try it with:
        <option name="unitAttachmentName" value="UnitSupportAttachment" count="unitSupportAttachment"/>

        then add the changes. Idk if that wording is correct but worth a try. Also you should use conditions and not trigger the way the example does.

        F 1 Reply Last reply Reply Quote 0
        • F Offline
          ff03k64 @beelee
          last edited by

          @beelee Unfortunately, support attachments aren't part of the unit attachment.

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            beelee @ff03k64
            last edited by

            @ff03k64 said in changing support attachments with triggers:

            @beelee Unfortunately, support attachments aren't part of the unit attachment.

            yea but in pos2 it says:

            unitAttachmentName values: the type of attachment (UnitAttachment, UnitSupportAttachment) and the exact full name of the attachment to be changed. Defaults to UnitAttachment if missing.

            That's why I thought you might be able to make the change with it.

            F 1 Reply Last reply Reply Quote 0
            • F Offline
              ff03k64 @beelee
              last edited by

              @beelee I have to apologize, i think you are right. I was doing some digging, and I was starting to come around to your line of reasoning anyway, but the way you worded it this time it just clicked in my head.

              1 Reply Last reply Reply Quote 1
              • B Offline
                beelee
                last edited by

                So just to be clear here is the transport in the above example in Unit Attachments

                <!-- Transport -->
                <attachment name="unitAttachment" attachTo="transport" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
                <option name="movement" value="2"/>
                <option name="isSea" value="true"/>
                <option name="transportCapacity" value="11"/>
                <option name="attack" value="0"/>
                <option name="defense" value="0"/>
                <option name="canBeGivenByTerritoryTo" value="British"/>
                </attachment>

                When the trigger is activated it will change the transport to the "unitAttachmentName" one. Thought you could do something similar only with the Support Attachments instead.

                F 1 Reply Last reply Reply Quote 0
                • F Offline
                  ff03k64 @beelee
                  last edited by ff03k64

                  @beelee
                  This is what i have and doesn't work.

                  		<attachment name="triggerAttachmentHeavyCAP" attachTo="XCOM" javaClass="TriggerAttachment" type="player">
                  			<option name="unitType" value="heavy"/>
                  			<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
                  			<option name="unitProperty" value="createsUnitsList" count="1:grenade"/>
                  			<option name="unitAttachmentName" value="UnitSupportAttachment" count="supportAttachmentXCOMholo"/>
                  			<option name="unitProperty" value="number" count="4"/>	
                  			<option name="playerAttachmentName" value="UserActionAttachment" count="userActionAttachment_heavy_promotion"/>
                  			<option name="playerProperty" value="activateTrigger" count="-reset-triggerAttachmentHeavyCOL:1:false:false:false:false"/>
                  			<option name="playerProperty" value="text" count="promote_heavy_col"/>
                  			<option name="playerProperty" value="costResources" count="-reset-1000:XP"/>
                  		</attachment>	
                  

                  It actually throws an error about "createsUnitsList"

                  Trying some other things now

                  Edit: Seperated it into a second trigger, that did it!

                  
                  			
                  		<attachment name="triggerAttachmentHeavyCAP2" attachTo="XCOM" javaClass="TriggerAttachment" type="player">
                  			<option name="unitType" value="heavy"/>
                  			<option name="unitAttachmentName" value="UnitSupportAttachment" count="supportAttachmentXCOMholo"/>
                  			<option name="unitProperty" value="number" count="4"/>	
                  		</attachment>	
                  			
                  		<attachment name="triggerAttachmentHeavyCAP" attachTo="XCOM" javaClass="TriggerAttachment" type="player">
                  			<option name="unitType" value="heavy"/>
                  			<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
                  			<option name="unitProperty" value="createsUnitsList" count="1:grenade"/>
                  			<option name="playerAttachmentName" value="UserActionAttachment" count="userActionAttachment_heavy_promotion"/>
                  			<option name="playerProperty" value="activateTrigger" count="-reset-triggerAttachmentHeavyCOL:1:false:false:false:false"/>
                  			<option name="playerProperty" value="text" count="promote_heavy_col"/>
                  			<option name="playerProperty" value="costResources" count="-reset-1000:XP"/>
                              <option name="activateTrigger" value="triggerAttachmentHeavyCAP2:1:false:false:false:false"/>
                  		</attachment>	
                  
                  B 1 Reply Last reply Reply Quote 1
                  • B Offline
                    beelee @ff03k64
                    last edited by

                    @ff03k64 heh heh was just gonna say that I didn't think you could do both unit attachment and support in one trigger. But you figured out 🙂 Right on I like a success story 🙂

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