When the game starts
-
Classify as worker init
-

Events
-


Time - Elapsed game time is 0.00 seconds
-

Conditions
-

Actions
-


Custom script: set bj_wantDestroyGroup = true
-


Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
-



Loop - Actions
-




Custom script: local boolean paused
-




Set unit = (Picked unit)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Level of Worker for unit) Greater than 0
-





Then - Actions
-






Unit - Add classification of A peon-type unit to unit
-






Custom script: if GetUnitCurrentOrder(udg_unit) == 0 then
-






Custom script: set paused = IsUnitPaused(udg_unit)
-






Custom script: call PauseUnit(udg_unit, true)
-






Custom script: if not paused then
-






Custom script: call PauseUnit(udg_unit, false)
-






Custom script: endif
-






Custom script: endif
-





Else - Actions
For when a unit spawns
-
Classify as worker spawn
-

Events
-


Unit - A unit enters (Entire map)
-

Conditions
-

Actions
-


Custom script: local boolean paused
-


Set unit = (Triggering unit)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Level of Worker for unit) Greater than 0
-



Then - Actions
-




Unit - Add classification of A peon-type unit to unit
-




Custom script: if GetUnitCurrentOrder(udg_unit) == 0 then
-




Custom script: set paused = IsUnitPaused(udg_unit)
-




Custom script: call PauseUnit(udg_unit, true)
-




Custom script: if not paused then
-




Custom script: call PauseUnit(udg_unit, false)
-




Custom script: endif
-




Custom script: endif
-



Else - Actions
For some reason, it's not showing the white spaces in the beginning of those custom scripts.
Anyway, as I said before, you either need to move your units or pause them to remove entirely a glitch where they would still attack nearby units.
Object Editor:
As you said, there are many units in your map that should be considered as workers. So, in order to speed up a little bit your "add ability to many units" in the object editor: I suggest that you check the ID of the ability, which you're going to add to the units.
After checking the ID, copy it into your
Ctrl +
C, but don't forget to add a comma before it -
,A000
.
Now, all you have to do is, select a worker unit in the object editor, then its ability field. Hold
Left-Shift and press
Enter, hit
Right Arrow key, then
Ctrl +
V. Hit
Enter again and proceed to the next unit.