Chance in triggers
-
@Cernel It would impact a lot of maps as almost all the A&A maps and many of the older maps don't use when. Here is I think the only POS2 explanation which mentions it firing at the 'default' time but not really what that means:
when values: this is a value of when the trigger should fire. it is optional, and if left out the trigger will fire at its default time. "before/after:name-of-step" (example: value="after:chineseEndTurn"). 'when' can be set multiple times if you want a trigger to fire in multiple spots. FYI: if your triggers are displaying odd behavior, MAKE SURE WHEN IS SET. complex triggers can experience unexpected behavior if 'when' is not set. -
@Cernel
when values: this is a value of when the trigger should fire. it is optional, and if left out the trigger will fire at its default time. "before/after:name-of-step" (example: value="after:chineseEndTurn"). 'when' can be set multiple times if you want a trigger to fire in multiple spots.
FYI: if your triggers are displaying odd behavior, MAKE SURE WHEN IS SET. complex triggers can experience unexpected behavior if 'when' is not set.I was able to not use a "condition" or "when", with deterministic triggers.
-
@redrum Yes, what I was saying is that the "default time" should be documented, obviously.
Moreover, having this default time, missing the when, is quite the dumb liability in the making of activated triggers testing conditions, as those triggers would also fire on their own, so you need to set a "when" that will never happen (like referring to a non-existent phase), that is a huge and mandatory hack. Very bad process here.
-
@Cernel Agree on both points. The first we can probably address. The second would require a lot of effort.
-
@redrum If the default when are staying, it would be good to have a way to specify a "never" for the when option. Maybe something like:
<option name="when" value="null"/>
That is understood by the program as the trigger never firing (unless activated).
-
In that case why not...
<option name="when" value="activation"/>
... instead of "null"? Or maybe "triggered"??
When making xml code, I think the terms and wording should support understanding and intuition, so cryptic language should be kept to a minimum. -
-
I tried this code:
<attachment name="conditionAttachmentUtahBeach" attachTo="Americans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
<option name="alliedOwnershipTerritories" value="Utah Beach" count="1"/>
</attachment>
<attachment name="triggerAttachmentUtahBeachInfantry" attachTo="Americans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachmentUtahBeach"/>
<option name="placement" value="Utah Beach:infantry" count="2"/>
<option name="players" value="Americans"/>
<option name="when" value="before:AmericansEndTurn"/>
</attachment>
<attachment name="triggerAttachmentUtahBeachArtillery" attachTo="Americans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachmentUtahBeach"/>
<option name="placement" value="Utah Beach:artillery" count="1"/>
<option name="players" value="Americans"/>
<option name="when" value="before:AmericansEndTurn"/>
</attachment>
<attachment name="triggerAttachmentUtahBeachArmor" attachTo="Americans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player">
<option name="conditions" value="conditionAttachmentUtahBeach"/>
<option name="placement" value="Utah Beach:armour" count="1"/>
<option name="players" value="Americans"/>
<option name="chance" value="3:6"/>
<option name="when" value="before:AmericansEndTurn"/>
</attachment>Still does not work. Does anyone see what is wrong?
-
@RogerCooper What do you mean by doesn't work? You get an error? None of them fire? Only the non-chance ones fire?
-
@redrum The triggers do not fire. There is no error message.
-
@RogerCooper Since you say that it does not work and you are receiving no error message, either, first thing I would guess is that the "when" is wrong, as that is not validated.
Be sure that corresponds exactly to the phase you are looking for.
Also, probably you should link here to the xml you are working on, or at least tell what game is that, if possible (that way I could have seen myself if this guess of mine is on spot). -
@Cernel Here is the D-Day_3.xml. This is mod of the existing D-Day map.
-
@RogerCooper You have the wrong phase name in the "when" condition. Replace the when condition in all the triggers with this:
<option name="when" value="before:americanEndTurn"/>
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login