Simple Trigger Help
-
@Name Do you have all the game properties set up correctly?
<!-- allows a player to let its units be captured by another player if true, when the territory is captured. units must have canBeCapturedOnEnteringBy and territories must have captureUnitOnEnteringBy and the players must have the player attachment captureUnitOnEnteringBy --> <property name="Capture Units On Entering Territory" value="false" editable="false"> <boolean/> </property> <!-- if "Capture Units On Entering Territory" is true, then the units can either be captured (default) or destroyed (only if this property below is true: "On Entering Units Destroyed Instead Of Captured") --> <property name="On Entering Units Destroyed Instead Of Captured" value="false" editable="false"> <boolean/> </property> <!-- specific rules --> <!-- land related --> <!-- if true, units with destroyedWhenCapturedBy will be destroyed instead of captured. only applies to non-combat units, since combat units die in combat --> <property name="Units Can Be Destroyed Instead Of Captured" value="true" editable="false"> <boolean/> </property> <!-- allows units to change into other units using the whenCapturedChangesInto ability --> <property name="Units Can Be Changed On Capture" value="true" editable="false"> <boolean/> </property> -
@Hepps said in Simple Trigger Help:
This one in particular is absolutely a MUST for what you are trying to accomplish.<!-- allows units to change into other units using the whenCapturedChangesInto ability --> <property name="Units Can Be Changed On Capture" value="true" editable="false"> <boolean/> </property> -
@Hepps said in Simple Trigger Help:
@Hepps said in Simple Trigger Help:
This one in particular is absolutely a MUST for what you are trying to accomplish.<!-- allows units to change into other units using the whenCapturedChangesInto ability --> <property name="Units Can Be Changed On Capture" value="true" editable="false"> <boolean/> </property>That was it, thanks. Btw it works with consumesUnit.
-
@Name Yes... after looking at it figured my initial guess was wrong... but often it is a process of elimination of different things. More so when you are guessing at what people are trying to accomplish.

Glad it worked.
-
@Hepps said in Simple Trigger Help:
@Name Yes... after looking at it figured my initial guess was wrong... but often it is a process of elimination of different things. More so when you are guessing at what people are trying to accomplish.

Glad it worked.
Well in most cases so far (including ones not posted here), my troubles were simply some missing property, but at least by now I've learned to check if I can find a related one needed for something to work.
The citizens/slaves feature is probably getting scrapped though since its extra visual burden and really hard to balance, income-wise, with added units per turn that give income.
I'll eventually make a map development thread but for now I'll keep asking here. I'm getting used to making triggers and started looking into politics. Before doing loads of tedious work I'd like opinions on possible and advisable political features. I've read a bit across the forums but I still can't say a have a clear view on this.
The background:
- The map is set in Hellenistic/Roman times, probably starting at 222BC. Focus will be around Cleomenian, Second Punic, Macedonian and Syrian Wars.
- There are many factions, of varied power and faction balance is not a primary concern. I'd like to have around 30 playables eventually.
- The map is detailed (many regions) and big.
The concerns:
- FFA or Fixed Alliances seem unrealistic but easy to make.
- Detailed politics (players can change any relation possible) would be ideal but a lot of work. I've read that the AI is really bad at it, but in what way?
- Triggered relationships could work and keep historical accuracy reasonable. Say if Macedon or Rome gains a territory in Illyria, the other declares war. But I'm afraid it would railroad the game too much and limit player agency. Is it possible to have set AI reactions (or chances) but let a human decide how to react?
Are there other options? Or any upsides/downsides I'm unaware of?
-
Hi Name. Welcome to the site.@Name said in Simple Trigger Help:
...Is it possible to have set AI reactions (or chances) but let a human decide how to react?
Are there other options? Or any upsides/downsides I'm unaware of?
Not sure if I understand you 100% correctly, but you might be able to have a AI player activate a trigger for a Human player if the right conditions are met and then on the Human players turn, a notification could show up, such as asking to declare war on somebody ? Idk could be worth a shot though.
It seems that there's a game that uses lend lease kinda like that. I can't remember what it is though. Zim Xero's "Pacific Challenge" has a lot of triggers and interaction that goes on. Frostion's "Age of Tribes" as well. "Total World War" is another complex map that does a lot of different things. Actually it might be the one I was thinking of about the lend lease. "Feudal Japan" does a lot of stuff too.
Anyway, you might want to check those out and see if any of their behavior does what you want.
Also Pacific Challenge is heavily AI based if I remember right. Maybe that's his "Solo" challenge. Anyway

-
@beelee
Hi and thanks!What I meant by that is that when a trigger to (potentially) change relationship is activated (say Player1 captured region X )
- If Player2 is AI it is given a set reaction (declare war on Player1) or a chance (say 1:6 to declare war - maybe increasing by further 1:6 each passing turn).
- If Player2 is Human, they are given a choice (User/Political Action I guess), to declare war if they want.
I'll check those maps to get ideas, but I'm mostly interested on informed opinions of the general possibilities and which ones would better fit the scale/setting of mine. And later look into details on implementation (if something complex is needed).
I'd generally prefer something AI friendly and not too memory heavy, since ~30 player turns will take quite long anyway.
-
@Name I would probably recommend fixed alliances at least to start with as its the simplest and easiest to test with the AI. There are a few various options around diplomacy:
- Fixed alliances
- FFA either with no diplomacy or open diplomacy where players can declare alliance or war with each other freely or for some cost
- Diplomacy with restricted options and alliances like Global 40
- Some sort of unit based system like we are creating for PoP: https://forums.triplea-game.org/topic/1063/power-of-politics-1914-a-wwi-scenario
It mostly boils down to how much effort you want to put into diplomacy and if you want the AI to be able to handle it.
-
@redrum said in Simple Trigger Help:
@Name I would probably recommend fixed alliances at least to start with as its the simplest and easiest to test with the AI. There are a few various options around diplomacy:
- Fixed alliances
- FFA either with no diplomacy or open diplomacy where players can declare alliance or war with each other freely or for some cost
- Diplomacy with restricted options and alliances like Global 40
- Some sort of unit based system like we are creating for PoP: https://forums.triplea-game.org/topic/1063/power-of-politics-1914-a-wwi-scenario
It mostly boils down to how much effort you want to put into diplomacy and if you want the AI to be able to handle it.
From what he said so far, sounds like the game would be about as AI unplayable as Civil War, which adds to the fact that the AI is currently very bad at FFA politics, so, while it is always possible the AI to be upgraded to that level, that makes it currently largely unfeasible going with option 2, as that would require 30 human players, that also probably don't care at all about game balance (as a matter of fair winning chances).
@Name Probably the best compromise between what TripleA offers and realism is going with a Domination style politics, in which you would have something like 5 or 6 sides (fixed alliances), each having a number of powers (if 30 in total, respectively 6 or 5 powers per side), and you would distribute such power in a way to make the most sense with historical politics (grouping those that were tendentially friendly to each other and assure that those that were main enemies of each other stay in different sides). That way the game might have a chance to get played, especially PBF (you would need "only" to find 5 or 6 players, committing for what is probably going to be a year long gaming experience, if not several years).
Theorically, I think the best (both for playability and for historical consistency) would be going Feudal Japan style, having each human player taking 1 power (under some balanced distribution), all remaining ones given to the AI (that is what most commercial historical digital games do, as well), but, for this, you would need the AI actually playing the game at a level of skill comparable to the persons.
-
@Cernel said in Simple Trigger Help:
Theorically, I think the best (both for playability and for historical consistency) would be going Feudal Japan style, having each human player taking 1 power (under some balanced distribution), all remaining ones given to the AI (that is what most commercial historical digital games do, as well), but, for this, you would need the AI actually playing the game at a level of skill comparable to the persons.
Also since this would allow playing the game solo too, taking only 1 player and going for taking over the (known) world (as I guess most commercial historical digital games are usually played).
-
Decent AI compatibility is a must. I want to be able to play the game solo or hotseat with a few friends. So far it works rather well, besides a couple of issues.
- "Garrisons" (0/3/0), maximum of 4 per territory are a central part of the gameplay. But the AI won't buy them or I have to use "hacks" giving them 1 movement (triggered movement change during purchase, requiresUnitsToMove, or the best it seems, givesMoment -1 from factory type units). But if I use those hacks, the AI often buys more Garrisons than it can place.
- I'm under the impression (could be wrong though), that the AI doesn't consider nevative isMarine when launching naval invasions and I have the majority of land units at isMarine -1 or -2.
Online is secondary concern but I'll look into it as well. I doubt a game would take months or a year. I'll avoid heavy triggering. There are also severe limits to how many troops a player can have (mostly due to upkeep). Each unit represents around 1000 troops and factions will usually have those in the range of 5-50, depending on territory size and casualties (the upkeep system ensures it takes quite long to reach total troop potential, while garrisons make snowballing hard-ish). The more I say or read the more I think I'd better present the whole target gameplay before hoping for better advice. I'd do that soon.
Anyway back to diplomacy:
-
FFA with politics seems out of the question, too much work and AI won't handle it.
-
FFA without politics doesn't fit the era much.
-
I'll take a look at the maps mentioned.
-
A mix of fixed alliances and triggered changes seems the most probable. But can someone explain if something like this is possible:
What I meant by that is that when a trigger to (potentially) change relationship is activated (say Player1 captured region X ) - If Player2 is AI it is given a set reaction (declare war on Player1) or a chance (say 1:6 to declare war - maybe increasing by further 1:6 each passing turn). - If Player2 is Human, they are given a choice (User/Political Action I guess), to declare war if they want.
If not I wonder how it would feel to force diplo changes to both player and AI depending on where they invaded etc. Like entering some other power's sphere of influnce is guaranteed war, instantly or soon. I guess it would need some visual feedback to work decently. Some form of "casus beli" markers with the flag of the one getting it on triggering territories.
-
@Name 30 players is certainly an ambitious plan. I can't even fathom what the XML would even look like with that kind of political landscape... let alone how to make it AI compatible.
Just the Garrison unit alone with it max units per territory is likely already beyond its comprehension level.
-
@Hepps said in Simple Trigger Help:
@Name 30 players is certainly an ambitious plan. I can't even fathom what the XML would even look like with that kind of political landscape... let alone how to make it AI compatible.
That's why I'm leaning towards fixed alliances, but I prefer adding some triggered changes to better represent the era (see previous post). The AI won't handle it perfectly, it might invade triggering territories at times it won't have the strength to deal with an additional enemy or two. But I think it's an acceptable middle ground solution. And those territories won't be too many so no extensive coding added to the large task (many factions and total territories).
Just the Garrison unit alone with it max units per territory is likely already beyond its comprehension level.
Even with overpurchasing garrisons the hard AI isn't a pushover so far. It can even use them later to quickly replentish it's defenses. But I'm interested in an alternative defense system. The first idea I was using was "factories" having some defense, which has impact (but only if friendly troops are present). Could consider falling back to that or use some new suggestion.
-
@Name said in Simple Trigger Help:
Decent AI compatibility is a must. I want to be able to play the game solo or hotseat with a few friends. So far it works rather well, besides a couple of issues.
For what I've read so far, I've a hard time believing this map plays rather well with any AI, but you have the map, so I guess I should take your word.
In this case, you should definitely follow a Feudal Japan style setup, in which every power is on its own (FFA) and you have a simple politics set of rules, then the map being played by taking 1 power per each person in the game, assigning all remaining ones to Hard AI.
You can have the politics working not too badly as long as you don't use any archetype alliance and allows downgrading from any relationships directly to war (for something like alliance, just use the archetype Neutral, but allowing moving into territories, and be sure that you can directly go from that to war).
I strongly suggest not doing any extreme hacks like the ones you described. We already have maps that were tailored around the limits of the old AI, and now that AI is completely gone, and the maps are there broken. Rather, make some chance triggers to give some of the units the AI doesn't buy, removing the resources that would be needed to purchase them, before such a phase (basically, random purchasing for part of the money). You would need adding something to tell the triggers if the player is AI or not, for example like Feudal Japan does with its various triggers adding Ashigarus, et cetera, for AI powers, depending on having placed stuff on boxes, at start game.
-
@Cernel said in Simple Trigger Help:
For what I've read so far, I've a hard time believing this map plays rather well with any AI, but you have the map, so I guess I should take your word.
Don't exactly take my word. I'm a tripleA newbie, even though a rather experienced TBS/RTS/Grand Strategy player. I actually haven't played much of any map to have a good comparison, but can usually beat HardAI in my map with relatively unfavorable conditions, not without a challenge though. Most of it's functions work well I think (minus garrisons and maybe negative isMarine?). I haven't edited much from the core gameplay and alliances are still fixed. Maybe the map having multiple resources (several of them used for upkeep besides purchace, one of them also fuel) could be a downgrade on the AI?
In this case, you should definitely follow a Feudal Japan style setup, in which every power is on its own (FFA) and you have a simple politics set of rules, then the map being played by taking 1 power per each person in the game, assigning all remaining ones to Hard AI.
You can have the politics working not too badly as long as you don't use any archetype alliance and allows downgrading from any relationships directly to war (for something like alliance, just use the archetype Neutral, but allowing moving into territories, and be sure that you can directly go from that to war).
This system seems very tedious to code, especially with so many players, and I'd like true alliances since they are appropriate for the setting. I think I'll go with fixed alliances and probably add some conditions to change them as I described. If this works badly I'll probably revert to just fixed alliances or consider your suggestion.
Btw Feudal Japan uses this, so I'm confused.
<attachment name="relationshipTypeAttachment" attachTo="Allied" javaClass="games.strategy.triplea.attachments.RelationshipTypeAttachment" type="relationship"> <option name="archeType" value="allied"/> <option name="canMoveLandUnitsOverOwnedLand" value="true"/> <option name="givesBackOriginalTerritories" value="false"/> <option name="canTakeOverOwnedTerritory" value="false"/> </attachment>I strongly suggest not doing any extreme hacks like the ones you described. We already have maps that were tailored around the limits of the old AI, and now that AI is completely gone, and the maps are there broken. Rather, make some chance triggers to give some of the units the AI doesn't buy, removing the resources that would be needed to purchase them, before such a phase (basically, random purchasing for part of the money). You would need adding something to tell the triggers if the player is AI or not, for example like Feudal Japan does with its various triggers adding Ashigarus, et cetera, for AI powers, depending on having placed stuff on boxes, at start game.
I'll consider that among the options, not sure yet on how to handle this.
-
- "Garrisons" (0/3/0), maximum of 4 per territory are a central part of the gameplay. But the AI won't buy them or I have to use "hacks" giving them 1 movement (triggered movement change during purchase, requiresUnitsToMove, or the best it seems, givesMoment -1 from factory type units). But if I use those hacks, the AI often buys more Garrisons than it can place.
Yeah, the AI currently doesn't support purchasing non-factory 0 movement units. This is something that I'll probably look to add soon as enough maps have them that its probably worth it.
- I'm under the impression (could be wrong though), that the AI doesn't consider nevative isMarine when launching naval invasions and I have the majority of land units at isMarine -1 or -2.
Not sure on this one. Very few if any maps use negative isMarine so I can't remember if the AI handles that or not. I'll have to take a closer look.
If you want a sort of fixed with some triggers system, I would probably model it after something like Global 40. Where based on certain conditions, nations can/will declare war on each other but that generally there are fixed alliances just that maybe some of them don't start out as at war.
What I meant by that is that when a trigger to (potentially) change relationship is activated (say Player1 captured region X ) - If Player2 is AI it is given a set reaction (declare war on Player1) or a chance (say 1:6 to declare war - maybe increasing by further 1:6 each passing turn). - If Player2 is Human, they are given a choice (User/Political Action I guess), to declare war if they want.This should be possible though you may need to create a prompt like in Greyhawk Wars to set a flag whether each player is human or AI to then be used to determine which action or trigger is fired.
-
@redrum said in Simple Trigger Help:
- "Garrisons" (0/3/0), maximum of 4 per territory are a central part of the gameplay. But the AI won't buy them or I have to use "hacks" giving them 1 movement (triggered movement change during purchase, requiresUnitsToMove, or the best it seems, givesMoment -1 from factory type units). But if I use those hacks, the AI often buys more Garrisons than it can place.
Yeah, the AI currently doesn't support purchasing non-factory 0 movement units. This is something that I'll probably look to add soon as enough maps have them that its probably worth it.
- I'm under the impression (could be wrong though), that the AI doesn't consider nevative isMarine when launching naval invasions and I have the majority of land units at isMarine -1 or -2.
Not sure on this one. Very few if any maps use negative isMarine so I can't remember if the AI handles that or not. I'll have to take a closer look.
That's great:) Do you have estimate on when the update could be?
If you want a sort of fixed with some triggers system, I would probably model it after something like Global 40. Where based on certain conditions, nations can/will declare war on each other but that generally there are fixed alliances just that maybe some of them don't start out as at war.
What I meant by that is that when a trigger to (potentially) change relationship is activated (say Player1 captured region X ) - If Player2 is AI it is given a set reaction (declare war on Player1) or a chance (say 1:6 to declare war - maybe increasing by further 1:6 each passing turn). - If Player2 is Human, they are given a choice (User/Political Action I guess), to declare war if they want.This should be possible though you may need to create a prompt like in Greyhawk Wars to set a flag whether each player is human or AI to then be used to determine which action or trigger is fired.
If one player is supposed to change from a fixed/starting alliance to another one, is that doable? I guess only by using relationshipInitialize instead? Can alliancesCanChainTogether help in some way?
Say Aetolia is allied to Rome (+Roman Allies). Seleucids invades a territory in Greece, triggering war with Rome (+Roman Allies). (How) can I have Aetolia switch sides to being at war with Rome (+Roman Allies) and allied to Seleucids (+Seleucid Allies)?
Edit: I also can't make units CapturedOnEnteringBy
The unit has:
<option name='canBeCapturedOnEnteringBy' value='Macedon'/>Territory has:
<option name='captureUnitOnEnteringBy' value='Macedon'/> <option name='changeUnitOwners' value='Macedon_Allies'/>(Not having the second option like Global 40 or setting it to Macedon won't work either)
Player has:
<attachment name='playerAttachment' attachTo='Macedon' javaClass='PlayerAttachment' type='player'> <option name='captureUnitOnEnteringBy' value='Macedon_Allies'/> </attachment>Properties:
<property name='Capture Units On Entering Territory' value='true' editable='false'> <boolean/> </property>Edit2: Before making a map thread to showcase things and get better informed feedback I'd like to know if it's ok to use 2d art from other (commercial) games. I've seen a couple of downloadable maps do it, but just to be sure, should I avoid screenshots due to "my" (possibly placeholder) icons?
-
@Name Responses:
-
AI updates - Hard to say. I'll try to at least take a look at it this week or next week but would depend on the LoE.
-
To have nations change relationship/alliance, I believe you'd need something like this:
Change the relationship based on some conditions:
<attachment name="triggerAttachmentRussiansWarJapanese" attachTo="Russians" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentRussiansNeutralJapanTurn5plus"/> <option name="relationshipChange" value="Russians:Japanese:anyNeutral:War"/> <option name="notification" value="RUSSIANS_AT_WAR_WITH_JAPAN"/> <option name="when" value="before:russianPolitics"/> </attachment>Have alliancesCanChainTogether if you want to will share both allies and enemies once they reach Allied or War:
<attachment name="relationshipTypeAttachment" attachTo="Allied" javaClass="games.strategy.triplea.attachments.RelationshipTypeAttachment" type="relationship"> <option name="archeType" value="allied"/> <option name="alliancesCanChainTogether" value="true"/> </attachment>-
A bit hard to follow what the issue is but you might have the player attachment inverted. I would recommend looking at TWW XML: https://github.com/triplea-maps/total_world_war/blob/master/map/games/Total_World_War_Dec1941_3.0.xml
-
For images, its really up to each map maker on what they use. TripleA primarily just asks that you don't use any profanity or controversial images. There is no way for us to check all your images and where you get them from so its up to you on what you are comfortable using in regards to copyright and other laws. Outside of some A&A images/terminology a long time ago, I haven't seen any issues around this.
-
-
@redrum said in Simple Trigger Help:
@Name Responses:
- AI updates - Hard to say. I'll try to at least take a look at it this week or next week but would depend on the LoE.
Np, but what does LoE mean?
- To have nations change relationship/alliance, I believe you'd need something like this:
Change the relationship based on some conditions:
<attachment name="triggerAttachmentRussiansWarJapanese" attachTo="Russians" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentRussiansNeutralJapanTurn5plus"/> <option name="relationshipChange" value="Russians:Japanese:anyNeutral:War"/> <option name="notification" value="RUSSIANS_AT_WAR_WITH_JAPAN"/> <option name="when" value="before:russianPolitics"/> </attachment>Have alliancesCanChainTogether if you want to will share both allies and enemies once they reach Allied or War:
<attachment name="relationshipTypeAttachment" attachTo="Allied" javaClass="games.strategy.triplea.attachments.RelationshipTypeAttachment" type="relationship"> <option name="archeType" value="allied"/> <option name="alliancesCanChainTogether" value="true"/> </attachment>My issue is that I plan to have some players that will have fixed alliances (say "alliance leaders") for the whole game and others changing on conditions. If a changeable one gets to an alliance with a new "alliance leader", will alliancesCanChainTogether have them ally the alliance leader's allies and war their enemies, including past allies of the changeable player? Or do I have to include at least one past ally of the changeable as enemy? Or do I have to cover all possible combinations of player alliances in my triggers? I hope this time my description makes more sense.
- A bit hard to follow what the issue is but you might have the player attachment inverted. I would recommend looking at TWW XML: https://github.com/triplea-maps/total_world_war/blob/master/map/games/Total_World_War_Dec1941_3.0.xml
I'll check those thanks.
- For images, its really up to each map maker on what they use. TripleA primarily just asks that you don't use any profanity or controversial images. There is no way for us to check all your images and where you get them from so its up to you on what you are comfortable using in regards to copyright and other laws. Outside of some A&A images/terminology a long time ago, I haven't seen any issues around this.
Thanks again.
-
-
LoE - level of effort, ie. how long it would take me to implement

-
I believe
alliancesCanChainTogetherlooks at the current allies/enemies of the nation its relationship changed with (nothing that isn't current). So in your example, if your changed the relationship of Aetolia and Seleucids to Allied then Aetolia would become allied with all the Seleucid Allies and go to war with all its enemies (and vice versa).
-
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