Yes, I thought of that, but how often is that true? AIs often have several redundant structures, and with players you have no way of knowing what they have and haven't built. And what if you change something later, and add or remove a structure of the same type? Then the trigger is broken. The only way it could work is if you scan through each structure in AIProc and update the trigger, and even then there are issues with it. Say the player in question (assumed to be an AI) has three Advanced Labs, and you destroy one of them. The trigger would be something like this:
CreateCountTrigger(1, 1, (player #), mapAdvancedLab, mapAny, 3, cmpLower, "None");
(Note that I use "None" instead of "NoResponseToTrigger" as it's easier to type).
So now the trigger will fire if one of the Advanced Labs is destroyed, but how do we know if the "specific" Lab was destroyed? Instead, we'd need something like this:
CreateCountTrigger(1, 1, (player #), mapAdvancedLab, mapAny, 3, cmpLower, "OneLabDead");
...
SCRIPT_API void OneLabDead()
{
if ([special unit variable].IsLive() == false)
{
(code here)
}
}
Which is starting to look a lot like the code I originally posted. Also note that we'll then need multiple triggers to check after each Advanced Lab is destroyed; which presents problems if we have more than we started with (this isn't a problem with the method I posted earlier as the code checks if a specific unit is still alive, rather than checking if a unit type has less than a minimum number we've assigned, as we're looking for here).
Perhaps we could instead set up a trigger that repeats itself and fires after only one Lab is destroyed:
CreateCountTrigger(1, 0, (player #), mapAdvancedLab, mapAny, 3, cmpLower, "LabDead");
In the response to that trigger, you could then add IsLive checks for the objective-vital structure(s) you need. But at that point you might as well just set it up in AIProc, and it's almost identical to the code I posted early (but a lot harder to implement).
And yeah, feel free to look into how Dynamix did it if you get the chance.