IsDestroyer
-
isDestroyer
Unit use anti-sub rules
An option withinunitAttachment
Parameters:value: true / false Cancels out an enemy isSub unit's first strike and submerge abilities. Enables enemy isSub units to be hit by air units if using ww2v3 rules. 'Air Attack Sub Restricted' property affects this option. Defaults to false if not set.
Example:
copy example to clipboardContext:
copy context to clipboardRelated:
is it possible to make a 1:1 programming, means ONE destoyer blocks exactly ONE sub, not all subs.
-
@Numetalfan said in IsDestroyer:
is it possible to make a 1:1 programming, means ONE destoyer blocks exactly ONE sub, not all subs.
Sadly this is not currently possible. It has been talked about before with having the option of 1 sub blocks 1,2,3...etc but ... yea no go right now
-
I want to create a trigger the changes the "isDestroyer" function by a condition:
a) the destroyer is in a sea zone adjacnet to a land containg a unit (let's saya "costal defense")
then a trigger will turn this option offb) is the destroyer elsewhere on the map, the trigger will not fire
my problem:
how to define a trigger condition that checks if the current place of a destroyer, a sea zone, is adjacent to land containing a specific unit (here: "costal defense")?
-
what I did so far:
- a second type of destroyer:
<attachment name="unitAttachment" attachTo="destroyer_near_sub_bunker" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
<option name="movement" value="2"/>
<option name="isSea" value="true"/>
<option name="attack" value="2"/>
<option name="defense" value="2"/>
</attachment>it does not have the "Isdestroyer" function
- conditions
<attachment name="conditionAttachmentdestroyerUKSZ7" attachTo="British" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="directPresenceTerritories" value="7 Sea Zone"/>
<option name="players" value="British:Russians:USA:Americans_west"/>
<option name="unitPresence" value="destroyer" count= "1"/>
</attachment><attachment name="conditionAttachmentAxisholdFrance" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="alliedOwnershipTerritories" value="France"/>
</attachment>and a trigger for that situation:
<attachment name="UKnoIsDestroyerSZ7" attachTo="British" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="when" value="after:britishCombatMove"/>
<option name="conditions" value="conditionAttachmentdestroyerUKSZ7:conditionAttachmentAxisholdFrance"/>
<option name="removeUnits" value="7 Sea Zone:destroyer" count="1"/>
<option name="placement" value="7 Sea Zone:destroyer_near_sub_bunker" count="1"/>
</attachment>indeed it works, the subs can dive and cannot be attacked
-
Even my coding works,
it's a static one, it works exactly für Sea Zone 7
I want an idea that works always, for any Sea Zone, if there is a sub bunker unit in the land adjacent
Any ideas?
-
@numetalfan the only way I know is to make one for every coastal SZ with different number of DDs each time.
Maybe the variable ? stuff redrum made could make it easier ? Idk
-
@numetalfan In custom mods i play, i always get rid of isDestroyer options and replace it with supportAttachments to have Destroyers decrease Submarine combat values at a 1:1 ratio. I do this to most of the units in general to have kinda rock scissor paper element. To compensate, Submarines cannot submerge at the start of combat, only after the first round of combat and dont have first strike ability.
Additionally i have air units do the same. They also act like a Anti-Sub unit. -
can you give me an example how to achieve that?
-
@numetalfan
Examples
Below makes Subs stronger against Battleship, by giving the Battleship the option to strengthen the Subs by +1 if encoutered at a 1:1 ratio<attachment name="supportAttachmentTorpedoTarget1" attachTo="Battleship" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType"> <option name="unitType" value="Submersible:Submarine"/> <option name="faction" value="enemy"/> <option name="side" value="defence:offence"/> <option name="dice" value="strength"/> <option name="bonus" value="1"/> <option name="number" value="1"/> <option name="bonusType" value="Torpedo Strike"/> <option name="players" value="Germans:Russians:British:Americans"/> </attachment>
Below Destroyers decrease enemy Sub combat values by -1 at a 1:1 ratio.
<attachment name="supportAttachmentDestroyer" attachTo="Destroyer" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType"> <option name="unitType" value="Submersible:Submarine"/> <option name="faction" value="enemy"/> <option name="side" value="defence:offence"/> <option name="dice" value="strength"/> <option name="bonus" value="-1"/> <option name="number" value="1"/> <option name="bonusType" value="Naval Combat"/> <option name="players" value="Germans:Russians:British:Americans"/> </attachment>
-
With the line
....option name="side" value="defence:offence"/>
will this not decrease both, defence and attack by 1 ?
-
@numetalfan Yes. This is intended. But you can do how you like. Even -2 for either defense or offense. No limits there.
-
is this a downloadable map ?
-
@numetalfan No. Its just my personal modded game based on NWO 5 Nations map. But i think there are some maps out there which are using negative and positive support attachments.
What do you need exactly? More details about how to structure a support attachment based rock scissor paper element into a game?
Feel free to ask. I will do as much as i can to help you with anything i am able to do.