Red (The Holy Roman Empire) has defeated blue (France). The grey lines represent the connections between duchies, and thus whether or not they are adjacent. Each duchy has its own specific location, and each Cybernetics Core is also an invincible unit with a specific Unit Index ID. Red is now going to enforce peace against blue and annex a duchy (at the moment, my plan is to do this via blue clicking a button on the Duchy of his choice that he's occupying, which will put a unit into the build queue and activate a trigger.)
However, blue is demanding the Duchy outlined in yellow, which cannot be demanded because it is not adjacent to any of his territories. This should spit out an error for blue, telling him to try again.
Now, I know I could simply do this via a trigger like this:
Triggername
Players
Conditions
Actions
And then I could copy and paste this trigger about 150 times and manually change the locations/unit indexes of EUDs for each trigger. But that's a lot of work and it's pretty likely I'll screw up at least a few of them and have to bugtest later. I thought about using a location and simply centering it over the target, then detecting whether Current Player brings at 'at least 2' Duchies, but the layout of my map is highly irregular and this would be unreliable.
Is there another way that this could be done, perhaps with fewer triggers, perhaps by using arithmetic on the Unit Index IDs? I feel like the basic principle here is to conduct a breadth-first search, but I'm not sure how to break it down into Starcraft triggers.
Post has been edited 1 time(s), last time on Jan 29 2022, 8:50 pm by Brusilov.
None.