I got around 500 regions, most of them are for this
That seems like an excessive number of regions for spawning units. For example the first map in the Orc expansion campaign (where you play as Rexxar) has ~550 regions total, but only about 100 of them for spawning creeps. You may want to check those maps to see how Blizz did it.
You may also want to consider if some locations cannot be calculated (like instead of 10 regions you leave only the center one and spawn units offset by random distance towards random angle from that location) or if some regions cannot be merged together.
What I showed in my previous post is one of the options to manage spawning units. It's not the only option - as I wrote earlier, depending on how your map is set up, some approaches may be better than others.
If you have many regions, then the question may be how many units per region do you spawn. If the average is low number, then you could use a completely different approach for spawning units.
Instead of setting one specific unit-type you want to spawn and then configure in the HowMany array how many of that unit you want to spawn in each region, you could instead set one specific region and provide an array of unit-types you want to spawn there. It would look something like this:
-
Map Ini 2
-

Events
-

Conditions
-

Actions
-


Set VariableSet RegionToSpawn = Desert Spawn 1 <gen>
-


Set VariableSet UnitTypesToSpawn[1] = Footman
-


Set VariableSet UnitTypesToSpawn[2] = Footman
-


Set VariableSet UnitTypesToSpawn[3] = Knight
-


Set VariableSet NumberOfUnitTypes = 3
-


Trigger - Run Spawn Type 2 <gen> (checking conditions)
-


-------- --------------------------------------------- --------
-


Set VariableSet RegionToSpawn = Desert Spawn 2 <gen>
-


Set VariableSet UnitTypesToSpawn[1] = Footman
-


Set VariableSet UnitTypesToSpawn[2] = Rifleman
-


Set VariableSet UnitTypesToSpawn[3] = Rifleman
-


Set VariableSet UnitTypesToSpawn[4] = Rifleman
-


Set VariableSet NumberOfUnitTypes = 4
-


Trigger - Run Spawn Type 2 <gen> (checking conditions)
-


-------- --------------------------------------------- --------
-


Set VariableSet RegionToSpawn = Desert Spawn 3 <gen>
-


Set VariableSet UnitTypesToSpawn[1] = Footman
-


Set VariableSet UnitTypesToSpawn[2] = Rifleman
-


Set VariableSet NumberOfUnitTypes = 2
-


Trigger - Run Spawn Type 2 <gen> (checking conditions)
-


-------- --------------------------------------------- --------
-


Set VariableSet RegionToSpawn = Desert Spawn 4 <gen>
-


Set VariableSet UnitTypesToSpawn[1] = Footman
-


Set VariableSet UnitTypesToSpawn[2] = Footman
-


Set VariableSet UnitTypesToSpawn[3] = Footman
-


Set VariableSet UnitTypesToSpawn[4] = Siege Engine
-


Set VariableSet NumberOfUnitTypes = 4
-


Trigger - Run Spawn Type 2 <gen> (checking conditions)
-
Spawn Type 2
-

Events
-

Conditions
-

Actions
-


For each (Integer index) from 1 to NumberOfUnitTypes, do (Actions)
-



Loop - Actions
-




Set VariableSet loc = (Random point in RegionToSpawn)
-




Unit - Create 1 UnitTypesToSpawn[index] for Player 1 (Red) at loc facing (Random angle) degrees
-




Custom script: call RemoveLocation(udg_loc)
From the triggers above, 2 Footmen and 1 Knight will be spawned in Desert Region 1, etc.
The variables here are
- RegionToSpawn: region
- UnitTypesToSpawn: unit-type array
- NumberOfUnitTypes: integer
- index: integer
Do I create this new trigger or use my time on creating the simple one I was doing
At the end of the day, it depends. There's functionally nothing wrong with the way you have it, but you should consider readability of your triggers and how prone to error your trigger is. For example I know my trigger will not leak, because the only place it could leak is only the small "Spawn Type" trigger and I can also quite easily see where I spawn what.
On the other hand your trigger is prone to human error - for example by accident picking up different point variable when creating unit and then trying to investigate in a hundreds-line long trigger which unit is the one spawning in wrong place, etc.
You should also ask yourself questions like: Can I easily understand all the things that are going on in my trigger? Will I (or a friend) be able to easily understand that trigger 2 months later when I want to update it?
This trigger will get very big xD
You should divide such triggers into smaller, more manageable, parts.
For example divide your spawn triggers by the area. If you have for example Desert Spawn regions and Forest Spawn regions, then have separate trigger for each area and a single trigger with "Map Initialization" event which will run those triggers. I mean something like this:
-
Map Ini
-

Events
-

Conditions
-

Actions
-


Trigger - Run Spawn Desert Creeps <gen> (checking conditions)
-


Trigger - Run Spawn Forest Creeps <gen> (checking conditions)
-
Spawn Desert Creeps
-

Events
-

Conditions
-

Actions
-


Set VariableSet RegionToSpawn = Desert Spawn 1 <gen>
-


-------- ... would continue on with spawning creeps in Desert Regions --------
-
Spawn Forest Creeps
-

Events
-

Conditions
-

Actions
-


Set VariableSet RegionToSpawn = Forest Spawn 1 <gen>
-


-------- ... would continue on with spawning creeps in Forest Regions --------