Trigger Question
-
If a trigger activates a trigger, will that trigger fire regardless of it's conditions ? I didn't think so but am starting to wonder. I have a trigger when it fires, it activates another one and that one has a condition that isn't true but fires anyway.
-
@beelee from 'pact_of_steel_2.xml'
activateTrigger values: This will fire another named trigger. Format: "triggerName:numberOfTimes:useUses:testUses:testConditions:testChance". "activateTrigger" will be affected by "each" in a condition statement. triggerName is the name of the trigger to fire, numberOfTimes is the number of times to fire that trigger, useUses makes sure the firing uses up a "use" at the end of this round, and the tests test the trigger before firing. example: value="triggerAttachmentRussians5_FarEastReserves:1:false:false:false:false"
So to answer your question, Yes the trigger will always fire if the last value is 'false', if the last value is 'true', then the conditions of the trigger are check prior to firing.
Hope this helps
Cheers...
-
Thank you was getting ready to dive in to POS2 again lol
-
I'm still having trouble with this. The way i understand it is, using this trigger:
<attachment name="triggerAttachment_Destroyer_1_Ordered_to_Vichy_Port" attachTo="French" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachment_Axis_Conquer_All_France:Vichy_active:conditionAttachmentFrenchDD"/>
<option name="chance" value="3:6"/>
<option name="when" value="before:frenchCombatMove"/>
<option name="activateTrigger" value="triggerAttachment_Axis_Conquer_All_France_Destroyer1_Place:1:true:true:true:true"/>
<option name="activateTrigger" value="triggerAttachment_Destroyer1_Must_Sail_to_Vichy_Port_93_Sea_Zone_!:1:true:true:true:true"/>
</attachment>would mean that the two "activate" triggers will only fire if the above one does, ( which needs it 's "chance" to hit in order to fire ), along with all of the individual triggers conditions for the "activate ones" also being true, in order for them to fire.
Unfortunately the other triggers are still firing sometimes.
-
@beelee short answer 'No'
'triggerAttachment_Axis_Conquer_All_France_Destroyer1_Place' will also fire when it's 'conditions' check is 'true' and the same is for 'triggerAttachment_Destroyer1_Must_Sail_to_Vichy_Port_93_Sea_Zone_!'.So without seeing those triggers and there 'conditions' values, my guess is that they are firing because of those values and not because of 'triggerAttachment_Destroyer_1_Ordered_to_Vichy_Port'.
Hope you understand what I am saying, and I hope it help to explain why the other triggers may still be firing.
Cheers...
-
ok so basically the two activate triggers will fire if their conditions are met regardless if the trigger that activates them fires or not ? I don't see what activate trigger does then.
Is there a way to create a condition with a trigger ? I tried using chance on a condition but it didn't work. I need the chance trigger to somehow make the other two only fire when chance is successful.
Thanks
-
@beelee
Have the chance trigger change a switch condition. Then have the two other triggers check the switch. Change the switch back to false at the end of the turn.Switch Condition:
<attachment name="conditionAttachment_Destroyer_1_Ordered_to_Vichy_Port" attachTo="French" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="switch" value="false"/> </attachment>
Trigger to Change Switch:
<attachment name="triggerAttachment_Destroyer_1_Ordered_to_Vichy_Port" attachTo="French" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Axis_Conquer_All_France:Vichy_active:conditionAttachmentFrenchDD"/> <option name="chance" value="3:6"/> <option name="players" value="French"/> <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachment_Destroyer_1_Ordered_to_Vichy_Port"/> <option name="playerProperty" value="switch" count="true"/> <option name="when" value="before:frenchCombatMove"/> </attachment>
Then one more trigger to change the switch back:
<attachment name="triggerAttachment_Destroyer_1_Ordered_to_Vichy_Port_False" attachTo="French" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_Destroyer_1_Ordered_to_Vichy_Port"/> <option name="players" value="French"/> <option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachment_Destroyer_1_Ordered_to_Vichy_Port"/> <option name="playerProperty" value="switch" count="false"/> <option name="when" value="before:frenchEndTurn"/> </attachment>
Now have the other trigger just check to see if 'conditionAttachment_Destroyer_1_Ordered_to_Vichy_Port' is true.
Hope this helps.
Cheers...
-
I'll give it a go. Thanks again
-
yea looks as if this is gonna work just fine. Figured there was a way, but i couldn't figure it out without your help
I know it's in pos2 but I just have trouble grasping some of what is explained there. At any rate, Thanks again for cluing me in.
Peace Out
-
@beelee
No problem. Just happy this was helpfulCheers...
-
did belee make a new mod/map?
What's it called?
-
Hi Captain
Yea added Oztea's 1939 setup for the global game and have been working on a "vichy option" for it. It's not gonna do quite what i want but thanks to redrum and wc It'll be pretty close -
Ran into another issue. I have this "condition"
<attachment name="conditionAttachmentFrenchCA" attachTo="French" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="directPresenceTerritories" value="map" count="1"/>
<option name="unitPresence" value="cruiser" count="1"/>
</attachment>used with this trigger
<attachment name="triggerAttachment_Cruiser1_Ordered_to_Vichy_Port" attachTo="French" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachment_Axis_Conquer_All_France:Vichy_active:conditionAttachment_Turns2:conditionAttachmentFrenchCA"/>
<option name="chance" value="3:6"/>
<option name="players" value="French"/>
<option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentCruiser1_Ordered_to_Vichy_Port"/>
<option name="playerProperty" value="switch" count="true"/>
<option name="when" value="before:frenchCombatMove"/>
</attachment>which works correctly but when I use this
<attachment name="conditionAttachmentFrenchCA2" attachTo="French" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="directPresenceTerritories" value="map" count="1"/>
<option name="unitPresence" value="cruiser" count="2"/>
</attachment>and this
<attachment name="triggerAttachment_Cruiser2_Ordered_to_Vichy_Port" attachTo="French" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachment_Axis_Conquer_All_France:Vichy_active:conditionAttachment_Turns2:conditionAttachmentFrenchCA2"/>
<option name="chance" value="3:6"/>
<option name="players" value="French"/>
<option name="playerAttachmentName" value="RulesAttachment" count="conditionAttachmentCruiser2_Ordered_to_Vichy_Port"/>
<option name="playerProperty" value="switch" count="true"/>
<option name="when" value="before:frenchCombatMove"/>
</attachment>this trigger won't fire. The only difference is having the 2 cruisers instead of 1. unitPresence" value="cruiser" count="2"
I thought that would mean that if I have 2 cruisers on the map the trigger would fire but if only 1 cruiser it wouldn't.If there are no cruisers on the map, then the first trigger won't fire either, which is correct. Anyone know why this second trigger isn't firing ? I tried changing the map "count" to 2 and also just getting rid of the count as well but no go.
Thanks
-
@beelee did you try it with two cruisers in one territory, with map count at '1'. My bet is that it would work then.
directPresenceTerritories (list territories to check) map (all the territories) 1 (the count of territories that have to match): so only 1 territory has to match for this to be true. unitPresence (check for units) cruiser (type of unit) 2 (the number of units per territory). So unless you have 2 units in a single territory, this will not return as true. If you try count as 2 for map and count as 1 for cruiser then you should get what you are asking for. But that will return false for 2 cruisers in 1 territory.
Hope this helps some.
Cheers...
-
right on man. Finally got it to work right. It turns out setting map to 2 for count doesn't work but it gave me the idea to do that if I list the sea zones separately and that did the trick. I tried map with no count and that doesn't work either so my guess is count must mean how many maps. Since there's only one, 1 is the only number that works.
At any rate, map at 1 with 2 cruisers and then list the zones with count at 2 and 1 cruiser combine them into an Or condition and we're all dialed in
I don't think my placement will work 100% correctly but it will only require 1 edit in less than 10% of the games, so i can live with that.
Once again Thanks for all your help
-
@wc_sumpton said in Trigger Question:
@beelee from 'pact_of_steel_2.xml'
activateTrigger values: This will fire another named trigger. Format: "triggerName:numberOfTimes:useUses:testUses:testConditions:testChance". "activateTrigger" will be affected by "each" in a condition statement. triggerName is the name of the trigger to fire, numberOfTimes is the number of times to fire that trigger, useUses makes sure the firing uses up a "use" at the end of this round, and the tests test the trigger before firing. example: value="triggerAttachmentRussians5_FarEastReserves:1:false:false:false:false"
So to answer your question, Yes the trigger will always fire if the last value is 'false', if the last value is 'true', then the conditions of the trigger are check prior to firing.
Hope this helps
Cheers...
No, actually:
The activate trigger will always fire, upon the trigger firing (assuming this is what you mean), if the last 3 entries are "false:false:false".
To check the condition of the trigger to activate (assuming such trigger has any), it is the penultimate entry that must be true (as per what you pasted, the ultimate one is testing chance).
-
@beelee good to hear, still it seems funny that:
<attachment name="conditionAttachmentFrenchCA2" attachTo="French" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directPresenceTerritories" value="map" count="2"/> <option name="unitPresence" value="cruiser" count="1"/> </attachment>
Did not work for you when you had cruisers in at least 2 different territories. At least you figured out a work-around.
Happy modding!
Cheers...
-
yea i thought that was weird too. It makes sense the way you explained it. I'm gonna mess with it some more and see if i can get "map" count="2" to work. I just want to understand it correctly at this point.
-
-
Cool. Thanks for posting again. I gave it another crack and got it to work with map count =2. Needless to say that saves a lot of work. Idk what I did the other day when i tried it and failed. i thought I had that failure saved but I must've worked over it.
Oh well, alls well that ends well