sleeping nations trigger function
-
Hi all,
is it opssible to make a nation at the start of the game "none-existant", means there no units at all on the board
and create a trigger that activates that country.After that activation that nation is active has it normal movements, combats and unit placing phases.
To make an example.
in AA41-anniversary the Chinese start an get instead of income an infantry for 2 territories
let's say thexml already knows a "resistance Chinese".
The trigger would be: if 4 of the Chinese territories are lost to the Axis, the trigger activates the "resistance Chinese". I want to know:
- definition of a sleeping nation with no units on the board
- trigger to activate
- trigger that activates the nation
Maybe someone knows a downloadable game with such a coding, then I check it myself.
-
@numetalfan You might want to check CrazyG's WW1 scenario.
-
that was a very interesting game link,
but he solves the problem differently:
By triggering former neutral countries become part of an original nation and will be from then on played as part of that country.something like:
<option name="notification" value="GreeceJoinsTheWar"/>
<option name="changeOwnership" value="Greece 01:NeutralNations:UnitedKingdom:true"/> -
I still look for a trigger that skips the nations steps until the condition occured.
In my example it would be the Chinese:
<step name="chinesePurchase" delegate="purchaseNoPU" player="Chinese"/>
<step name="chineseCombatMove" delegate="move" player="Chinese"/>
<step name="chineseBattle" delegate="battle" player="Chinese"/>
<step name="chineseNonCombatMove" delegate="move" player="Chinese" display="Non Combat Move"/>
<step name="chinesePlace" delegate="place" player="Chinese"/>
<step name="chineseEndTurn" delegate="endTurnNoPU" player="Chinese">Anyone an idea how the skip those steps by a Trigger A
and later activate them by a Trigger B
and where condition A and B contradict each other, so that always only one of them can be valid and so only one of the triggers too. -
You really can not turn steps off and on with triggers. This could be simulated, by reducing the movement of all units to 0 prior to combat move and then returning the movement back to normal after non-combat:
<attachment name="triggerAttachmentChineseDoNotMove" attachTo="Chinese" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentChineseDoNotMove"/> <option name="unitType" value="infantry:etc..."/> <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/> <option name="unitProperty" value="movement" count="0"/> <option name="when" value="before:chineseCombatMove"/> </attachment> <attachment name="triggerAttachmentChineseOneMoveUnits" attachTo="Chinese" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentAlwaysTrue"/> <option name="unitType" value="infantry:artillery"/> <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/> <option name="unitProperty" value="movement" count="1"/> <option name="when" value="after:chineseNonCombatMove"/> </attachment>
The number of territories could be set to a very high number for 'purchaseNoPU'.
Hope this gives you some ideas.
Cheers...
-
thx. Interesting I had the same idea just before you answered.
Go via the territories. An impossible combo from the start and later triggering the normal situation. The impossible combo keeps the "sleeping nation" out of the game, later it "wakes up" by a trigger condition.
I will try it this way and report.
-
another question:
<attachment name='rulesAttachment' attachTo='Chinese' javaClass='RulesAttachment' type='player'>
<option name='movementRestrictionTerritories' value='Sinkiang:Central China:China:Manchuria:Kwangtung:French Indochina'/>
<option name='movementRestrictionType' value='allowed'/>
<option name='productionPerXTerritories' value='infantry' count='2'/>the
<option name='productionPerXTerritories' value='infantry' count='2'/>
works as the Chinese are the territory owner themselvesis there a way to
a) define several countries
b) define they have to be controlled by the same alliance (e.g. Allies)
c) then to make those countries count to the ..perXTerritorriesthis would for the Chinese be Burma as an example.
Is Burma controlled by the British it counts for the Chinese for their ..perXTerritorries as if it is one of their countries.
possible or not?
-
The ownership of Burma would have to be changed over to Chinese:
<attachment name="triggerAttachmentBurmaChineseOwnership" attachTo="Chinese" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentAlwaysTrue"/> <option name="territories" value="Burma"/> <option name="territoryAttachmentName" value="TerritoryAttachment" count="territoryAttachment"/> <option name="territoryProperty" value="originalOwner" count="Chinese"/> <option name="when" value="before:chineseEndTurn"/> </attachment>
If an ally of Chinese controls Burma, then as the 'originalOwner', control of the territory should switch over to Chinese. Then after Chinese endTurn 'originalOwner' should be changed back to its original setting, or '-reset-' to remove.
Hope this works for you.
Cheers...
-
Hi,
thats a fine idea.
however the idea is - in this example - that at the time the <option name='productionPerXTerritories' value='infantry' count='2'/> for the Chinese is done, Burma is also part of it.So when exactly does the engine count all Chinese territories to get the number of new infantries?
If it is
<step name="chinesePurchase" delegate="purchaseNoPU" player="Chinese"/>
then the trigger should be changend into<option name="territoryProperty" value="originalOwner" count="Chinese"/>
<option name="when" value="before:chinesePurchase"/>instead of
<option name="when" value="before:chineseEndTurn"/>
is chineseEnd turn not too late?
-
You are probably right. I was thinking collect income, which is done at endTurn.
Cheers...