Can't get changeOwnership to work.
-
<attachment name="triggerAttachmentAnschluss" attachTo="Germans" javaClass="TriggerAttachment" type="player"> <option name="changeOwnership" value="Bregenz:Austrians:Germans:true"/> <!-- Changes the units --> <option name="changeOwnership" value="Bregenz:Austrians:Germans:false"/> <!-- Changes the territory --> <option name="when" value="after:germansCombatMove"/> <option name="uses" value="1"/> </attachment> <!-- User Actions --> <attachment name="userActionAttachmentAnschluss" attachTo="Germans" javaClass="UserActionAttachment" type="player"> <option name="text" value="Anschluss"/> <option name="chance" value="6:6"/> <option name="activateTrigger" value="triggerAttachmentAnschluss:1:true:false:false:false"/> </attachment>As the trigger name suggests, I want to create the possiblity for Germany to "anschluss" Austria, where all Austrian territories and units become controlled by Germany, however I can't get the units to change ownership as well.
I have added "captureUnitOnEnteringBy" to the relevant territory attachments as well as "canBeCapturedOnEnteringBy" for the land units, and the property "Capture Units On Entering Territory". Not sure if that is necessary?
-
Lol it happened yet again, I found the solution just after I posted. I had to include a player attachment for Austria...
<attachment name="playerAttachment" attachTo="Austrians" javaClass="games.strategy.triplea.attachments.PlayerAttachment" type="player"> <option name="captureUnitOnEnteringBy" value="Germans"/> </attachment>I was spending hours on this and couldn't figure it out, but I realize it 5 minutes later after I asked it here xD
-
Anyway, I have a follow-up question so this thread might be not completely useless

<option name="changeOwnership" value="Bregenz:Austrians:Germans:true"/> <!-- Changes the units --> <option name="changeOwnership" value="Central Austria:Austrians:Germans:true"/> <!-- Changes the units --> <option name="changeOwnership" value="Graz:Austrians:Germans:true"/> <!-- Changes the units --> ...I am currently having a line for changeOwnership for every single Austrian territory. Is there a way to make this a little bit cleaned up using foreach? I tried using foreach with a variable list containing all Austrian territories but then the trigger only works for the very last territory, not for the other ones.
<attachment foreach="$Austria$" name="triggerAttachmentAnschluss" attachTo="Germans" javaClass="TriggerAttachment" type="player"> <option name="changeOwnership" value="@Austria@:Austrians:Germans:true"/> <!-- Changes the units --> <option name="changeOwnership" value="@Austria@:Austrians:Germans:false"/> <!-- Changes the territory --> <option name="when" value="after:germansCombatMove"/> <option name="uses" value="1"/> </attachment> -
If I am reading your coding correctly, then each trigger is being named the same; "triggerAttachmentAnschluss". Because of this only one trigger will fire, all the others are over written. Include the variable name in the trigger name so that each trigger will have a unique name.
Cheers...
-
Ah OK, so you have to make it "triggerAttachmentAnschluss@Austria@"?
-
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