Allow Triggers to Give Multiple Resources
-
Would be nice if resource used the count value:
Present way with resourceCount<attachment name="triggerAttachmentRussians3_RecoveredGermanTech" attachTo="Russians" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="objectiveAttachmentRussians3_HardAdvance"/> <option name="resource" value="techTokens" count="2"/> <option name="resourceCount" value="2"/> <option name="uses" value="1"/> </attachment> <attachment name="triggerAttachmentRussians3_RecoveredGermanPUs" attachTo="Russians" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="objectiveAttachmentRussians3_HardAdvance"/> <option name="resource" value="PUs"/> <option name="resourceCount" value="2"/> <option name="uses" value="1"/> </attachment>
Using count:
<attachment name="triggerAttachmentRussians3_RecoveredGermanTechPUs" attachTo="Russians" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="objectiveAttachmentRussians3_HardAdvance"/> <option name="resource" value="techTokens" count="2"/> <option name="resource" value="PUs" count="2"/> <option name="uses" value="1"/> </attachment>
With the New Resource Bar I can see a lot of map using multiple resources in triggers.
Cheers...
This has been added to the list of resource improvements here: https://forums.triplea-game.org/topic/128/resource-system-assessment-and-improvements
-
@wc_sumpton Yeah, this is a good suggestion so you can use multiple resources in the same trigger. I believe to achieve this now you'd have to make multiple triggers on the same condition.
-
If this was implemented, I would have to "clean up" a lot of my XMLs ... It has really annoyed me to make multiple triggers.
-
@frostion lol
-
@frostion This is the price of progress. lol
-
This has been added to the list of resource improvements here: https://forums.triplea-game.org/topic/128/resource-system-assessment-and-improvements
-
@redrum Thank you
Cheers...
-
@wc_sumpton I remember Veqryn said that one should not use a same trigger to make multiple things, but make multiple different triggers, one for each thing; tho I don't know why is that and if that would apply to the case of giving different resources, as well, or not.
Myself, I'm not sure if I would prefer making multiple triggers, one for each resource, or putting multiple resources into the same trigger. -
HOW I CODED MY XML TRIGGERS:
Each of the triggers in my maps does only 1 thing.
If I need to do 2 things, I made 2 different triggers. -
@cernel Nevermind, I understand he clarified that:
so long as there is only 1 effect from the trigger, (in your case, "placement"), then your trigger would be considered a "well-coded" trigger
So, having a bunch of "resource" would be good practice, if I got it right. So, I guess making 2 triggers to give 1 resource each or 1 trigger to give 2 resources is just a matter of preference; not sure about myself.
-
I wonder if "activateTrigger" and another effect within a basic trigger, fall into bad practice category. Or political actions and user actions that fire multiple effects via "activateTrigger". Actually Political action can't even use "activateTrigger".