I have been working on a AI creator script for my clans training map. So far I have managed to get all the error messages that show up in game out of the script except for this last one,
Error in expression <g">
Error position: <">
Error Missing;
Now I tink the error is some where in the creatunit area cause it happens multiple times.
This is the script,
//REGION RUNCODE
////////////////////////////////////////////////////////
//Runcode: var = [Groupleader,Amountofinfantry,Amountofvehicles,Amountofarmour,AmountofAirunits,Geartype,Unitside] execVM "AIcreator.sqf"
//Geartypes: 1=West, 2=East
//Sides: 1=West, 2=East, 3=Guerilla, 4=Civilian
////////////////////////////////////////////////////////
//ENDREGION
//REGION Data gathering
_Unit = _this select 0;
_InfS = _this select 1;
_VecS = _this select 2;
_ArmS = _this select 3;
_AirS = _this select 4;
_Geartype = _this select 5;
_Unittype = _this select 6;
_Group = group _Unit;
//ENDREGION
//REGION Unit lists
_InfW = ["SoldierWSaboteurPipe2","SoldierWAA","SoldierWAT","SoldierWAR","SoldierWCrew","SoldierWMiner","SoldierWG","SoldierWMG","SoldierWB","SoldierWPilot","OfficerW","SoldierWMedic","SoldierWSaboteurAssault","SoldierWSaboteurMarksman","","SoldierWSaboteurRecon","SoldierWSaboteurPipe","TeamLeaderW","SquadLeaderW","SoldierWSniper"];
_VecW = ["Truck5tOpen","Truck5tMG","HMMWV","HMMWV50","HMMWVMK","Truck5t","HMMWVTOW","M1030","m113ambul","Truck5tRepair","Truck5tRefuel","Truck5tReammo"];
_ArmW = ["M113","Vulcan","M1Abrams","Stryker_TOW","Stryker_ICV_M2","Stryker_ICV_MK19"];
_AirW = ["UH60","Camel","MH6","UH60MG","AV8B","AV8B2","AH6","AH1W","A10"];
_InfE = ["SoldierEAA","SoldierEAT","SoldierECrew","SoldierEMiner","SoldierEMG","SoldierEG","SoldierESniper","SoldierEB","SoldierEPilot","SoldierESaboteurMarksman","OfficerE","SoldierESaboteurBizon","SoldierESaboteurPipe","SoldierEMedic","SquadLeaderE","TeamLeaderE"];
_VecE = ["UAZ","UralReammo","UralRefuel","Ural","UAZMG","UralOpen","UAZ_AGS30","UralRepair","TT650G","bmp2ambul"];
_ArmE = ["T72","BMP2","BRDM2","BRDM2_ATGM","ZSU"];
_AirE = ["KA50","Mi17_MG","Mi17","Su34B","Su34","Camel2"];
_InfG = ["SoldierGAA","SoldierGAT","SoldierGCrew","SoldierGMiner","SoldierGGuard","SoldierGCommando","SquadLeaderG","TeamLeaderG","SoldierGB","SoldierGMG","SoldierGMedic","OfficerG","SoldierGSniper","SoldierGPilot","SoldierGG","SoldierGMarksman"];
_VecG = ["Landrover_Closed","LandroverMG","Landrover"];
_ArmG = ["Vulcan_RACS","M113_RACS","T72_RACS"];
_AirG = ["AH6_RACS","MH6_RACS"];
_InfC = ["Civilian","Civilian10","Civilian11","Civilian12","Civilian20","Civilian14","Civilian15","Civilian19","Civilian2","Civilian13","Civilian21","Civilian9","Civilian8","Civilian7","Civilian6","Civilian5","Civilian18","Civilian17","Civilian16","Civilian3","Civilian4"];
_VecC = ["SkodaGreen","Skoda","UralCivil","Bus_city","SkodaBlue","SkodaRed","datsun1_civil_1_open","hilux1_civil_3_open","hilux1_civil_2_covered","hilux1_civil_1_open","car_hatchback","UralCivil2","TT650C","datsun1_civil_3_open","datsun1_civil_2_covered","car_sedan","tractor"];
_ArmC = [];
_AirC = [];
//ENDREGION
//REGION Unit creation
switch (_Unittype) do {
//REGION West
case 1:
{
while {_I < _InfS} do
{
_I=_I+1;
_IA = count _InfW;
_IN = random _IA;
_IN = round _IN;
_IUnit = _InfW select _IN;
(_IUnit createUnit [position _Unit, _Group]);
};
while {_V < _VecS} do
{
_V=_V+1;
_VA = count _VecW;
_VN = random _VA;
_VN = round _VN;
_VUnit = _VecW select _VN;
(_VUnit createUnit [position _Unit, _Group]);
};
while {_R < _ArmS} do
{
_R=_R+1;
_RA = count _ArmW;
_RN = random _RA;
_RN = round _RN;
_RUnit = _ArmW select _RN;
(_RUnit createUnit [position _Unit, _Group]);
};
while {_A < _AirS} do
{
_A=_A+1;
_AA = count _AirW;
_AN = random _AA;
_AN = round _AN;
_AUnit = _AirW select _AN;
(_AUnit createUnit [position _Unit, _Group]);
};
};
//ENDREGION
//REGION East
case 2:
{
while {_I < _InfS} do
{
_I=_I+1;
_IA = count _InfE;
_IN = random _IA;
_IN = round _IN;
_IUnit = _InfE select _IN;
(_IUnit createUnit [position _Unit, _Group]);
};
while {_V < _VecS} do
{
_V=_V+1;
_VA = count _VecE;
_VN = random _VA;
_VN = round _VN;
_VUnit = _VecE select _VN;
(_VUnit createUnit [position _Unit, _Group]);
};
while {_R < _ArmS} do
{
_R=_R+1;
_RA = count _ArmE;
_RN = random _RA;
_RN = round _RN;
_RUnit = _ArmE select _RN;
(_RUnit createUnit [position _Unit, _Group]);
};
while {_A < _AirS} do
{
_A=_A+1;
_AA = count _AirE;
_AN = random _AA;
_AN = round _AN;
_AUnit = _AirE select _AN;
(_AUnit createUnit [position _Unit, _Group]);
};
};
//ENDREGION
//REGION Guerilla
case 3:
{
while {_I < _InfS} do
{
_I=_I+1;
_IA = count _InfG;
_IN = random _IA;
_IN = round _IN;
_IUnit = _InfG select _IN;
(_IUnit createUnit [position _Unit, _Group]);
};
while {_V < _VecS} do
{
_V=_V+1;
_VA = count _VecG;
_VN = random _VA;
_VN = round _VN;
_VUnit = _VecG select _VN;
(_VUnit" createUnit [position _Unit, _Group]);
};
while {_R < _ArmS} do
{
_R=_R+1;
_RA = count _ArmG;
_RN = random _RA;
_RN = round _RN;
_RUnit = _ArmG select _RN;
(_RUnit" createUnit [position _Unit, _Group]);
};
while {_A < _AirS} do
{
_A=_A+1;
_AA = count _AirG;
_AN = random _AA;
_AN = round _AN;
_AUnit = _AirG select _AN;
(_AUnit" createUnit [position _Unit, _Group]);
};
};
//ENDREGION
//REGION Civilian
case 4:
{
while {_I < _InfS} do
{
_I=_I+1;
_IA = count _InfC;
_IN = random _IA;
_IN = round _IN;
_IUnit = _InfC select _IN;
(_IUnit createUnit [position _Unit, _Group]);
};
while {_V < _VecS} do
{
_V=_V+1;
_VA = count _VecC;
_VN = random _VA;
_VN = round _VN;
_VUnit = _VecC select _VN;
(_VUnit createUnit [position _Unit, _Group]);
};
while {_R < _ArmS} do
{
_R=_R+1;
_RA = count _ArmC;
_RN = random _RA;
_RN = round _RN;
_RUnit = _ArmC select _RN;
(_RUnit createUnit [position _Unit, _Group]);
};
while {_A < _AirS} do
{
_A=_A+1;
_AA = count _AirC;
_AN = random _AA;
_AN = round _AN;
_AUnit = _AirC select _AN;
(_AUnit createUnit [position _Unit, _Group]);
};
};
//ENDREGION
};
//ENDREGION
//REGION GEAR
switch (_Geartype) do{
case 1:
{
[_Unit,1,10] execVM "gear\Gearsquad.sqf";
};
case 2:
{
[_Unit,2,10] execVM "gear\Gearsquad.sqf";
};
};
//ENDREGION
//REGION Exit
exitWith;
//ENDREGION
Does anyone have a clue what is wrong with this script?
The Unknown
P.S. I only tested this in SP yet but it is intended for MP use once I get the codeing error's out I plan on testing it in MP.