Changing Territory Owner with a User Action
-
I want to give a terriory to Germans when clicked Anschluss button. I can already display button on the screen but it does nothing. Here is my code:
<attachment name="conditionAttachment_Germany_anschluss" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="switch" value="true"/> <option name="directPresenceTerritories" value="Greater Southern Germany" count="1"/> <option name="unitPresence" value="infantry" count="1"/> <option name="players" value="Neutral_True"/> </attachment> <attachment name="triggerAttachment_Germany_anschluss" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="changeOwnership" value="Greater Southern Germany:Neutral_True:Germans:true"/> </attachment> <attachment name="userActionAttachment_5_Germany_anschluss" attachTo="Germans" javaClass="games.strategy.triplea.attachments.UserActionAttachment" type="player"> <option name="conditions" value="conditionAttachment_Germany_anschluss"/> <option name="activateTrigger" value="triggerAttachment_Germany_anschluss:1:false:false:false:false"/> <option name="text" value="Germany_anschluss"/> </attachment>
-
@stalinpasha Do you have the "Use Triggers" property true?
-
@Cernel said in Changing Territory Owner with a User Action:
Use Triggers
<property name="Use Triggers" value="true" editable="false"> <boolean/> </property>
This one? Already true.
-
@stalinpasha
Okay my mistake, I tested wrong version. It is working now but neutral units don't convert. Also I will be happy to get help about where text notification messages stored. -
@stalinpasha I think you will need to use a separate trigger to remove the neutral units and place new ones. I had problems trying to use a single trigger. It can have the same condition.
-
@stalinpasha I guessed so, since everything looked fine with what you posted. For your new item, look at how WWII Global II handles Mongolia becoming Russians (normally, only infrastructures convert when a territory is conquered).
-
@Cernel @RogerCooper Thanks for your helpful supports. Mongolia fixed the problem. captureUnitOnEnteringBy was added if anyone interested the solution. I still need help for adding text for action.
-
@stalinpasha Have a properties file called "actionstext" inside the main map folder. Iside that file have:
Germany_anschluss.BUTTON= Germany_anschluss.DESCRIPTION= Germany_anschluss.NOTIFICATION_SUCCESS= Germany_anschluss.OTHER_NOTIFICATION_SUCCESS=
Each equal sign preceeds what you want to display, on the same line.
-
@Cernel Wow works very vell, thanks. My mod is going to more interesting right now. Here's some German actions:
https://imgur.com/LuZLVbd (I don't understand how to add image) Is there any way to Soviet player can accept/reject Molotov-Ribbentrop? -
@stalinpasha There is an "Upload Image" icon right above where you write.
Are you aware that TripleA officially offers its gamemaking istructions inside the "Pact of Steel 2" game xml file inside the games folder of the "The Pact of Steel map"?
Is there any way to Soviet player can accept/reject Molotov-Ribbentrop?
<option name="actionAccept" value="Soviet"/>
Likely only if you want nobody to play your map with any AI, though.
-
@Cernel @stalinpasha I just use drag and drop when I want to upload an image to forum.