Oztea 1939 Global
-
Thought I had one for this but I was wrong. Do now lol
At any rate, I have a trigger placement problem. When the below trigger activates, all of the triggers place whether their conditions are met or not. So if only one neutral Destroyer present, it will remove the DD correctly but then place all the other naval units as well instead of just the DD.
It's kind of involved but here is some of the xml
<attachment name="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Turns_German" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachment_Germany_Occupies_Southern_France:Vichy_active:conditionAttachment_Fleet_Can_Turn_Axis"/>
<option name="chance" value="3:6"/>
<option name="when" value="before:germansPlace"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_DDPlace:1:true:true:false:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_DDPlace2:1:true:true:false:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_TRPTPlace:1:true:true:false:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_BBPlace:1:true:true:false:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_CAPlace:1:true:true:false:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_CA2Place:1:true:true:false:false"/>
</attachment>Here are the conditions:
<attachment name="conditionAttachment_Germany_Occupies_Southern_France" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="directOwnershipTerritories" value="Southern France" count="1"/>
</attachment><attachment name="Vichy_active" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="gameProperty" value="Vichy Option"/>
</attachment><attachment name="conditionAttachment_Fleet_Can_Turn_Axis" attachTo="Neutral_True" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="conditions" value="conditionAttachment_Fleet_Can_Turn_Free_Destroyer:conditionAttachment_Fleet_Can_Turn_Free_Transport:conditionAttachment_Fleet_Can_Turn_Free_Battleship:conditionAttachment_Fleet_Can_Turn_Free_Cruiser"/>
<option name="conditionType" value="OR"/>
</attachment>Here's one of the above conditions:
<attachment name="conditionAttachment_Fleet_Can_Turn_Free_Destroyer" attachTo="Neutral_True" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="directPresenceTerritories" value="93 Sea Zone" count="1"/>
<option name="unitPresence" value="destroyer" count="1"/>
</attachment>Here's the entire xml:
Oztea_1939_Global xml 1.97.zipOriginally discussed here but thought I might as well give it it's own zone:
https://forums.triplea-game.org/topic/1697/trigger-question/13?_=1613495624437
Any help is appreciated.
Thanks -
The activateTrigger is not testing conditions. In the called trigger there is 'conditionAttachment_False' (always false condition), so adding any other conditions there will not make a different. The always false condition should be removed and the activateTrigger shoud be:'1:true:true:true:false' to test for the conditions.
Cheers...
-
@wc_sumpton right on thanks. I'll give it a go
-
@wc_sumpton Right on that worked. Sadly I'm still struggling. I have the trigger firing twice. I need to add another condition. A "switch" somehow to the trigger but just can't figure it out.
<attachment name="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_CA2Place" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachment_Axis_Occupies_Southern_France:conditionAttachment_Fleet_Can_Turn_Free_Cruiser2"/>
<option name="placement" value="93 Sea Zone:cruiser"/>
<option name="when" value="before:germansPlace"/>
<option name="uses" value="1"/>
<option name="activateTrigger" value="triggerAttachment_Fleet_Can_Turn_Germany_Cruiser_Remove:1:true:true:false:false"/>
</attachment>This will fire as well:
<attachment name="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Turns_German" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachment_Germany_Occupies_Southern_France:Vichy_active:conditionAttachment_Fleet_Can_Turn_Axis"/>
<option name="chance" value="3:6"/>
<option name="when" value="before:germansPlace"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_DDPlace:1:true:true:true:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_DDPlace2:1:true:true:true:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_TRPTPlace:1:true:true:true:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_BBPlace:1:true:true:true:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_CAPlace:1:true:true:true:false"/>
<option name="activateTrigger" value="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_CA2Place:1:true:true:true:false"/>
</attachment>I need the first one not to fire. I've come close, but it's just beyond me for some reason. Here's what I currently have. German player changed only so far.
-
well I tried this:
<attachment name="conditionAttachment_VichyFleetCanTurnGermanSwitch" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="switch" value="true"/>
</attachment>and this:
<attachment name="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_CA2Place" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachment_Axis_Occupies_Southern_France:conditionAttachment_Fleet_Can_Turn_Free_Cruiser2"/>
<option name="placement" value="93 Sea Zone:cruiser"/>
<option name="when" value="before:germansPlace"/>
<option name="uses" value="1"/>
<!-- the below just prevents the other triggers from ever firing, by setting the condition to be something impossible -->
<option name="players" value="Germans"/>
<option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachment_VichyFleetCanTurnGermanSwitch"/>
<option name="playerProperty" value="switch" count="false"/>
<option name="activateTrigger" value="triggerAttachment_Fleet_Can_Turn_Germany_Cruiser_Remove:1:true:true:false:false"/>
</attachment>with false and true being changed but still no joy. I'll take another break and try again. Pretty sure it's simple. Kinda like me lol
-
To me it reads as if all the triggers are firing at the same time:
<option name="when" value="before:germansPlace"/>
It may be better to split them up to insure the order in which the fire:
<attachment name="conditionAttachment_VichyFleetCanTurnSwitch" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="switch" value="false"/> </attachment>
Now use one trigger to change the switch
<attachment name="triggerAttachment_ChangeVichyFleetCanTurnSwitch" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_AlwaysFalseCondition"/> <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachment_VichyFleetCanTurnSwitch"/> <option name="playerProperty" value="switch" count="false"/> <!-- To insure it only gets used once --> <option name="uses" value="1"/> </attachment>
Then have each player call this switch if they pass their chance, but do it after their Noncombat Movement. With the switch set have the placement/remove triggers check this switch along with the rest of the conditions. These triggers can be fired before placement. Don't forget to reset the switch after its use.
Hopefully by splitting the actions it will be easier to understand what is happening and when.
Cheers...
-
Hay @beelee
Here another idea that may work. Combine the switch change and chance triggers into one trigger.
You will still need the switch and the always false conditions, but change the chance call like:<attachment name="triggerAttachment_ChangeVichyFleetCanTurnSwitch" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <!-- Change the conditions --> <option name="conditions" value="conditionAttachment_Germany_Occupies_Southern_France:Vichy_active:conditionAttachment_Fleet_Can_Turn_Axis"/> <!-- Add the chance --> <option name="chance" value="3:6"/> <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachment_VichyFleetCanTurnSwitch"/> <option name="playerProperty" value="switch" count="true"/> <!-- Going to add all the players that can take the fleet --> <option name="players" value="Germans:Italians"/> <!-- When for each player --> <option name="when" value="after:germansNonCombatMove"/> <option name="when" value="after:italiansNonCombatMove"/> <!-- To insure it only gets used once --> <option name="uses" value="1"/> </attachment>
Note no activateTrigger calls, the switch is use to enable the other triggers:
<attachment name="triggerAttachment_Germany_Occupies_Southern_France_Fleet_Germany_CA2Place" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <!-- Add switch to conditions --> <option name="conditions" value="conditionAttachment_Axis_Occupies_Southern_France:conditionAttachment_Fleet_Can_Turn_Free_Cruiser2:conditionAttachment_VichyFleetCanTurnSwitch"/> <option name="placement" value="93 Sea Zone:cruiser"/> <option name="when" value="before:germansPlace"/> <option name="uses" value="1"/> <option name="activateTrigger" value="triggerAttachment_Fleet_Can_Turn_Germany_Cruiser_Remove:1:true:true:false:false"/> </attachment>
And then the trigger to reset the switch:
<attachment name="triggerAttachment_VichyFleetCanTurnSwitchBack" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <!-- Check to see if switch is true --> <option name="conditions" value="conditionAttachment_VichyFleetCanTurnSwitch"/> <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachment_VichyFleetCanTurnSwitch"/> <option name="playerProperty" value="switch" count="false"/> <!-- Player, when and uses --> <option name="players" value="Germans:Italians"/> <option name="when" value="after:germansPlace"/> <option name="when" value="after:italiansPlace"/> <option name="uses" value="1"/> </attachment>
Cheers...
-
@wc_sumpton right on thanks again. I'll give it a go