option name="unitPresence" value="Unit" count="0"
-
hej triple A code wizards! trying to solve another issue here (and kindly request some advice:)
I want to have 1 specific unit automatically being replaced (by purchase) when slain
*( why? representing automatic successsion of Clan leaders by a family member and keeping AI always with a leader ingame/ with only 1 turn absence; * )I tried to work with different variations of
<option name="unitPresence" value="Daimyo" count="0"/> but it doesn't work,
not on its own, not if combined with a <option name="directPresenceTerritories" value="map" count="1"/> or a "alliedExclusionTerritories"<attachment foreach="$AllRegularClans$:$AllRegularClansLC$" name="conditionAttachment_No_Daimyo_@AllRegularClans@" attachTo="@AllRegularClans@" javaClass="RulesAttachment" type="player"> <option name="directPresenceTerritories" value="map" count="1"/> <option name="unitPresence" value="Daimyo" count="0"/> <option name="unitPresence" value="Shiro_(Castle):Shiro_1Hit:Kyuden_(Palace):Kyuden_1Hit:Jousai_(Citadel):Jousai_1Hit" count="1"/> <option name="rounds" value="2-+"/> </attachment> <attachment foreach="$AllRegularClans$:$AllRegularClansLC$" name="triggerAttachment_Place_New_Daimyo_@AllRegularClans@" attachTo="@AllRegularClans@" javaClass="TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachment_No_Daimyo_@AllRegularClans@"/> <option name="when" value="before:@AllRegularClansLC@Purchase"/> <option name="purchase" value="Daimyo" count="1"/> </attachment>
what occurs now is that the Daimyo is purchased every turn now, whether he is on the map, or not. grrrrrr
anyone got a clue or example?
-
@ebbe Have you tried directExclusionTerritories? I think that would be the proper way to do it.
AlliedExclusionTerritories would fail to trigger if any of your allies have a Daimyo on the map, and I imagine that's usually the case if each clan is supposed to have its own Daimyo most of the time.
DirectPresenceTerritories is behaving as it was designed (although not how you want it to) by adding a Daimyo whenever there are 0 or more Daimyos on the map for your clan, i.e., always.
-
Try:
<option name="unitPresence" value="Daimyo" count="1"/> <option name="invert" value="true"/>
Thus if there is 1 or more "Daimyo"s the invert of the true statement will make if false, but if there is no Daimyo, the statement will be inverted to true!
Cheers...
-
You could also make the Daimyo a cheap unit, but sent maxBuiltPerPlayer to 1.
-
@rogercooper thanks for all feedback: this is the current trick I use.... but I like to free some space in the purchasing panel...