Skip to content

Commit

Permalink
ai now spawn in next AO
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirk Main committed May 29, 2015
1 parent e59d20e commit 7d7ba7c
Show file tree
Hide file tree
Showing 11 changed files with 285 additions and 186 deletions.
10 changes: 5 additions & 5 deletions CHVD/fn_addonInit.sqf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[] spawn {
//Wait for mission init, in case there are variables defined some place else
waitUntil {time > 0};

CHVD_scriptRunning = if (isNil "CHVD_scriptRunning") then {false} else {CHVD_scriptRunning};
if (CHVD_scriptRunning) exitWith {systemChat "CHVD script is running. Addon disabled"};

//Define variables, load from profileNamespace
CHVD_allowNoGrass = if (isNil "CHVD_allowNoGrass") then {true} else {CHVD_allowNoGrass};
CHVD_maxView = if (isNil "CHVD_maxView") then {12000} else {CHVD_maxView};
Expand All @@ -29,19 +29,19 @@
//Begin initialization
waitUntil {!isNull player};
waitUntil {!isNull findDisplay 46};

/*
_actionText = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"} else {"View Distance Settings"};
player addAction [_actionText, CHVD_fnc_openDialog, [], -99, false, true];
player addEventHandler ["Respawn", format ["player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]", _actionText]];

*/
//Detect when to change setting type
[] spawn {
for "_i" from 0 to 1 step 0 do {
[nil, false] call CHVD_fnc_updateSettings;
_currentVehicle = vehicle player;
waitUntil {_currentVehicle != vehicle player};
};
};
};
[] spawn {
for "_i" from 0 to 1 step 0 do {
waitUntil {UAVControl (getConnectedUAV player) select 1 != ""};
Expand Down
8 changes: 4 additions & 4 deletions CHVD/fn_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
CHVD_scriptRunning = true;
//Wait for mission init, in case there are variables defined some place else
waitUntil {time > 0};

//Define variables, load from profileNamespace
CHVD_allowNoGrass = if (isNil "CHVD_allowNoGrass") then {true} else {CHVD_allowNoGrass};
CHVD_maxView = if (isNil "CHVD_maxView") then {12000} else {CHVD_maxView};
Expand All @@ -27,19 +27,19 @@
//Begin initialization
waitUntil {!isNull player};
waitUntil {!isNull findDisplay 46};

/*
_actionText = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"} else {"View Distance Settings"};
player addAction [_actionText, CHVD_fnc_openDialog, [], -99, false, true];
player addEventHandler ["Respawn", format ["player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]", _actionText]];

*/
//Detect when to change setting type
[] spawn {
for "_i" from 0 to 1 step 0 do {
[nil, false] call CHVD_fnc_updateSettings;
_currentVehicle = vehicle player;
waitUntil {_currentVehicle != vehicle player};
};
};
};
[] spawn {
for "_i" from 0 to 1 step 0 do {
waitUntil {UAVControl (getConnectedUAV player) select 1 != ""};
Expand Down
99 changes: 1 addition & 98 deletions EVO/fn_buildAmmoCrate.sqf
Original file line number Diff line number Diff line change
@@ -1,103 +1,6 @@
_crate = _this select 0;
_EVOrank = _this select 1;

rank1weapons = ["arifle_MX_F","launch_NLAW_F","launch_RPG32_F"];
rank1items = ["optic_Aco","optic_ACO_grn","acc_flashlight"];

rank2weapons = ["launch_B_Titan_short_F","launch_B_Titan_F","hgun_ACPC2_F","arifle_MXC_F","arifle_MX_GL_F","arifle_MX_SW_F"];
rank2items = ["optic_Hamr","optic_Hamr","optic_Aco_smg","optic_ACO_grn_smg","optic_Holosight","optic_Holosight_smg","bipod_01_F_snd","bipod_01_F_blk","bipod_01_F_mtp"];

rank3weapons = ["arifle_MXM_F","arifle_Mk20C_F","arifle_Mk20C_plain_F","arifle_Mk20_GL_F","hgun_Pistol_heavy_02_F","LMG_Mk200_F"];
rank3items = ["B_UavTerminal","Laserdesignator","acc_pointer_IR","optic_MRCO","NVGoggles"];

rank4weapons = ["hgun_ACPC2_snds_F","arifle_MXM_Black_F","arifle_TRG21_F","arifle_TRG21_GL_F","arifle_TRG20_F","SMG_01_F","arifle_MX_GL_Black_F","arifle_MX_SW_Black_F","hgun_PDW2000_F","SMG_01_F","SMG_02_F"];
rank4items = ["muzzle_snds_H","muzzle_snds_L","muzzle_snds_M","muzzle_snds_B","muzzle_snds_H_MG","muzzle_snds_H_SW","muzzle_snds_acp","muzzle_snds_338_black","muzzle_snds_338_green","muzzle_snds_338_sand","muzzle_snds_93mmg","muzzle_snds_93mmg_tan"];

rank5weapons = ["srifle_EBR_F","srifle_DMR_02_F","srifle_DMR_02_camo_F","srifle_DMR_02_sniper_F","srifle_DMR_03_F","srifle_DMR_03_khaki_F","srifle_DMR_03_tan_F","srifle_DMR_03_multicam_F","srifle_DMR_03_woodland_F","srifle_DMR_06_camo_F","srifle_DMR_06_olive_F","srifle_DMR_06_camo_khs_F","MMG_02_camo_F","MMG_02_black_F","MMG_02_sand_F"];
rank5items = ["optic_SOS","optic_NVS","optic_Nightstalker","optic_tws","optic_tws_mg","optic_Yorris","optic_MRD","optic_DMS","optic_LRPS"];

rank6weapons = ["srifle_LRR_F","srifle_GM6_F","srifle_LRR_camo_F"];
rank6items = ["optic_AMS","optic_AMS_khk","optic_AMS_snd"];

rank7weapons = [];
availableHeadgear = [
"H_HelmetB",
"H_HelmetB_camo",
"H_HelmetB_paint",
"H_HelmetB_light",
"H_HelmetSpecB",
"H_Booniehat_mcamo",
"H_Booniehat_khk_hs",
"H_MilCap_mcamo",
"H_Cap_tan_specops_US",
"H_Cap_khaki_specops_UK",
"H_Cap_headphones",
"H_Bandanna_mcamo",
"H_Bandanna_khk_hs",
"H_Shemag_khk",
"H_ShemagOpen_khk",
"H_Watchcap_blk",
"H_PilotHelmetHeli_B",
"H_CrewHelmetHeli_B",
"H_PilotHelmetFighter_B",
"H_HelmetCrew_B"
];
availableGoggles = [
"G_Combat",
"G_Lowprofile",
"G_Shades_Black",
"G_Shades_Blue",
"G_Shades_Green",
"G_Shades_Red",
"G_Sport_Blackred",
"G_Sport_Blackyellow",
"G_Squares_Tinted",
"G_Tactical_Black",
"G_Tactical_Clear",
"G_Bandanna_blk"
];
availableUniforms = [
"U_B_CombatUniform_mcam",
"U_B_CombatUniform_mcam_tshirt",
"U_B_CombatUniform_mcam_vest",
"U_B_HeliPilotCoveralls",
"U_B_CTRG_1",
"U_B_CTRG_2",
"U_B_CTRG_3"
];
availableVests = [
"V_BandollierB_khk",
"V_BandollierB_blk",
"V_PlateCarrier1_rgr",
"V_PlateCarrier2_rgr",
"V_PlateCarrierGL_rgr",
"V_PlateCarrierSpec_rgr",
"V_PlateCarrierL_CTRG",
"V_PlateCarrierH_CTRG"
];
availableItems = [
"ItemWatch",
"ItemCompass",
"ItemGPS",
"ItemRadio",
"ItemMap",
"MineDetector",
"Binocular",
"NVGoggles",
"FirstAidKit",
"Medikit",
"ToolKit"
];
availableBackpacks = [
"B_AssaultPack_rgr",
"B_AssaultPack_mcamo",
"B_Kitbag_rgr",
"B_Kitbag_mcamo",
"B_TacticalPack_blk",
"B_TacticalPack_mcamo"
];
availableWeapons = [];
availableMagazines = [];
if (("fullArsenal" call BIS_fnc_getParamValue) == 0) exitWith {};

switch (_EVOrank) do {
case "PRIVATE": {
Expand Down
5 changes: 2 additions & 3 deletions EVO/fn_initEVO.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ currentTargetRT = nil;
currentTargetOF = nil;
RTonline = true;
officerAlive = true;
paraSquads = 1;
infSquads = (("infSquadsParam" call BIS_fnc_getParamValue) * 2);
mechSquads = ("mechSquadsParam" call BIS_fnc_getParamValue);
infSquads = ("infSquadsParam" call BIS_fnc_getParamValue);
armorSquads = ("armorSquadsParam" call BIS_fnc_getParamValue);
markerCounter = 0;
"opforair" setMarkerAlpha 0;
"counter" setMarkerAlpha 0;
"counter_1" setMarkerAlpha 0;
currentSideMission = "none";
currentSideMissionMarker = "nil";
nextTargetMarkerName = "nil";
availableSideMissions = [];
currentSideMissionStatus = "ip";
handle = [] spawn EVO_fnc_buildSideMissionArray;
Expand Down
30 changes: 28 additions & 2 deletions EVO/fn_initTarget.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ currentTargetSqkm = (_x1 * _y1);
publicVariable "currentTargetSqkm";
"opforair" setMarkerPos (getMarkerPos currentTargetMarkerName);

_nextTargetMarker = createMarker [nextTargetMarkerName, position _currentTarget];
nextTargetMarkerName setMarkerShape "ELLIPSE";
nextTargetMarkerName setMarkerBrush "FDiagonal";
nextTargetMarkerName setMarkerDir direction (targetLocations select (targetCounter + 1));
_aoSize = [(((size (targetLocations select (targetCounter + 1))) select 0) + 200), (((size (targetLocations select (targetCounter + 1))) select 1) + 200)];
nextTargetMarkerName setMarkerSize _aoSize;
nextTargetMarkerName setMarkerColor "ColorEAST";
nextTargetMarkerName setMarkerPos (position (targetLocations select (targetCounter + 1)));


_pos = (position (targetLocations select (targetCounter + 1)));
_array = nearestObjects [_pos, ["house"], 500];
_obj = _array select 0;
"opforArrow" setMarkerPos (getPos _obj);
"opforArrow" setMarkerDir (([_obj, getMarkerPos currentTargetMarkerName] call bis_fnc_relativeDirTo) + 90);


_towerClass = "Land_Communication_F";
//_towerClass = ["Land_Communication_F", "Land_TTowerBig_2_F", "Land_TTowerBig_1_F"] call BIS_fnc_selectRandom;
/*
Expand Down Expand Up @@ -166,16 +183,25 @@ _grp = [getPos currentTargetOF, EAST, (configFile >> "CfgGroups" >> "EAST" >> "O

for "_i" from 1 to infSquads do {
_null = [_currentTarget] spawn {
_grp = [_this select 0, "infantry"] call EVO_fnc_sendToAO;
_grp = [_this select 0, "infantry", true] call EVO_fnc_sendToAO;
waitUntil {({alive _x} count units _grp) < 5};
while {RTonline} do {
_grp = [_this select 0, "infantry"] call EVO_fnc_sendToAO;
waitUntil {({alive _x} count units _grp) < 5};
};
};
};

for "_i" from 1 to armorSquads do {
_null = [_currentTarget] spawn {
_grp = [_this select 0, "armor"] call EVO_fnc_sendToAO;
_grp = [_this select 0, "armor", true] call EVO_fnc_sendToAO;
_tank = vehicle leader _grp;
waitUntil {({alive _x} count units _grp) < 1 || !canMove _tank || !alive _tank};
while {RTonline} do {
_grp = [_this select 0, "armor"] call EVO_fnc_sendToAO;
_tank = vehicle leader _grp;
waitUntil {({alive _x} count units _grp) < 1 || !canMove _tank || !alive _tank};
};
};
};

Expand Down
19 changes: 2 additions & 17 deletions EVO/fn_pinit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,15 @@ player addaction ["<t color='#CCCC00'>HALO Drop</t>","ATM_airdrop\atm_airdrop.sq
player addaction ["<t color='#CCCC00'>Group Management</t>","disableserialization; ([] call BIS_fnc_displayMission) createDisplay 'RscDisplayDynamicGroups'",nil,1,false,true,"","(player distance spawnBuilding) < 10"];


if (alive currentTargetOF) then {
currentTargetOF addAction [format["Capture %1", name currentTargetOF],"_this spawn EVO_fnc_officer",nil,1,false,true,"","alive currentTargetOF"];
} else {
[] spawn {
_loop = true;
while {_loop} do {
sleep 10;
if (alive currentTargetOF) then {
currentTargetOF addAction [format["Capture Colonel %1", name currentTargetOF],"_this spawn EVO_fnc_officer",nil,1,false,true,"","alive currentTargetOF"];
_loop = false;
};
};
};
};


[[[player], {
if (isServer) then {
_this select 0 addEventHandler ["HandleScore", {[] spawn EVO_fnc_handleScore}];
};
}], "BIS_fnc_spawn", true] call BIS_fnc_MP;

if (("fullArsenal" call BIS_fnc_getParamValue) == 0) then {
player addaction ["Arsenal","['Open',true] spawn BIS_fnc_arsenal;",nil,1,false,true,"","(player distance hqbox) < 10"];
//player addaction ["Arsenal","['Open',true] spawn BIS_fnc_arsenal;",nil,1,false,true,"","(player distance hqbox) < 10"];
0 = ["AmmoboxInit",[hqbox, true]] spawn BIS_fnc_arsenal;
};

if (("pfatigue" call BIS_fnc_getParamValue) == 0) then {
Expand Down
Loading

0 comments on commit 7d7ba7c

Please sign in to comment.