placement/removeUnits Question
-
I designed conditions and a trigger:
<attachment name="triggerSpaintoPro-Axis" attachTo="Pro-Axis" javaClass="TriggerAttachment" type="player">
<option name="when" value="after:Pro-AlliesCombatMove"/>
<option name="conditions" value="conditionAttachmentalliedbattlespain:conditionAttachmentobjectiveG4cn"/>
<option name="removeUnits" value="Spain:all"/>
<option name="changeOwnership" value="Spain:any:Pro-Axis:false"/>
<option name="placement" value="Spain:pa_infantry" count="3"/>
<option name="uses" value="1"/>
</attachment>everythings works..
....except:
<option name="removeUnits" value="Spain:all"/>all original (neutral) units there remain. What can be the reason for that?
-
@numetalfan so Spain is a True Neutral that changes into a Pro-Axis Neutral ?
If so you might need to remove the Neutral units before it changes ownership to pro-axis and then add them back as pro-axis after if needed.
You'd probably need separate triggers.
This is just a guess
-
The units do not belong to Pro-Allies. 'removeUnits' is looking into Spain and removing all Pro-Allies units.
Cheers...
-
so in the placement phase it is
<unitPlacement unitType="infantry" territory="Spain" quantity="3"/>
so no owner nation.
but the trigger has to be attached to someonethe units are located in:
...\units\Neutralmy first idea:
<attachment name="triggerSpaintoPro-Axis1" attachTo="Neutral" javaClass="TriggerAttachment" type="player">
<option name="when" value="after:Pro-AlliesCombatMove"/>
<option name="conditions" value="conditionAttachmentalliedbattlespain:conditionAttachmentobjectiveG4cn"/>
<option name="removeUnits" value="Spain:all"/>
<option name="uses" value="1"/>
</attachment>does not work, maybe it's because of
attachTo="Neutralhow to solve this ?
-
@numetalfan so Spain has changed to "Neutral_Axis" or w/e you have in your game. So try the attachTo="Neutral_Axis"
-
I am sorry, but I don't have a simple answer. The only way I am able to remove 'Neutral' units it to have a 'Neutral' player. '<option name="players" value="Neutral"/> dose not seem to work.
Again sorry.

Cheers...
-
@wc_sumpton said in placement/removeUnits Question:
I am sorry, but I don't have a simple answer. The only way I am able to remove 'Neutral' units it to have a 'Neutral' player. '<option name="players" value="Neutral"/> dose not seem to work.
Again sorry.

Cheers...
I think @redrum already clarified that the "Neutral" player is sort of a program hack to support simple "neutral" defensive units. For anything more complex than that, I believe you are supposed to have an actual player, hiding it and pre-assigning it to "Does Nothing".
-
@numetalfan
Try using a pseudo player, I call them "none", with a<player name="none" optional="false" canBeDisabled="false" defaultType="DoesNothing" isHidden="true"/>
-
@all
I will try that, thx
-
now everything works!
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