trigger question - unit with hit
-
@beelee not sure what units you're using but I have Global 40 ones in Global 40 House Rules if you want to just copy them
-
@beelee
that's it<!-- BattleShip-damaged -->
<attachment name="unitAttachment" attachTo="battleship-damaged" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
<option name="movement" value="2"/>
<option name="attack" value="4"/>
<option name="defense" value="4"/>
<option name="isSea" value="true"/>
<option name="canBombard" value="true"/>
<option name="hitPoints" value="2"/><option name="whenHitPointsRepairedChangesInto" value="0:true:battleship"/>
</attachment>
My "special unit" was very similar, but the most important coding is:
<option name="whenHitPointsRepairedChangesInto" value="0:true:battleship"/>
that is what I missed
thx -
I still miss something, everythings works fine, but the repairing ist not happening
here you see the new unit adjacant to a factory, but it was not repaired
the codes are:
-
<property name="Units Repair Hits End Turn" value="true" editable="true">
<boolean/>
</property> -
<property name="Two hit battleship" value="true" editable="false">
<boolean/>
</property> -
<property name='Two HitPoint Units Require Repair Facilities' value='true' editable='true'>
<boolean/>
</property> -
<attachment name="unitAttachment" attachTo="factory" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
<option name="isFactory" value="true"/>
<option name="isAAforBombingThisUnitOnly" value="true"/>
<option name='repairsUnits' value='battleship:battleship-damaged'/>
</attachment> -
<attachment name="unitAttachment" attachTo="battleship-damaged" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
<option name="movement" value="2"/>
<option name="attack" value="4"/>
<option name="defense" value="4"/>
<option name="isSea" value="true"/>
<option name="canBombard" value="true"/>
<option name="hitPoints" value="2"/>
<option name="whenHitPointsRepairedChangesInto" value="0:true:battleship"/>
</attachment>
I wonder what is missing
-
-
@numetalfan yea so unfortunately, that's not gonna work. If i edit the damaged BB to have 1 hit point of damage, then it does. But if we could do that we wouldn't need it anyway. So back to the same issue.
I suggest looking at how "Hulls" work in Total World War. I'm gonna take a look at it myself. It seems as if you ought to be able to make something work with the Hulls. I'm not real familiar with them but think you place them and make it turn into a BB by using "consumesUnits" somehow.
Here's what he has
<attachment name="unitAttachment" attachTo="germanBattleship" javaClass="UnitAttachment" type="unitType">
<option name="movement" value="2"/>
<option name="attack" value="6"/>
<option name="defense" value="5"/>
<option name="attackRolls" value="2"/>
<option name="defenseRolls" value="2"/>
<option name="canBombard" value="true"/>
<option name="isSea" value="true"/>
<option name="hitPoints" value="2"/>
<option name="bombard" value="5"/>
<option name="requiresUnits" value="germanDocks:germanFactory"/>
<option name="consumesUnits" value="1:germanHull"/>
<option name="whenHitPointsDamagedChangesInto" value="1:true:germanBattleship-damaged"/>
</attachment>I'm not sure how it changes. I'm gonna read up on it
-
@beelee Still not quite sure how it works
consumesUnits
values: requires that a unit be present in a territory, then when this unit is placed the other units are destroyed / upgraded into this unit. Can have multiple instances of this, which means it consumes multiple types of units. -
@beelee hmm...yea I don't think that's gonna work either. Because you can't place your BB then w/out a Damaged one. What is the exact scenario again ? Is this for the PH attack ? Or you want to be able to do this anywhere ?
Edit
Ok I just went through th thread again and I think WC is right, you can't place a damaged unit in game. Might be able to figure out away to make your scenario still work though. I'm gonna think on it some more -
Ok so have the DamagedBB placed when your trigger sees all the BBs sunk. Might as well make it a A0 D0 M0 since it's not going anywhere. Then your -10 PU trigger fires when he sees it's there. Then at the start of JPNs turn have a trigger remove it. That way if JPN attacks again it won't be there to soak a hit.
-
that was excatly my first programming, but this way of doing it restricts the game. I want the user to decide what he does.
If he decides to move the damaged BB to a shore next to factory it should be repaired, if the player decides to attack with it, it should be possible too.
I think the programmers should enlarge the "placement" function by the battleship_hit.
-
@numetalfan yea that'd be cool. I'd make a Feature request as WC suggested then, because edit is the only way to do it for now.
There's been a few more developers active lately. If it's easy, maybe someone will take it on sooner than later.
Might request at git also https://github.com/triplea-game/triplea/issues then add Feature Request from the Label menu. Might get more visibility that way. I'd post it here too.
-
thx
-
Trigger question.
First trigger condition....something like
name='conditionAttachmentJapaneseBattleships' attachTo='Japanese' javaClass='RulesAttachment' type='player'>
<option name='directPresenceTerritories' value='map' count='1'/>
<option name='unitPresence' value='battleship' count='1'/>Second trigger condition
name='conditionAttachmentJapaneseBattleships' attachTo='Japanese' javaClass='RulesAttachment' type='player'>
<option name='directPresenceTerritories' value='map' count='1'/>
<option name='unitPresence' value='battleship_hit' count='1'/>It does not work! There is an error
So how make a condition that checks the presence of a regular battleship but that has already got a hit in a defined territory??
-
@numetalfan do you have "when" set for your trigger ? If so , might need to play around with which phase.
It does find the BB, just not the damaged one ?
-
That was just an example. My trigger has a when...
Yeah. If there is a battleship in thst sea zone the trigger works. Is there a BB with a hit it doesn't. And ...battleship_hit.. causes an immediate error, the game will not start.
-
@numetalfan hmm...yea when the BB is hit it still calls it a BB when you hover on it so Idk ... you could try making the BB turn into a different unit when hit and then search for that.
Sort of what we were trying earlier with the "BattleshipDamaged"
-
Hi all,
I tried
<attachment name="conditionAttachmentPearlHarbour" attachTo="Americans_west" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="directExclusionTerritories" value="53 Sea Zone" count="1"/>
<option name="rounds" value="1"/>
</attachment>I thought this coding would check how the status of 53 sea zone is:
If Japan did not attack or the attack failed, this condition should be wrong, there would still be an unit (battleship) of the American_west thereIf the Japanese are succesful, there are no more allied ships left, so the condition would be true.
yet, it doesn't work correctly. I wonder why
-
@numetalfan I would try using "unitPresence" and"directPresenceTerritories" instead . Something like
<option name="directPresenceTerritories" value="53 Sea Zone" count="1"/>
<option name="unitPresence" value="battleship" count="1"/>