Navigation

    TripleA Logo

    TripleA Forum

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

    Change Unit Ownership? [Re-opened]

    Maps & Mods
    5
    23
    2308
    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.
    • SlendyMcTendies
      SlendyMcTendies @wc_sumpton last edited by

      @wc_sumpton Does the value of PlayerAttachmentName need to be unique for each action? Because for some reason the unit control transfer stopped working when I added this code to the other 7 players (Russians, Japanese, Americans, etc)

      W 1 Reply Last reply Reply Quote 0
      • W
        wc_sumpton @SlendyMcTendies last edited by

        @slendymctendies

        Each player should have only one "playerAttachment", having more will cause problems. Thus 'PlayerAttachmentName' will not be unique. If problems persist, try adding 'players' <option>.

        Cheers...

        SlendyMcTendies 1 Reply Last reply Reply Quote 1
        • SlendyMcTendies
          SlendyMcTendies @wc_sumpton last edited by

          @wc_sumpton I'm confused about what you mean by players only being allowed "one" player attachment. You have two in your code example, yet it worked at the time.

          @wc_sumpton said in Change Unit Ownership? [Resolved]:

          @slendymctendies

          The following seems to work:

          <!-- Remove Capital Requirement -->
          <attachment foreach="$AllPlayers$" name="playerAttachment" attachTo="@AllPlayers@" javaClass="games.strategy.triplea.attachments.PlayerAttachment" type="player">
          	<option name="retainCapitalNumber" value="0"/>
          	<option name="retainCapitalProduceNumber" value="0"/>
          	<option name="giveUnitControl" value="$AllPlayers$"/>
          	<option name="giveUnitControlInAllTerritories" value="false"/>
          </attachment>
          <attachment foreach="$Territory$" name="triggerAttachment_Germans_SurrenderTo_Russians_@Territory@_ChangeOwnership" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
          	<option name="trigger" value="conditionAttachment_Germans_SurrenderTo_Russians"/>
          	<option name="when" value="before:germansEndTurn"/>
          	<option name="changeOwnership" value="@Territory@:Germans:Russians:false"/>
          	<option name="uses" value="1"/>
          </attachment>
          <!--  change military units canBeGivenByTerritoryTo -->
          <attachment name="triggerAttachment_canBeGivenByTerritoryTo_GermansToRussians" attachTo="Germans" javaClass="TriggerAttachment" type="player">
          	<option name="conditions" value="conditionAttachment_Germans_SurrenderTo_Russians"/>
          	<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
          	<option name="unitType" value="$AllUnits$"/>
          	<option name="unitProperty" value="canBeGivenByTerritoryTo" count="-reset-Russians"/>
          	<option name="when" value="after:germansPolitics"/>
          	<option name="uses" value="1"/>
          </attachment>
          <!--  Give unit control Germans to Russians  -->
          <attachment name="triggerAttachment_GiveUnitControl_GermansToRussians" attachTo="Germans" javaClass="TriggerAttachment" type="player">
          	<option name="conditions" value="conditionAttachment_Germans_SurrenderTo_Russians"/>
          	<option name="playerAttachmentName" value="PlayerAttachment" count="playerAttachment"/>
          	<option name="playerProperty" value="giveUnitControl" count="-reset-Russians"/>
          	<option name="when" value="after:germansPolitics"/>
          	<option name="uses" value="1"/>
          </attachment>
           <!--  Give give captured units Germans to Russians  -->
          <attachment name="triggerAttachment_GiveUnitControlInAllTerritories_GermansToRussians" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
          	<option name="trigger" value="conditionAttachment_Germans_SurrenderTo_Russians"/>
          	<option name="when" value="after:germansPolitics"/>
          	<option name="playerAttachmentName" value="PlayerAttachment" count="playerAttachment"/>
          	<option name="playerProperty" value="giveUnitControlInAllTerritories" count="true"/>
          	<option name="uses" value="1"/>
          </attachment>
          

          Cheers...

          So what do you mean by players only having one player attachment?

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