I have a script that picks out random weapons from the CFGWeapons config file, and assigns whatever is random chosen to a unit.
Twice I have received the message
Error: creating weapon CannonCore with scope=private
Which stops the script from continuing.
I have no idea what it is about or what it is related to.
If having the script helps, then here it is, but I must warn that it is very random so you may never get the result, or you may take a long time trying to get it.
_unitArray = [Marksman,Rifleman,Grenadier,Engineer];
_uniformArray = ["U_B_CombatUniform_mcam","U_B_CombatUniform_mcam_tshirt","U_B_CombatUniform_mcam_vest"];
_wpncfg = configFile >> "CfgWeapons";
//Loop from 1 to 3 to be used with selecting individual group members. Changing it from 1 to 0 would select the leader too.
For "_i" from 1 to 3 do {
_wpncount = (random (count _wpncfg));
_wpnselect = _wpncfg select _wpncount;
_wpnname = configName _wpnselect;
//Select a group member in sequence from unit 1 to unit 3 NOT unit 0 to unit 3 as unit 0 is the group leader (player)
_team = units group player select _i;
//Get the current clothing that _unitGuy is wearing
_vest = vest (_unitArray select (random (count _unitArray)));
_head = headgear (_unitArray select (random (count _unitArray)));
_backpack = backpack (_unitArray select (random (count _unitArray)));
_team doMove (getMarkerPos "Crate");
waitUntil {_team distance (getMarkerPos "Crate") <= 4};
sleep 2;
//Remove the teammates uniform and weapons
removeAllWeapons _team;
removeUniform _team;
sleep (random 0.3);
removeAllContainers _team;
sleep (random 0.3);
removeAllAssignedItems _team;
sleep (random 0.3);
_team addUniform (_uniformArray select (random(count _uniformArray)));
sleep 0.5;
if ((typeName _vest) == "STRING" && _vest != "") then {_team addVest _vest};
sleep 0.5;
if ((typeName _backpack) == "STRING" && _backpack != "") then {_team addBackpack _backpack};
sleep 0.5;
if ((typeName _head) == "STRING" && _head != "") then {_team addHeadGear _head};
sleep 0.5;
_team addWeapon _wpnname;
sleep 0.5;
_curweap = currentWeapon _team;
_ammocfg = getArray (configFile >> "CfgWeapons" >> _curweap >> "magazines");
_mags = _ammocfg select 0;
for "_i" from 0 to 5 do {_team addMagazine _mags};
};