Your description of your maze solution does not make it clear what you've done to 'save time'.
Yeah, not sure how you're even able to comment on that, seeing how I edited it out before the post even got moderated. I realized that it was a bit tricky to explain exactly what I did, but it basically ended up saving a shitton of coding time.
I ended up deleting it because I was on my work PC, and I couldn't for the life of me remember how I actually coded it, so I gave up trying to explain the scenario.
But since we are on the topic now... First off, look at the attached screenshot. That shows 1 of the 12 identical mazes and the 7 regions used as reference points for the pathing. I numbered them, for reference. Then, I put all 7x12 of these points into 7 arrays of 12 points each. 1 array for all 12 "point 1" locations, for example. I will spare you the wall of text on that one... but the event generator looks like this:
-
Events
-
Conditions
-
Actions
-

For each (Integer A) from 1 to 12, do (Actions)
-


Loop - Actions
-



-------- Add events to move triggers --------
-



Trigger - Add to CathLolicon toR1 <gen> the event (Unit - A unit enters Cspawn[(Integer A)])
-



Trigger - Add to CathLolicon toR2 <gen> the event (Unit - A unit enters Cr1[(Integer A)])
-



Trigger - Add to CathLolicon toR3 <gen> the event (Unit - A unit enters Cr2[(Integer A)])
-



Trigger - Add to CathLolicon toR4 <gen> the event (Unit - A unit enters Cr3[(Integer A)])
-



Trigger - Add to CathLolicon toR5 <gen> the event (Unit - A unit enters Cr4[(Integer A)])
-



Trigger - Add to CathLolicon toEnd <gen> the event (Unit - A unit enters Cr5[(Integer A)])
-



Trigger - Add to CathLolicon toHell <gen> the event (Unit - A unit enters Cend[(Integer A)])
As you can see, there's 7 movement triggers, 1 for each of the points. The loop above basically generates 12 events for each of them, so that it can run on all 12 mazes.
The actual triggers look like this:
-
CathLolicon toR3
-

Events
-

Conditions
-


(Owner of (Triggering unit)) Equal to Neutral Hostile
-

Actions
-


For each (Integer A) from 1 to 12, do (Actions)
-



Loop - Actions
-




If ((Custom value of (Triggering unit)) Equal to (Integer A)) then do (Unit - Order (Triggering unit) to Move To Cr3p[(Custom value of (Triggering unit))]) else do (Do nothing)
Originally, I thought that I could just ask the triggering unit to move to the next point by the index stored in their custom value (which, logically, should work), but the game for some reason lost track of which iteration of the trigger was being called, so I had to loop through all 12 scenarios to make sure that each iteration of the trigger only ran the 1 scenario that I needed.
Either way, I also realized that in this case, I am actually running through rapid action loops rather than condition checks and events, so I also deleted this because I realized it wasn't relevant to the main topic. But since we are here,
can someone explain to me why this trigger doesn't work without the loop?
I've always heard that triggerconditions are specifically extremely efficient so there can be many evaluations without issue.
That's very comforting to hear!
The best solution, of course, is to be smart about your triggers in the first place. Don't cut corners and save time if it makes the code complex or huge parts overlap or... etc.
Being smart about your triggers can mean many things. Refactoring triggers saves a lot of time in both development and changes. If I hadn't used this approach, I would have had to code all 12 mazes instead of just 1.