Yeah, sure.
Note that I don't explain arrays and loops in this post. If you need info on that,
So in the Setup-trigger you just set up a simple table. That means you're using arrayed variables to link 2 things together.
In this case, you link the building and the unit together (so you can easily know which building creates which unit).
spawnBuildingType[1] creates spawnUnitType[1]
spawnBuildingType[2] creates spawnUnitType[2]
spawnBuildingType[3] creates spawnUnitType[3]
...
Tables like this are very common and useful.
In the next trigger, we loop through the entire table (from 1 to the amount of buildings we have).
Every time the integer increases by 1, we pick all buildings of type spawnBuildingType[looped integer].
Because we linked those units together with the ones they create (see previous paragraph), we know exactly which unit type to spawn (spawnUnitType[looped integer]).
The custom scripts and the "set tempLoc1" are used to remove memory leaks (memory leaks slow down the game, you always need to remove them).