Question about an optional trigger
-
I would like to create a trigger that which game will be started without some features if it is selected before game launched. These are Strategic Bombing-Intercept-Convoy blockades.
I'am not even sure if it is possible.
-
@schulz You can do that with options. See the Global Game Redesign. But my suggestion is to have 2 xml files.
-
Almost all unit options can be changed with triggers. For something like SBR:
<attachment name="unitAttachment" attachTo="bomber" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> ... <option name="isStrategicBomber" value="true"/> </attachment>
Then create a custom property in the <property> section of the xml:
<property name="Bomber can SBR" value="true" editable="true"> <boolean/> </property>
A condition to read the custom property:
<attachment name="conditionAttachmentUseSBR" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="gameProperty" value="Bomber can SBR"/> </attachment>
And a trigger to set the option:
<attachment name="triggerAttachmentTurnOffSBR" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentUseSBR"/> <option name="invert" value="true"/> <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/> <option name="unitType" value="bomber"/> <option name="unitProperty" value="isStrategicBomber" count="false"/> <option name="when" value="before:germansCombatMove"/> <option name="uses" value="1"/> </attachment>
Separate game properties could be developed for each change, or use 1 property.
Hope this is helpful.
Cheers...
-
@wc_sumpton @rogercooper Thank you. I just wonder if there is any way to start without blockade zones instead of cancelling blockade abilities of ships.
Also is it possible to make upkeep optional?
-
For blockade zones:
<option name="territoryAttachmentName" value="TerritoryAttachment" count="territoryAttachment"/> <option name="territories" value="Sea Zone 1:Sea Zone 2"/> <option name="territoryProperty" value="blockadeZone" count="false"/>
For upkeep cost:
<option name="unitProperty" value="createsResourcesList" count="-reset-"/>
Cheers...
-
@wc_sumpton Thank you. Worked perfectly.
-
@wc_sumpton Currently I have a property called "AI compatibility" which turn off upkeep-bombing-intercept. Is it possible to make only Allies countries selectable and making Axis hard AI as default with single property as well?
-
Sorry, none that I am aware of. You can set the Player to AI with 'defaultType="AI"'. This can be selected by the player at the start of the game.
Cheers...