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

    Change control of naval mine (AA unit)

    Scheduled Pinned Locked Moved Map Making
    3 Posts 2 Posters 655 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.
    • VictoryFirstV Offline
      VictoryFirst
      last edited by VictoryFirst

      Sometimes the naval mines in the game I am working on get captured by naval victories and are therefore controlled by the wrong nation because they function as Anti-Aircraft. I am trying to make a trigger to replace these mines with the correct ones if that happens, but it does not work.

      	<attachment name="conditionAttachmentWrongMineSZ11" attachTo="Russians" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
      		<option name="alliedPresenceTerritories" value="SZ 11"/>
      		<option name="unitPresence" value="mines" count="1"/>
      	</attachment>
      
      	<attachment name="triggerAttachmentChangeToBerlinMine" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
      		<option name="conditions" value="conditionAttachmentWrongMineSZ11"/>			
      		<option name="changeOwnership" value="SZ 11:ANY:Germans:true"/>
      		<option name="when" value="before:russiansNonCombatMove"/>
      		<option name="when" value="before:frenchNonCombatMove"/>
      		<option name="when" value="before:britishNonCombatMove"/>
      		<option name="when" value="before:italiansNonCombatMove"/>
      		<option name="when" value="before:americansNonCombatMove"/>
      		<option name="when" value="before:austrohungariansNonCombatMove"/>
      		<option name="when" value="before:germansNonCombatMove"/>
      		<option name="when" value="before:ottomansNonCombatMove"/>
      	</attachment>
      

      I checked and the condition works, but the trigger doesn't change the mine to a German one.

      wc_sumptonW 1 Reply Last reply Reply Quote 1
      • wc_sumptonW Offline
        wc_sumpton @VictoryFirst
        last edited by

        @victoryfirst

        All I did was add a territory attachment for SZ 11.

        <attachment name="territoryAttachment" attachTo="SZ 11" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory">
        	<option name="captureUnitOnEnteringBy" value="Germans"/>
        </attachment>
        

        Territories marked as "isWater" do not require territory attachments.

        Cheers...

        VictoryFirstV 1 Reply Last reply Reply Quote 3
        • VictoryFirstV Offline
          VictoryFirst @wc_sumpton
          last edited by

          @wc_sumpton

          Thank you, it works now! Awesome! 😁

          1 Reply Last reply Reply Quote 2

          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