That would be my guess as well maybe trailing space in the first 3 units,
or there are other units on side WP with the exact same names that are getting assigned instead?
To test\find either case, esp the later:
Code: Select all
local u;
for i=1,8 do;
u = ScenEdit_GetUnit({Side="WP",Name="38th OShAP #" ..i});
if u ~=nil then
ScenEdit_AssignUnitToMission(u.guid,"SAG ASW");
print('assigned unit named: ' .. u.name .. ' guid: ' ... u.guid);
else
print('Failed to find and assign unit: ' .. '38th OShAP #' .. tostring(i));
end
u = nil;
end