new unit with special rules - is it possible?



  • I found out that in an battle 1 Armour attacks 1 ATG
    the ATG only defends on a "2"

    that means there must be an error somewhere:

    <attachment name="supportAttachmentTankATG" attachTo="armour" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="unitType" value="ATG"/>
    <option name="faction" value="enemy"/>
    <option name="side" value="defence"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="AntiTankSupport"/>
    </attachment>

    <!-- ATG-->
    <attachment name="unitAttachment" attachTo="ATG" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
    <option name="movement" value="1"/>
    <option name="transportCost" value="3"/>
    <option name="attack" value="2"/>
    <option name="defense" value="2"/>
    <option name="requiresUnits" value="factory"/>
    </attachment>

    what can it be?



  • @Numetalfan

    I think "side" refers to the "attachTo" unit which in this case is "armour". Change it to "offense" and see what happens.

    As to your other question about finding the artillery support information. In your xml the commands used are deprecated and should be removed:

    <!-- Infantry -->
    <attachment name="unitAttachment" attachTo="infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
       <option name="movement" value="1"/>
       <option name="transportCost" value="2"/>
       <!-- <option name="isInfantry" value="true"/> Remove -->
       <option name="isLandTransportable" value ="true"/> <!-- Add -->
       <option name="isAirTransportable" value="true"/>
       <option name="attack" value="1"/>
       <option name="defense" value="2"/>
       <!-- <option name="artillerySupportable" value="true"/> Remove -->
       <!-- <property name="Unit Placement Restrictions" value="true" editable="false"> Remove -->
       <!-- <boolean/> Remove -->
       <!-- </property> Remove -->
       <!-- </attachment> Remove -->
    </attachment>
    
    <!-- Artillery -->
    <attachment name="unitAttachment" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
       <option name="movement" value="1"/>
       <option name="transportCost" value="3"/>
       <option name="attack" value="2"/>
       <option name="defense" value="2"/>
       <!-- <option name="artillery" value="true"/> Remove -->
     <option name="requiresUnits" value="factory"/>
       <!-- <property name="Unit Placement Restrictions" value="true" editable="false"> Remove -->
       <!-- <boolean/> Remove -->
       <!-- </property> Remove -->
       <!-- </attachment> Remove -->
    </attachment>
    

    Now lets rebuild it:

    <!-- Artillery support -->
    <attachment name="supportAttachmentArtillery" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
       <option name="unitType" value="infantry"/>
       <option name="faction" value="allied"/>
       <option name="side" value="offence"/>
       <option name="dice" value="strength"/>
       <option name="bonus" value="1"/>
       <option name="number" value="1"/>
       <option name="bonusType" value="ArtyOld"/>
       <option name="impArtTech" value="true"/>
    </attachment>-->
    

    To allow the ATG to support infantry just create another support attachment for the ATG just like the artillery.

    What can not be done is to have the ATG's support only be applied when there is an enemy tank present.

    Cheers...



  • Hi,

    I tried, I have no syntax errors - but - my changes have no effects

    1. Mortar - the mortar unit works like the old artillery, in offence an infantry gets +1 attack:

    the units
    <!-- Infantry -->
    <attachment name="unitAttachment" attachTo="infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
    <option name="movement" value="1"/>
    <option name="transportCost" value="2"/>
    <option name="isInfantry" value="true"/>
    <option name="isAirTransportable" value="true"/>
    <option name="attack" value="1"/>
    <option name="defense" value="2"/>
    </attachment>

    <!-- Mortar  -->
    <attachment name="unitAttachment" attachTo="mortar" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="1"/>
      <option name="transportCost" value="3"/>
      <option name="attack" value="2"/>
      <option name="defense" value="2"/>
      <option name="artillery" value="true"/>
    

    <option name="requiresUnits" value="factory"/>
    </attachment>

    <attachment name="supportAttachmentMortar" attachTo="mortar" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="unitType" value="infantry"/>
    <option name="faction" value="allied"/>
    <option name="side" value="offense"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="MortarInfantrySupport"/>
    </attachment>

    what might be the problem?



  • secont the "new" artillery

    it give +1 def to both, an infantry and an ATG

    the units

    <!-- Artillery -->
    <attachment name="unitAttachment" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="1"/>
      <option name="transportCost" value="3"/>
      <option name="attack" value="2"/>
      <option name="defense" value="2"/>
      <option name="artillery" value="true"/>
    

    <option name="requiresUnits" value="factory"/>
    </attachment>

    <!-- ATG-->
    <attachment name="unitAttachment" attachTo="ATG" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
    <option name="movement" value="1"/>
    <option name="transportCost" value="3"/>
    <option name="attack" value="2"/>
    <option name="defense" value="2"/>
    <option name="requiresUnits" value="factory"/>
    </attachment>

    und the bonus:

    <!-- ArtilleryI support -->
    <attachment name="supportAttachmentArtilleryI" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="unitType" value="infantry"/>
    <option name="faction" value="allied"/>
    <option name="side" value="offence"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="ArtilleryInfantrySupport"/>
    </attachment>

    <!-- ArtilleryA support -->
    <attachment name="supportAttachmentArtilleryA" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="unitType" value="ATG"/>
    <option name="faction" value="allied"/>
    <option name="side" value="offence"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="ArtilleryATGSupport"/>
    </attachment>

    I tried some battles, but the effects were not visible
    what can be the reason?



  • @Numetalfan

    There are no players assigned to the supportAttachment's. You need to add:

    <option name="players" value="Germans:Russians:Japanese:British:Italians:Chinese:Americans"/>
    

    This will allow each country to use the support.

    Cheers...



  • @wc_sumpton said in new unit with special rules - is it possible?:

    <option name="players" value="Germans:Russians:Japanese:British:Italians:Chinese:Americans"/>

    thx. I added this, but unfortunately, nothing works:

    1. ATG support with:

    <!-- ATG support-->
    <attachment name="supportAttachmentTankATG" attachTo="armour" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="players" value="Germans:Russians:Japanese:British:Italians:Chinese:Americans_west:USA"/>
    <option name="unitType" value="ATG"/>
    <option name="faction" value="enemy"/>
    <option name="side" value="offence:defence"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="AntiTankSupport"/>
    </attachment>

    and

    <!-- ATG-->
    <attachment name="unitAttachment" attachTo="ATG" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
    <option name="movement" value="1"/>
    <option name="transportCost" value="3"/>
    <option name="attack" value="2"/>
    <option name="defense" value="2"/>
    <option name="requiresUnits" value="factory"/>
    </attachment>

    and

    <!-- Armour -->
    <attachment name="unitAttachment" attachTo="armour" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="2"/>
      <option name="transportCost" value="3"/>
      <option name="canBlitz" value="true"/>
      <option name="isLandTransport" value="true"/>
      <option name="attack" value="3"/>
      <option name="defense" value="3"/>
    

    <option name="requiresUnits" value="factory"/>
    </attachment>

    1. Artillery support to Infantry and ATG with

      <!-- Artillery -->
      <attachment name="unitAttachment" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="1"/>
      <option name="transportCost" value="3"/>
      <option name="attack" value="2"/>
      <option name="defense" value="2"/>
      <option name="requiresUnits" value="factory"/>
      </attachment>

    and

    <!-- ArtilleryI support -->
    <attachment name="supportAttachmentArtilleryI" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="players" value="Germans:Russians:Japanese:British:Italians:Chinese:Americans_west:USA"/>
    <option name="unitType" value="infantry"/>
    <option name="faction" value="allied"/>
    <option name="side" value="defence"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="ArtilleryInfantrySupport"/>
    </attachment>

    <!-- ArtilleryA support -->
    <attachment name="supportAttachmentArtilleryA" attachTo="artillery" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="players" value="Germans:Russians:Japanese:British:Italians:Chinese:Americans_west:USA"/>
    <option name="unitType" value="ATG"/>
    <option name="faction" value="allied"/>
    <option name="side" value="defence"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="ArtilleryATGSupport"/>
    </attachment>

    1. Mortar support for an infantry (like original artillery)

    <!-- Mortar support -->
    <attachment name="supportAttachmentMortar" attachTo="mortar" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="players" value="Germans:Russians:Japanese:British:Italians:Chinese:Americans_west:USA"/>
    <option name="unitType" value="infantry"/>
    <option name="faction" value="allied"/>
    <option name="side" value="offence"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="MortarInfantrySupport"/>
    </attachment>

    with

    <!-- Mortar  -->
    <attachment name="unitAttachment" attachTo="mortar" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="1"/>
      <option name="transportCost" value="3"/>
      <option name="attack" value="2"/>
      <option name="defense" value="2"/>
      <option name="artillery" value="true"/>
    

    <option name="requiresUnits" value="factory"/>
    </attachment>

    and

       <!-- Infantry -->
    

    <attachment name="unitAttachment" attachTo="infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
    <option name="movement" value="1"/>
    <option name="transportCost" value="2"/>
    <option name="isInfantry" value="true"/>
    <option name="isAirTransportable" value="true"/>
    <option name="attack" value="1"/>
    <option name="defense" value="2"/>
    </attachment>

    why do they all fail?


  • Moderators

    Im not a 100% sure how this works but try adding

    <option name="impArtTech" value="true"/>

    and see what happens

    To your support attachment



  • Hi beelee,

    I tried again and everything worked, my saved test game was probably buggy.

    Your syntax file does not seem necessary. But thx



  • @Numetalfan

    Glad to hear everything is now working. I don't use a saved game to test, because the saved game carries a copy of the xml, not the one being tested. I usually use edit mode on a new game to remove units, reset territory ownership and add units to mock up battles to test changes.

    @beelee

    "impArtTech" deal with the technology 'improvedArtillerySupport' which if 'true', will double the number of supported units when this technology is received.

    Cheers...


Log in to reply