@jip
Too late! I already spent hours last night re-writing the scripts and testing!
I figured it was worth doing, just to speed up the sim speed a little. The new script has only a third as many operations to complete, while the old script would call the Random function to run 12 different times when spawning a unit/building. Now it is only called 3 times.
I don't know how fast Lua is at running the Random function, but that was a lot of unnecessary work for every spawned unit. Now multiple that by hundreds of units. And I'm assuming just running a simple "ifelse = variable" is faster than calling a Random number. So, new scripts should help with spawning large waves. (Except in an issue where spawn is too close to map edge and triggers the test loop, hence why I need to add an abort to the script.)
Not that people should use the mod on maps with spawns close to map edge, but someone surely will. So just trying to correct for that issue.