Major Powers taking over neutrals
-
I am working on a mod where a number of different powers may take control of neutral areas through a random event. Neutral areas may have varying numbers of neutral units.
I am looking for code that would allow me change the territory owner and all the neutral units in the territory. The event should not fire if the territory is not neutral. Changing the owner looks easy, but the changing the unit-ownership looks tricky.
-
-
@wc_sumpton Thank you, I will check it out.
-
As of now, I am just trying to get territory ownership to change.
<attachment name="triggerAttachmenttest" attachTo="Soviet_Union" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentEveryTurn" /> <option name="players" value="Soviet_Union" /> <option name="chance" value="1:1" /> <option name="chanceIncrementOnFailure" value="1" /> <option name="when" value="before:Sovet_UnionPurchase" /> <option name="changeOwnership" value="Ireland:Non_Aligned:Soviet_Union:false"/> <option name="uses" value="1"/> </attachment>
Other events are firing correctly. Is there something I need to set to allow territory ownership changes?
-
I think you need it set to true instead of false on the changeOwnership line
Edit
hmm ... I don't think that should matter thoughEdit 2
well Idk what boolean captured means.
I have both true and false triggers. I went through all the properties and didn't see anything standout that would need to be turned on.
I guess you could try setting to true and see what happens otherw ise wc probably know
-
@beelee It didn't make a difference.
-
Try without chance and see if it'll fire
Edit
Here's a couple that I have that work but Idk if as said something else needs turned on -
@beelee It still doesn't fire.
-
well bummer. Guess we best ping @wc_sumpton
Edit
yea I think the captured thing is for your Allies as if a Allied capital is conquered then your Allie takes controlled and then if it's a enemy they just take control. The true false partBut you probably knew that
-
@beelee I figure out the problem. There was a spelling error in a different forEach loop. When I fixed, that everything works.
-