Apos has basically got it right. The only way to do this is going to be to have as many triggers in each specific territory as there are external territories.
So for example, Germany will look like this:
If soldier in Germany and enemy in Germany, attack German enemy.
If solider in Germany and no enemy in Germany and enemy in France, attack French enemy.
If soldier in Germany and no enemy in Germany and no enemy in France and enemy in Sweden, attack Swede enemy.
If soldier in Germany and no enemy in Germany and no enemy in France and no enemy in Sweden and enemy in Spain, attack Spanish enemy.
etc.
Each region can have it's own specific order; when France is out of enemies the soldiers will go to Germany, and when Germany is out of enemies the French soldiers will go to Spain next (assuming nationality of soldiers stays constant and doesn't change based on current region; your initial posts implies this is not the case).
Probably the best way to arrange all of this is to use switches, or if you have multiple players, you'll need death counts. Have a unit set aside for each region, and at the start have triggers like this:
If enemy in France (bring), set DC for French to 1
If enemy in Germany (bring), set DC for German to 1
If enemy in Sweden (bring), set DC for Swede to 1
etc.
Then your triggers above can just be "if German DC is 0 and French DC is 0 and Sweden DC is 1" etc.
OR
Because units will only execute the last orders you give them, you could do it in reverse order like this:
For Germany:
If enemy in Spain, attack Spanish enemy
If enemy in Sweden, attack Swedish enemy
If enemy in France, attack French enemy
If enemy in Germany, attack German enemy.
This would give you the right behaviour you want, although it means that you're potentially giving a unit 4 different orders in quick succession, which probably isn't the best in terms of efficiency. I'd probably go with the first approach, because setting up a DC for whether enemies are in an area could be re-used for other trigger systems you might have that could find that information useful.
OR
Actually there's another way, and this is how I do a lot of the systems in my DS Night Fixed map.
De-couple the attacking system from the region system. Do this by creating a new location called "Current target".
Then:
If enemy in Spain, move Current Target location to Spain
If enemy in Sweden, move Current Target location to Sweden
If enemy in France, move Current Target location to France
If enemy in Germany, move Current Target location to Germany
Attack enemy in Current Target
This system is more flexible if you need to add a new country in the future. All you have to do is add a new Current Target location movement trigger, like this:
If enemy is in United Kingdom, move Current Target location to UK.
As I've outlined it, this system won't work if you have two groups of soliders, say some in France and some in Germany, and you want them to attack their own local enemies before they move on to the next country. With the above simple system, this would make all of the soldiers in France and Germany attack the enemies in Germany, before both going to attack the enemies in France. The best around that is to repeat the location movement triggers before each attack trigger:
If enemy in Spain, move Current Target location to Spain
...
If enemy in Germany, move Current Target location to Germany
German soldiers: attack enemy in Current Target
If enemy in Spain, move Current Target to Spain
..
If enemy in France, move Current Target location to France
French soldiers: attack enemy in Current Target
Post has been edited 3 time(s), last time on Aug 19 2011, 6:09 am by Lanthanide.
None.