chat.sqf 7iTt chat\chat.sqf =iTt chat\chat_sar.sqf QkU chat\chat_sar_pt2.sqf !kU CrashToWreck.sqf {T create_cas_mission.sqf +^T~ create_convoy_mission.sqf 4^T create_extraction_mission.sqf OEiT create_extraction_mission_hurt.sqf OpTE create_insertion_mission.sqf aEiTU create_insertion_mission_diver.sqf I^T create_insertion_mission_evac.sqf R^TE create_missing_unit.sqf oU create_playerDown_mission.sqf x^T" create_sar_mission.sqf ';iT description.ext h!U' eos\AI_Skill.sqf CUp eos\core\b_core.sqf R) eos\core\b_Launch.sqf nRK eos\core\eos_core.sqf R3 eos\core\eos_launch.sqf &R
eos\core\spawn_fnc.sqf Rm eos\functions\cargo_fnc.sqf 9R eos\functions\EOS_KillCounter.sqf Y|R< eos\functions\EOS_Markers.sqf Q eos\functions\eos_spawnVehicle.sqf kRG eos\functions\findSafePos.sqf R? eos\functions\infantry_fnc.sqf !R eos\functions\setSkill.sqf R eos\functions\SHK_buildingpos.sqf GRs eos\functions\shk_patrol.sqf pR
eos\functions\shk_pos.sqf gUR eos\functions\TransportUnload_fnc.sqf R eos\OpenMe.sqf UB
eos\UnitPools.sqf ȿU Extended Functions\ai\Efnc_setRndSkill.sqf 9ES Extended Functions\boolean\Efnc_aliveGroup.sqf 9ES Extended Functions\boolean\Efnc_aliveUnits.sqf 9ES Extended Functions\boolean\Efnc_groupDead.sqf 9ES Extended Functions\boolean\Efnc_groupInVehicle.sqf 9ES' Extended Functions\boolean\Efnc_groupInVehicles.sqf 9ES Extended Functions\direction\Efnc_getDir.sqf 9ES Extended Functions\effects\Efnc_createEffect.sqf cU Extended Functions\functional\Efnc_singleParam.sqf 9ES Extended Functions\hints\Efnc_advHints.sqf 9ES Extended Functions\map\Efnc_mapClick.sqf 9ES Extended Functions\markers\Efnc_hideMarker.sqf 9ES Extended Functions\numbers\Efnc_randInRange.sqf 9ES Extended Functions\objects\Efnc_createLight.sqf 9ES Extended Functions\objects\Efnc_nearestRoad.sqf 9ES Extended Functions\position\Efnc_getPosAtAngle.sqf 9ES Extended Functions\position\Efnc_setPosASLZ.sqf 9ESE Extended Functions\position\Efnc_setPosATLZ.sqf 9ESE Extended Functions\position\Efnc_setPosZ.sqf 9ES8 Extended Functions\tasks\Efnc_updateTask.sqf 9ES Extended Functions\waypoints\Efnc_createWP.sqf 9ES functions.sqf (1V> gui_common.hpp 9ESYR IGN_AHD\functions.sqf 9ES IGN_AHD\handlers.sqf 9ES$ IGN_AHD\IGN_AHD.sqf 9ES
IGN_AHD\IGN_AHD_Init.hpp 9ES IGN_AHD\sounds\alarm_industry.wav 9ES~1 IGN_AHD\sounds\alarm_industryLong.ogg 9ESA IGN_AHD\sounds\alarm_pulseSaw.wav 9ES + IGN_AHD\threads.sqf 9ES IGN_LIB\Event.hpp 9ESF IGN_LIB\Functor.hpp :ESh IGN_LIB\IGN_LIB_INIT.sqf :ESW IGN_LIB\Internal.hpp :ES IGN_LIB\ManagedEvent.hpp :ES IGN_LIB\Pointer.hpp :ES img\crew.paa ISd* img\load.jpg 2V img\shift1.paa yHSd* img\Thumbs.db gMIS > img\unused\Thumbs.db :ES init.sqf A+1VG; mission.sqm 2V Options Dialog\defines.hpp GeUU Options Dialog\dialogs.hpp ʿU8 Options Dialog\HIGH.sqf ĿU
Options Dialog\LOW.sqf MU Options Dialog\MID.sqf *ÿU
Options Dialog\Options Dialog Warzone.sqf WU% Options Dialog\Options_Dialog.hpp :ES$" Options Dialog\Options_Dialog.sqf wU0 Options Dialog\Options_Dialog_Macros.hpp :ES1 Options Dialog\ULTRA.sqf Ua pic.jpg 32V postinit.sqf hTZ radio.sqf |IS randomfire.sqf ^T scripts\ai\actions.sqf tBU scripts\ai\claimleadership.sqf tR: scripts\ai\deleterecruitsai.sqf Z:RA scripts\ai\recruitmedic.sqf cBU scripts\ai\recruitrifleman.sqf wBU scripts\heloGoTo\addGotoAction.sqf NPN scripts\heloGoTo\addHeliDepartAction.sqf N scripts\heloGoTo\addHeliDepartLandAction.sqf ~Nf scripts\heloGoTo\cancelGotoAction.sqf +N scripts\heloGoTo\compileFunctions.sqf {HU scripts\heloGoTo\escort\fn\cond_fn1.sqf ;Nb scripts\heloGoTo\escort\fn\cond_fn2.sqf ;N1 scripts\heloGoTo\escort\fn\cond_fn3.sqf ;N5 scripts\heloGoTo\escort\fn\escortHeli.sqf f]Q scripts\heloGoTo\escort\fn\escortRTB.sqf N scripts\heloGoTo\escort\heliEscort_init.sqf \Q scripts\heloGoTo\escort\respawnEscort.sqf FN scripts\heloGoTo\Extraction_destination.sqf BfQI scripts\heloGoTo\extractionMapClick.sqf 3N scripts\heloGoTo\extractLiftOff.sqf 6?N scripts\heloGoTo\fn\addExAction.sqf v\Q scripts\heloGoTo\fn\disableAttackMode.sqf ԌN scripts\heloGoTo\fn\enableAttackMode.sqf b\Q scripts\heloGoTo\fn\re_addExAction.sqf KN scripts\heloGoTo\fn\redefineTaxi.sqf 9N scripts\heloGoTo\fn\removeAction.sqf N scripts\heloGoTo\fn\respawnPlayer.sqf 9CfQ scripts\heloGoTo\heliDepartAction.sqf ozHU- scripts\heloGoTo\heliDepartLandAction.sqf #rHU scripts\heloGoTo\heliStayPut.sqf .\Q scripts\heloGoTo\heliTaxi_init.sqf j\Q scripts\heloGoTo\heloGoTo_init.sqf \Q scripts\heloGoTo\initHeliTaxi.sqf OfQ scripts\heloGoTo\Land_destination.sqf "\Q scripts\heloGoTo\landMapClick.sqf -N? scripts\heloGoTo\resetCommandingUnit.sqf HfQf scripts\heloGoTo\respawnHeli.sqf OfQa scripts\heloGoTo\RTB.sqf ϲT
scripts\heloGoTo\RTBaction.sqf N scripts\heloGoTo\rtbLink.sqf @7Nr scripts\heloGoTo\setHeliVar.sqf KN spawnSmoke.sqf :ES stop.sqf )T x_reload.sqf YL PAPABEAR = [West,"HQ"]; PAPABEAR sideChat "Welcome pilot, your shift starts shortly so get yourself squared away";
PAPABEAR = [West,"HQ"]; PAPABEAR sideChat "Welcome pilot, your shift starts shortly so get yourself squared away";
PAPABEAR = [West,"HQ"]; PAPABEAR sideChat "We've just received an emergency distress signal - last known position is marked on the map.";
sleep 8;
vehicle player vehicleChat "Copy that, we are enroute";
sleep 7;
PAPABEAR = [West,"HQ"]; PAPABEAR sideChat "Find the men and bring them back before the enemy does!";
sleep 7;
vehicle player vehicleChat "Will do sir, november one out";
vehicle player vehicleChat "HQ We have located the target, there boarding now";
sleep 7;
PAPABEAR = [West,"HQ"]; PAPABEAR sideChat "There staus november one?";
sleep 7;
vehicle player vehicleChat "Cuts and bruises sir";
sleep 7;
PAPABEAR = [West,"HQ"]; PAPABEAR sideChat "Thats good work november one";
sleep 8;
vehicle player vehicleChat "We are enroute to base now sir";
sleep 5;
PAPABEAR = [West,"HQ"]; PAPABEAR sideChat "Medics are being alerted now over and out";
_heli = _this;
_crew = crew _heli;
titleText ["", "BLACK FADED", 1];
{
_x allowDamage false;
moveOut _x;
//_x setpos [getpos _x select 0, getpos _x select 1, 0];
_x setBehaviour "COMBAT";
} foreach _crew;
// wait until the chopper is not moving
waitUntil
{
vector = velocity _heli;
(vector select 0) == 0 && (vector select 1) == 0 && (vector select 2) == 0;
};
sleep 2;
_pos = getpos _heli;
//deleteVehicle _heli;
//_wreck = createVehicle ["Land_Wreck_Heli_Attack_02_F", _pos, [], 0, "CAN_COLLIDE"];
{ _x allowDamage true; } foreach _crew;
titleText ["", "BLACK IN", 4];
player playMove "AmovPpneMstpSrasWrflDnon_AmovPknlMstpSrasWrflDnon";
sleep 4;
hint "Use scroll wheel to call for pickup."
deleteVehicle apc1;
_cas_pos = _this select 0;
_radius = [_this, 1, 300, [0]] call BIS_fnc_param; // default to 300
_target_types = [_this, 2, "Armor", ["", []]] call BIS_fnc_param; // default to armor
_target_count = [_this, 3, 2, [0]] call BIS_fnc_param; // default to 2
_targets_separate = [_this, 4, false, [true]] call BIS_fnc_param; // default to false (targets will be grouped together)
_taskDesc = _this select 5;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", "CAS"];
_mission setVariable ["task", player createSimpleTask ["CAS"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
_mission setVariable ["pos_cas", _cas_pos];
_mission setVariable ["mrk_cas", ["cas_mrk", "CAS", _cas_pos] call fnc_createMarker];
// create CAS targets
_cas_data = [_target_types, _target_count, _cas_pos, _radius, _targets_separate] call fnc_createCASTargets;
// Garbage Collector Use
_mission setVariable ["array_groups", _cas_data select 1]; // holds all groups, for Garbage Collection
_mission setVariable ["array_objects", _cas_data select 0]; // holds misc objects not bound to a group
_mission setVariable ["target_vehicles", _cas_data select 0];
_mission setVariable ["target_groups", _cas_data select 1];
// Events
// fires when a target is destroyed/disabled (sends [missionObj, vehicleDestroyed])
_mission setVariable ["event_target_destroyed_single", [[objNull, objNull]] call IGN_fnc_createEvent];
// fires when all targets destroyed/disabled (sends [missionObj])
_mission setVariable ["event_targets_destroyed", [[objNull]] call IGN_fnc_createEvent];
// Clean Up
_mission setVariable ["destroy",
{
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_cas");
[(MISSION getVariable "event_target_destroyed_single")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_targets_destroyed")] call IGN_fnc_deleteEvent;
[EVENT_MISSION_FAILED, MISSION getVariable "eh_failed"] call IGN_fnc_deleteEventHandler;
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT SINGLE TARGET DESTROYED
[
(_mission getVariable "event_target_destroyed_single"),
{
private ["_mission"];
_mission = _this select 0;
_vehicle = _this select 1;
// call reinforcements
if (!REINFORCEMENT_CALLED) then
{
if (REINFORCEMENT_CHANCE call fnc_chance) then
{
REINFORCEMENT_CALLED = true;
[EVENT_REINFORCEMENT_CALLED, (getpos _vehicle)] call IGN_fnc_RaiseEvent;
};
};
}
] call IGN_fnc_addEventHandler;
// EVENT ALL TARGETS DESTROYED
[
(_mission getVariable "event_targets_destroyed"),
{
private ["_mission"];
_mission = _this select 0;
[EVENT_MISSION_COMPLETED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
// MISSION FAILED
_ehFailedID = [
EVENT_MISSION_FAILED,
{
onEachFrame {};
}
] call IGN_fnc_addEventHandler;
_mission setVariable ["eh_failed", _ehFailedID];
// onEachFrame
onEachFrameArgs = _mission;
onEachFrame
{
_mission = onEachFrameArgs;
// single target destroyed
_v = (_mission getVariable "target_vehicles") call fnc_vehicleDisabledInCollection;
if (!(isNull _v)) then
{
_tempArr = (_mission getVariable "target_vehicles") - [_v]; // remove element
_mission setVariable ["target_vehicles", _tempArr];
[_mission getVariable "event_target_destroyed_single", [_mission, _v]] call IGN_fnc_raiseEvent;
};
// all targets destroyed
if (count (_mission getVariable "target_vehicles") == 0) then
{
[_mission getVariable "event_targets_destroyed", [_mission]] call IGN_fnc_raiseEvent;
onEachFrame {};
};
};
[EVENT_MISSION_CREATED,[_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;/*
CONVOY MISSION TEMPLATE
*/
deleteVehicle apc1;
_pos = _this select 0;
_dir = _this select 1;
_veh_classes = _this select 2;
_taskDesc = _this select 3;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", "Convoy"];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_start", _pos];
// ROAD LOOK UP
_mrk = ["convoyStart_mrk", "Last Known Location", _pos, "hd_arrow", "colorRed"] call fnc_createMarker; // fnc_createMarker corrupts _pos
_mrk setMarkerDir _dir;
_mission setVariable ["mrk_convoy", _mrk];
//_dbg_mrk1 = ["convoy_dbg_mrk", "end Position", _endPos, "hd_arrow"] call fnc_createMarker;
_convoyData = [_veh_classes, _pos, _dir] call fnc_createConvoy;
//_dbg_mrk2 = ["convoy_dbg_unit", "unit", getpos ((_convoyData select 1) select 0)] call fnc_createMarker;
//_mission setVariable ["mrk_debug_1", _dbg_mrk1];
//_mission setVariable ["mrk_debug_2", _dbg_mrk2];
/*
[(_convoyData select 1) select 0, _dbg_mrk2] spawn
{
while {true} do
{
sleep 1; (_this select 1) setMarkerPos getpos (_this select 0);
};
};
*/
// waypoint
_wp = [_convoyData select 0, _endPos, 0, "MOVE", 100,
{
[MISSION getVariable "event_wp_complete", [MISSION]] call IGN_fnc_raiseEvent;
}, [0, 0, 0]] call EF_fnc_createWP;
_mission setVariable ["grp_convoy", _convoyData select 0];
_mission setVariable ["target_vehicles", _convoyData select 1]; // keeps alive vehicles only
_mission setVariable ["array_objects", [_convoyData select 1]];
_mission setVariable ["array_groups", [_convoyData select 0]];
_mission setVariable ["task", player createSimpleTask ["Convoy"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// Events
// fires when a target is destroyed/disabled (sends [missionObj, vehicleDestroyed])
_mission setVariable ["event_target_destroyed_single", [[objNull, objNull]] call IGN_fnc_createEvent];
// fires when all targets destroyed/disabled (sends [missionObj])
_mission setVariable ["event_targets_destroyed", [[objNull]] call IGN_fnc_createEvent];
// fires when convoy reaches waypoint (sends [missionObj])
_mission setVariable ["event_wp_complete", [[objNull]] call IGN_fnc_createEvent];
// Clean Up
_mission setVariable ["destroy",
{
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_convoy");
deleteMarker (MISSION getVariable "mrk_debug_1");
deleteMarker (MISSION getVariable "mrk_debug_2");
[(MISSION getVariable "event_target_destroyed_single")] call IGN_fnc_DeleteEvent;
[(MISSION getVariable "event_targets_destroyed")] call IGN_fnc_DeleteEvent;
[(MISSION getVariable "event_wp_complete")] call IGN_fnc_DeleteEvent;
[EVENT_MISSION_FAILED, MISSION getVariable "eh_failed"] call IGN_fnc_DeleteEventHandler;
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT SINGLE TARGET DESTROYED
[
(_mission getVariable "event_target_destroyed_single"),
{
private ["_mission"];
_mission = _this select 0;
_vehicle = _this select 1;
// call reinforcements
if (!REINFORCEMENT_CALLED) then
{
if (REINFORCEMENT_CHANCE call fnc_chance) then
{
REINFORCEMENT_CALLED = true;
[EVENT_REINFORCEMENT_CALLED, (getpos _vehicle)] call IGN_fnc_RaiseEvent;
};
};
}
] call IGN_fnc_AddEventHandler;
// EVENT ALL TARGETS DESTROYED
[
(_mission getVariable "event_targets_destroyed"),
{
private ["_mission"];
_mission = _this select 0;
[EVENT_MISSION_COMPLETED, [_mission, _mission getVariable "task"]] call IGN_fnc_RaiseEvent;
}
] call IGN_fnc_AddEventHandler;
// EVENT WAYPOINT COMPLETE
[
(_mission getVariable "event_wp_complete"),
{
private ["_mission"];
_mission = _this select 0;
_vehicle = (_mission getVariable "target_vehicles") select 0;
[EVENT_MISSION_FAILED, [_mission, _mission getVariable "task"]] call IGN_fnc_RaiseEvent;
}
] call IGN_fnc_AddEventHandler;
// MISSION FAILED
_ehFailedID = [
EVENT_MISSION_FAILED,
{
onEachFrame {};
}
] call IGN_fnc_AddEventHandler;
_mission setVariable ["eh_failed", _ehFailedID];
// onEachFrame
onEachFrameArgs = _mission;
onEachFrame
{
_mission = onEachFrameArgs;
// single target destroyed
_v = (_mission getVariable "target_vehicles") call fnc_vehicleDisabledInCollection;
if (!(isNull _v)) then
{
_tempArr = (_mission getVariable "target_vehicles") - [_v]; // remove element
_mission setVariable ["target_vehicles", _tempArr];
[_mission getVariable "event_target_destroyed_single", [_mission, _v]] call IGN_fnc_RaiseEvent;
};
// all targets destroyed
if (count (_mission getVariable "target_vehicles") == 0) then
{
[_mission getVariable "event_targets_destroyed", [_mission]] call IGN_fnc_RaiseEvent;
onEachFrame {};
};
};
[EVENT_MISSION_CREATED,[_mission, _mission getVariable "task"]] call IGN_fnc_RaiseEvent;
deleteVehicle apc1;
_pickUp_pos = _this select 0;
_dropOff_pos = _this select 1;
_type = _this select 2;
_taskDesc = _this select 3;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", _type];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_pickUp", _pickUp_pos];
_mission setVariable ["pos_dropOff", _dropOff_pos];
_mission setVariable ["grp_pickUp", _pickUp_pos call fnc_createGroup];
// Garbage Collector Use
_mission setVariable ["array_groups", [_mission getVariable "grp_pickUp"]];
_mission setVariable ["array_objects", []];
private ["_mrkPickUpText", "_mrkDropOffText"];
if (_type == "insertion") then
{
_mrkPickUpText = "Pick Up Point";
_mrkDropOffText = "Insertion LZ";
};
if (_type == "extraction") then
{
private ["_enemyGrps"];
_mrkPickUpText = "Extraction LZ";
_mrkDropOffText = "Drop Off Point";
_enemyGrps = [_pickUp_pos, 1 + (round (random 1.99)), EXTRACTION_ENEMY_SPAWN_DIST] call fnc_spawnEnemyGroups;
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + _enemyGrps];
};
_mission setVariable ["mrk_pickUp", ["pickUp_mrk", _mrkPickUpText, _pickUp_pos] call fnc_createMarker];
_mission setVariable ["mrk_dropOff", ["dropOff_mrk", _mrkDropOffText, _dropOff_pos] call fnc_createMarker];
_mission setVariable ["is_picked_up", false];
_mission setVariable ["task", player createSimpleTask ["Insert/Extract"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// EVENTS
_mission setVariable ["event_pickUp", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
_mission setVariable ["event_squadLoaded", [[objNull]] call IGN_fnc_createEvent]; // raises [missionObj]
_mission setVariable ["event_dropOff", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
// TRIGGERS
// pickUp
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
_trg setTriggerStatements["(vehicle player != player) && ((vehicle player) in thislist) && (isTouchingGround (vehicle player))",
"[MISSION getVariable 'event_pickUp', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_pickUp", _trg];
// dropOff
_trg = createTrigger["EmptyDetector", _dropOff_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["((vehicle player) in thislist) && (isTouchingGround (vehicle player)) && MISSION getVariable 'is_picked_up'",
"[MISSION getVariable 'event_dropOff', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_dropOff", _trg];
// pickUpUnitsDead
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead",
"[EVENT_MISSION_FAILED, [MISSION, MISSION getVariable 'task']] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_pickUpUnitsDead", _trg];
// squadLoaded
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["[MISSION getVariable 'grp_pickUp', vehicle player] call EF_fnc_groupInVehicle && !(MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead)",
"[MISSION getVariable 'event_squadLoaded', [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_squadLoaded", _trg];
// inSmokeRange
if (_type == "extraction") then
{
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[2000,2000,0,false];
_trg setTriggerActivation["EAST","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["(vehicle player) in thisList",
"0 = (getpos thisTrigger) execVM 'spawnSmoke.sqf';",
""];
_mission setVariable ["trg_inSmokeRange", _trg];
};
/* NOT USABLE UNTIL BIS_fnc_addStackedEventHandler implements routing of arguments to calling function
// ON EACH FRAME
// pickUpUnitsDead
// squadLoaded
_id = ["onEachFrameId", "onEachFrame",
{
private ["_missionObj"];
_missionObj = _this select 0;
_veh = vehicle player;
_grp = _missionObj getVariable "grp_pickUp";
hint format ["mission = %1 veh = %2 grp = %3 params = %4", _missionObj, _veh, _grp, _this];
if (_grp call EF_fnc_groupDead) then
{
[_missionObj getVariable "event_failed", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}
else
{
if ([_grp, _veh] call EF_fnc_groupInVehicle) then
{
[_missionObj getVariable "event_squadLoaded", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
};
}, [_mission, vehicle player]] call BIS_fnc_addStackedEventHandler;
_mission setVariable ["onEachFrame", _id];
*/
// CLEAN UP
_mission setVariable ["destroy",
{
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_pickUp");
deleteMarker (MISSION getVariable "mrk_dropOff");
[(MISSION getVariable "event_pickUp")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_squadLoaded")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_dropOff")] call IGN_fnc_deleteEvent;
//[(_this getVariable "event_failed")] call IGN_fnc_deleteEvent;
deleteVehicle (MISSION getVariable "trg_pickUp");
deleteVehicle (MISSION getVariable "trg_dropOff");
//[_this getVariable "onEachFrame", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
deleteVehicle (MISSION getVariable "trg_pickUpUnitsDead");
deleteVehicle (MISSION getVariable "trg_squadLoaded");
if ((MISSION getVariable "name") == "extraction") then
{
deleteVehicle (MISSION getVariable "trg_inSmokeRange"); // delete smoke trigger if extraction
};
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT PICKED UP
[
(_mission getVariable "event_pickUp"),
{
private ["_mission", "_vehicle", "_wp"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
// order ai squad into vehicle
{_x assignAsCargo _vehicle} foreach units _group;
{[_x] ordergetin true} foreach units _group;
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET";} foreach units _group;
_wp = _group addwaypoint [_vehicle,5,1];
_wp setwaypointType "GETIN";
}
] call IGN_fnc_addEventHandler;
// EVENT SQUAD LOADED
[
(_mission getVariable "event_squadLoaded"),
{
(_this select 0) setVariable ["is_picked_up", true];
Team sidechat "we're in, go go go";
}
] call IGN_fnc_addEventHandler;
// EVENT DROP OFF
[
(_mission getVariable "event_dropOff"),
{
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
_lz = _mission getVariable "pos_dropOff";
_task = _mission getVariable "task";
// eject ai group, fiddle around with behaviour
deleteWaypoint [_group,1];
{_x action["eject", vehicle _x]} forEach units _group;
{unAssignVehicle _x} forEach units _group;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _group;
wp = _group addwaypoint [_lz,5,1];
wp setwaypointType "MOVE";
[EVENT_MISSION_COMPLETED, [MISSION, MISSION getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
[EVENT_MISSION_CREATED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
// MISC
{ _x setUnitPos "MIDDLE"; } foreach units (_mission getVariable "grp_pickUp");
//((units (_mission getVariable "grp_pickUp")) select 0) allowDamage false;
deleteVehicle apc1;
_pickUp_pos = _this select 0;
_dropOff_pos = _this select 1;
_type = _this select 2;
_taskDesc = _this select 3;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", _type];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_pickUp", _pickUp_pos];
_mission setVariable ["pos_dropOff", _dropOff_pos];
_mission setVariable ["grp_pickUp", _pickUp_pos call fnc_createGrouphurt];
// Garbage Collector Use
_mission setVariable ["array_groups", [_mission getVariable "grp_pickUp"]];
_mission setVariable ["array_objects", []];
private ["_mrkPickUpText", "_mrkDropOffText"];
if (_type == "insertion") then
{
_mrkPickUpText = "Pick Up Point";
_mrkDropOffText = "Insertion LZ";
};
if (_type == "extraction") then
{
private ["_enemyGrps"];
_mrkPickUpText = "Extraction LZ";
_mrkDropOffText = "Drop Off Point";
_enemyGrps = [_pickUp_pos, 1 + (round (random 1.99)), EXTRACTION_ENEMY_SPAWN_DIST] call fnc_spawnEnemyGroups;
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + _enemyGrps];
};
_mission setVariable ["mrk_pickUp", ["pickUp_mrk", _mrkPickUpText, _pickUp_pos] call fnc_createMarker];
_mission setVariable ["mrk_dropOff", ["dropOff_mrk", _mrkDropOffText, _dropOff_pos] call fnc_createMarker];
_mission setVariable ["is_picked_up", false];
_mission setVariable ["task", player createSimpleTask ["Insert/Extract"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// EVENTS
_mission setVariable ["event_pickUp", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
_mission setVariable ["event_squadLoaded", [[objNull]] call IGN_fnc_createEvent]; // raises [missionObj]
_mission setVariable ["event_dropOff", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
// TRIGGERS
// pickUp
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
_trg setTriggerStatements["(vehicle player != player) && ((vehicle player) in thislist) && (isTouchingGround (vehicle player))",
"[MISSION getVariable 'event_pickUp', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_pickUp", _trg];
// dropOff
_trg = createTrigger["EmptyDetector", _dropOff_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["((vehicle player) in thislist) && (isTouchingGround (vehicle player)) && MISSION getVariable 'is_picked_up'",
"[MISSION getVariable 'event_dropOff', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_dropOff", _trg];
// pickUpUnitsDead
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead",
"[EVENT_MISSION_FAILED, [MISSION, MISSION getVariable 'task']] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_pickUpUnitsDead", _trg];
// squadLoaded
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["[MISSION getVariable 'grp_pickUp', vehicle player] call EF_fnc_groupInVehicle && !(MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead)",
"[MISSION getVariable 'event_squadLoaded', [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_squadLoaded", _trg];
// inSmokeRange
if (_type == "extraction") then
{
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[2000,2000,0,false];
_trg setTriggerActivation["EAST","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["(vehicle player) in thisList",
"0 = (getpos thisTrigger) execVM 'spawnSmoke.sqf';",
""];
_mission setVariable ["trg_inSmokeRange", _trg];
};
/* NOT USABLE UNTIL BIS_fnc_addStackedEventHandler implements routing of arguments to calling function
// ON EACH FRAME
// pickUpUnitsDead
// squadLoaded
_id = ["onEachFrameId", "onEachFrame",
{
private ["_missionObj"];
_missionObj = _this select 0;
_veh = vehicle player;
_grp = _missionObj getVariable "grp_pickUp";
hint format ["mission = %1 veh = %2 grp = %3 params = %4", _missionObj, _veh, _grp, _this];
if (_grp call EF_fnc_groupDead) then
{
[_missionObj getVariable "event_failed", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}
else
{
if ([_grp, _veh] call EF_fnc_groupInVehicle) then
{
[_missionObj getVariable "event_squadLoaded", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
};
}, [_mission, vehicle player]] call BIS_fnc_addStackedEventHandler;
_mission setVariable ["onEachFrame", _id];
*/
// CLEAN UP
_mission setVariable ["destroy",
{
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_pickUp");
deleteMarker (MISSION getVariable "mrk_dropOff");
[(MISSION getVariable "event_pickUp")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_squadLoaded")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_dropOff")] call IGN_fnc_deleteEvent;
//[(_this getVariable "event_failed")] call IGN_fnc_deleteEvent;
deleteVehicle (MISSION getVariable "trg_pickUp");
deleteVehicle (MISSION getVariable "trg_dropOff");
//[_this getVariable "onEachFrame", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
deleteVehicle (MISSION getVariable "trg_pickUpUnitsDead");
deleteVehicle (MISSION getVariable "trg_squadLoaded");
if ((MISSION getVariable "name") == "extraction") then
{
deleteVehicle (MISSION getVariable "trg_inSmokeRange"); // delete smoke trigger if extraction
};
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT PICKED UP
[
(_mission getVariable "event_pickUp"),
{
private ["_mission", "_vehicle", "_wp"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
// order ai squad into vehicle
{_x assignAsCargo _vehicle} foreach units _group;
{[_x] ordergetin true} foreach units _group;
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET";} foreach units _group;
_wp = _group addwaypoint [_vehicle,5,1];
_wp setwaypointType "GETIN";
Team sidechat "Board that chopper";
}
] call IGN_fnc_addEventHandler;
// EVENT SQUAD LOADED
[
(_mission getVariable "event_squadLoaded"),
{
(_this select 0) setVariable ["is_picked_up", true];
Team sidechat "we're in, go go go";
}
] call IGN_fnc_addEventHandler;
// EVENT DROP OFF
[
(_mission getVariable "event_dropOff"),
{
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
_lz = _mission getVariable "pos_dropOff";
_task = _mission getVariable "task";
// eject ai group, fiddle around with behaviour
deleteWaypoint [_group,1];
{_x action["eject", vehicle _x]} forEach units _group;
{unAssignVehicle _x} forEach units _group;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _group;
wp = _group addwaypoint [_lz,5,1];
wp setwaypointType "MOVE";
[EVENT_MISSION_COMPLETED, [MISSION, MISSION getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
[EVENT_MISSION_CREATED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
// MISC
{ _x setUnitPos "MIDDLE"; } foreach units (_mission getVariable "grp_pickUp");
//((units (_mission getVariable "grp_pickUp")) select 0) allowDamage false;
deleteVehicle apc1;
_pickUp_pos = _this select 0;
_dropOff_pos = _this select 1;
_type = _this select 2;
_taskDesc = _this select 3;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", _type];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_pickUp", _pickUp_pos];
_mission setVariable ["pos_dropOff", _dropOff_pos];
_mission setVariable ["grp_pickUp", _pickUp_pos call fnc_createGroup];
// Garbage Collector Use
_mission setVariable ["array_groups", [_mission getVariable "grp_pickUp"]];
_mission setVariable ["array_objects", []];
private ["_mrkPickUpText", "_mrkDropOffText"];
if (_type == "insertion") then
{
_mrkPickUpText = "Pick Up Point";
_mrkDropOffText = "Insertion LZ";
};
if (_type == "extraction") then
{
private ["_enemyGrps"];
_mrkPickUpText = "Extraction LZ";
_mrkDropOffText = "Drop Off Point";
_enemyGrps = [_pickUp_pos, 1 + (round (random 1.99)), EXTRACTION_ENEMY_SPAWN_DIST] call fnc_spawnEnemyGroups;
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + _enemyGrps];
nul=[] execVM "chat\chat_extraction.sqf";
};
_mission setVariable ["mrk_pickUp", ["pickUp_mrk", _mrkPickUpText, _pickUp_pos] call fnc_createMarker];
_mission setVariable ["mrk_dropOff", ["dropOff_mrk", _mrkDropOffText, _dropOff_pos] call fnc_createMarker];
_mission setVariable ["is_picked_up", false];
_mission setVariable ["task", player createSimpleTask ["Insert/Extract"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// EVENTS
_mission setVariable ["event_pickUp", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
_mission setVariable ["event_squadLoaded", [[objNull]] call IGN_fnc_createEvent]; // raises [missionObj]
_mission setVariable ["event_dropOff", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
// TRIGGERS
// pickUp
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
_trg setTriggerStatements["(vehicle player != player) && ((vehicle player) in thislist) && (isTouchingGround (vehicle player))",
"[MISSION getVariable 'event_pickUp', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_pickUp", _trg];
// dropOff
_trg = createTrigger["EmptyDetector", _dropOff_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["((vehicle player) in thislist) && (isTouchingGround (vehicle player)) && MISSION getVariable 'is_picked_up'",
"[MISSION getVariable 'event_dropOff', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_dropOff", _trg];
// pickUpUnitsDead
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead",
"[EVENT_MISSION_FAILED, [MISSION, MISSION getVariable 'task']] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_pickUpUnitsDead", _trg];
// squadLoaded
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["[MISSION getVariable 'grp_pickUp', vehicle player] call EF_fnc_groupInVehicle && !(MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead)",
"[MISSION getVariable 'event_squadLoaded', [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_squadLoaded", _trg];
// inSmokeRange
if (_type == "extraction") then
{
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[2000,2000,0,false];
_trg setTriggerActivation["EAST","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["(vehicle player) in thisList",
"0 = (getpos thisTrigger) execVM 'spawnSmoke.sqf';",
""];
_mission setVariable ["trg_inSmokeRange", _trg];
};
/* NOT USABLE UNTIL BIS_fnc_addStackedEventHandler implements routing of arguments to calling function
// ON EACH FRAME
// pickUpUnitsDead
// squadLoaded
_id = ["onEachFrameId", "onEachFrame",
{
private ["_missionObj"];
_missionObj = _this select 0;
_veh = vehicle player;
_grp = _missionObj getVariable "grp_pickUp";
hint format ["mission = %1 veh = %2 grp = %3 params = %4", _missionObj, _veh, _grp, _this];
if (_grp call EF_fnc_groupDead) then
{
[_missionObj getVariable "event_failed", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}
else
{
if ([_grp, _veh] call EF_fnc_groupInVehicle) then
{
[_missionObj getVariable "event_squadLoaded", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
};
}, [_mission, vehicle player]] call BIS_fnc_addStackedEventHandler;
_mission setVariable ["onEachFrame", _id];
*/
// CLEAN UP
_mission setVariable ["destroy",
{
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_pickUp");
deleteMarker (MISSION getVariable "mrk_dropOff");
[(MISSION getVariable "event_pickUp")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_squadLoaded")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_dropOff")] call IGN_fnc_deleteEvent;
//[(_this getVariable "event_failed")] call IGN_fnc_deleteEvent;
deleteVehicle (MISSION getVariable "trg_pickUp");
deleteVehicle (MISSION getVariable "trg_dropOff");
//[_this getVariable "onEachFrame", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
deleteVehicle (MISSION getVariable "trg_pickUpUnitsDead");
deleteVehicle (MISSION getVariable "trg_squadLoaded");
if ((MISSION getVariable "name") == "extraction") then
{
deleteVehicle (MISSION getVariable "trg_inSmokeRange"); // delete smoke trigger if extraction
};
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT PICKED UP
[
(_mission getVariable "event_pickUp"),
{
private ["_mission", "_vehicle", "_wp"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
// order ai squad into vehicle
{_x assignAsCargo _vehicle} foreach units _group;
{[_x] ordergetin true} foreach units _group;
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET";} foreach units _group;
_wp = _group addwaypoint [_vehicle,5,1];
_wp setwaypointType "GETIN";
Team sidechat "Board that chopper";
}
] call IGN_fnc_addEventHandler;
// EVENT SQUAD LOADED
[
(_mission getVariable "event_squadLoaded"),
{
(_this select 0) setVariable ["is_picked_up", true];
}
] call IGN_fnc_addEventHandler;
// EVENT DROP OFF
[
(_mission getVariable "event_dropOff"),
{
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
_lz = _mission getVariable "pos_dropOff";
_task = _mission getVariable "task";
// eject ai group, fiddle around with behaviour
deleteWaypoint [_group,1];
{_x action["eject", vehicle _x]} forEach units _group;
{unAssignVehicle _x} forEach units _group;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _group;
wp = _group addwaypoint [_lz,5,1];
wp setwaypointType "MOVE";
[EVENT_MISSION_COMPLETED, [MISSION, MISSION getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
[EVENT_MISSION_CREATED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
// MISC
{ _x setUnitPos "MIDDLE"; } foreach units (_mission getVariable "grp_pickUp");
//((units (_mission getVariable "grp_pickUp")) select 0) allowDamage false;
deleteVehicle apc1;
_pickUp_pos = _this select 0;
_dropOff_pos = _this select 1;
_type = _this select 2;
_taskDesc = _this select 3;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", _type];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_pickUp", _pickUp_pos];
_mission setVariable ["pos_dropOff", _dropOff_pos];
_mission setVariable ["grp_pickUp", _pickUp_pos call fnc_createGroupdivers];
// Garbage Collector Use
_mission setVariable ["array_groups", [_mission getVariable "grp_pickUp"]];
_mission setVariable ["array_objects", []];
private ["_mrkPickUpText", "_mrkDropOffText"];
if (_type == "insertion") then
{
_mrkPickUpText = "Pick Up Point";
_mrkDropOffText = "Insertion DZ";
};
if (_type == "extraction") then
{
private ["_enemyGrps"];
_mrkPickUpText = "Extraction LZ";
_mrkDropOffText = "Drop Off Point";
_enemyGrps = [_pickUp_pos, 1 + (round (random 1.99)), EXTRACTION_ENEMY_SPAWN_DIST] call fnc_spawnEnemyGroups;
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + _enemyGrps];
};
_mission setVariable ["mrk_pickUp", ["pickUp_mrk", _mrkPickUpText, _pickUp_pos] call fnc_createMarker];
_mission setVariable ["mrk_dropOff", ["dropOff_mrk", _mrkDropOffText, _dropOff_pos] call fnc_createMarker];
_mission setVariable ["is_picked_up", false];
_mission setVariable ["task", player createSimpleTask ["Insert/Extract"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// EVENTS
_mission setVariable ["event_pickUp", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
_mission setVariable ["event_squadLoaded", [[objNull]] call IGN_fnc_createEvent]; // raises [missionObj]
_mission setVariable ["event_dropOff", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
// TRIGGERS
// pickUp
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
_trg setTriggerStatements["(vehicle player != player) && ((vehicle player) in thislist) && (isTouchingGround (vehicle player))",
"[MISSION getVariable 'event_pickUp', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_pickUp", _trg];
// dropOff
_trg = createTrigger["EmptyDetector", _dropOff_pos];
_trg setTriggerArea[50,50,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["((vehicle player) in thislist) && MISSION getVariable 'is_picked_up'",
"[MISSION getVariable 'event_dropOff', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_dropOff", _trg];
// pickUpUnitsDead
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead",
"[EVENT_MISSION_FAILED, [MISSION, MISSION getVariable 'task']] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_pickUpUnitsDead", _trg];
// squadLoaded
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["[MISSION getVariable 'grp_pickUp', vehicle player] call EF_fnc_groupInVehicle && !(MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead)",
"[MISSION getVariable 'event_squadLoaded', [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_squadLoaded", _trg];
// inSmokeRange
if (_type == "extraction") then
{
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[2000,2000,0,false];
_trg setTriggerActivation["EAST","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["(vehicle player) in thisList",
"0 = (getpos thisTrigger) execVM 'spawnSmoke.sqf';",
""];
_mission setVariable ["trg_inSmokeRange", _trg];
};
/* NOT USABLE UNTIL BIS_fnc_addStackedEventHandler implements routing of arguments to calling function
// ON EACH FRAME
// pickUpUnitsDead
// squadLoaded
_id = ["onEachFrameId", "onEachFrame",
{
private ["_missionObj"];
_missionObj = _this select 0;
_veh = vehicle player;
_grp = _missionObj getVariable "grp_pickUp";
hint format ["mission = %1 veh = %2 grp = %3 params = %4", _missionObj, _veh, _grp, _this];
if (_grp call EF_fnc_groupDead) then
{
[_missionObj getVariable "event_failed", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}
else
{
if ([_grp, _veh] call EF_fnc_groupInVehicle) then
{
[_missionObj getVariable "event_squadLoaded", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
};
}, [_mission, vehicle player]] call BIS_fnc_addStackedEventHandler;
_mission setVariable ["onEachFrame", _id];
*/
// CLEAN UP
_mission setVariable ["destroy",
{
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_pickUp");
deleteMarker (MISSION getVariable "mrk_dropOff");
[(MISSION getVariable "event_pickUp")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_squadLoaded")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_dropOff")] call IGN_fnc_deleteEvent;
//[(_this getVariable "event_failed")] call IGN_fnc_deleteEvent;
deleteVehicle (MISSION getVariable "trg_pickUp");
deleteVehicle (MISSION getVariable "trg_dropOff");
//[_this getVariable "onEachFrame", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
deleteVehicle (MISSION getVariable "trg_pickUpUnitsDead");
deleteVehicle (MISSION getVariable "trg_squadLoaded");
if ((MISSION getVariable "name") == "extraction") then
{
deleteVehicle (MISSION getVariable "trg_inSmokeRange"); // delete smoke trigger if extraction
};
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT PICKED UP
[
(_mission getVariable "event_pickUp"),
{
private ["_mission", "_vehicle", "_wp"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
// order ai squad into vehicle
{_x assignAsCargo _vehicle} foreach units _group;
{[_x] ordergetin true} foreach units _group;
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET";} foreach units _group;
_wp = _group addwaypoint [_vehicle,5,1];
_wp setwaypointType "GETIN";
Team sidechat "Board that chopper";
}
] call IGN_fnc_addEventHandler;
// EVENT SQUAD LOADED
[
(_mission getVariable "event_squadLoaded"),
{
(_this select 0) setVariable ["is_picked_up", true];
Team sidechat "we're in, go go go";
}
] call IGN_fnc_addEventHandler;
// EVENT DROP OFF
[
(_mission getVariable "event_dropOff"),
{
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
_lz = _mission getVariable "pos_dropOff";
_task = _mission getVariable "task";
// eject ai group, fiddle around with behaviour
deleteWaypoint [_group,1];
{_x action["eject", vehicle _x]} forEach units _group;
{unAssignVehicle _x} forEach units _group;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _group;
wp = _group addwaypoint [_lz,5,1];
wp setwaypointType "MOVE";
[EVENT_MISSION_COMPLETED, [MISSION, MISSION getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
[EVENT_MISSION_CREATED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
// MISC
{ _x setUnitPos "MIDDLE"; } foreach units (_mission getVariable "grp_pickUp");
//((units (_mission getVariable "grp_pickUp")) select 0) allowDamage false;
deleteVehicle apc1;
_pickUp_pos = _this select 0;
_dropOff_pos = _this select 1;
_type = _this select 2;
_taskDesc = _this select 3;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", _type];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_pickUp", _pickUp_pos];
_mission setVariable ["pos_dropOff", _dropOff_pos];
_mission setVariable ["grp_pickUp", _pickUp_pos call fnc_createGroupevac];
// Garbage Collector Use
_mission setVariable ["array_groups", [_mission getVariable "grp_pickUp"]];
_mission setVariable ["array_objects", []];
private ["_mrkPickUpText", "_mrkDropOffText"];
if (_type == "insertion") then
{
_mrkPickUpText = "Pick Up Point";
_mrkDropOffText = "Insertion LZ";
};
if (_type == "extraction") then
{
private ["_enemyGrps"];
_mrkPickUpText = "Extraction LZ";
_mrkDropOffText = "Drop Off Point";
_enemyGrps = [_pickUp_pos, 1 + (round (random 1.99)), EXTRACTION_ENEMY_SPAWN_DIST] call fnc_spawnEnemyGroups;
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + _enemyGrps];
};
_mission setVariable ["mrk_pickUp", ["pickUp_mrk", _mrkPickUpText, _pickUp_pos] call fnc_createMarker];
_mission setVariable ["mrk_dropOff", ["dropOff_mrk", _mrkDropOffText, _dropOff_pos] call fnc_createMarker];
_mission setVariable ["is_picked_up", false];
_mission setVariable ["task", player createSimpleTask ["Insert/Extract"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// EVENTS
_mission setVariable ["event_pickUp", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
_mission setVariable ["event_squadLoaded", [[objNull]] call IGN_fnc_createEvent]; // raises [missionObj]
_mission setVariable ["event_dropOff", [[objNull, objNull]] call IGN_fnc_createEvent]; // raises [vehicle, missionObj]
// TRIGGERS
// pickUp
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
_trg setTriggerStatements["(vehicle player != player) && ((vehicle player) in thislist) && (isTouchingGround (vehicle player))",
"[MISSION getVariable 'event_pickUp', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_pickUp", _trg];
// dropOff
_trg = createTrigger["EmptyDetector", _dropOff_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["((vehicle player) in thislist) && (isTouchingGround (vehicle player)) && MISSION getVariable 'is_picked_up'",
"[MISSION getVariable 'event_dropOff', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_dropOff", _trg];
// pickUpUnitsDead
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead",
"[EVENT_MISSION_FAILED, [MISSION, MISSION getVariable 'task']] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_pickUpUnitsDead", _trg];
// squadLoaded
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["[MISSION getVariable 'grp_pickUp', vehicle player] call EF_fnc_groupInVehicle && !(MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead)",
"[MISSION getVariable 'event_squadLoaded', [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_squadLoaded", _trg];
// inSmokeRange
if (_type == "extraction") then
{
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[2000,2000,0,false];
_trg setTriggerActivation["EAST","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["(vehicle player) in thisList",
"0 = (getpos thisTrigger) execVM 'spawnSmoke.sqf';",
""];
_mission setVariable ["trg_inSmokeRange", _trg];
};
/* NOT USABLE UNTIL BIS_fnc_addStackedEventHandler implements routing of arguments to calling function
// ON EACH FRAME
// pickUpUnitsDead
// squadLoaded
_id = ["onEachFrameId", "onEachFrame",
{
private ["_missionObj"];
_missionObj = _this select 0;
_veh = vehicle player;
_grp = _missionObj getVariable "grp_pickUp";
hint format ["mission = %1 veh = %2 grp = %3 params = %4", _missionObj, _veh, _grp, _this];
if (_grp call EF_fnc_groupDead) then
{
[_missionObj getVariable "event_failed", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}
else
{
if ([_grp, _veh] call EF_fnc_groupInVehicle) then
{
[_missionObj getVariable "event_squadLoaded", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
};
}, [_mission, vehicle player]] call BIS_fnc_addStackedEventHandler;
_mission setVariable ["onEachFrame", _id];
*/
// CLEAN UP
_mission setVariable ["destroy",
{
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_pickUp");
deleteMarker (MISSION getVariable "mrk_dropOff");
[(MISSION getVariable "event_pickUp")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_squadLoaded")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_dropOff")] call IGN_fnc_deleteEvent;
//[(_this getVariable "event_failed")] call IGN_fnc_deleteEvent;
deleteVehicle (MISSION getVariable "trg_pickUp");
deleteVehicle (MISSION getVariable "trg_dropOff");
//[_this getVariable "onEachFrame", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
deleteVehicle (MISSION getVariable "trg_pickUpUnitsDead");
deleteVehicle (MISSION getVariable "trg_squadLoaded");
if ((MISSION getVariable "name") == "extraction") then
{
deleteVehicle (MISSION getVariable "trg_inSmokeRange"); // delete smoke trigger if extraction
};
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT PICKED UP
[
(_mission getVariable "event_pickUp"),
{
private ["_mission", "_vehicle", "_wp"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
// order ai squad into vehicle
{_x assignAsCargo _vehicle} foreach units _group;
{[_x] ordergetin true} foreach units _group;
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET";} foreach units _group;
_wp = _group addwaypoint [_vehicle,5,1];
_wp setwaypointType "GETIN";
Team sidechat "Board that chopper";
}
] call IGN_fnc_addEventHandler;
// EVENT SQUAD LOADED
[
(_mission getVariable "event_squadLoaded"),
{
(_this select 0) setVariable ["is_picked_up", true];
Team sidechat "we're in, go go go";
}
] call IGN_fnc_addEventHandler;
// EVENT DROP OFF
[
(_mission getVariable "event_dropOff"),
{
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
_lz = _mission getVariable "pos_dropOff";
_task = _mission getVariable "task";
// eject ai group, fiddle around with behaviour
deleteWaypoint [_group,1];
{_x action["eject", vehicle _x]} forEach units _group;
{unAssignVehicle _x} forEach units _group;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _group;
wp = _group addwaypoint [_lz,5,1];
wp setwaypointType "MOVE";
[EVENT_MISSION_COMPLETED, [MISSION, MISSION getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
[EVENT_MISSION_CREATED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
// MISC
{ _x setUnitPos "MIDDLE"; } foreach units (_mission getVariable "grp_pickUp");
//((units (_mission getVariable "grp_pickUp")) select 0) allowDamage false;
/*
MISSING UNIT MISSION TEMPLATE
BY ROBJ
DO NOT COPY ALL RIGHTS RESERVED
*/
_pickUp_pos = _this select 0;
_dropOff_pos = _this select 1;
_radius = _this select 2;
_taskDesc = _this select 3;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", "SAR"];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_pickUp", _pickUp_pos];
_mission setVariable ["pos_dropOff", _dropOff_pos];
_mission setVariable ["mrk_area", ["SARarea_mrk", "", _pickUp_pos, _radius] call fnc_createMarkerEllipse2];
_mission setVariable ["mrk_pickUp", ["pickUp_mrk", "Area Of Search", _pickUp_pos] call fnc_createMarker2];
_mission setVariable ["mrk_dropOff", ["dropOff_mrk", "Drop Off", _dropOff_pos] call fnc_createMarker2];
//_pickUp_pos = [_pickUp_pos, _radius] call fnc_placementRadiusGround;
_pickUp_pos = [[[_pickUp_pos, _radius]]] call BIS_fnc_randomPos;
_sarData = [_pickup_pos, _radius, (Mission_Dictionary getVariable "Wreck2")] call fnc_createSARGroup2;
_mission setVariable ["grp_pickUp", _sarData select 0];
_mission setVariable ["array_objects", [_sarData select 1]];
_mission setVariable ["array_groups", [_sarData select 0]];
// spawn enemies
_enemyGrps = [_pickUp_pos, 3, SAR_ENEMY_SPAWN_DIST] call fnc_spawnEnemyGroups;
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + _enemyGrps];
_mission setVariable ["is_picked_up", false];
_mission setVariable ["task", player createSimpleTask ["SAR"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// EVENTS
_mission setVariable ["event_pickUp", [[objNull, objNull]] call IGN_fnc_createEvent];
_mission setVariable ["event_squadLoaded", [[objNull]] call IGN_fnc_createEvent];
_mission setVariable ["event_dropOff", [[objNull, objNull]] call IGN_fnc_createEvent];
// TRIGGERS
// pickUp
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
_trg setTriggerStatements["(vehicle player != player) && ((vehicle player) in thislist) && (isTouchingGround (vehicle player))",
"[MISSION getVariable 'event_pickUp', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_pickUp", _trg];
// dropOff
_trg = createTrigger["EmptyDetector", _dropOff_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["((vehicle player) in thislist) && (isTouchingGround (vehicle player)) && MISSION getVariable 'is_picked_up'",
"[MISSION getVariable 'event_dropOff', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_dropOff", _trg];
// pickUpUnitsDead
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead",
"[EVENT_MISSION_FAILED, [MISSION, MISSION getVariable 'task']] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_pickUpUnitsDead", _trg];
// squadLoaded
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["[MISSION getVariable 'grp_pickUp', vehicle player] call EF_fnc_groupInVehicle && !(MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead)",
"[MISSION getVariable 'event_squadLoaded', [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_squadLoaded", _trg];
/* NOT USABLE UNTIL BIS_fnc_addStackedEventHandler implements routing of arguments to calling function
// ON EACH FRAME
// pickUpUnitsDead
// squadLoaded
_id = ["onEachFrameId", "onEachFrame",
{
private ["_missionObj"];
_missionObj = _this select 0;
_veh = vehicle player;
_grp = _missionObj getVariable "grp_pickUp";
hint format ["mission = %1 veh = %2 grp = %3 params = %4", _missionObj, _veh, _grp, _this];
if (_grp call EF_fnc_groupDead) then
{
[_missionObj getVariable "event_failed", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}
else
{
if ([_grp, _veh] call EF_fnc_groupInVehicle) then
{
[_missionObj getVariable "event_squadLoaded", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
};
}, [_mission, vehicle player]] call BIS_fnc_addStackedEventHandler;
_mission setVariable ["onEachFrame", _id];
*/
// CLEAN UP
_mission setVariable ["destroy",
{
AA_WILL_SPAWN = true; // need this here in case mission fails
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_pickUp");
deleteMarker (MISSION getVariable "mrk_dropOff");
deleteMarker (MISSION getVariable "mrk_area");
[(MISSION getVariable "event_pickUp")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_squadLoaded")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_dropOff")] call IGN_fnc_deleteEvent;
//[(_this getVariable "event_failed")] call fnc_DeleteEvent;
deleteVehicle (MISSION getVariable "trg_pickUp");
deleteVehicle (MISSION getVariable "trg_dropOff");
//[_this getVariable "onEachFrame", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
deleteVehicle (MISSION getVariable "trg_pickUpUnitsDead");
deleteVehicle (MISSION getVariable "trg_squadLoaded");
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT PICKED UP
[
(_mission getVariable "event_pickUp"),
{
private ["_mission"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
// order ai squad into vehicle
{_x assignAsCargo _vehicle} foreach units _group;
{[_x] ordergetin true} foreach units _group;
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET";} foreach units _group;
wp = _group addwaypoint [_vehicle,5,1];
wp setwaypointType "GETIN";
nul=[] execVM "chat\chat_sar_pt2.sqf";
Team sidechat "Board that heli";
}
] call IGN_fnc_addEventHandler;
// EVENT SQUAD LOADED
[
(_mission getVariable "event_squadLoaded"),
{
(_this select 0) setVariable ["is_picked_up", true];
Team sidechat "we're in, go go go";
// Turn on AA spawning
AA_WILL_SPAWN = true;
}
] call IGN_fnc_addEventHandler;
// EVENT DROP OFF
[
(_mission getVariable "event_dropOff"),
{
private ["_vehicle", "_mission", "_group", "_lz", "_task", "_wp"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
_lz = _mission getVariable "pos_dropOff";
_task = _mission getVariable "task";
// eject ai group, fiddle around with behaviour
deleteWaypoint [_group,1];
{_x action["eject", vehicle _x]} forEach units _group;
{unAssignVehicle _x} forEach units _group;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _group;
_wp = _group addwaypoint [_lz,5,1];
_wp setwaypointType "MOVE";
[EVENT_MISSION_COMPLETED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
[EVENT_MISSION_CREATED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
// MISC
{ _x setUnitPos "MIDDLE"; } foreach units (_mission getVariable "grp_pickUp");
//((units (_mission getVariable "grp_pickUp")) select 0) allowDamage false;
// create fire/smoke
_eff = [_sarData select 1, ["fire", "smoke"] call BIS_fnc_selectRandom] call EF_fnc_createEffect;
(_mission getVariable "array_objects") set [count (_mission getVariable "array_objects"), _eff];
// turn off AA spawning
AA_WILL_SPAWN = false;
/*
Player Chopper Down Mission Template
*/
deleteVehicle apc1;
_posPickUp = _this select 0;
_posDropOff = _this select 1;
_crew = _this select 2;
_taskDesc = _this select 3;
// merge crew into single group
{
if (group _x != group player) then
{
[_x] joinSilent (group player);
};
} foreach (_crew - [_crew select 0]); // assuming _crew select 0 is player
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", "playerDown"];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_pickUp", _posPickUp];
_mission setVariable ["pos_dropOff", _posDropOff];
_mission setVariable ["mrk_pickUp", ["pickUp_mrk", "Chopper Down", _posPickUp] call fnc_createMarker];
_mission setVariable ["array_crew", _crew];
_mission setVariable ["grp_pickUp", (group player)];
_mission setVariable ["array_objects", []];
_mission setVariable ["array_groups", []]; // needs to be tweaked to not include player and gunner (if alive)
_mission setVariable ["is_picked_up", false];
_mission setVariable ["task", player createSimpleTask ["playerDown"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// SAR HELO SPAWN
_heloSpawnPos = [_posPickUp, PLAYERDOWN_RESCUE_SPAWN_DIST, (random 359)] call EF_fnc_getPosAtAngle;
_heloSpawnPos = _heloSpawnPos - [(_heloSpawnPos select 2)]; // remove Z so BIS_fnc_spawnVehicle creates it in FLYING
_SARHELODATA = [_heloSpawnPos, 0, "B_Heli_Transport_01_F", WEST] call bis_fnc_spawnvehicle;
(_SARHELODATA select 0) setCaptive true; // Chopper belongs to CIVILIAN SIDE!
(_SARHELODATA select 2) allowFleeing 0;
(_SARHELODATA select 2) setCombatMode "BLUE";
// MISSION DATA SETTING
_mission setVariable ["helicopter", _SARHELODATA select 0];
_mission setVariable ["grp_helicopter", _SARHELODATA select 2];
// WAYPOINTS
[_mission getVariable "grp_helicopter", _posPickUp, 1, "MOVE", 500] call EF_fnc_createWP;
[_mission getVariable "grp_helicopter", _posPickUp, 2, "MOVE", 600,
{
(vehicle this) land "LAND";
[MISSION getVariable "event_pickUp", [_mission getVariable "helicopter", _mission]] call IGN_fnc_raiseEvent;
}] call EF_fnc_createWP;
// ENEMY SPAWN
_enemyGrps = [_posPickUp, ([0, 1, 2] call BIS_fnc_selectRandom), PLAYERDOWN_ENEMY_SPAWN_DIST] call fnc_spawnEnemyGroups;
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + _enemyGrps];
// EVENTS
//_mission setVariable ["event_time", [ [objNull, []] ] call IGN_fnc_createEvent]; // sends [missionObj, crewArray]
_mission setVariable ["event_pickUp", [[objNull, objNull]] call IGN_fnc_createEvent];
_mission setVariable ["event_squadLoaded", [[objNull]] call IGN_fnc_createEvent];
_mission setVariable ["event_dropOff", [[objNull, objNull]] call IGN_fnc_createEvent];
// TRIGGERS
// NOT WORKING!!! isTouchingGround does not recognize airfield as ground!
// dropOff
_trg = createTrigger["EmptyDetector", _posDropOff];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["CIV","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["((vehicle player) in thislist) && (isTouchingGround (vehicle player)) && MISSION getVariable 'is_picked_up'",
"[MISSION getVariable 'event_dropOff', [(MISSION getVariable 'helicopter'), MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_dropOff", _trg];
// squadLoaded
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["[MISSION getVariable 'grp_pickUp', (MISSION getVariable 'helicopter')] call EF_fnc_groupInVehicle",
"[MISSION getVariable 'event_squadLoaded', [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_squadLoaded", _trg];
// SARHELO Killed/Unable to fly
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["!alive (MISSION getVariable 'helicopter') || !canMove (MISSION getVariable 'helicopter')",
"[EVENT_MISSION_FAILED, [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_SARFailed", _trg];
/* NOT USABLE UNTIL BIS_fnc_addStackedEventHandler implements routing of arguments to calling function
// ON EACH FRAME
// pickUpUnitsDead
// squadLoaded
_id = ["onEachFrameId", "onEachFrame",
{
private ["_missionObj"];
_missionObj = _this select 0;
_veh = vehicle player;
_grp = _missionObj getVariable "grp_pickUp";
hint format ["mission = %1 veh = %2 grp = %3 params = %4", _missionObj, _veh, _grp, _this];
if (_grp call EF_fnc_groupDead) then
{
[_missionObj getVariable "event_failed", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}
else
{
if ([_grp, _veh] call EF_fnc_groupInVehicle) then
{
[_missionObj getVariable "event_squadLoaded", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
};
}, [_mission, vehicle player]] call BIS_fnc_addStackedEventHandler;
_mission setVariable ["onEachFrame", _id];
*/
// CLEAN UP
_mission setVariable ["destroy",
{
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_pickUp");
[(MISSION getVariable "event_pickUp")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_squadLoaded")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_dropOff")] call IGN_fnc_deleteEvent;
//[(_this getVariable "event_failed")] call fnc_DeleteEvent;
deleteVehicle (MISSION getVariable "trg_dropOff");
deleteVehicle (MISSION getVariable "trg_SARFailed");
//[_this getVariable "onEachFrame", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
deleteVehicle (MISSION getVariable "trg_squadLoaded");
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT PICKED UP
[
(_mission getVariable "event_pickUp"),
{
private ["_mission", "_vehicle"];
_vehicle = _this select 0;
_mission = _this select 1;
{
_x assignAsCargo _vehicle;
_x orderGetin true;
} foreach (_mission getVariable "array_crew");
pilot271 sidechat "GET IN";
}
] call IGN_fnc_addEventHandler;
// EVENT SQUAD LOADED
[
(_mission getVariable "event_squadLoaded"),
{
private ["_mission"];
_mission = _this select 0;
_mission setVariable ["is_picked_up", true];
pilot271 sidechat "Lets get you guys home";
[_mission getVariable "grp_helicopter", (_mission getVariable "pos_dropOff"), 3, "MOVE", 300] call EF_fnc_createWP;
[_mission getVariable "grp_helicopter", (_mission getVariable "pos_dropOff"), 4, "MOVE", 300,
{
(vehicle this) land "land";
}] call EF_fnc_createWP;
}
] call IGN_fnc_addEventHandler;
// EVENT DROP OFF
[
(_mission getVariable "event_dropOff"),
{
private ["_vehicle", "_mission", "_group"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
_lz = _mission getVariable "pos_dropOff";
_task = _mission getVariable "task";
// eject ai group, fiddle around with behaviour
{_x action["eject", vehicle _x]} forEach units _group;
{unAssignVehicle _x} forEach units _group;
// split off extra units from player group
{
if (_x != player) then
{
[_x] join grpNull;
_mission setVariable ["array_objects", (_mission getVariable "array_objects") + [_x]];
//(_mission getVariable "array_objects") set [count (_mission getVariable "array_objects"), _x];
};
} foreach (units _group);
_vehicle land "NONE";
_mission setVariable ["array_objects", (_mission getVariable "array_objects") + [(_mission getVariable "helicopter")]];
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + [(_mission getVariable "grp_helicopter")]];
[(_mission getVariable "grp_helicopter"), getpos GL_HELI_FINAL, 4, "MOVE", 500] call EF_fnc_createWP;
[EVENT_MISSION_COMPLETED, [MISSION, MISSION getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
// Create new Kajman at base with preloaded gunner and event handlers
(getMarkerPos "HELI_SPAWN") call fnc_CreateKajmanWithGunner;
[EVENT_MISSION_CREATED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
/*
SEARCH AND RESCUE MISSION TEMPLATE
*/
nul=[] execVM "chat\chat_sar.sqf";
deleteVehicle apc1;
_pickUp_pos = _this select 0;
_dropOff_pos = _this select 1;
_radius = _this select 2;
_taskDesc = _this select 3;
MISSION = createVehicle ["Land_HelipadEmpty_F", [0,0,0], [], 0, "NONE"];
_mission = MISSION;
// common attributes
_mission setVariable ["name", "SAR"];
_mission setVariable ["task", taskNull];
// mission specific
_mission setVariable ["pos_pickUp", _pickUp_pos];
_mission setVariable ["pos_dropOff", _dropOff_pos];
_mission setVariable ["mrk_area", ["SARarea_mrk", "", _pickUp_pos, _radius] call fnc_createMarkerEllipse];
_mission setVariable ["mrk_pickUp", ["pickUp_mrk", "SAR", _pickUp_pos] call fnc_createMarker];
_mission setVariable ["mrk_dropOff", ["dropOff_mrk", "Drop Off", _dropOff_pos] call fnc_createMarker];
//_pickUp_pos = [_pickUp_pos, _radius] call fnc_placementRadiusGround;
_pickUp_pos = [[[_pickUp_pos, _radius]]] call BIS_fnc_randomPos;
_sarData = [_pickup_pos, _radius, (Mission_Dictionary getVariable "Wreck")] call fnc_createSARGroup;
_mission setVariable ["grp_pickUp", _sarData select 0];
_mission setVariable ["array_objects", [_sarData select 1]];
_mission setVariable ["array_groups", [_sarData select 0]];
// spawn enemies
_enemyGrps = [_pickUp_pos, 3, SAR_ENEMY_SPAWN_DIST] call fnc_spawnEnemyGroups;
_mission setVariable ["array_groups", (_mission getVariable "array_groups") + _enemyGrps];
_mission setVariable ["is_picked_up", false];
_mission setVariable ["task", player createSimpleTask ["SAR"]];
(_mission getVariable "task") setSimpleTaskDescription [(_taskDesc select 0), (_taskDesc select 1), ""];
// EVENTS
_mission setVariable ["event_pickUp", [[objNull, objNull]] call IGN_fnc_createEvent];
_mission setVariable ["event_squadLoaded", [[objNull]] call IGN_fnc_createEvent];
_mission setVariable ["event_dropOff", [[objNull, objNull]] call IGN_fnc_createEvent];
// TRIGGERS
// pickUp
_trg = createTrigger["EmptyDetector", _pickUp_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
_trg setTriggerStatements["(vehicle player != player) && ((vehicle player) in thislist) && (isTouchingGround (vehicle player))",
"[MISSION getVariable 'event_pickUp', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_pickUp", _trg];
// dropOff
_trg = createTrigger["EmptyDetector", _dropOff_pos];
_trg setTriggerArea[300,300,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["((vehicle player) in thislist) && (isTouchingGround (vehicle player)) && MISSION getVariable 'is_picked_up'",
"[MISSION getVariable 'event_dropOff', [vehicle player, MISSION]] call IGN_fnc_raiseEvent",
""];
_mission setVariable ["trg_dropOff", _trg];
// pickUpUnitsDead
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0, 0, 0, true];
_trg setTriggerStatements["MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead",
"[EVENT_MISSION_FAILED, [MISSION, MISSION getVariable 'task']] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_pickUpUnitsDead", _trg];
// squadLoaded
_trg = createTrigger["EmptyDetector", [0,0,0]];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["NONE","PRESENT",false];
_trg setTriggerTimeout [0,0,0, true];
_trg setTriggerStatements["[MISSION getVariable 'grp_pickUp', vehicle player] call EF_fnc_groupInVehicle && !(MISSION getVariable 'grp_pickUp' call EF_fnc_groupDead)",
"[MISSION getVariable 'event_squadLoaded', [MISSION]] call IGN_fnc_raiseEvent;",
""];
_mission setVariable ["trg_squadLoaded", _trg];
/* NOT USABLE UNTIL BIS_fnc_addStackedEventHandler implements routing of arguments to calling function
// ON EACH FRAME
// pickUpUnitsDead
// squadLoaded
_id = ["onEachFrameId", "onEachFrame",
{
private ["_missionObj"];
_missionObj = _this select 0;
_veh = vehicle player;
_grp = _missionObj getVariable "grp_pickUp";
hint format ["mission = %1 veh = %2 grp = %3 params = %4", _missionObj, _veh, _grp, _this];
if (_grp call EF_fnc_groupDead) then
{
[_missionObj getVariable "event_failed", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}
else
{
if ([_grp, _veh] call EF_fnc_groupInVehicle) then
{
[_missionObj getVariable "event_squadLoaded", [_missionObj]] call fnc_RaiseEvent;
[_id, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
};
}, [_mission, vehicle player]] call BIS_fnc_addStackedEventHandler;
_mission setVariable ["onEachFrame", _id];
*/
// CLEAN UP
_mission setVariable ["destroy",
{
AA_WILL_SPAWN = true; // need this here in case mission fails
[EVENT_MISSION_CLEANUP, [MISSION]] call IGN_fnc_raiseEvent;
deleteMarker (MISSION getVariable "mrk_pickUp");
deleteMarker (MISSION getVariable "mrk_dropOff");
deleteMarker (MISSION getVariable "mrk_area");
[(MISSION getVariable "event_pickUp")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_squadLoaded")] call IGN_fnc_deleteEvent;
[(MISSION getVariable "event_dropOff")] call IGN_fnc_deleteEvent;
//[(_this getVariable "event_failed")] call fnc_DeleteEvent;
deleteVehicle (MISSION getVariable "trg_pickUp");
deleteVehicle (MISSION getVariable "trg_dropOff");
//[_this getVariable "onEachFrame", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
deleteVehicle (MISSION getVariable "trg_pickUpUnitsDead");
deleteVehicle (MISSION getVariable "trg_squadLoaded");
deleteVehicle MISSION;
MISSION_IN_PROGRESS = false;
}];
// REGISTER HANDLERS
// EVENT PICKED UP
[
(_mission getVariable "event_pickUp"),
{
private ["_mission"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
// order ai squad into vehicle
{_x assignAsCargo _vehicle} foreach units _group;
{[_x] ordergetin true} foreach units _group;
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET";} foreach units _group;
wp = _group addwaypoint [_vehicle,5,1];
wp setwaypointType "GETIN";
nul=[] execVM "chat\chat_sar_pt2.sqf";
Team sidechat "Board that heli";
}
] call IGN_fnc_addEventHandler;
// EVENT SQUAD LOADED
[
(_mission getVariable "event_squadLoaded"),
{
(_this select 0) setVariable ["is_picked_up", true];
Team sidechat "we're in, go go go";
// Turn on AA spawning
AA_WILL_SPAWN = true;
}
] call IGN_fnc_addEventHandler;
// EVENT DROP OFF
[
(_mission getVariable "event_dropOff"),
{
private ["_vehicle", "_mission", "_group", "_lz", "_task", "_wp"];
_vehicle = _this select 0;
_mission = _this select 1;
_group = _mission getVariable "grp_pickUp";
_lz = _mission getVariable "pos_dropOff";
_task = _mission getVariable "task";
// eject ai group, fiddle around with behaviour
deleteWaypoint [_group,1];
{_x action["eject", vehicle _x]} forEach units _group;
{unAssignVehicle _x} forEach units _group;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _group;
_wp = _group addwaypoint [_lz,5,1];
_wp setwaypointType "MOVE";
[EVENT_MISSION_COMPLETED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
}
] call IGN_fnc_addEventHandler;
[EVENT_MISSION_CREATED, [_mission, _mission getVariable "task"]] call IGN_fnc_raiseEvent;
// MISC
{ _x setUnitPos "MIDDLE"; } foreach units (_mission getVariable "grp_pickUp");
//((units (_mission getVariable "grp_pickUp")) select 0) allowDamage false;
// create fire/smoke
_eff = [_sarData select 1, ["fire", "smoke"] call BIS_fnc_selectRandom] call EF_fnc_createEffect;
(_mission getVariable "array_objects") set [count (_mission getVariable "array_objects"), _eff];
// turn off AA spawning
AA_WILL_SPAWN = false;
// Options Dialog compilation
#include "gui_common.hpp"
#include "Options Dialog\Options_Dialog_Macros.hpp"
#include "Options Dialog\Options_Dialog.hpp"
// Options Dialog Warzones
#include "Options Dialog\defines.hpp"
#include "Options Dialog\dialogs.hpp"
// overview
overviewText = "Pilot Sikorsky CH-53E On Missions";
//overviewTextLocked = "";
overviewPicture = "img\load.jpg";
author = "RobJ2210";
// loading screen
onLoadName = "CH-53E Super Stallion Pilot"; // Mission name (temporary solution; actual name set in editor will be used later in the alpha)
onLoadMission = "Get in your NHIndustries NH90 and get to work its your shift"; // Description
loadScreen = "img\load.jpg"; // Preview picture
/* Garbage Collector Settings */
corpseLimit = 20;
corpseRemovalMinTime = 20;
corpseRemovalMaxTime = 300; // 5 min
wreckLimit = 10;
wreckRemovalMinTime = 20; //seconds
wreckRemovalMaxTime = 300; // 5 min
// AHD Sound effects
class CfgSounds
{
sounds[] = {};
class alarm_industry
{
// how the sound is referred to in the editor (e.g. trigger effects)
name = "alarm_industry";
// filename, volume, pitch
//
sound[] = {"IGN_AHD\sounds\alarm_industryLong.ogg", 2, 1};
// subtitle delay in seconds, subtitle text
titles[] = {};
};
};
class CfgNotifications
{
class Default
{
title = ""; // Tile displayed as text on black background. Filled by arguments.
iconPicture = ""; // Small icon displayed in left part. Colored by "color", filled by arguments.
iconText = ""; // Short text displayed over the icon. Colored by "color", filled by arguments.
description = ""; // Brief description displayed as structured text. Colored by "color", filled by arguments.
color[] = {1,1,1,1}; // Icon and text color
duration = 5; // How many seconds will the notification be displayed
priority = 0; // Priority; higher number = more important; tasks in queue are selected by priority
difficulty[] = {}; // Required difficulty settings. All listed difficulties has to be enabled
};
// Examples
class TaskCreated
{
title = "TASK ASSIGNED";
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskiconcreated_ca.paa";
description = "%1";
priority = 0;
};
class TaskCompleted
{
title = "TASK COMPLETED";
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskicondone_ca.paa";
description = "%1";
priority = 0;
};
class TaskFailed
{
title = "TASK FAILED";
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskiconfailed_ca.paa";
description = "%1";
priority = 0;
};
class TaskCancelled
{
title = "TASK CANCELLED";
iconPicture = "\A3\ui_f\data\map\mapcontrol\taskiconcanceled_ca.paa";
description = "%1";
priority = 0;
};
};
class CfgFunctions
{
class EF
{
class Effects
{
class createEffect
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\effects\Efnc_createEffect.sqf";
};
};
class Functional
{
class singleParam
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\functional\Efnc_singleParam.sqf";
};
};
class AI
{
class setRndSkill
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\ai\Efnc_setRndSkill.sqf";
};
};
class Boolean
{
class aliveGroup
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\boolean\Efnc_aliveGroup.sqf";
};
class aliveUnits
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\boolean\Efnc_aliveUnits.sqf";
};
class groupDead
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\boolean\Efnc_groupDead.sqf";
};
class groupInVehicle
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\boolean\Efnc_groupInVehicle.sqf";
};
class groupInVehicles
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\boolean\Efnc_groupInVehicles.sqf";
};
};
class Direction
{
class getDir
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\direction\Efnc_getDir.sqf";
};
};
class Hints
{
class advHints
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\hints\Efnc_advHints.sqf";
};
};
class Map
{
class mapClick
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\map\Efnc_mapClick.sqf";
};
};
class Markers
{
class hideMarker
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\markers\Efnc_hideMarker.sqf";
};
};
class Numbers
{
class randInRange
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\numbers\Efnc_randInRange.sqf";
};
};
class Objects
{
class createLight
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\objects\Efnc_createLight.sqf";
};
class nearestRoad
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\objects\Efnc_nearestRoad.sqf";
};
};
class Position
{
class getPosAtAngle
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\position\Efnc_getPosAtAngle.sqf";
};
class setPosASLZ
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\position\Efnc_setPosASLZ.sqf";
};
class setPosATLZ
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\position\Efnc_setPosATLZ.sqf";
};
class setPosZ
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\position\Efnc_setPosZ.sqf";
};
};
class Tasks
{
class updateTask
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\tasks\Efnc_updateTask.sqf";
};
};
class Waypoints
{
class createWP
{
//preInit = 1; // 1 to call the function upon mission start, before objects are initialized. Passed arguments are ["preInit"]
//ext = ".sqf"; // Set file type, can be ".sqf" or ".fsm" (meaning scripted FSM). Default is ".sqf".
file = "Extended Functions\waypoints\Efnc_createWP.sqf";
};
};
};
};// INFANTRY SKILL
_InfskillSet = [
0.2, // aimingAccuracy
0.45, // aimingShake
0.2, // aimingSpeed
0.1, // spotDistance
0.4, // spotTime
1, // courage
1, // reloadSpeed
1, // commanding
1 // general
];
// ARMOUR SKILL
_ArmSkillSet = [
0.25, // aimingAccuracy
0.45, // aimingShake
0.6, // aimingSpeed
0.4, // spotDistance
0.4, // spotTime
1, // courage
1, // reloadSpeed
1, // commanding
1 // general
];
// LIGHT VEHICLE skill
_LigSkillSet = [
0.25, // aimingAccuracy
0.45, // aimingShake
0.6, // aimingSpeed
0.4, // spotDistance
0.4, // spotTime
1, // courage
1, // reloadSpeed
1, // commanding
1 // general
];
// HELICOPTER SKILL
_AIRskillSet = [
0.25, // aimingAccuracy
0.45, // aimingShake
0.6, // aimingSpeed
0.4, // spotDistance
0.4, // spotTime
1, // courage
1, // reloadSpeed
1, // commanding
1 // general
];
// STATIC SKILL
_STAskillSet = [
0.25, // aimingAccuracy
0.45, // aimingShake
0.6, // aimingSpeed
0.4, // spotDistance
0.4, // spotTime
1, // courage
1, // reloadSpeed
1, // commanding
1 // general
];
server setvariable ["INFskill",_InfskillSet];
server setvariable ["ARMskill",_ArmSkillSet];
server setvariable ["LIGskill",_LigSkillSet];
server setvariable ["AIRskill",_AIRskillSet];
server setvariable ["STAskill",_STAskillSet];if (!isServer) exitWith {};
private ["_fGroup","_cargoType","_vehType","_CHside","_mkrAgl","_initialLaunch","_pause","_eosZone","_hints","_waves","_aGroup","_side","_actCond","_enemyFaction","_mAH","_mAN","_distance","_grp","_cGroup","_bGroup","_CHType","_time","_timeout","_faction"];
_mkr=(_this select 0);_mPos=markerpos(_this select 0);_mkrX=getMarkerSize _mkr select 0;_mkrY=getMarkerSize _mkr select 1;_mkrAgl=markerDir _mkr;
_infantry=(_this select 1);_PApatrols=_infantry select 0;_PAgroupSize=_infantry select 1;
_LVeh=(_this select 2);_LVehGroups=_LVeh select 0;_LVgroupSize=_LVeh select 1;
_AVeh=(_this select 3);_AVehGroups=_AVeh select 0;
_SVeh=(_this select 4);_CHGroups=_SVeh select 0;_fSize=_SVeh select 1;
_settings=(_this select 5);_faction=_settings select 0;_mA=_settings select 1;_side=_settings select 2;
_heightLimit=if (count _settings > 4) then {_settings select 4} else {false};
_debug=if (count _settings > 5) then {_settings select 5} else {false};
_basSettings=(_this select 6);
_pause=_basSettings select 0;
_waves=_basSettings select 1;
_timeout=_basSettings select 2;
_eosZone=_basSettings select 3;
_hints=_basSettings select 4;
_initialLaunch= if (count _this > 7) then {_this select 7} else {false};
_Placement=(_mkrX + 500);
if (_mA==0) then {_mAH = 1;_mAN = 0.5;};
if (_mA==1) then {_mAH = 0;_mAN = 0;};
if (_mA==2) then {_mAH = 0.5;_mAN = 0.5;};
if (_side==EAST) then {_enemyFaction="east";};
if (_side==WEST) then {_enemyFaction="west";};
if (_side==INDEPENDENT) then {_enemyFaction="GUER";};
if (_side==CIVILIAN) then {_enemyFaction="civ";};
if ismultiplayer then {
if (_heightLimit) then
{_actCond="{vehicle _x in thisList && isplayer _x && ((getPosATL _x) select 2) < 5} count playableunits > 0";
}else
{_actCond="{vehicle _x in thisList && isplayer _x} count playableunits > 0";
};}else{
if (_heightLimit) then
{_actCond="{vehicle _x in thisList && isplayer _x && ((getPosATL _x) select 2) < 5} count allUnits > 0";
}else
{_actCond="{vehicle _x in thisList && isplayer _x} count allUnits > 0";};};
_basActivated = createTrigger ["EmptyDetector",_mPos];
_basActivated setTriggerArea [_mkrX,_mkrY,_mkrAgl,FALSE];
_basActivated setTriggerActivation ["ANY","PRESENT",true];
_basActivated setTriggerStatements [_actCond,"",""];
_mkr setmarkercolor bastionColor;
_mkr setmarkeralpha _mAN;
waituntil {triggeractivated _basActivated};
_mkr setmarkercolor bastionColor;
_mkr setmarkeralpha _mAH;
_bastActive = createTrigger ["EmptyDetector",_mPos];
_bastActive setTriggerArea [_mkrX,_mkrY,_mkrAgl,FALSE];
_bastActive setTriggerActivation ["any","PRESENT",true];
_bastActive setTriggerTimeout [1, 1, 1, true];
_bastActive setTriggerStatements [_actCond,"",""];
_bastClear = createTrigger ["EmptyDetector",_mPos];
_bastClear setTriggerArea [(_mkrX+(_Placement*0.3)),(_mkrY+(_Placement*0.3)),_mkrAgl,FALSE];
_bastClear setTriggerActivation [_enemyFaction,"NOT PRESENT",true];
_bastClear setTriggerStatements ["this","",""];
// PAUSE IF REQUESTED
if (_pause > 0 and !_initialLaunch) then {
for "_counter" from 1 to _pause do {
if (_hints) then {hint format ["Attack ETA : %1",(_pause - _counter)];};
sleep 1;};
};
// SPAWN PATROLS
_aGroup=[];
for "_counter" from 1 to _PApatrols do {
_pos = [_mPos, _Placement, random 360] call BIS_fnc_relPos;
_grp=[_pos,_PAgroupSize,_faction,_side] call EOS_fnc_spawngroup;
_aGroup set [count _aGroup,_grp];
if (_debug) then {PLAYER SIDECHAT (format ["Spawned Patrol: %1",_counter]);0= [_mkr,_counter,"patrol",getpos (leader _grp)] call EOS_debug};
};
//SPAWN LIGHT VEHICLES
_bGrp=[];
for "_counter" from 1 to _LVehGroups do {
_newpos = [_mPos, (_Placement +200), random 360] call BIS_fnc_relPos;
if (surfaceiswater _newpos) then {_vehType=8;_cargoType=10;}else{_vehType=7;_cargoType=9;};
_bGroup=[_newpos,_side,_faction,_vehType]call EOS_fnc_spawnvehicle;
if ((_LVgroupSize select 0) > 0) then{
0=[(_bGroup select 0),_LVgroupSize,(_bGroup select 2),_faction,_cargoType] call eos_fnc_setcargo;
};
0=[(_bGroup select 2),"LIGskill"] call eos_fnc_grouphandlers;
_bGrp set [count _bGrp,_bGroup];
if (_debug) then {player sidechat format ["Light Vehicle:%1 - r%2",_counter,_LVehGroups];0= [_mkr,_counter,"Light Veh",(getpos leader (_bGroup select 2))] call EOS_debug};
};
//SPAWN ARMOURED VEHICLES
_cGrp=[];
for "_counter" from 1 to _AVehGroups do {
_newpos = [_mPos, _Placement, random 360] call BIS_fnc_relPos;
if (surfaceiswater _newpos) then {_vehType=8;}else{_vehType=2;};
_cGroup=[_newpos,_side,_faction,_vehType]call EOS_fnc_spawnvehicle;
0=[(_cGroup select 2),"ARMskill"] call eos_fnc_grouphandlers;
_cGrp set [count _cGrp,_cGroup];
if (_debug) then {player sidechat format ["Armoured:%1 - r%2",_counter,_AVehGroups];0= [_mkr,_counter,"Armour",(getpos leader (_cGroup select 2))] call EOS_debug};
};
//SPAWN HELICOPTERS
_fGrp=[];
for "_counter" from 1 to _CHGroups do {
if ((_fSize select 0) > 0) then {_vehType=4}else{_vehType=3};
_newpos = [(markerpos _mkr), 1500, random 360] call BIS_fnc_relPos;
_fGroup=[_newpos,_side,_faction,_vehType,"fly"]call EOS_fnc_spawnvehicle;
_CHside=_side;
_fGrp set [count _fGrp,_fGroup];
if ((_fSize select 0) > 0) then {
_cargoGrp = createGroup _side;
0=[(_fGroup select 0),_fSize,_cargoGrp,_faction,9] call eos_fnc_setcargo;
0=[_cargoGrp,"INFskill"] call eos_fnc_grouphandlers;
_fGroup set [count _fGroup,_cargoGrp];
null = [_mkr,_fGroup,_counter] execvm "eos\functions\TransportUnload_fnc.sqf";
}else{
_wp1 = (_fGroup select 2) addWaypoint [(markerpos _mkr), 0];
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointType "SAD";};
if (_debug) then {player sidechat format ["Chopper:%1",_counter];0= [_mkr,_counter,"Chopper",(getpos leader (_fGroup select 2))] call EOS_debug};
};
// ADD WAYPOINTS
{
_getToMarker = _x addWaypoint [_mPos, 0];
_getToMarker setWaypointType "SAD";
_getToMarker setWaypointSpeed "NORMAL";
_getToMarker setWaypointBehaviour "AWARE";
_getToMarker setWaypointFormation "NO CHANGE";
}foreach _aGroup;
{
_getToMarker = (_x select 2) addWaypoint [_mPos, 0];
_getToMarker setWaypointType "SAD";
_getToMarker setWaypointSpeed "NORMAL";
_getToMarker setWaypointBehaviour "AWARE";
_getToMarker setWaypointFormation "NO CHANGE";
}foreach _cGrp;
{
_pos = [_mPos, (_mkrX + 50), random 360] call BIS_fnc_relPos;
_getToMarker = (_x select 2) addWaypoint [_pos, 0];
_getToMarker setWaypointType "UNLOAD";
_getToMarker setWaypointSpeed "NORMAL";
_getToMarker setWaypointBehaviour "AWARE";
_getToMarker setWaypointFormation "NO CHANGE";
_wp = (_x select 2) addWaypoint [_mPos, 1];
_wp setWaypointType "SAD";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointBehaviour "AWARE";
_wp setWaypointFormation "NO CHANGE";
}foreach _bGrp;
waituntil {triggeractivated _bastActive};
for "_counter" from 1 to _timeout do {
if (_hints) then {
if (_waves > 1) then {hint format ["Next wave ETA : %1",(_timeout - _counter)];};};
sleep 1;
if (!triggeractivated _bastActive || getmarkercolor _mkr == "colorblack") exitwith
{
hint "Zone lost. You must re-capture it";
_mkr setmarkercolor hostileColor;
_mkr setmarkeralpha _mAN;
if (_eosZone) then {
null = [_mkr,[_PApatrols,_PAgroupSize],[_PApatrols,_PAgroupSize],[_LVehGroups,_LVgroupSize],[_AVehGroups,0,0,0],[_faction,_mA,350,_CHside]] execVM "eos\core\EOS_Core.sqf";
};
_waves=0;
};
};
_waves=(_waves - 1);
if (triggeractivated _bastActive and triggeractivated _bastClear and (_waves < 1) ) then
{
if (_hints) then {hint "Waves complete";};
_mkr setmarkercolor VictoryColor;
_mkr setmarkeralpha _mAN;
}else{
if (_waves >= 1) then {
if (_hints) then {hint "Reinforcements inbound";};
null = [_mkr,[_PApatrols,_PAgroupSize],[_LVehGroups,_LVgroupSize],[_AVehGroups],[_CHGroups,_fSize],_settings,[_pause,_waves,_timeout,_eosZone,_hints],true] execVM "eos\core\b_core.sqf";
};};
waituntil {getmarkercolor _mkr == "colorblack" OR getmarkercolor _mkr == VictoryColor OR getmarkercolor _mkr == hostileColor or !triggeractivated _bastActive};
if (_debug) then {player sidechat "delete units";};
{
{deleteVehicle _x} foreach units _x;
}foreach _aGroup;
if (count _cGrp > 0) then
{
{ _vehicle = _x select 0;
_crew = _x select 1;
_grp = _x select 2;
{deleteVehicle _x} forEach (_crew);
if (!(vehicle player == _vehicle)) then
{{deleteVehicle _x} forEach[_vehicle];};
{deleteVehicle _x} foreach units _grp;
deleteGroup _grp;
}foreach _cGrp;
};
if (count _bGrp > 0) then
{
{ _vehicle = _x select 0;
_crew = _x select 1;
_grp = _x select 2;
{deleteVehicle _x} forEach (_crew);
if (!(vehicle player == _vehicle)) then
{{deleteVehicle _x} forEach[_vehicle];};
{deleteVehicle _x} foreach units _grp;
deleteGroup _grp;
}foreach _bGrp;
};
// CACHE HELICOPTER TRANSPORT
if (count _fGrp > 0) then
{
{ _vehicle = _x select 0;_crew = _x select 1;_grp = _x select 2; _cargoGrp = _x select 3;
{deleteVehicle _x} forEach (_crew);
if (!(vehicle player == _vehicle)) then {{deleteVehicle _x} forEach[_vehicle];};
{deleteVehicle _x} foreach units _grp;deleteGroup _grp;
{deleteVehicle _x} foreach units _cargoGrp;deleteGroup _cargoGrp;
}foreach _fGrp;};
deletevehicle _bastActive;deletevehicle _bastClear;deletevehicle _basActivated;
if (getmarkercolor _mkr == "colorblack") then {_mkr setmarkeralpha 0;};if (isServer) then {
private ["_CHgroupArray","_LVgroupArray","_PAgroupArray","_CHGroups","_AVehGroups","_LVehGroups","_PApatrols"];
_JIPmkr=(_this select 0);
_infantry=(_this select 1);
_PApatrols=_infantry select 0;
_PAgroupSize=_infantry select 1;
_LVeh=(_this select 2);
_LVehGroups=_LVeh select 0;
_LVgroupSize=_LVeh select 1;
_AVeh=(_this select 3);
_AVehGroups=_AVeh select 0;
_SVeh=(_this select 4);
_CHGroups=_SVeh select 0;
_CHgroupSize=_SVeh select 1;
_settings=(_this select 5);
_basSettings=(_this select 6);
if (_PAgroupSize==0) then {_PAgroupArray=[1,1]};
if (_PAgroupSize==1) then {_PAgroupArray=[2,4]};
if (_PAgroupSize==2) then {_PAgroupArray=[4,8]};
if (_PAgroupSize==3) then {_PAgroupArray=[8,12]};
if (_PAgroupSize==4) then {_PAgroupArray=[12,16]};
if (_PAgroupSize==5) then {_PAgroupArray=[16,20]};
if (_LVgroupSize==0) then {_LVgroupArray=[1,1]};
if (_LVgroupSize==1) then {_LVgroupArray=[2,4]};
if (_LVgroupSize==2) then {_LVgroupArray=[4,8]};
if (_LVgroupSize==3) then {_LVgroupArray=[8,12]};
if (_LVgroupSize==4) then {_LVgroupArray=[12,16]};
if (_LVgroupSize==5) then {_LVgroupArray=[16,20]};
if (_CHgroupSize==0) then {_CHgroupArray=[0,0]};
if (_CHgroupSize==1) then {_CHgroupArray=[2,4]};
if (_CHgroupSize==2) then {_CHgroupArray=[4,8]};
if (_CHgroupSize==3) then {_CHgroupArray=[8,12]};
if (_CHgroupSize==4) then {_CHgroupArray=[12,16]};
if (_CHgroupSize==5) then {_CHgroupArray=[16,20]};
{
_eosMarkers=server getvariable "EOSmarkers";
if (isnil "_eosMarkers") then {_eosMarkers=[];};
_eosMarkers set [count _eosMarkers,_x];
server setvariable ["EOSmarkers",_eosMarkers,true];
null = [_x,[_PApatrols,_PAgroupArray],[_LVehGroups,_LVgroupArray],[_AVehGroups],[_CHGroups,_CHgroupArray],_settings,_basSettings] execVM "eos\core\b_core.sqf";
}foreach _JIPmkr;
};if (!isServer) exitWith {};
private ["_newpos","_cargoType","_vehType","_dGrp","_mkrAgl","_side","_bGroup","_civZone","_fGrp","_fSize","_fGrps","_eGrp","_eGrps","_dGrps","_aMin","_aSize","_aGrps","_aGrp","_bMin","_units","_bSize","_bGrps","_bGrp","_trig","_cache","_grp","_crew","_vehicle","_actCond","_mAN","_mAH","_distance","_mA","_settings","_cGrp","_cSize","_cGrps","_taken","_clear","_enemyFaction","_faction","_n","_eosAct","_eosActivated","_debug","_mkr","_mPos","_mkrX","_mkrY"];
_mkr=(_this select 0);_mPos=markerpos(_this select 0);
_mkrX=getMarkerSize _mkr select 0;
_mkrY=getMarkerSize _mkr select 1;
_mkrAgl=markerDir _mkr;
_a=(_this select 1);_aGrps=_a select 0;_aSize=_a select 1;_aMin=_aSize select 0;
_b=(_this select 2);_bGrps=_b select 0;_bSize=_b select 1;_bMin=_bSize select 0;
_c=(_this select 3);_cGrps=_c select 0;_cSize=_c select 1;
_d=(_this select 4);_dGrps=_d select 0;_eGrps=_d select 1;_fGrps=_d select 2;_fSize=_d select 3;
_settings=(_this select 5);_faction=_settings select 0;_mA=_settings select 1;_distance=_settings select 2;_side=_settings select 3;
_heightLimit=if (count _settings > 4) then {_settings select 4} else {false};
_debug=if (count _settings > 5) then {_settings select 5} else {false};
_cache= if (count _this > 6) then {_this select 6} else {false};
if (_side==EAST) then {_enemyFaction="east";_civZone=false;};
if (_side==WEST) then {_enemyFaction="west";_civZone=false;};
if (_side==INDEPENDENT) then {_enemyFaction="GUER";_civZone=false;};
if (_side==CIVILIAN) then {_enemyFaction="civ";_civZone=true;};
if (_mA==0) then {_mAH = 1;_mAN = 0.5;};
if (_mA==1) then {_mAH = 0;_mAN = 0;};
if (_mA==2) then {_mAH = 0.5;_mAN = 0.5;};
// INITIATE ZONE
_trig=format ["EOSTrigger%1",_mkr];
if (!_cache) then {
if ismultiplayer then {
if (_heightLimit) then
{_actCond="{vehicle _x in thisList && isplayer _x && ((getPosATL _x) select 2) < 5} count playableunits > 0";
}else
{_actCond="{vehicle _x in thisList && isplayer _x} count playableunits > 0";
};}else{
if (_heightLimit) then
{_actCond="{vehicle _x in thisList && isplayer _x && ((getPosATL _x) select 2) < 5} count allUnits > 0";
}else
{_actCond="{vehicle _x in thisList && isplayer _x} count allUnits > 0";};};
_eosActivated = createTrigger ["EmptyDetector",_mPos];
_eosActivated setTriggerArea [(_distance+_mkrX),(_distance+_mkrY),_mkrAgl,FALSE];
_eosActivated setTriggerActivation ["ANY","PRESENT",true];
_eosActivated setTriggerTimeout [1, 1, 1, true];
_eosActivated setTriggerStatements [_actCond,"",""];
server setvariable [_trig,_eosActivated];
}else{
_eosActivated=server getvariable _trig;
};
_mkr setmarkerAlpha _mAN;
if (!(getmarkercolor _mkr == VictoryColor)) then //IF MARKER IS GREEN DO NOT CHANGE COLOUR
{
_mkr setmarkercolor hostileColor;
};
waituntil {triggeractivated _eosActivated}; //WAIT UNTIL PLAYERS IN ZONE
if (!(getmarkercolor _mkr == "colorblack"))then {
if (!(getmarkercolor _mkr == VictoryColor)) then {_mkr setmarkerAlpha _mAH;};
// SPAWN HOUSE PATROLS
for "_counter" from 1 to _aGrps do {
if (isnil "_aGrp") then {_aGrp=[];};
if (_cache) then {
_cacheGrp=format ["HP%1",_counter];
_units=_eosActivated getvariable _cacheGrp;
_aSize=[_units,_units];
_aMin=_aSize select 0;
if (_debug)then{player sidechat format ["ID:%1,restore - %2",_cacheGrp,_units];};
};
if (_aMin > 0) then {
_aGroup=[_mPos,_aSize,_faction,_side] call EOS_fnc_spawngroup;
if (!surfaceiswater _mPos) then {
0=[_mPos,units _aGroup,_mkrX,0,[0,20],true,true] call shk_fnc_fillhouse;
}else{
0 = [_aGroup,_mkr] call EOS_fnc_taskpatrol;
};
_aGrp set [count _aGrp,_aGroup];
0=[_aGroup,"INFskill"] call eos_fnc_grouphandlers;
if (_debug) then {PLAYER SIDECHAT (format ["Spawned House Patrol: %1",_counter]);0= [_mkr,_counter,"House Patrol",getpos (leader _aGroup)] call EOS_debug};
};
};
// SPAWN PATROLS
for "_counter" from 1 to _bGrps do {
if (isnil "_bGrp") then {_bGrp=[];};
if (_cache) then {
_cacheGrp=format ["PA%1",_counter];
_units=_eosActivated getvariable _cacheGrp;
_bSize=[_units,_units];
_bMin=_bSize select 0;
if (_debug)then{player sidechat format ["ID:%1,restore - %2",_cacheGrp,_units];};
};
if (_bMin > 0) then {
_pos = [_mkr,true] call SHK_pos;
_bGroup=[_pos,_bSize,_faction,_side] call EOS_fnc_spawngroup;
0 = [_bGroup,_mkr] call EOS_fnc_taskpatrol;
_bGrp set [count _bGrp,_bGroup];
0=[_bGroup,"INFskill"] call eos_fnc_grouphandlers;
if (_debug) then {PLAYER SIDECHAT (format ["Spawned Patrol: %1",_counter]);0= [_mkr,_counter,"patrol",getpos (leader _bGroup)] call EOS_debug};
};
};
//SPAWN LIGHT VEHICLES
for "_counter" from 1 to _cGrps do {
if (isnil "_cGrp") then {_cGrp=[];};
_newpos=[_mkr,50] call EOS_fnc_findSafePos;
if (surfaceiswater _newpos) then {_vehType=8;_cargoType=10;}else{_vehType=7;_cargoType=9;};
_cGroup=[_newpos,_side,_faction,_vehType]call EOS_fnc_spawnvehicle;
if ((_cSize select 0) > 0) then{
0=[(_cGroup select 0),_cSize,(_cGroup select 2),_faction,_cargoType] call eos_fnc_setcargo;
};
0=[(_cGroup select 2),"LIGskill"] call eos_fnc_grouphandlers;
0 = [(_cGroup select 2),_mkr] call EOS_fnc_taskpatrol;
_cGrp set [count _cGrp,_cGroup];
if (_debug) then {player sidechat format ["Light Vehicle:%1 - r%2",_counter,_cGrps];0= [_mkr,_counter,"Light Veh",(getpos leader (_cGroup select 2))] call EOS_debug};
};
//SPAWN ARMOURED VEHICLES
for "_counter" from 1 to _dGrps do {
if (isnil "_dGrp") then {_dGrp=[];};
_newpos=[_mkr,50] call EOS_fnc_findSafePos;
if (surfaceiswater _newpos) then {_vehType=8;}else{_vehType=2;};
_dGroup=[_newpos,_side,_faction,_vehType]call EOS_fnc_spawnvehicle;
0=[(_dGroup select 2),"ARMskill"] call eos_fnc_grouphandlers;
0 = [(_dGroup select 2),_mkr] call EOS_fnc_taskpatrol;
_dGrp set [count _dGrp,_dGroup];
if (_debug) then {player sidechat format ["Armoured:%1 - r%2",_counter,_dGrps];0= [_mkr,_counter,"Armour",(getpos leader (_dGroup select 2))] call EOS_debug};
};
//SPAWN STATIC PLACEMENTS
for "_counter" from 1 to _eGrps do {
if (surfaceiswater _mPos) exitwith {};
if (isnil "_eGrp") then {_eGrp=[];};
_newpos=[_mkr,50] call EOS_fnc_findSafePos;
_eGroup=[_newpos,_side,_faction,5]call EOS_fnc_spawnvehicle;
0=[(_eGroup select 2),"STAskill"] call eos_fnc_grouphandlers;
_eGrp set [count _eGrp,_eGroup];
if (_debug) then {player sidechat format ["Static:%1",_counter];0= [_mkr,_counter,"Static",(getpos leader (_eGroup select 2))] call EOS_debug};
};
//SPAWN CHOPPER
for "_counter" from 1 to _fGrps do {
if (isnil "_fGrp") then {_fGrp=[];};
if ((_fSize select 0) > 0) then {_vehType=4}else{_vehType=3};
_newpos = [(markerpos _mkr), 1500, random 360] call BIS_fnc_relPos;
_fGroup=[_newpos,_side,_faction,_vehType,"fly"]call EOS_fnc_spawnvehicle;
_fGrp set [count _fGrp,_fGroup];
if ((_fSize select 0) > 0) then {
_cargoGrp = createGroup _side;
0=[(_fGroup select 0),_fSize,_cargoGrp,_faction,9] call eos_fnc_setcargo;
0=[_cargoGrp,"INFskill"] call eos_fnc_grouphandlers;
_fGroup set [count _fGroup,_cargoGrp];
null = [_mkr,_fGroup,_counter] execvm "eos\functions\TransportUnload_fnc.sqf";
}else{
_wp1 = (_fGroup select 2) addWaypoint [(markerpos _mkr), 0];
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointType "SAD";};
0=[(_fGroup select 2),"AIRskill"] call eos_fnc_grouphandlers;
if (_debug) then {player sidechat format ["Chopper:%1",_counter];0= [_mkr,_counter,"Chopper",(getpos leader (_fGroup select 2))] call EOS_debug};
};
//SPAWN ALT TRIGGERS
_clear = createTrigger ["EmptyDetector",_mPos];
_clear setTriggerArea [_mkrX,_mkrY,_mkrAgl,FALSE];
_clear setTriggerActivation [_enemyFaction,"NOT PRESENT",true];
_clear setTriggerStatements ["this","",""];
_taken = createTrigger ["EmptyDetector",_mPos];
_taken setTriggerArea [_mkrX,_mkrY,_mkrAgl,FALSE];
_taken setTriggerActivation ["ANY","PRESENT",true];
_taken setTriggerStatements ["{vehicle _x in thisList && isplayer _x && ((getPosATL _x) select 2) < 5} count allUnits > 0","",""];
_eosAct=true;
while {_eosAct} do
{
// IF PLAYER LEAVES THE AREA OR ZONE DEACTIVATED
if (!triggeractivated _eosActivated || getmarkercolor _mkr == "colorblack") exitwith
{
if (_debug) then {if (!(getmarkercolor _mkr == "colorblack")) then {hint "Restarting Zone AND deleting units";}else{hint "EOS zone deactivated";};};
//CACHE LIGHT VEHICLES
if (!isnil "_cGrp") then
{
{ _vehicle = _x select 0;_crew = _x select 1;_grp = _x select 2;
if (!alive _vehicle || {!alive _x} foreach _crew) then { _cGrps= _cGrps - 1;};
{deleteVehicle _x} forEach (_crew);
if (!(vehicle player == _vehicle)) then {{deleteVehicle _x} forEach[_vehicle];};
{deleteVehicle _x} foreach units _grp;deleteGroup _grp;
}foreach _cGrp;
if (_debug) then {player sidechat format ["ID:c%1",_cGrps];};};
// CACHE ARMOURED VEHICLES
if (!isnil "_dGrp") then
{
{ _vehicle = _x select 0;_crew = _x select 1;_grp = _x select 2;
if (!alive _vehicle || {!alive _x} foreach _crew) then {_dGrps= _dGrps - 1;};
{deleteVehicle _x} forEach (_crew);
if (!(vehicle player == _vehicle)) then {{deleteVehicle _x} forEach[_vehicle];};
{deleteVehicle _x} foreach units _grp;deleteGroup _grp;
}foreach _dGrp;
if (_debug) then {player sidechat format ["ID:c%1",_dGrps];};};
// CACHE PATROL INFANTRY
if (!isnil "_bGrp") then
{ _n=0;
{ _n=_n+1;_units={alive _x} count units _x;_cacheGrp=format ["PA%1",_n];
if (_debug) then{player sidechat format ["ID:%1,cache - %2",_cacheGrp,_units];};
_eosActivated setvariable [_cacheGrp,_units];
{deleteVehicle _x} foreach units _x;deleteGroup _x;
}foreach _bGrp;
};
// CACHE HOUSE INFANTRY
if (!isnil "_aGrp") then
{ _n=0;
{ _n=_n+1;_units={alive _x} count units _x;_cacheGrp=format ["HP%1",_n];
if (_debug) then{player sidechat format ["ID:%1,cache - %2",_cacheGrp,_units];};
_eosActivated setvariable [_cacheGrp,_units];
{deleteVehicle _x} foreach units _x;deleteGroup _x;
}foreach _aGrp;
};
// CACHE MORTARS
if (!isnil "_eGrp") then
{
{ _vehicle = _x select 0;_crew = _x select 1;_grp = _x select 2;
if (!alive _vehicle || {!alive _x} foreach _crew) then {_eGrps= _eGrps - 1;};
{deleteVehicle _x} forEach (_crew);
if (!(vehicle player == _vehicle)) then {{deleteVehicle _x} forEach[_vehicle];};
{deleteVehicle _x} foreach units _grp;deleteGroup _grp;
}foreach _eGrp;};
// CACHE HELICOPTER TRANSPORT
if (!isnil "_fGrp") then
{
{ _vehicle = _x select 0;_crew = _x select 1;_grp = _x select 2; _cargoGrp = _x select 3;
if (!alive _vehicle || {!alive _x} foreach _crew) then {_fGrps= _fGrps - 1;};
{deleteVehicle _x} forEach (_crew);
if (!(vehicle player == _vehicle)) then {{deleteVehicle _x} forEach[_vehicle];};
{deleteVehicle _x} foreach units _grp;deleteGroup _grp;
if (!isnil "_cargoGrp") then {
{deleteVehicle _x} foreach units _cargoGrp;deleteGroup _cargoGrp;};
}foreach _fGrp;};
_eosAct=false;
if (_debug) then {hint "Zone Cached";};
};
if (triggeractivated _clear and triggeractivated _taken and !_civZone)exitwith
{// IF ZONE CAPTURED BEGIN CHECKING FOR ENEMIES
_cGrps=0;_aGrps=0;_bGrps=0;_dGrps=0;_eGrps=0;_fGrps=0;
while {triggeractivated _eosActivated AND !(getmarkercolor _mkr == "colorblack")} do
{
if (!triggeractivated _clear) then
{
_mkr setmarkercolor hostileColor;
_mkr setmarkerAlpha _mAH;
if (_debug) then {hint "Zone Lost";};
}else{
_mkr setmarkercolor VictoryColor;
_mkr setmarkerAlpha _mAN;
if (_debug) then {hint "Zone Captured";};
};
sleep 1;};
// PLAYER LEFT ZONE
_eosAct=false;
};sleep 0.5;};
deletevehicle _clear;deletevehicle _taken;
if (!(getmarkercolor _mkr == "colorblack")) then {
null = [_mkr,[_aGrps,_aSize],[_bGrps,_bSize],[_cGrps,_cSize],[_dGrps,_eGrps,_fGrps,_fSize],_settings,true] execVM "eos\core\eos_core.sqf";
}else{_Mkr setmarkeralpha 0;};
};if (isServer) then {
private ["_HPpatrols","_HPgroupProbability","_CHgroupArray","_LVgroupArray","_HPgroupArray","_PAgroupArray","_CHgroupSize","_CHGroups","_SVehGroups","_AVgroupSize","_AVehGroups","_LVehGroups","_LVgroupSize","_PAgroupSize","_PApatrols","_HPpatrols","_HPgroupSize"];
_JIPmkr=(_this select 0);
_HouseInfantry=(_this select 1);
_HPpatrols=_HouseInfantry select 0;
_HPgroupSize=_HouseInfantry select 1;
_HPgroupProbability=if (count _HouseInfantry > 2) then {_HouseInfantry select 2} else {100};
_infantry=(_this select 2);
_PApatrols=_infantry select 0;
_PAgroupSize=_infantry select 1;
_PAgroupProbability=if (count _infantry > 2) then {_infantry select 2} else {100};
_LVeh=(_this select 3);
_LVehGroups=_LVeh select 0;
_LVgroupSize=_LVeh select 1;
_LVgroupProbability=if (count _LVeh > 2) then {_LVeh select 2} else {100};
_AVgrp=(_this select 4);
_AVehGroups=_AVgrp select 0;
_AVgroupProbability=if (count _AVgrp > 1) then {_AVgrp select 1} else {100};
_SVgrp=(_this select 5);
_SVehGroups=_SVgrp select 0;
_SVgroupProbability=if (count _SVgrp > 1) then {_SVgrp select 1} else {100};
_CHGrp=(_this select 6);
_CHGroups=_CHGrp select 0;
_CHgroupSize=_CHGrp select 1;
_CHgroupProbability=if (count _CHGrp > 2) then {_CHGrp select 2} else {100};
_settings=(_this select 7);
if (_HPgroupProbability > floor random 100) then {
if (_HPgroupSize==0) then {_HPgroupArray=[1,1]};
if (_HPgroupSize==1) then {_HPgroupArray=[2,4]};
if (_HPgroupSize==2) then {_HPgroupArray=[4,8]};
if (_HPgroupSize==3) then {_HPgroupArray=[8,12]};
if (_HPgroupSize==4) then {_HPgroupArray=[12,16]};
if (_HPgroupSize==5) then {_HPgroupArray=[16,20]};
}else{_HPpatrols=0;_HPgroupArray=[1,1];};
if (_PAgroupProbability > floor random 100) then {
if (_PAgroupSize==0) then {_PAgroupArray=[1,1]};
if (_PAgroupSize==1) then {_PAgroupArray=[2,4]};
if (_PAgroupSize==2) then {_PAgroupArray=[4,8]};
if (_PAgroupSize==3) then {_PAgroupArray=[8,12]};
if (_PAgroupSize==4) then {_PAgroupArray=[12,16]};
if (_PAgroupSize==5) then {_PAgroupArray=[16,20]};
}else{_PApatrols=0;_PAgroupArray=[1,1];};
if (_LVgroupProbability > floor random 100) then {
if (_LVgroupSize==0) then {_LVgroupArray=[0,0]};
if (_LVgroupSize==1) then {_LVgroupArray=[2,4]};
if (_LVgroupSize==2) then {_LVgroupArray=[4,8]};
if (_LVgroupSize==3) then {_LVgroupArray=[8,12]};
if (_LVgroupSize==4) then {_LVgroupArray=[12,16]};
if (_LVgroupSize==5) then {_LVgroupArray=[16,20]};
}else{_LVehGroups=0;_LVgroupArray=[0,0];};
if (_AVgroupProbability > floor random 100) then {
}else{_AVehGroups=0;};
if (_SVgroupProbability > floor random 100) then {
}else{_SVehGroups=0;};
if (_CHgroupProbability > floor random 100) then {
if (_CHgroupSize==0) then {_CHgroupArray=[0,0]};
if (_CHgroupSize==1) then {_CHgroupArray=[2,4]};
if (_CHgroupSize==2) then {_CHgroupArray=[4,8]};
if (_CHgroupSize==3) then {_CHgroupArray=[8,12]};
if (_CHgroupSize==4) then {_CHgroupArray=[12,16]};
if (_CHgroupSize==5) then {_CHgroupArray=[16,20]};
}else{_CHGroups=0;_CHgroupArray=[0,0]};
{
_eosMarkers=server getvariable "EOSmarkers";
if (isnil "_eosMarkers") then {_eosMarkers=[];};
_eosMarkers set [count _eosMarkers,_x];
server setvariable ["EOSmarkers",_eosMarkers,true];
null = [_x,[_HPpatrols,_HPgroupArray],[_PApatrols,_PAgroupArray],[_LVehGroups,_LVgroupArray],[_AVehGroups,_SVehGroups,_CHGroups,_CHgroupArray],_settings] execVM "eos\core\EOS_Core.sqf";
}foreach _JIPmkr;
};
IF (isnil "server")then{hint "YOU MUST PLACE A GAME LOGIC NAMED SERVER!";};
eos_fnc_spawnvehicle=compile preprocessfilelinenumbers "eos\functions\eos_SpawnVehicle.sqf";
eos_fnc_grouphandlers=compile preprocessfilelinenumbers "eos\functions\setSkill.sqf";
eos_fnc_findsafepos=compile preprocessfilelinenumbers "eos\functions\findSafePos.sqf";
eos_fnc_spawngroup= compile preprocessfile "eos\functions\infantry_fnc.sqf";
eos_fnc_setcargo = compile preprocessfile "eos\functions\cargo_fnc.sqf";
eos_fnc_taskpatrol= compile preprocessfile "eos\functions\shk_patrol.sqf";
SHK_pos= compile preprocessfile "eos\functions\shk_pos.sqf";
shk_fnc_fillhouse = compile preprocessFileLineNumbers "eos\Functions\SHK_buildingpos.sqf";
eos_fnc_getunitpool= compile preprocessfilelinenumbers "eos\UnitPools.sqf";
call compile preprocessfilelinenumbers "eos\AI_Skill.sqf";
EOS_Deactivate = {
private ["_mkr"];
_mkr=(_this select 0);
{
_x setmarkercolor "colorblack";
_x setmarkerAlpha 0;
}foreach _mkr;
};
EOS_debug = {
private ["_note"];
_mkr=(_this select 0);
_n=(_this select 1);
_note=(_this select 2);
_pos=(_this select 3);
_mkrID=format ["%3:%1,%2",_mkr,_n,_note];
deletemarker _mkrID;
_debugMkr = createMarker[_mkrID,_pos];
_mkrID setMarkerType "Mil_dot";
_mkrID setMarkercolor "colorBlue";
_mkrID setMarkerText _mkrID;
_mkrID setMarkerAlpha 0.5;
};if (!isServer) exitWith {};
private ["_cargoPool","_emptySeats","_vehicle","_debug","_grp","_grpSize"];
_vehicle=(_this select 0);
_grpSize=(_this select 1);
_grp=(_this select 2);
_faction=(_this select 3);
_cargoType=(_this select 4);
_debug=false;
_cargoPool=[_faction,_cargoType] call eos_fnc_getunitpool;
_side=side (leader _grp);
// FILL EMPTY SEATS
_emptySeats=_vehicle emptyPositions "cargo";
if (_debug) then {hint format ["%1",_emptySeats];};
//GET MIN MAX GROUP
_grpMin=_grpSize select 0;
_grpMax=_grpSize select 1;
_d=_grpMax-_grpMin;
_r=floor(random _d);
_grpSize=_r+_grpMin;
// IF VEHICLE HAS SEATS
if (_emptySeats > 0) then {
// LIMIT SEATS TO FILL TO GROUP SIZE
if (_grpSize > _emptySeats) then {_grpSize = _emptySeats};
if (_debug) then {hint format ["Seats Filled : %1",_grpSize];};
for "_x" from 1 to _grpSize do {
_unit=_cargoPool select (floor(random(count _cargoPool)));
_unit=_unit createUnit [GETPOS _vehicle, _grp];
};
{_x moveincargo _vehicle}foreach units _grp;
};
private ["_eosKills"];
_eosKills=server getvariable "EOSkillCounter";
if (isnil "_eosKills") then {_eosKills=0;}else{
_eosKills=server getvariable "EOSkillCounter";
};
_eosKills=_eosKills + 1;
server setvariable ["EOSkillCounter",_eosKills,true];
hint format ["Units Killed: %1",_eosKills];_eosMarkers=server getvariable "EOSmarkers";
{_x setMarkerAlpha (MarkerAlpha _x);
_x setMarkercolor (getMarkercolor _x);
}foreach _eosMarkers;
_position=(_this select 0);
_side=(_this select 1);
_faction=(_this select 2);
_type=(_this select 3);
_special = if (count _this > 4) then {_this select 4} else {"CAN_COLLIDE"};
_vehicleType=[_faction,_type] call eos_fnc_getunitpool;
_grp = createGroup _side;
_vehPositions=[(_vehicleType select 0)] call BIS_fnc_vehicleRoles;
_vehicle = createVehicle [(_vehicleType select 0), _position, [], 0, _special];
_vehCrew=[];
{
_currentPosition=_x;
if (_currentPosition select 0 == "driver")then {
_unit = _grp createUnit [(_vehicleType select 1), _position, [], 0, "CAN_COLLIDE"];
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
_vehCrew set [count _vehCrew,_unit];
};
if (_currentPosition select 0 == "turret")then {
_unit = _grp createUnit [(_vehicleType select 1), _position, [], 0, "CAN_COLLIDE"];
_unit assignAsGunner _vehicle;
_unit MoveInTurret [_vehicle,_currentPosition select 1];
_vehCrew set [count _vehCrew,_unit];
};
}foreach _vehPositions;
_return=[_vehicle,_vehCrew,_grp];
_return_mrk=(_this select 0);
_radveh =(_this select 1);
_pos = [_mkr,true] call SHK_pos;
for "_counter" from 0 to 20 do {
_newpos = [_pos,0,_radveh,5,1,20,0] call BIS_fnc_findSafePos;
if ((_pos distance _newpos) < (_radveh + 5))
exitWith {
_pos = _newpos;
};
};
_newposif (!isServer) exitWith {};
// SINGLE INFANTRY GROUP
private ["_grp","_unit","_pool","_pos","_faction"];
_pos=(_this select 0);
_grpSize=(_this select 1);
_faction=(_this select 2);
_side=(_this select 3);
_grpMin=_grpSize select 0;
_grpMax=_grpSize select 1;
_d=_grpMax-_grpMin;
_r=floor(random _d);
_grpSize=_r+_grpMin;
if (surfaceiswater _pos) then {_pool=[_faction,1] call eos_fnc_getunitpool;}else{_pool=[_faction,0] call eos_fnc_getunitpool;};
_grp=createGroup _side;
for "_x" from 1 to _grpSize do {
_unitType=_pool select (floor(random(count _pool)));
_unit = _grp createUnit [_unitType, _pos, [], 6, "FORM"];
};
_grp_grp=(_this select 0);
_skillArray=(_this select 1);
_skillset = server getvariable _skillArray;
{
_unit = _x;
{
_skillvalue = (_skillset select _forEachIndex) + (random 0.2) - (random 0.2);
_unit setSkill [_x,_skillvalue];
} forEach ['aimingAccuracy','aimingShake','aimingSpeed','spotDistance','spotTime','courage','reloadSpeed','commanding','general'];
if (EOS_DAMAGE_MULTIPLIER != 1) then {_unit removeAllEventHandlers "HandleDamage";_unit addEventHandler ["HandleDamage",{_damage = (_this select 2)*EOS_DAMAGE_MULTIPLIER;_damage}];};
if (EOS_KILLCOUNTER) then {_unit addEventHandler ["killed", "null=[] execVM ""eos\functions\EOS_KillCounter.sqf"""]};
// ADD CUSTOM SCRIPTS TO UNIT HERE
} forEach (units _grp); /*
SHK_buildingpos.sqf
Shuko of LDD Kyllikki (kyllikki.fi)
IRC: shuko @ quakenet
Version: 0.12
Syntax:
nul = [position,unitList,radius,priority,height,disableMove,stance,hide] execvm "shk_buildingpos.sqf"
Required Parameters:
Origo Position Position from where building positions are searched for.
Units Array Units to be moved.
Optional Parameters:
Radius Integer Range from the origo to look for building positions. Default is 20.
Priority Integer Building position priority.
0: Random, default value.
1: Ground floor has highest prio, roof positions are last to be filled.
2: Roof has top prio, ground level lowest.
Height Array Filter for positions.
[min,max] Minimum and maximum height from ground for valid positions.
DisableMove Boolean Issues disableai "move" to all units.
Stance Boolean Issues setunitpos "up" to all units.
Hide Array Hiding does not prevent the units from detecting and engaging enemies.
It's only meant to be used for preventing the units being detected from far away.
Portition Amount of units to be hidden. Valid values between 0 and 1;
Condition Condition to reveal the hidden units.
Examples:
nul = [getpos hq,[man1,man2,man3]] execvm "shk_buildingpos.sqf"
nul = [getpos house,[sniper1,sniper2],20,2] execvm "shk_buildingpos.sqf"
nul = [getpos house,units grpAlpha,30,0,[1,4]] execvm "shk_buildingpos.sqf"
nul = [getpos house,bmen1,20,0,[],true,true,[0.5,"SHK_revealHouseUnits"]] execvm "shk_buildingpos.sqf"
Todo:
Patrol (switch positions)
Change prio (for example lower level units moves to roof)
Position
object: take pos and dir
array: [[x,y,z],dir]
Multiple unit groups per script. [[parameters],[parameters2],[parameters]]
Goal is to get all units into one _men array.
*/
private "_men";
if isserver then {
private "_sortArray";
_sortArray = {
private "_sort";
_sort = {
private ["_h","_i","_j","_a","_lo","_hi","_x","_id"];
_a = _this select 0; //array to be sorted
_id = _this select 1; //array item index to be compared
_lo = _this select 2; //lower index to sort from
_hi = _this select 3; //upper index to sort to
_h = nil; //used to make a do-while loop below
_i = _lo;
_j = _hi;
if (count _a == 0) exitWith {};
_x = (_a select ((_lo+_hi)/2)) select _id;
while {isnil "_h" || _i <= _j} do {
while {(_a select _i) select _id < _x} do {_i=_i+1};
while {(_a select _j) select _id > _x} do {_j=_j-1};
if (_i<=_j) then {
_h = _a select _i;
_a set [_i, _a select _j];
_a set [_j, _h];
_i=_i+1;
_j=_j-1;
};
};
if (_lo<_j) then {[_a, _id, _lo, _j] call _sort};
if (_i<_hi) then {[_a, _id, _i, _hi] call _sort};
};
[_this select 0, _this select 1, 0, 0 max ((count (_this select 0))-1)] call _sort;
_this select 0
};
private ["_opos","_rad","_bpos"];
_opos = _this select 0;
if (typename _opos == typename objNull) then {_opos = getpos _opos};
_men = _this select 1;
_rad = if (count _this > 2) then { _this select 2 } else { 20 };
_bpos = [];
{
private ["_i","_p"];
for [{_i = 0;_p = _x buildingpos _i},{str _p != "[0,0,0]"},{_i = _i + 1;_p = _x buildingpos _i}] do {
_bpos set [count _bpos,_p];
};
} foreach (nearestObjects [_opos, ["Building"], _rad]);
// Priority
private "_prio";
if (count _this > 3) then {
_prio = _this select 3;
_bpos = [_bpos,2] call _sortArray;
} else {
_prio = 0;
};
// Height
if (count _this > 4) then {
if (count (_this select 4) > 0) then {
private ["_tmp","_min","_max","_h"];
_tmp = [];
_min = (_this select 4) select 0;
_max = (_this select 4) select 1;
{
_h = _x select 2;
if (_h >= _min && _h <= _max) then { _tmp set [count _tmp,_x] };
} foreach _bpos;
_bpos = _tmp;
};
};
// DisableMove
private "_disableMove";
_disableMove = if (count _this > 5) then { _this select 5 } else { false };
// Stance
private "_stance";
_stance = if (count _this > 6) then { _this select 6 } else { false };
private ["_taken","_ind","_pos","_dir"];
_taken = [];
{
while {count _taken < count _bpos} do {
switch _prio do {
case 0: { _ind = floor(random count _bpos) }; // random
case 1: { _ind = count _taken }; // ground floor first
case 2: { _ind = count _bpos - count _taken - 1 }; // roof first
};
if !(_ind in _taken) exitwith {
_taken set [count _taken,_ind];
_pos = _bpos select _ind;
_dir = ((_pos select 0) - (_opos select 0)) atan2 ((_pos select 1) - (_opos select 1));
if (_dir < 0) then {_dir = _dir + 360};
_x setpos _pos;
_x setformdir _dir;
if _disableMove then { doStop _x; };
if _stance then { _x setunitpos "UP" };
};
};
} foreach _men;
}; //isserver
// Hide
if (count _this > 7) then {
if (isnil "SHK_BuildingPos_init") then {
SHK_BuildingPos_fnc = {
private ["_act","_arr"];
_act = _this select 0;
_arr = _this select 1;
{ _x hideobject _act } foreach _arr;
};
"SHK_BuildingPos_EH" addpublicvariableeventhandler {
private ["_act","_arr"];
_arr = _this select 1;
_act = _arr select 0;
_arr = _arr select 1;
[_act,_arr] call SHK_BuildingPos_fnc;
};
SHK_BuildingPos_init = true;
};
if isserver then {
private ["_hide","_portition","_condition","_hidden","_u","_i"];
_hide = _this select 7;
_portition = _hide select 0;
_portition = round (_portition * (count _men));
_condition = _hide select 1;
_hidden = [];
for "_i" from 0 to (_portition - 1) do {
_u = _men select _i;
_hidden set [count _hidden, _u];
};
SHK_BuildingPos_EH = [true,_hidden];
publicvariable "SHK_BuildingPos_EH";
if !isdedicated then { [true,_hidden] call SHK_BuildingPos_fnc };
waituntil {(call compile _condition)};
SHK_BuildingPos_EH = [false,_hidden];
publicvariable "SHK_BuildingPos_EH";
if !isdedicated then { [false,_hidden] call SHK_BuildingPos_fnc };
};
};
/*
SHK_patrol
Based on BIN_taskPatrol by Binesi
Version 0.22
Author: Shuko (shuko@quakenet, miika@miikajarvinen.fi)
http://forums.bistudio.com/showthread.php?163496-SHK_Patrol
Modified for EOS by Bangabob
Requires SHK_POS.sqf
Required Parameters:
0 Object or Group The patrolling unit
1 Marker Name
*/
DEBUG = false;
if !isserver exitwith {};
// Handle parameters
private ["_grp","_dst","_marker"];
_dst = 250;
switch (typename _this) do {
case (typename grpNull): { _grp = _this };
case (typename objNull): { _grp = group _this };
case (typename []): {
_grp = _this select 0;
if (typename _grp == typename objNull) then {_grp = group _grp};
if (count _this > 1) then {_marker = _this select 1};
};
};
_grp setBehaviour "SAFE";
_grp setSpeedMode "LIMITED";
_grp setCombatMode "YELLOW";
_grp setFormation (["STAG COLUMN", "WEDGE", "ECH LEFT", "ECH RIGHT", "VEE", "DIAMOND"] call BIS_fnc_selectRandom);
private ["_cnt","_wps","_slack"];
_cnt = 4 + (floor random 3) + (floor (_dst / 100)); // number of waypoints
_wps = [];
_slack = _dst / 5.5;
if (_slack < 20) then {_slack = 20};
// Find positions for waypoints
private ["_a","_p"];
while {count _wps < _cnt} do {
if (surfaceiswater (getpos(leader _grp)) ) then {
_p = [_mkr,true] call SHK_pos;}else{_p = [_mkr,true] call SHK_pos;
};
_wps set [count _wps, _p];
};
// Create waypoints
private ["_cur","_wp"];
for "_i" from 1 to (_cnt - 1) do {
_cur = (_wps select _i);
_wp = _grp addWaypoint [_cur, 0];
_wp setWaypointType "MOVE";
_wp setWaypointCompletionRadius (5 + _slack);
[_grp,_i] setWaypointTimeout [0,2,16];
// When completing waypoint have 33% chance to choose a random next wp
[_grp,_i] setWaypointStatements ["true", "if ((random 3) > 2) then { group this setCurrentWaypoint [(group this), (floor (random (count (waypoints (group this)))))];};"];
if (DEBUG) then {
private "_m";
_m = createMarker [format["SHK_patrol_WP%1%2",(floor(_cur select 0)),(floor(_cur select 1))],_cur];
_m setMarkerShape "Ellipse";
_m setMarkerSize [20,20];
_m setmarkerColor "ColorRed";
};
};
// Cycle in case we reach the end
private "_wp1";
_wp1 = _grp addWaypoint [(_wps select 1), 0];
_wp1 setWaypointType "CYCLE";
_wp1 setWaypointCompletionRadius 50;
if (DEBUG) then {
while {sleep 5; {alive _x} count (units _grp) > 0} do {
private ["_m","_p"];
_p = getpos leader _grp;
_m = createMarker [format["SHK_patrol_%1%2%3",(floor(_p select 0)),(floor(_p select 1)),floor time],_p];
_m setMarkerShape "Icon";
_m setMarkerType "mil_dot";
_m setmarkerColor "ColorBlue";
};
};/*
SHK_pos - Random position generator for Arma 2
Author: Shuko (IRC: shuko@quakenet, Email: miika@miikajarvinen.fi)
Version: 0.1
Parameters for marker area based position:
Area String Marker to define area from which the position is taken.
Water Boolean Allow position on water? Optional, default is false.
Usage examples:
myPos = ["markerName"] execvm "SHK_pos.sqf";
myPos = ["myMarker1",true] execvm "SHK_pos.sqf";
Parameters for relative position:
Point of Origin Position array The position from which direction and distance is calculated from.
Direction Number Compass direction (0-359) from Point of Origin.
Array Array can be used to give minimum and maximum directions.
Distance Number Distance in meters from Point of Origin.
Array Array can be used to give minimum and maximum distance.
Water Boolean Allow position on water? Optional, default is false.
Water solution Integer Water positions not allowed, what to do?
0: Do nothing, do not return any position. An empty array is returned.
1: Find closest land. Search is done with increasing radius until land is found, thus the resulting
position might not be exactly in the given direction and distance.
2: Decrease distance until land is found. Direction is kept the same.
3: Increase distance until land is found. Direction is kept the same.
4: Decrease direction (counter clock-wise) until land is found. Distance is kept the same.
5: Increase direction (clock-wise) until land is found. Distance is kept the same.
If no integer is given, solution 1 is used by default.
Usage examples:
myPos = [getpos player,random 360,200,true] execvm "SHK_pos.sqf";
myPos = [getmarkerpos "myMarker",125,random 500] execvm "SHK_pos.sqf";
myPos = [getpos player,random 360,[200,500],false,2] execvm "SHK_pos.sqf";
Example of creating multiple positions:
SHK_pos = compile preprocessfile "SHK_pos.sqf";
for "_i" from 0 to 500 do {
_p = [getpos player,random 360,random 1000] call SHK_pos;
if (count _p > 0) then {
call compile format ["
_m%1 = createMarker[""mySpot%1"",[_p select 0,_p select 1]];
_m%1 setMarkerShape ""ICON"";
_m%1 setMarkerType ""DOT"";
_m%1 setmarkercolor ""colorred"";
",_i];
};
};
*/
private "_getpos";
_getpos = {
private ["_origo","_dir","_dist"];
_origo = _this select 0;
_dir = _this select 1;
_dist = _this select 2;
if (typename _dir == typename []) then {
if ((_dir select 0) > (_dir select 1)) then { _dir set [1,((_dir select 1) + 360)] };
_dir = ((_dir select 0) + random((_dir select 1)-(_dir select 0)))
};
if (typename _dist == typename []) then {
_dist = ((_dist select 0) + random((_dist select 1)-(_dist select 0)));
};
[((_origo select 0) + (_dist * sin _dir)),((_origo select 1) + (_dist * cos _dir)),0];
};
private "_water";
if (typename (_this select 0) == typename "") then {
private ["_pos","_area","_cp","_cx","_cy","_as","_rx","_ry","_ad","_cd","_sd","_xo","_yo","_loop"];
_area = _this select 0;
if (count _this > 1) then {_water = _this select 1} else {_water = false};
_cp = getMarkerPos _area;
_cx = abs(_cp select 0);
_cy = abs(_cp select 1);
_as = getMarkerSize _area;
_rx = _as select 0;
_ry = _as select 1;
_ad = (markerDir _area) * -1;
_cd = cos _ad;
_sd = sin _ad;
_loop = true;
while {_loop} do {
_tx = (random (_rx*2))-_rx;
_ty = (random (_ry*2))-_ry;
_xo = if (_ad!=0) then {_cx+ (_cd*_tx - _sd*_ty)} else {_cx+_tx};
_yo = if (_ad!=0) then {_cy+ (_sd*_tx + _cd*_ty)} else {_cy+_ty};
_pos = [_xo,_yo,0];
if (_water) then {
_loop = false;
} else {
if (!surfaceIsWater [_pos select 0,_pos select 1]) then {_loop = false};
};
};
_pos
} else {
private ["_origo","_dir","_dist","_pos","_loop","_watersolution"];
_origo = _this select 0;
_dir = _this select 1;
_dist = _this select 2;
if (count _this > 3) then {_water = _this select 3} else {_water = false};
if (count _this > 4) then {_watersolution = _this select 4} else {_watersolution = 1};
_pos = [_origo,_dir,_dist] call _getpos;
if (!_water) then {
private ["_d","_l","_p"];
_l = true;
switch _watersolution do {
case 0: {
if (surfaceIsWater [_pos select 0,_pos select 1]) then {
_pos = +[];
};
};
case 1: {
_d = 10; _l = true;
while {_l} do {
for "_i" from 0 to 350 do {
_p = [_pos,_i,_d] call _getpos;
if (!surfaceIsWater [_p select 0,_p select 1]) exitwith {_l = false};
};
_d = _d + 10;
};
_pos = _p;
};
case 2: {
_d = _pos distance _origo;
while {_d = _d - 10; _l} do {
_pos = [_pos,_dir,_d] call _getpos;
if (!surfaceIsWater [_pos select 0,_pos select 1]) then {_l = false};
if (_d < 10) then {_l = false; _pos = + []};
};
};
case 3: {
_d = _pos distance _origo;
while {_d = _d + 10; _l} do {
_pos = [_pos,_dir,_d] call _getpos;
if (!surfaceIsWater [_pos select 0,_pos select 1]) then {_l = false};
if (_d > 10000) then {_l = false; _pos = + []};
};
};
case 4: {
if (typename _dir == typename []) then {
_d = _dir select 0;
_dir = _dir select 0;
} else {
_d = _dir;
};
while {_l} do {
_p = [_pos,_d,_dist] call _getpos;
if (!surfaceIsWater [_p select 0,_p select 1]) exitwith {_l = false};
if (_d < (_dir - 360)) then {_l = false};
_d = _d - 10;
};
_pos = _p;
};
case 5: {
if (typename _dir == typename []) then {
_d = _dir select 1;
_dir = _dir select 1;
} else {
_d = _dir;
};
while {_l} do {
_p = [_pos,_d,_dist] call _getpos;
if (!surfaceIsWater [_p select 0,_p select 1]) exitwith {_l = false};
if (_d > (_dir + 360)) then {_l = false};
_d = _d + 10;
};
_pos = _p;
};
};
};
_pos
};private ["_pad","_getToMarker","_cargoGrp","_vehicle"];
_mkr=(_this select 0);
_veh=(_this select 1);
_counter=(_this select 2);
_debug=false;
_vehicle = _veh select 0;
_grp = _veh select 2;
_cargoGrp= _veh select 3;
_pos = [_mkr,false] call SHK_pos;
_pad = createVehicle ["Land_HelipadEmpty_F", _pos, [], 0, "NONE"];
if (_debug) then {0= [_mkr,_counter,"Unload Pad",(getpos _pad)] call EOS_debug;};
{_x allowFleeing 0} forEach units _grp;
{_x allowFleeing 0} forEach units _cargoGrp;
_wp1 = _grp addWaypoint [_pos, 0];
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointType "UNLOAD";
_wp1 setWaypointStatements ["true", "(vehicle this) LAND 'GET IN';"];
waituntil {_vehicle distance _pad < 30};
_cargoGrp leaveVehicle _vehicle;
waitUntil{sleep 0.2; {_x in _vehicle} count units _cargoGrp == 0};
if (_debug) then {hint "Transport unloaded";};
0 = [_cargoGrp,_mkr] call eos_fnc_taskpatrol;
_wp2 = _grp addWaypoint [[0,0,0], 0];
_wp2 setWaypointSpeed "FULL";
_wp2 setWaypointType "MOVE";
_wp2 setWaypointStatements ["true", "{deleteVehicle _x} forEach crew (vehicle this) + [vehicle this];"];
deletevehicle _pad;EOS_Spawn = compile preprocessfilelinenumbers "eos\core\eos_launch.sqf";Bastion_Spawn=compile preprocessfilelinenumbers "eos\core\b_launch.sqf";null=[] execVM "eos\core\spawn_fnc.sqf";onplayerConnected {[] execVM "eos\Functions\EOS_Markers.sqf";};
/* EOS 1.98 by BangaBob
GROUP SIZES
0 = 1
1 = 2,4
2 = 4,8
3 = 8,12
4 = 12,16
5 = 16,20
EXAMPLE CALL - EOS
null = [["MARKERNAME","MARKERNAME2"],[2,1,70],[0,1],[1,2,30],[2,60],[2],[1,0,10],[1,0,250,WEST]] call EOS_Spawn;
null=[["M1","M2","M3"],[HOUSE GROUPS,SIZE OF GROUPS,PROBABILITY],[PATROL GROUPS,SIZE OF GROUPS,PROBABILITY],[LIGHT VEHICLES,SIZE OF CARGO,PROBABILITY],[ARMOURED VEHICLES,PROBABILITY], [STATIC VEHICLES,PROBABILITY],[HELICOPTERS,SIZE OF HELICOPTER CARGO,PROBABILITY],[FACTION,MARKERTYPE,DISTANCE,SIDE,HEIGHTLIMIT,DEBUG]] call EOS_Spawn;
EXAMPLE CALL - BASTION
null = [["BAS_zone_1"],[3,1],[2,1],[2],[0,0],[0,0,EAST,false,false],[10,2,120,TRUE,TRUE]] call Bastion_Spawn;
null=[["M1","M2","M3"],[PATROL GROUPS,SIZE OF GROUPS],[LIGHT VEHICLES,SIZE OF CARGO],[ARMOURED VEHICLES],[HELICOPTERS,SIZE OF HELICOPTER CARGO],[FACTION,MARKERTYPE,SIDE,HEIGHTLIMIT,DEBUG],[INITIAL PAUSE, NUMBER OF WAVES, DELAY BETWEEN WAVES, INTEGRATE EOS, SHOW HINTS]] call Bastion_Spawn;
*/
VictoryColor="colorGreen"; // Colour of marker after completion
hostileColor="colorRed"; // Default colour when enemies active
bastionColor="colorOrange"; // Colour for bastion marker
EOS_DAMAGE_MULTIPLIER=1; // 1 is default
EOS_KILLCOUNTER=false; // Counts killed units
null = [["lowblue1","lowblue2","lowblue3","lowblue4","lowblue5"],[0,0],[4,1],[0,0],[0],[0],[0,0],[1,1,1100,WEST]] call EOS_Spawn;
null = [["lowred1","lowred2","lowred3","lowred4","lowred5"],[0,0],[3,2],[0,0],[0],[0],[0,0],[0,1,1100,EAST]] call EOS_Spawn;
null = [["midblue1","midblue2","midblue3","midblue4","midblue5","midblue6","midblue7","midblue8","midblue9","midblue10"],[0,0],[4,1],[2,2],[0],[0],[0,0],[1,1,1100,WEST]] call EOS_Spawn;
null = [["midred1","midred2","midred3","midred4","midred5","midred6","midred7","midred8","midred9","midred10"],[0,0],[3,2],[1,2],[0],[0],[0,0],[0,1,1100,EAST]] call EOS_Spawn;
null = [["highblue2","highblue3","highblue5","highblue6","highblue7","highblue8","highblue9","highblue10"],[0,0],[4,2],[2,2],[1],[0],[0,0],[1,1,1100,WEST]] call EOS_Spawn;
null = [["highred1","highred3","highred4","highred5","highred6","highred7","highred8","highred9"],[0,0],[3,3],[1,3],[1],[0],[0,0],[0,1,1100,EAST]] call EOS_Spawn;
null = [["highblue4","highblue1"],[0,0],[4,2],[2,2],[1],[0],[1,3],[1,1,1100,WEST]] call EOS_Spawn;
null = [["highred2","highred10"],[0,0],[3,3],[1,3],[1],[0],[1,2],[0,1,1100,EAST]] call EOS_Spawn;
null = [["ultrablue1","ultrablue2","ultrablue3","ultrablue4","ultrablue5","ultrablue6","ultrablue7","ultrablue8","ultrablue9","ultrablue10"],[0,0],[5,4],[3,2],[2],[0],[0,0],[1,1,1100,WEST]] call EOS_Spawn;
null = [["ultrared1","ultrared2","ultrared3","ultrared4","ultrared5","ultrared6","ultrared7","ultrared8","ultrared9","ultrared10"],[0,0],[5,6],[3,3],[2],[0],[0,0],[0,1,1100,EAST]] call EOS_Spawn;
null = [["ultrablue11","ultrablue12","ultrablue13","ultrablue14","ultrablue15"],[0,0],[6,2],[2,2],[1],[0],[2,3],[1,1,1100,WEST]] call EOS_Spawn;
null = [["ultrared11","ultrared12","ultrared13","ultrared14","ultrared15"],[0,0],[6,3],[1,3],[1],[0],[2,2],[0,1,1100,EAST]] call EOS_Spawn;private ["_tempArray","_InfPool","_MotPool","_ACHPool","_CHPool","_uavPool","_stPool","_shipPool","_diverPool","_crewPool","_heliCrew","_ArmPool"];
_faction=(_this select 0);
_type=(_this select 1);
_tempArray=[];
// EAST CSAT FACTION
if (_faction==0) then {
_InfPool= ["O_SoldierU_SL_F","O_soldierU_repair_F","O_soldierU_medic_F","O_sniper_F","O_Soldier_A_F","O_Soldier_AAT_F","O_Soldier_AR_F","O_Soldier_AT_F","O_soldier_exp_F","O_Soldier_F","O_engineer_F","O_engineer_U_F","O_medic_F","O_recon_exp_F","O_recon_F","O_recon_JTAC_F","O_recon_LAT_F","O_recon_M_F","O_recon_medic_F","O_recon_TL_F"];
_ArmPool= ["O_APC_Wheeled_02_rcws_F","O_MBT_02_cannon_F"];
_MotPool= ["O_Truck_02_transport_F","O_MRAP_02_F","O_MRAP_02_gmg_F","O_MRAP_02_hmg_F"];
_ACHPool= ["O_Heli_Attack_02_black_F","O_Heli_Attack_02_F"];
_CHPool= ["O_Heli_Light_02_F","O_Heli_Light_02_unarmed_F"];
_uavPool= ["O_UAV_01_F","O_UAV_02_CAS_F","O_UGV_01_rcws_F"];
_stPool= ["O_Mortar_01_F","O_static_AT_F","O_static_AA_F"];
_shipPool= ["O_Boat_Armed_01_hmg_F","O_Boat_Transport_01_F"];
_diverPool= ["O_diver_exp_F","O_diver_F","O_diver_TL_F"];
_crewPool= ["O_crew_F"];
_heliCrew= ["O_helicrew_F","O_helipilot_F"];
};
// WEST NATO FACTION
if (_faction==1) then {
_InfPool= ["B_sniper_F","B_Soldier_A_F","B_Soldier_AA_F","B_Soldier_AAA_F","B_Soldier_AAR_F","B_Soldier_AAT_F","B_Soldier_AR_F","B_Soldier_AT_F","B_soldier_exp_F","B_Soldier_F","B_engineer_F","B_medic_F","B_recon_exp_F","B_recon_F","B_recon_JTAC_F","B_recon_LAT_F","B_recon_M_F","B_recon_medic_F","B_recon_TL_F"];
_ArmPool= ["B_MBT_01_cannon_F","B_APC_Tracked_01_rcws_F","B_APC_Wheeled_01_cannon_F","B_MBT_02_cannon_F"];
_MotPool= ["B_Truck_01_transport_F","B_MRAP_01_F","B_MRAP_01_gmg_F","B_MRAP_01_hmg_F"];
_ACHPool= ["B_Heli_Attack_01_F","B_Heli_Light_01_armed_F"];
_CHPool= ["B_Heli_Light_01_F","B_Heli_Transport_01_camo_F","B_Heli_Transport_01_F"];
_uavPool= ["B_UAV_01_F","B_UAV_01_CAS_F","B_UGV_01_rcws_F"];
_stPool= ["B_Mortar_01_F","B_static_AT_F","B_static_AA_F"];
_shipPool= ["B_Boat_Armed_01_minigun_F","B_Boat_Transport_01_F"];
_diverPool= ["B_diver_exp_F","B_diver_F","B_diver_TL_F"];
_crewPool= ["B_crew_F"];
_heliCrew= ["B_helicrew_F","B_helipilot_F"];
};
// INDEPENDENT AAF FACTION
if (_faction==2) then {
_InfPool= ["I_engineer_F","I_Soldier_A_F","I_Soldier_AA_F","I_Soldier_AAA_F","I_Soldier_AAR_F","I_Soldier_AAT_F","I_Soldier_AR_F","I_Soldier_AT_F","I_Soldier_exp_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_repair_F"];
_ArmPool= ["I_APC_Wheeled_03_cannon_F"];
_MotPool= ["I_MRAP_03_F","I_MRAP_03_gmg_F","I_MRAP_03_hmg_F","I_Truck_02_medical_F"];
_ACHPool= [];
_CHPool= ["I_Heli_Transport_02_F","B_Heli_Light_02_unarmed_F"];
_uavPool= ["I_UAV_01_F","I_UAV_02_CAS_F","I_UGV_01_rcws_F"];
_stPool= ["I_Mortar_01_F"];
_shipPool= ["I_Boat_Transport_01_F","I_G_Boat_Transport_01_F","I_Boat_Armed_01_minigun_F"];
_diverPool= ["I_diver_exp_F","I_diver_F","I_diver_TL_F"];
_crewPool= ["I_crew_F"];
_heliCrew= ["I_helicrew_F","I_helipilot_F"];
};
// CIVILIAN
if (_faction==3) then {
_InfPool= ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_hunter_1_F","C_man_p_beggar_F","C_man_p_beggar_F_afro","C_man_p_fugitive_F","C_man_p_shorts_1_F","C_man_pilot_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F","C_man_shorts_1_F","C_man_shorts_2_F","C_man_shorts_3_F","C_man_shorts_4_F","C_man_w_worker_F"];
_ArmPool= ["C_Hatchback_01_F","C_Hatchback_01_sport_F","C_Quadbike_01_F","C_SUV_01_F","C_Van_01_transport_F","C_Van_01_box_F"];
_MotPool= ["C_Hatchback_01_F","C_Hatchback_01_sport_F","C_Quadbike_01_F","C_SUV_01_F","C_Van_01_transport_F","C_Van_01_box_F"];
_ACHPool= [];
_CHPool= [];
_uavPool= [];
_stPool= [];
_shipPool= ["C_Boat_Civil_01_F","C_Boat_Civil_01_rescue_F","C_Boat_Civil_04_F","C_Rubberboat"];
_diverPool= [];
_crewPool= ["C_man_1"];
_heliCrew= ["C_man_1","C_man_1"];
};
// WEST FIA FACTION
if (_faction==4) then {
_InfPool= ["B_G_engineer_F","B_G_medic_F","B_G_officer_F","B_G_Soldier_A_F","B_G_Soldier_AR_F","B_G_Soldier_exp_F","B_G_Soldier_F","B_G_Soldier_GL_F","B_G_Soldier_LAT_F","B_G_Soldier_lite_F","B_G_Soldier_M_F","B_G_Soldier_SL_F","B_G_Soldier_TL_F"];
_ArmPool= [];
_MotPool= ["B_G_Offroad_01_F","B_G_Offroad_01_armed_F","B_G_Van_01_transport_F","B_G_Van_01_fuel_F"];
_ACHPool= [];
_CHPool= [];
_uavPool= [];
_stPool= ["B_G_Mortar_01_F"];
_shipPool= ["B_G_Boat_Transport_01_F"];
_diverPool= [];
_crewPool= [];
_heliCrew= [];
};
// ADD CLASSNAMES
if (_faction==5) then {
_InfPool= [];
_ArmPool= [];
_MotPool= [];
_ACHPool= [];
_CHPool= [];
_uavPool= [];
_stPool= [];
_shipPool= [];
_diverPool= [];
_crewPool= [];
_heliCrew= [];
};
// ADD CLASSNAMES
if (_faction==6) then {
_InfPool= [];
_ArmPool= [];
_MotPool= [];
_ACHPool= [];
_CHPool= [];
_uavPool= [];
_stPool= [];
_shipPool= [];
_diverPool= [];
_crewPool= [];
_heliCrew= [];};
// ADD CLASSNAMES
if (_faction==7) then {
_InfPool= [];
_ArmPool= [];
_MotPool= [];
_ACHPool= [];
_CHPool= [];
_uavPool= [];
_stPool= [];
_shipPool= [];
_diverPool= [];
_crewPool= [];
_heliCrew= [];};
////////////////////////////////////////////////////////////////////////////////////////
if (_type==0) then {
for "_i" from 0 to 5 do{
_unit=_InfPool select (floor(random(count _InfPool)));
_tempArray set [count _tempArray,_unit];};
};
if (_type==1) then {_tempArray=_diverPool};
// CREATE ARMOUR & CREW
if (_type==2) then {
_tempUnit=_ArmPool select (floor(random(count _ArmPool)));
_temparray set [count _temparray,_tempUnit];
_crew=_crewPool select (floor(random(count _crewPool)));
_temparray set [count _temparray,_crew];
};
// CREATE ATTACK CHOPPER & CREW
if (_type==3) then {
_tempUnit=_ACHPool select (floor(random(count _ACHPool)));
_temparray set [count _temparray,_tempUnit];
_crew=_heliCrew select (floor(random(count _heliCrew)));
_temparray set [count _temparray,_crew];
};
// CREATE TRANSPORT CHOPPER & CREW
if (_type==4) then {
_tempUnit=_CHPool select (floor(random(count _CHPool)));
_temparray set [count _temparray,_tempUnit];
_crew=_heliCrew select (floor(random(count _heliCrew)));
_temparray set [count _temparray,_crew];
};
// CREATE STATIC & CREW
if (_type==5) then {
_tempUnit=_stPool select (floor(random(count _stPool)));
_temparray set [count _temparray,_tempUnit];
_crew=_crewPool select (floor(random(count _crewPool)));
_temparray set [count _temparray,_crew];
};
if (_type==6) then {_tempArray=_uavPool select (floor(random(count _uavPool)));};
// CREATE TRANSPORT & CREW
if (_type==7) then {
_tempUnit=_MotPool select (floor(random(count _MotPool)));
_temparray set [count _temparray,_tempUnit];
_crew=_crewPool select (floor(random(count _crewPool)));
_temparray set [count _temparray,_crew];
};
// CREATE BOAT & DIVER CREW
if (_type==8) then {
_tempUnit=_shipPool select (floor(random(count _shipPool)));
_temparray set [count _temparray,_tempUnit];
_crew=_diverPool select (floor(random(count _diverPool)));
_temparray set [count _temparray,_crew];
};
// CREATE CARGO
if (_type==9) then {
for "_i" from 0 to 4 do{
_unit=_InfPool select (floor(random(count _InfPool)));
_temparray set [count _temparray,_unit];
};
};
// CREATE DIVER CARGO
if (_type==10) then {
for "_i" from 0 to 4 do{
_unit=_diverPool select (floor(random(count _diverPool)));
_temparray set [count _temparray,_unit];
};
};
//hint format ["%1",_tempArray];
_tempArray/*
* Efnc_setRndSkill
* Sets ai skills of a unit to a random value within the desired range
* [unit, min, max] call Efnc_setRndSkill
* unit: Object - the unit
* min: float - number from 0.0 to 1.0 - minimum skill value to select
* max: float - number from 0.0. to 1.0 - maximum skill value to select
* returns: nothing
* Example: [units group player, 0.2, 0.4] call Efnc_setRndSkill;
*/
private ["_unit", "_min", "_max"];
_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_min = [_this, 1, 0, [0]] call BIS_fnc_param;
_max = [_this, 2, 1, [0]] call BIS_fnc_param;
{
private ["_val"];
_val = (_min * 100) + ( (random 0.99) * (((_max * 100) - (_min * 100)) + 1) ); // formula for random with adjusted range
_val = _val - (_val % 1);
_val = _val / 100;
_unit setskill [_x,_val];
} foreach ["aimingAccuracy", "aimingShake", "aimingSpeed", "endurance", "spotDistance", "spotTime", "courage", "reloadSpeed", "commanding", "general"];
/*
* Efnc_aliveGroup
* Tests to see whether the group is alive (has atleast 1 member alive)
* grpAlive = [grp] call Efnc_aliveGroup;
* grp: Group - the group to check
* Returns: Boolean - true if the group is alive, false if not
*/
private ["_grp", "_alive"];
_grp = [_this, grpNull, [grpNull]] call EF_fnc_singleParam;
if ({alive _x} count units _grp == 0) then
{
_alive = false;
}
else
{
_alive = true;
};
_alive/*
* Efnc_aliveUnits
* Tests to see whether the array of units is alive (atleast 1 unit is alive)
* unitsAlive = units call Efnc_aliveGroup;
* units: Array format [object1, object2, ...] - the units to check
* Returns: Boolean - true if the units are alive, false if not
*/
private ["_units", "_alive"];
_units = [_this, [], [[]]] call EF_fnc_singleParam;
if ({alive _x} count _units == 0) then
{
_alive = false;
}
else
{
_alive = true;
};
_alive// groupDead
// checks to see if all units in group are dead
// param - group
// returns true if all dead, false if not
_grp = [_this, grpNull, [grpNull]] call EF_fnc_singleParam;
({alive _x} count (units _grp)) == 0;
/*
* Efnc_groupInVehicle
* Tests to see whether all the units in a group are in the specified vehicle
* isIn = [group, vehicle] call Efnc_groupInVehicle;
* group: Group - group to check
* vehicle: Object - the vehicle to check
* returns: Boolean - true if group is in vehicle, false if not
*/
private ["_grp", "_veh", "_inVeh"];
_grp = _this select 0;
_veh = _this select 1;
// check if _veh is actual vehicle
if ({_x in _veh} count units _grp == count units _grp) then
{
_inVeh = true;
}
else
{
_inVeh = false;
};
_inVeh
/*
* Efnc_groupInVehicles
* Tests to see whether all the units in a group are in any of the specified vehicles
* isIn = [group, vehicles] call Efnc_groupInVehicles;
* group: Group - group to check
* vehicles: Array format [vehicle1, vehicle2, ...] - the vehicles to check
* returns: Boolean - true if group is in vehicles, false if not
*/
private ["_grp", "_vehs", "_inVeh"];
_grp = _this select 0;
_vehs = _this select 1;
_cnt = 0; // init count at 0
_units = units _grp; // units of group
{
private ["_veh"];
_veh = _x;
_cnt = _cnt + {_x in _veh} count _units;
} foreach _vehs;
if (_cnt == count _units) then
{
_inVeh = true;
}
else
{
_inVeh = false;
};
_inVeh
/*
* Efnc_getDir
* Find the direction between two things
* This function is overloaded to support (markers, objects, positions)
* _direction = [marker1, marker2] call Fnc_GetDir
*/
private ["_obj1", "_obj2", "_x1", "_x2", "_y1", "_y2", "_dir", "_posCommand"];
_obj1 = _this select 0;
_obj2 = _this select 1;
_posCommand = "";
switch (typeName _obj1) do
{
case "STRING":
{
_posCommand = "getMarkerPos";
};
case "OBJECT":
{
_posCommand = "getPos";
};
case "ARRAY":
{
_posCommand = "";
};
default
{
diag_log text "Efnc_getDir - unknown data type given";
};
};
_x1 = call compile format ["%1 _obj1 select 0;", _posCommand];
_y1 = call compile format ["%1 _obj1 select 1;", _posCommand];
switch (typeName _obj2) do
{
case "STRING":
{
_posCommand = "getMarkerPos";
};
case "OBJECT":
{
_posCommand = "getPos";
};
case "ARRAY":
{
_posCommand = "";
};
default
{
diag_log text "Efnc_getDir - unknown data type given";
};
};
_x2 = call compile format ["%1 _obj2 select 0;", _posCommand];
_y2 = call compile format ["%1 _obj2 select 1;", _posCommand];
_dir = (_x2 - _x1) ATan2 (_y2 - _y1);
_dir
/*
Create_Effect
Creates a particle effect, like smoke or fire on an object. Currently third parameter is not supported
params:
_obj - object to create effect on
_type - string ("smoke" or "fire")
_intensity - string ("low", "medium", "high") - default is high
[myCar, "fire", "medium"] call Create_Effect
*/
private ["_obj", "_type", "_intensity", "_effect"];
_obj = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_type = [_this, 1, "smoke", [""]] call BIS_fnc_param;
_intensity = [_this, 2, "high", [""]] call BIS_fnc_param;
if (_type == "smoke") then
{
_effect = "test_EmptyObjectForSmoke";
/*
unimplemented
if (_intensity == "low") exitWith {false};
if (_intensity == "medium") exitWith {false};
if (_intensity == "high") then {_effect = "test_EmptyObjectForSmoke";};
*/
}
else
{
if (_type == "fire") then
{
_effect = "test_EmptyObjectForFireBig";
/*
unimplemented
if (_intensity == "low") exitWith {false};
if (_intensity == "medium") exitWith {false};
if (_intensity == "high") then {_effect = "test_EmptyObjectForFireBig";};
*/
}
};
_thing = _effect createVehicle getpos _obj;
_thing attachTo [_obj,[0,0,0.1]];
_thing;/*
Igneous01
fnc_SingleParam
Validates single parameter against provided types, if no match found, defaults to provided value
If parameter is passed as array (ie. [singleParam] call someFnc) then it will be extracted and checked as well
this means your script/function can be completely agnostic as to whether someone calls it with an array argument
or single argument.
Both of these will work:
someVal = [arg] call myFunc;
someVal = arg call myFunc;
arguments:
_parameter : the parameter to check (any datatype)
_defaultValue : value to default to, if the parameter is invalid (any datatype) (Optional : defaults to 0)
_types : list of types to compare against (array) (Optional : defaults to accepting all types)
_error : log error if parameter is invalid (bool) (Optional : default is false)
example:
_myArg = [_this, objNull] call fnc_SingleParam; // does nothing, as _myArg accepts all types
_myArg = [_this, objNull, [objNull, 0, [] ]] call fnc_SingleParam; // if _myArg is not of type [object, number, or array] default to objNull
_myArg = [_this, "Default", [""], true] call fnc_SingleParam; // if _myArg is not type string, defaults to "Default", error is logged
*/
private ["_value", "_ty"];
_parameter = [_this, 0, 0] call BIS_fnc_param; // default to 0 if nothing provided
_defaultValue = [_this, 1, 0] call BIS_fnc_param; // default value is defaulted to 0
_types = [_this, 2, [_parameter], [[]]] call BIS_fnc_param; // default to parameter value, must be array type
_error = [_this, 3, false] call BIS_fnc_param; // error by default is off
_ty = typeName _parameter;
// if array, extract
if (_ty == (typename [])) then
{
_value = _parameter select 0;
_ty = typeName _value;
}
else
{
_value = _parameter;
};
// compare types against provided, default if no match found
_typeMatch = false;
{
if (_ty == (typeName _x)) exitWith
{
_typeMatch = true;
}
} forEach _types;
if (!_typeMatch) then
{
["%1 : Argument %2 is of invalid type - default %3 used instead", _fnc_scriptName, _value, _defaultValue] call bis_fnc_error;
_value = _defaultValue;
};
_value; // return value
/*
* Efnc_advHints
* creates advanced hints that display to the player
* [header, info, action, duration] call Efnc_advHints;
* header: String - The main header for the hint
* info: String - Secondary header
* action: String - Description of action/etc
* duration: Number - Time in seconds that hint will last for
* returns: nothing
* Example: ["Mission Available", "Attend Briefing", "Go to the briefing room", 5] spawn Fnc_AdvancedHints;
*/
private ["_header", "_info", "_action", "_duration"];
_header = _this select 0;
_info = _this select 1;
_action = _this select 2;
_duration = _this select 3;
[] call bis_fnc_hints;
BIS_AdvHints_THeader = _header;
BIS_AdvHints_TInfo = _info;
BIS_AdvHints_TAction = _action;
BIS_AdvHints_TBinds = "";
BIS_AdvHints_Duration = _duration;
BIS_AdvHints_HideCode = "hintSilent '';";
BIS_AdvHints_Text = call BIS_AdvHints_formatText;
BIS_AdvHints_HideCond = "";
call BIS_AdvHints_showHint;
/*
* Efnc_mapClick
* This returns the variables passed by onMapSingleClick, without the need to have global vars created to do something
* Also has a locking feature, preventing duplicate mapClicks from occuring at the same time
* [] call Efnc_mapClick
* Input: none
* returns array [_pos, _units, _shift, _alt] obtained from onmapsingleclick (see documentation of onMapSingleClick to see what these values mean)
* Ex: artilleryPos = ([] call Efnc_mapClick) select 0;
*/
private ["_return"];
_return = []; // init the return
// if the variable is defined, script is already running, lock the instance of the script, until the other is finished. (thread safety)
if (!isNil "EFNC_MAPCLICK_LOCK") exitWith {};
EFNC_MAPCLICK_STRING = "";
EFNC_MAPCLICK_LOCK = true; // lock is true (engaged)
// mouse click
onMapSingleClick {
onMapSingleClick {};
EFNC_MAPCLICK_LOCK = false;
EFNC_MAPCLICK_STRING = format ["_return = [%1, %2, %3, %4]", _pos, _units, _shift, _alt]; // get the vars from mapclick
};
waitUntil {!EFNC_MAPCLICK_LOCK}; // waits until the map is clicked
call compile EFNC_MAPCLICK_STRING; // run this code
// destroy these vars
EFNC_MAPCLICK_STRING = nil;
EFNC_MAPCLICK_LOCK = nil;
_return; // return the values
/*
* Efnc_hideMarker
* hide/show marker on map
* [marker, hide] call Efnc_hideMarker
* marker: marker - the marker
* hide: boolean - true hides the marker, false shows the marker
* returns: nothing
*/
private ["_marker", "_hide"];
_marker = _this select 0;
_hide = _this select 1;
if (_hide) then
{
_marker setMarkerAlpha 0;
}
else
{
_marker setMarkerAlpha 1;
};
/*
* Efnc_randInRange
* returns a random number, constricted to the range specified
* numberFrom2To5 = [min, max, decimal] call Efnc_RndInRange
* min: number - minimum number
* max: number - maximum number
* decimal: boolean - true can return a decimal (double) or integer
* returns: number - the random number
*/
private ["_min", "_max", "_double", "_val"];
_min = _this select 0;
_max = _this select 1;
_double = _this select 2;
_val = (_min * 100) + ( (random 0.99) * (((_max * 100) - (_min * 100)) + 1) ); // formula for random with adjusted range
if (_double) then
{
_val = _val - (_val % 1);
};
_val = _val / 100;
_val
/*
* Efnc_createLight
* creates a light object with specified parameters and position
* lightobj = [position, [red, green, blue], intensity] call Efnc_createLight
* position: array - format position
* red, green, blue: float - number from 0.0 to 1.0
* intensity: float - number from 0.0 to 1.0 (dim <-> bright)
* returns light object
* Example: redLight = [getpos player, [1.0, 0.0, 0.0], 1.0] call Efnc_createLight
*/
private ["_light", "_pos", "_colorArray", "_brightness"];
_pos = _this select 0; // position
_colorArray = _this select 1; // color array
_brightness = _this select 2; // brightness
_light= "#lightpoint" createVehicleLocal _pos;
_light setLightBrightness _brightness;
_light setLightAmbient _colorArray;
_light setLightColor _colorArray;
_light
/*
* Efnc_nearestRoad
* returns (if any) nearest road relative to specified position, objNull is returned if none found
* closestRoad = [position, radius] call Efnc_nearestRoad
* position: array - format position
* radius: number - maximum distance to search
* Returns: nearest road object, objNull if none found
* Example: road = [getpos player, 50] call Efnc_nearestRoad
*/
private ["_roads", "_closestRoad", "_pos", "_dist", "_radius"];
_pos = _this select 0;
_radius = _this select 1;
_roads = _pos nearRoads _radius;
_dist = _radius;
if (count _roads > 0) then {
{
if (_x distance _pos < _dist) then {
_dist = _x distance _pos;
_closestRoad = _x;
};
} foreach _roads;
_closestRoad;
}
else
{
objNull;
};
/*
* Efnc_getPosAtAngle
* returns a new position that is distance r away from original point at angle theta
* can find a position at the edge of a circle
* pos = [position, radius, angle] call Efnc_getPosAtAngle
* position - Object/Marker/Array - reference position
* radius: Number - radius/distance
* angle: Number - angle in degrees
* returns: position
* This function is overloaded, and supports markers, objects, and positions
* Example: _pos = [tank, 50, 45] call Fnc_GetPosAtAngle; - new position is 50 metres away from tank at NorthEast
*/
private ["_r", "_theta", "_refPos", "_rx", "_ry", "_x", "_y", "_pos"];
_refPos = _this select 0;
_r = _this select 1;
_theta = _this select 2;
switch (typeName _refPos) do {
case "OBJECT":
{
_refPos = getpos _refPos;
};
case "STRING":
{
_refPos = getMarkerPos _refPos;
};
case "ARRAY":
{
};
default
{
diag_log text "Efnc_getPosAtAngle - unknown data type given";
};
};
_rx = _refPos select 0;
_ry = _refPos select 1;
//diag_log text format ["Fnc_GetPosAtAngle: _r = %1, _theta = %2, _rx = _%3, _ry = %4, _thetaRad = %5", _r, _theta, _rx, _ry, _theta * _conversion];
_x = _rx + (_r * cos (- _theta + 90 ) );
_y = _ry + (_r * sin (- _theta + 90 ) );
_pos = [_x, _y];
//diag_log text format ["GP: Fnc_GetPosAtAngle: Result: _theta = %1, _pos = %2, _x = %3, _y = %4", _theta, _pos, _x, _y];
_pos
/*
* Efnc_setPosASLZ
* set the height of an object ASL
* [unit, height] call Efnc_setPosASLZ
* unit: Object
* height: number - number in metres
* returns: nothing
*/
private ["_unit", "_z"];
_unit = _this select 0;
_z = _this select 1;
_unit setposASL [(getpos _unit) select 0, (getpos _unit) select 1, _z];
/*
* Efnc_setPosATLZ
* set the height of an object ATL
* [unit, height] call Efnc_setPosATLZ
* unit: Object
* height: number - number in metres
* returns: nothing
*/
private ["_unit", "_z"];
_unit = _this select 0;
_z = _this select 1;
_unit setposATL [(getpos _unit) select 0, (getpos _unit) select 1, _z];
/*
* Efnc_setPosZ
* set the height of an object
* [unit, height] call Efnc_setPosZ
* unit: Object
* height: number - number in metres
* returns: nothing
*/
private ["_unit", "_z"];
_unit = _this select 0;
_z = _this select 1;
_unit setpos [(getpos _unit) select 0, (getpos _unit) select 1, _z];
/*
* Efnc_updateTask
* simplifies updating tasks, by both setting the task state, and making a call to the taskHint, so the hint displays to player
* [task, state] call Efnc_updateTask
* task: Task - the task object
* state: String - state of task ("SUCCEEDED", "FAILED", "CREATED", "CANCELED")
* returns: nothing
*/
private ["_task", "_state"];
_task = _this select 0;
_state = _this select 1;
_task settaskstate _state;
[objNull, ObjNull, _task, _state] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";
/*
* Efnc_createWP
* simplifies creating waypoints by passing all parameters into one call
* waypoint = [group, position, index number, type, (optional: completionRadius, {code to execute}, [timeout])] call Efnc_createWP
* group: Group - the group that gets the waypoint
* position: array - format position
* index number: integer - index of new waypoint
* type: String - the type of waypoint (ex "MOVE", "SAD", "TR UNLOAD")
* Optional Parameters
* completionRadius: Number - radius in metres for waypoint to complete
* {code to execute}: Code - code that will execute at waypoints activation - must be surrounded by code brackets {}
* [timeout]: Array format [min, med, max] - the timeout until the waypoint completes
* Example: wp = [group player, getpos player, 1, "MOVE", 150, {hint "you made it!"}, [0, 5, 10]] call Efnc_createWP
* returns: waypoint [group, index] format
*/
private ["_wp", "_grp", "_pos", "_index", "_type", "_completionRadius", "_statements", "_timeout"];
_grp = _this select 0;
_pos = _this select 1; // actual position, not object
_index = _this select 2; // waypoint index
_type = _this select 3; // ex "MOVE", "TR UNLOAD"
switch (count _this) do
{
case 5:
{
_completionRadius = _this select 4; // number of metres
};
case 6:
{
_completionRadius = _this select 4;
_statements = _this select 5; // code to execute (this is in code block);
};
case 7:
{
_completionRadius = _this select 4;
_statements = _this select 5;
_timeout = _this select 6;
};
};
// create waypoint
_wp = _grp addWaypoint [_pos, _index];
_wp setWaypointType _type;
if (!isNil "_completionRadius") then {
_wp setWaypointCompletionRadius _completionRadius;
};
if (!isNil "_statements") then {
private ["_string"];
_string = format ["call %1", _statements];
_wp setWaypointStatements ["true", _string];
};
if (!isNil "_timeout") then {
_wp setWaypointTimeout _timeout;
};
// output
_wp
fnc_select_position =
{
private ["_pos", "_prevPos"];
_prevPos = _this;
if ((isNil {_prevPos}) || (typeName _prevPos) != "OBJECT") then
{
_pos = LZ_ARRAY call BIS_fnc_selectRandom;
}
else
{
_pos = (LZ_ARRAY - [_prevPos]) call BIS_fnc_selectRandom;
};
getpos _pos;
};
fnc_createGroup =
{
private ["_pos", "_grp"];
if (isNil {_this}) exitWith {grpNull;};
if (typename _this != "ARRAY") exitWith {grpNull;};
_pos = _this;
_grp = createGroup west;
"B_Soldier_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "CORPORAL"];
"B_Soldier_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_medic_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_Soldier_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_medic_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_Soldier_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_medic_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_Soldier_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
_grp;
};
fnc_createGroupmed =
{
private ["_pos", "_grp"];
if (isNil {_this}) exitWith {grpNull;};
if (typename _this != "ARRAY") exitWith {grpNull;};
_pos = _this;
_grp = createGroup west;
"C_scientist_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "CORPORAL"];
"C_scientist_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
apc1 = "C_Van_01_box_F" createVehicle getMarkerPos "PICKUP_ZONE_11";
_grp;
};
fnc_createGroupdivers =
{
private ["_pos", "_grp"];
if (isNil {_this}) exitWith {grpNull;};
if (typename _this != "ARRAY") exitWith {grpNull;};
_pos = _this;
_grp = createGroup west;
"B_diver_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "CORPORAL"];
"B_diver_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_diver_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_diver_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
_grp;
};
fnc_createGroupevac =
{
private ["_pos", "_grp"];
if (isNil {_this}) exitWith {grpNull;};
if (typename _this != "ARRAY") exitWith {grpNull;};
_pos = _this;
_grp = createGroup west;
"C_man_polo_5_F_euro" createUnit [_pos, _grp,"this allowDamage false",0.5, "CORPORAL"];
"C_man_p_shorts_1_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"C_Nikos_aged" createUnit [_pos, _grp,"this setDamage 0.8; this allowDamage false",0.5, "PRIVATE"];
"C_Nikos_aged" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"B_recon_medic_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
"C_man_1_2_F" createUnit [_pos, _grp,"this allowDamage false",0.5, "PRIVATE"];
_grp;
};
fnc_createGrouphurt =
{
private ["_pos", "_grp"];
if (isNil {_this}) exitWith {grpNull;};
if (typename _this != "ARRAY") exitWith {grpNull;};
_pos = _this;
_grp = createGroup west;
"C_man_polo_5_F_euro" createUnit [_pos, _grp,"this setDamage 0.8; this allowDamage false",0.5, "CORPORAL"];
"C_man_p_shorts_1_F" createUnit [_pos, _grp,"this setDamage 0.8; this allowDamage false",0.5, "PRIVATE"];
_grp;
};
fnc_spawnEnemyGroups =
{
private ["_pos", "_count", "_grps", "_i", "_dist"];
_pos = _this select 0;
_count = _this select 1;
_dist = _this select 2;
_grps = [];
for [{_i = 0}, {_i < _count}, {_i = _i + 1}] do
{
private ["_g", "_p"];
_p = [_pos, _dist, (random 359)] call EF_fnc_getPosAtAngle;
_g = [_p, EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call BIS_fnc_spawnGroup;
_grps set [count _grps, _g];
// create seek and destroy waypoint for group
[_g, _pos, 1, "SAD", 50] call EF_fnc_createWP;
};
_grps; // return array of groups
};
fnc_createSARGroup =
{
private ["_pos", "_radius", "_wreckType", "_wreck", "_grp"];
_pos = _this select 0;
_radius = _this select 1;
_wreckType = _this select 2;
_wreck = createVehicle [_wreckType, _pos, [], 0, "CAN_COLLIDE"];
_grp = createGroup WEST;
(Mission_Dictionary getVariable "O_Heli_Pilot") createUnit [[_pos, 10, random (359)] call EF_fnc_GetPosAtAngle, _grp,"",0.5, "CORPORAL"];
(Mission_Dictionary getVariable "O_Heli_Crew") createUnit [[_pos, 10, random (359)] call EF_fnc_GetPosAtAngle, _grp,"",0.5, "PRIVATE"];
[_grp, _wreck];
};
fnc_createSARGroup2 =
{
private ["_pos", "_radius", "_wreckType", "_wreck", "_grp"];
_pos = _this select 0;
_radius = _this select 1;
_wreckType = _this select 2;
_wreck = createVehicle [_wreckType, _pos, [], 0, "CAN_COLLIDE"];
_grp = createGroup WEST;
(Mission_Dictionary getVariable "B_MAN") createUnit [[_pos, 10, random (359)] call EF_fnc_GetPosAtAngle, _grp,"",0.5, "CORPORAL"];
(Mission_Dictionary getVariable "B_MAN") createUnit [[_pos, 10, random (359)] call EF_fnc_GetPosAtAngle, _grp,"",0.5, "PRIVATE"];
(Mission_Dictionary getVariable "B_MAN") createUnit [[_pos, 10, random (359)] call EF_fnc_GetPosAtAngle, _grp,"",0.5, "PRIVATE"];
(Mission_Dictionary getVariable "B_MAN") createUnit [[_pos, 10, random (359)] call EF_fnc_GetPosAtAngle, _grp,"",0.5, "PRIVATE"];
[_grp, _wreck];
};
fnc_vehicleDisabled =
{
private ["_veh", "_res"];
_veh = [_this, objNull, [objNull]] call EF_fnc_singleParam;
if (isNull _veh) exitWith {false;};
_res = false;
if (!alive _veh || !canMove _veh) then { _res = true; };
_res;
};
fnc_vehicleDisabledInCollection =
{
private ["_veh", "_vehicles", "_res"];
_vehicles = _this;
_veh = objNull;
{
_res = _x call fnc_vehicleDisabled;
if (_res) then
{
_veh = _x;
};
} foreach _vehicles;
_veh;
};
fnc_createConvoy =
{
private ["_veh_types","_veh_count","_posBegin","_dir","_grp_convoy","_convoy_vehs","_i"];
_veh_types = _this select 0; // array ['veh_class_1', 'veh_class_2']
_veh_count = [_this, 1, 4, [0]] call BIS_fnc_param; // number
_posBegin = _this select 2; // start position
_dir = _this select 3; // dir
_grp_convoy = createGroup west;
_convoy_vehs = [];
for [{_i = 0}, {_i < _veh_count}, {_i = _i + 1}] do
{
private ["_v", "_spawnData"];
_spawnData = [_posBegin, _dir, _veh_types select _i, _grp_convoy] call BIS_fnc_spawnVehicle;
_convoy_vehs set [count _convoy_vehs, _spawnData select 0];
};
[_grp_convoy, _convoy_vehs]; // return
};
fnc_createCASTargets =
{
private ["_target_types","_target_count","_pos","_radius","_separate_groups","_target_groups","_target_vehicles","_spawnPos","_i"];
_target_types = _this select 0;
_target_count = _this select 1;
_pos = _this select 2;
_radius = _this select 3;
_separate_groups = _this select 4;
_target_groups = [];
_target_vehicles = [];
_spawnPos = [];
for [{_i = 0}, {_i < _target_count}, {_i = _i + 1}] do
{
private ["_type", "_veh", "_spawnData"];
if (typename _target_types == typename []) then
{
_type = _target_types call BIS_fnc_selectRandom;
}
else {_type = _target_types;};
// *******FIX THIS
if (_separate_groups || count _target_groups == 0) then
{
// position
// *** VEHICLE SPAWNS IN BAD PLACES (UNDERWATER, NEXT TO ANOTHER VEHICLE)
//_spawnPos = [_pos, _radius] call fnc_placementRadiusGround;
_spawnPos = [[[_pos, _radius]]] call BIS_fnc_randomPos;
_spawnData = [_spawnPos, (random 359), _type, west] call BIS_fnc_spawnVehicle;
_target_groups set [count _target_groups, _spawnData select 2]
}
else
{
// Increment Second argument of GetPosAtAngle!!!!! AND HANDLE SPAWNING IN BUILDINGS/WATER !!!!!!
_spawnData = [[_spawnPos, 25, random (359)] call EF_fnc_GetPosAtAngle, (random 359), _type, (_target_groups select 0)] call BIS_fnc_spawnVehicle;
};
_target_vehicles set[count _target_vehicles, _spawnData select 0];
};
// return data
[_target_vehicles, _target_groups];
};
fnc_createConvoy =
{
private ["_veh_types","_spawnPos","_dir","_grp_convoy","_convoy_vehs","_i"];
_veh_types = _this select 0; // array ['veh_class_1', 'veh_class_2']
_spawnPos = _this select 1; // start position (DOES THIS MODIFY ORIGINAL ARGUMENT??????)
_dir = _this select 2; // dir
_grp_convoy = createGroup west;
_convoy_vehs = [];
for [{_i = 0}, {_i < (count _veh_types)}, {_i = _i + 1}] do
{
private ["_v", "_spawnData"];
_spawnData = [_spawnPos, _dir, _veh_types select _i, _grp_convoy] call BIS_fnc_spawnVehicle;
_convoy_vehs set [count _convoy_vehs, _spawnData select 0];
_spawnPos = [_spawnPos, 25, _dir - 180] call EF_fnc_GetPosAtAngle;
};
[_grp_convoy, _convoy_vehs]; // return
};
fnc_createAAGroup =
{
private ["_pos", "_grp"];
_pos = _this;
_grp = createGroup east;
_pos = [[[_pos, 1200]]] call BIS_fnc_randomPos;
(Mission_Dictionary getVariable "B_Soldier_AA") createUnit [_pos, _grp,"",0.5, "CORPORAL"];
(Mission_Dictionary getVariable "B_Soldier") createUnit [_pos, _grp,"",0.5, "PRIVATE"];
(Mission_Dictionary getVariable "B_Soldier") createUnit [_pos, _grp,"",0.5, "PRIVATE"];
//hint format ["createAAGroup: %1", units _grp];
(leader _grp) setDir (random 359);
_grp; // return
};
fnc_createReinforcements =
{
private ["_pos", "_dir", "_type", "_veh", "_grp", "_spawnData"];
_pos = _this select 0;
_dir = _this select 1;
_type = _this select 2;
_grp = createGroup west;
_spawnData = [[_pos select 0, _pos select 1], _dir, _type, _grp] call BIS_fnc_spawnVehicle;
_veh = _spawnData select 0;
[_grp, _veh]; // return group and vehicle
};
// variable _z is ignored!!!!!!!!!!!!!!
fnc_placementRadiusGround =
{
private ["_pos", "_radius", "_newPos", "_z"];
_pos = [_this, 0, [0,0,0], [[]]] call BIS_fnc_param;
_radius = [_this, 1, 300, [0]] call BIS_fnc_param;
// return new position within radius relative to position
_newPos = [(_pos select 0)-_radius*sin(random 359), (_pos select 1)-_radius*cos(random 359)];
_z = getTerrainHeightASL _newPos; // BIS_fnc_spawnGroup doesn't use ASL position!!!!
_newPos set[2, 0];
_newPos;
};
fnc_deleteGroup =
{
private ["_grp"];
_grp = [_this, grpNull, [grpNull]] call EF_fnc_singleParam;
if (isNull(_grp)) exitWith {false;};
{
deleteVehicle _x;
} foreach units _grp;
deleteGroup _grp;
true;
};
fnc_createMarker =
{
private ["_name", "_text", "_pos", "_type", "_color", "_marker"];
_name = [_this, 0, "default_marker", [""]] call BIS_fnc_param;
_text = [_this, 1, "marker text", [""]] call BIS_fnc_param;
_pos = [_this, 2, [0,0,0], [[]]] call BIS_fnc_param;
_type = [_this, 3, "hd_destroy", [""]] call BIS_fnc_param;
_color = [_this, 4, "ColorBlue", [""]] call BIS_fnc_param;
_marker = createMarker [_name, _pos];
_name setMarkerText _text;
_name setMarkerType _type;
_name setMarkerColor _color;
_marker;
};
fnc_createMarker2 =
{
private ["_name", "_text", "_pos", "_type", "_color", "_marker"];
_name = [_this, 0, "default_marker", [""]] call BIS_fnc_param;
_text = [_this, 1, "marker text", [""]] call BIS_fnc_param;
_pos = [_this, 2, [0,0,0], [[]]] call BIS_fnc_param;
_type = [_this, 3, "hd_destroy", [""]] call BIS_fnc_param;
_color = [_this, 4, "ColorYellow", [""]] call BIS_fnc_param;
_marker = createMarker [_name, _pos];
_name setMarkerText _text;
_name setMarkerType _type;
_name setMarkerColor _color;
_marker;
};
fnc_createMarkerEllipse =
{
private ["_name","_text","_pos","_color","_marker","_radius"];
_name = [_this, 0, "default_marker", [""]] call BIS_fnc_param;
_text = [_this, 1, "marker text", [""]] call BIS_fnc_param;
_pos = [_this, 2, [0,0,0], [[]]] call BIS_fnc_param;
_radius = [_this, 3, 400, [0]] call BIS_fnc_param;
_color = [_this, 4, "ColorBlue", [""]] call BIS_fnc_param;
_marker = createMarker [_name, _pos];
_name setMarkerText _text;
_name setMarkerShape "ELLIPSE";
_name setMarkerSize [_radius, _radius];
_name setMarkerColor _color;
_marker;
};
fnc_createMarkerEllipse2 =
{
private ["_name","_text","_pos","_color","_marker","_radius"];
_name = [_this, 0, "default_marker", [""]] call BIS_fnc_param;
_text = [_this, 1, "marker text", [""]] call BIS_fnc_param;
_pos = [_this, 2, [0,0,0], [[]]] call BIS_fnc_param;
_radius = [_this, 3, 340, [0]] call BIS_fnc_param;
_color = [_this, 4, "ColorYellow", [""]] call BIS_fnc_param;
_marker = createMarker [_name, _pos];
_name setMarkerText _text;
_name setMarkerShape "ELLIPSE";
_name setMarkerSize [_radius, _radius];
_name setMarkerColor _color;
_marker;
};
fnc_CreateKajmanWithGunner =
{
private ["_pos", "_veh", "_gunner", "_grp"];
_pos = _this;
_veh = createVehicle ["CUP_B_CH53E_USMC", _pos, [], 0, "NONE"];
_grp = createGroup WEST;
_gunner = _grp createUnit [Mission_Dictionary getVariable "B_Heli_Crew", _pos, [], 0, "FORM"];
_gunner assignAsGunner _veh;
_gunner moveInGunner _veh;
_veh addEventHandler ["GetIn", eh_HeliGetIn];
_veh;
};
fnc_TrackCrashingHeli =
{
private ["_z", "_veh"];
_veh = _this;
waitUntil
{
_z = (getPosATL _veh) select 2;
//hint format ["%1", _z];
_z < 12;
};
0 = _veh execVM "CrashToWreck.sqf";
};
// Event Handlers
eh_HeliGetIn =
{
private ["_veh", "_unit", "_veh_pos"];
_veh = _this select 0;
_veh_pos = _this select 1;
_unit = _this select 2;
if (_veh_pos == "driver") then
{
private ["_grp"];
_veh removeEventHandler ["GetIn", 0];
_grp = group (gunner _veh);
[(gunner _veh)] join (group _unit);
deleteGroup _grp;
_veh addEventHandler ["HandleDamage", eh_HeliHandleDamage];
[_veh, MECHANICAL_CHANCE, MECHANICAL_PART] execVM "IGN_AHD\IGN_AHD.sqf";
};
};
eh_HeliHandleDamage =
{
if ((_this select 4) == "") exitWith {_this select 2;};
//hint "triggered";
if (!canMove (_this select 0)) then
{
// raise existing MISSION to cancelled status (if MISSION != null)
// transfer existing friendly units (if any) ownership to this mission (if feasable)
if (!isNull MISSION) then
{
[EVENT_MISSION_FAILED, [MISSION, MISSION getVariable "task"]] call IGN_fnc_raiseEvent;
MISSION_IN_PROGRESS = true;
};
(_this select 0) removeEventHandler ["HandleDamage", 0];
0 = (_this select 0) spawn fnc_TrackCrashingHeli;
};
_this select 2;
};
fnc_chance =
{
private ["_chance", "_res"];
_chance = _this;
_res = false;
if ((random(100)) < _chance) then {_res = true;};
_res;
};
fnc_cleanUpAA =
{
private ["_grp"];
_grp = _this;
if (isNil {_grp}) exitWith {};
if (isNull _grp) exitWith {};
// determine if separate calls makes a difference in GC behaviour
[units _grp] call BIS_fnc_GC;
[_grp] call BIS_fnc_GC;
};
//
// kills the entity (setdamage 1), sends to Garbage collector for cleanup
// best called with spawn - cleanup can happen concurrently
// NOT NEEDED, as BIS_GC will delete units/objects even if they are alive (only cares if player dist > 2000 or so)
/*
fnc_addToGCQueue =
{
private ["_entity"];
if (isNil {_entity}) exitWith {};
if (typename _entity == typename []) exitWith
{
{
if (typename _x == typename grpNull) then
{
{_x setDamage 1;} foreach units _x;
[units _x] call BIS_fnc_GC;
[_x] call BIS_fnc_GC;
};
if (typename _x == typename objNull) then
{
_x setDamage 1;
[_x] call BIS_fnc_GC;
};
} foreach _entity;
};
if (typename _entity == typename grpNull) then
{
{_x setDamage 1;} foreach units _entity;
[units _entity] call BIS_fnc_GC;
[_entity] call BIS_fnc_GC;
}
else {
if (typename _entity == typename objNull) then
{
_entity setDamage 1;
[_entity] call BIS_fnc_GC;
};
};
};
*////////////////////////////////////////////////////////////////////////////
/// Styles
///////////////////////////////////////////////////////////////////////////
// Control types
#define CT_STATIC 0
#define CT_BUTTON 1
#define CT_EDIT 2
#define CT_SLIDER 3
#define CT_COMBO 4
#define CT_LISTBOX 5
#define CT_TOOLBOX 6
#define CT_CHECKBOXES 7
#define CT_PROGRESS 8
#define CT_HTML 9
#define CT_STATIC_SKEW 10
#define CT_ACTIVETEXT 11
#define CT_TREE 12
#define CT_STRUCTURED_TEXT 13
#define CT_CONTEXT_MENU 14
#define CT_CONTROLS_GROUP 15
#define CT_SHORTCUTBUTTON 16
#define CT_XKEYDESC 40
#define CT_XBUTTON 41
#define CT_XLISTBOX 42
#define CT_XSLIDER 43
#define CT_XCOMBO 44
#define CT_ANIMATED_TEXTURE 45
#define CT_OBJECT 80
#define CT_OBJECT_ZOOM 81
#define CT_OBJECT_CONTAINER 82
#define CT_OBJECT_CONT_ANIM 83
#define CT_LINEBREAK 98
#define CT_USER 99
#define CT_MAP 100
#define CT_MAP_MAIN 101
#define CT_LISTNBOX 102
#define CT_CHECKBOX 77
// Static styles
#define ST_POS 0x0F
#define ST_HPOS 0x03
#define ST_VPOS 0x0C
#define ST_LEFT 0x00
#define ST_RIGHT 0x01
#define ST_CENTER 0x02
#define ST_DOWN 0x04
#define ST_UP 0x08
#define ST_VCENTER 0x0C
#define ST_TYPE 0xF0
#define ST_SINGLE 0x00
#define ST_MULTI 0x10
#define ST_TITLE_BAR 0x20
#define ST_PICTURE 0x30
#define ST_FRAME 0x40
#define ST_BACKGROUND 0x50
#define ST_GROUP_BOX 0x60
#define ST_GROUP_BOX2 0x70
#define ST_HUD_BACKGROUND 0x80
#define ST_TILE_PICTURE 0x90
#define ST_WITH_RECT 0xA0
#define ST_LINE 0xB0
#define ST_SHADOW 0x100
#define ST_NO_RECT 0x200
#define ST_KEEP_ASPECT_RATIO 0x800
#define ST_TITLE ST_TITLE_BAR + ST_CENTER
// Slider styles
#define SL_DIR 0x400
#define SL_VERT 0
#define SL_HORZ 0x400
#define SL_TEXTURES 0x10
// progress bar
#define ST_VERTICAL 0x01
#define ST_HORIZONTAL 0
// Listbox styles
#define LB_TEXTURES 0x10
#define LB_MULTI 0x20
// Tree styles
#define TR_SHOWROOT 1
#define TR_AUTOCOLLAPSE 2
// MessageBox styles
#define MB_BUTTON_OK 1
#define MB_BUTTON_CANCEL 2
#define MB_BUTTON_USER 4
///////////////////////////////////////////////////////////////////////////
/// Base Classes
///////////////////////////////////////////////////////////////////////////
class RscText
{
access = 0;
type = 0;
idc = -1;
colorBackground[] =
{
0,
0,
0,
0
};
colorText[] =
{
1,
1,
1,
1
};
text = "";
fixedWidth = 0;
x = 0;
y = 0;
h = 0.037;
w = 0.3;
style = 0;
shadow = 1;
colorShadow[] =
{
0,
0,
0,
0.5
};
font = "PuristaMedium";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
linespacing = 1;
tooltipColorText[] =
{
1,
1,
1,
1
};
tooltipColorBox[] =
{
1,
1,
1,
1
};
tooltipColorShade[] =
{
0,
0,
0,
0.65
};
};
class RscStructuredText
{
access = 0;
type = 13;
idc = -1;
style = 0;
colorText[] =
{
1,
1,
1,
1
};
class Attributes
{
font = "PuristaMedium";
color = "#ffffff";
align = "left";
shadow = 1;
};
x = 0;
y = 0;
h = 0.035;
w = 0.1;
text = "";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
shadow = 1;
};
class RscPicture
{
access = 0;
type = 0;
idc = -1;
style = 48;
colorBackground[] =
{
0,
0,
0,
0
};
colorText[] =
{
1,
1,
1,
1
};
font = "TahomaB";
sizeEx = 0;
lineSpacing = 0;
text = "";
fixedWidth = 0;
shadow = 0;
x = 0;
y = 0;
w = 0.2;
h = 0.15;
tooltipColorText[] =
{
1,
1,
1,
1
};
tooltipColorBox[] =
{
1,
1,
1,
1
};
tooltipColorShade[] =
{
0,
0,
0,
0.65
};
};
class RscEdit
{
access = 0;
type = 2;
x = 0;
y = 0;
h = 0.04;
w = 0.2;
colorBackground[] =
{
0,
0,
0,
1
};
colorText[] =
{
0.95,
0.95,
0.95,
1
};
colorDisabled[] =
{
1,
1,
1,
0.25
};
colorSelection[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",
1
};
autocomplete = "";
text = "";
size = 0.2;
style = "0x00 + 0x40";
font = "PuristaMedium";
shadow = 2;
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
canModify = 1;
tooltipColorText[] =
{
1,
1,
1,
1
};
tooltipColorBox[] =
{
1,
1,
1,
1
};
tooltipColorShade[] =
{
0,
0,
0,
0.65
};
};
class RscCombo
{
access = 0;
type = 4;
colorSelect[] =
{
0,
0,
0,
1
};
colorText[] =
{
1,
1,
1,
1
};
colorBackground[] =
{
0,
0,
0,
1
};
colorScrollbar[] =
{
1,
0,
0,
1
};
soundSelect[] =
{
"\A3\ui_f\data\sound\RscCombo\soundSelect",
0.1,
1
};
soundExpand[] =
{
"\A3\ui_f\data\sound\RscCombo\soundExpand",
0.1,
1
};
soundCollapse[] =
{
"\A3\ui_f\data\sound\RscCombo\soundCollapse",
0.1,
1
};
maxHistoryDelay = 1;
class ComboScrollBar
{
color[] =
{
1,
1,
1,
1
};
};
style = "0x10 + 0x200";
x = 0;
y = 0;
w = 0.12;
h = 0.035;
shadow = 0;
colorSelectBackground[] =
{
1,
1,
1,
0.7
};
arrowEmpty = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_ca.paa";
arrowFull = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_active_ca.paa";
wholeHeight = 0.45;
colorActive[] =
{
1,
0,
0,
1
};
colorDisabled[] =
{
1,
1,
1,
0.25
};
font = "PuristaMedium";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
tooltipColorText[] =
{
1,
1,
1,
1
};
tooltipColorBox[] =
{
1,
1,
1,
1
};
tooltipColorShade[] =
{
0,
0,
0,
0.65
};
};
class RscListBox
{
access = 0;
type = 5;
w = 0.4;
h = 0.4;
rowHeight = 0;
colorText[] =
{
1,
1,
1,
1
};
colorDisabled[] =
{
1,
1,
1,
0.25
};
colorScrollbar[] =
{
1,
0,
0,
0
};
colorSelect[] =
{
0,
0,
0,
1
};
colorSelect2[] =
{
0,
0,
0,
1
};
colorSelectBackground[] =
{
0.95,
0.95,
0.95,
1
};
colorSelectBackground2[] =
{
1,
1,
1,
0.5
};
colorBackground[] =
{
0,
0,
0,
0.3
};
soundSelect[] =
{
"\A3\ui_f\data\sound\RscListbox\soundSelect",
0.09,
1
};
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
class ListScrollBar
{
color[] =
{
1,
1,
1,
1
};
autoScrollEnabled = 1;
};
style = 16;
font = "PuristaMedium";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
shadow = 0;
colorShadow[] =
{
0,
0,
0,
0.5
};
period = 1.2;
maxHistoryDelay = 1;
tooltipColorText[] =
{
1,
1,
1,
1
};
tooltipColorBox[] =
{
1,
1,
1,
1
};
tooltipColorShade[] =
{
0,
0,
0,
0.65
};
};
class RscButton
{
access = 0;
type = 1;
text = "";
colorText[] =
{
1,
1,
1,
1
};
colorDisabled[] =
{
0.4,
0.4,
0.4,
1
};
colorBackground[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",
0.7
};
colorBackgroundDisabled[] =
{
0.95,
0.95,
0.95,
1
};
colorBackgroundActive[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",
1
};
colorFocused[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",
1
};
colorShadow[] =
{
0,
0,
0,
1
};
colorBorder[] =
{
0,
0,
0,
1
};
soundEnter[] =
{
"\A3\ui_f\data\sound\RscButton\soundEnter",
0.09,
1
};
soundPush[] =
{
"\A3\ui_f\data\sound\RscButton\soundPush",
0.09,
1
};
soundClick[] =
{
"\A3\ui_f\data\sound\RscButton\soundClick",
0.09,
1
};
soundEscape[] =
{
"\A3\ui_f\data\sound\RscButton\soundEscape",
0.09,
1
};
style = 2;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
shadow = 2;
font = "PuristaMedium";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
offsetX = 0.003;
offsetY = 0.003;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
borderSize = 0;
};
class RscShortcutButton
{
type = 16;
x = 0.1;
y = 0.1;
class HitZone
{
left = 0;
top = 0;
right = 0;
bottom = 0;
};
class ShortcutPos
{
left = 0;
top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
w = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";
h = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
};
class TextPos
{
left = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";
top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
right = 0.005;
bottom = 0;
};
shortcuts[] =
{
};
textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)";
color[] =
{
1,
1,
1,
1
};
colorFocused[] =
{
1,
1,
1,
1
};
color2[] =
{
0.95,
0.95,
0.95,
1
};
colorDisabled[] =
{
1,
1,
1,
0.25
};
colorBackground[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",
1
};
colorBackgroundFocused[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",
1
};
colorBackground2[] =
{
1,
1,
1,
1
};
soundEnter[] =
{
"\A3\ui_f\data\sound\RscButton\soundEnter",
0.09,
1
};
soundPush[] =
{
"\A3\ui_f\data\sound\RscButton\soundPush",
0.09,
1
};
soundClick[] =
{
"\A3\ui_f\data\sound\RscButton\soundClick",
0.09,
1
};
soundEscape[] =
{
"\A3\ui_f\data\sound\RscButton\soundEscape",
0.09,
1
};
class Attributes
{
font = "PuristaMedium";
color = "#E5E5E5";
align = "left";
shadow = "true";
};
idc = -1;
style = 0;
default = 0;
shadow = 1;
w = 0.183825;
h = "((((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";
animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa";
animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa";
animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa";
animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\over_ca.paa";
animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\focus_ca.paa";
animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\down_ca.paa";
periodFocus = 1.2;
periodOver = 0.8;
period = 0.4;
font = "PuristaMedium";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
text = "";
action = "";
class AttributesImage
{
font = "PuristaMedium";
color = "#E5E5E5";
align = "left";
};
};
class RscShortcutButtonMain
{
idc = -1;
style = 0;
default = 0;
w = 0.313726;
h = 0.104575;
color[] =
{
1,
1,
1,
1
};
colorDisabled[] =
{
1,
1,
1,
0.25
};
class HitZone
{
left = 0;
top = 0;
right = 0;
bottom = 0;
};
class ShortcutPos
{
left = 0.0145;
top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)) / 2";
w = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2) * (3/4)";
h = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)";
};
class TextPos
{
left = "(((safezoneW / safezoneH) min 1.2) / 32) * 1.5";
top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20)*2 - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)) / 2";
right = 0.005;
bottom = 0;
};
animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\normal_ca.paa";
animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\disabled_ca.paa";
animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\over_ca.paa";
animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\focus_ca.paa";
animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\down_ca.paa";
animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\normal_ca.paa";
period = 0.5;
font = "PuristaMedium";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)";
text = "";
action = "";
class Attributes
{
font = "PuristaMedium";
color = "#E5E5E5";
align = "left";
shadow = "false";
};
class AttributesImage
{
font = "PuristaMedium";
color = "#E5E5E5";
align = "false";
};
};
class RscFrame
{
type = 0;
idc = -1;
style = 64;
shadow = 2;
colorBackground[] =
{
0,
0,
0,
0
};
colorText[] =
{
1,
1,
1,
1
};
font = "PuristaMedium";
sizeEx = 0.02;
text = "";
};
class RscSlider
{
access = 0;
type = 3;
style = 1024;
w = 0.3;
color[] =
{
1,
1,
1,
0.8
};
colorActive[] =
{
1,
1,
1,
1
};
shadow = 0;
h = 0.025;
};
class IGUIBack
{
type = 0;
idc = 124;
style = 128;
text = "";
colorText[] =
{
0,
0,
0,
0
};
font = "PuristaMedium";
sizeEx = 0;
shadow = 0;
x = 0.1;
y = 0.1;
w = 0.1;
h = 0.1;
colorbackground[] =
{
"(profilenamespace getvariable ['IGUI_BCG_RGB_R',0])",
"(profilenamespace getvariable ['IGUI_BCG_RGB_G',1])",
"(profilenamespace getvariable ['IGUI_BCG_RGB_B',1])",
"(profilenamespace getvariable ['IGUI_BCG_RGB_A',0.8])"
};
};
class RscCheckBox
{
idc = -1;
type = 77;
style = 0;
checked = 0;
x = "0.375 * safezoneW + safezoneX";
y = "0.36 * safezoneH + safezoneY";
w = "0.025 * safezoneW";
h = "0.04 * safezoneH";
color[] =
{
1,
1,
1,
0.7
};
colorFocused[] =
{
1,
1,
1,
1
};
colorHover[] =
{
1,
1,
1,
1
};
colorPressed[] =
{
1,
1,
1,
1
};
colorDisabled[] =
{
1,
1,
1,
0.2
};
colorBackground[] =
{
0,
0,
0,
0
};
colorBackgroundFocused[] =
{
0,
0,
0,
0
};
colorBackgroundHover[] =
{
0,
0,
0,
0
};
colorBackgroundPressed[] =
{
0,
0,
0,
0
};
colorBackgroundDisabled[] =
{
0,
0,
0,
0
};
textureChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa";
textureUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa";
textureFocusedChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa";
textureFocusedUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa";
textureHoverChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa";
textureHoverUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa";
texturePressedChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa";
texturePressedUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa";
textureDisabledChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa";
textureDisabledUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa";
tooltipColorText[] =
{
1,
1,
1,
1
};
tooltipColorBox[] =
{
1,
1,
1,
1
};
tooltipColorShade[] =
{
0,
0,
0,
0.65
};
soundEnter[] =
{
"",
0.1,
1
};
soundPush[] =
{
"",
0.1,
1
};
soundClick[] =
{
"",
0.1,
1
};
soundEscape[] =
{
"",
0.1,
1
};
};
class RscTextCheckBox
{
idc = -1;
type = 7;
style = 0;
x = "LINE_X(XVAL)";
y = "LINE_Y";
w = "LINE_W(WVAL)";
h = 0.029412;
colorText[] =
{
1,
0,
0,
1
};
color[] =
{
0,
0,
0,
0
};
colorBackground[] =
{
0,
0,
1,
1
};
colorTextSelect[] =
{
0,
0.8,
0,
1
};
colorSelectedBg[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",
1
};
colorSelect[] =
{
0,
0,
0,
1
};
colorTextDisable[] =
{
0.4,
0.4,
0.4,
1
};
colorDisable[] =
{
0.4,
0.4,
0.4,
1
};
tooltipColorText[] =
{
1,
1,
1,
1
};
tooltipColorBox[] =
{
1,
1,
1,
1
};
tooltipColorShade[] =
{
0,
0,
0,
0.65
};
font = "PuristaMedium";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
rows = 1;
columns = 1;
strings[] =
{
"UNCHECKED"
};
checked_strings[] =
{
"CHECKED"
};
};
class RscButtonMenu
{
idc = -1;
type = 16;
style = "0x02 + 0xC0";
default = 0;
shadow = 0;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
colorBackground[] =
{
0,
0,
0,
0.8
};
colorBackgroundFocused[] =
{
1,
1,
1,
1
};
colorBackground2[] =
{
0.75,
0.75,
0.75,
1
};
color[] =
{
1,
1,
1,
1
};
colorFocused[] =
{
0,
0,
0,
1
};
color2[] =
{
0,
0,
0,
1
};
colorText[] =
{
1,
1,
1,
1
};
colorDisabled[] =
{
1,
1,
1,
0.25
};
period = 1.2;
periodFocus = 1.2;
periodOver = 1.2;
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
tooltipColorText[] =
{
1,
1,
1,
1
};
tooltipColorBox[] =
{
1,
1,
1,
1
};
tooltipColorShade[] =
{
0,
0,
0,
0.65
};
class TextPos
{
left = "0.25 * (((safezoneW / safezoneH) min 1.2) / 40)";
top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
right = 0.005;
bottom = 0;
};
class Attributes
{
font = "PuristaLight";
color = "#E5E5E5";
align = "left";
shadow = "false";
};
class ShortcutPos
{
left = "(6.25 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005";
top = 0.005;
w = 0.0225;
h = 0.03;
};
soundEnter[] =
{
"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",
0.09,
1
};
soundPush[] =
{
"\A3\ui_f\data\sound\RscButtonMenu\soundPush",
0.09,
1
};
soundClick[] =
{
"\A3\ui_f\data\sound\RscButtonMenu\soundClick",
0.09,
1
};
soundEscape[] =
{
"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",
0.09,
1
};
};
class RscButtonMenuOK
{
idc = 1;
shortcuts[] =
{
"0x00050000 + 0",
28,
57,
156
};
default = 1;
text = "OK";
soundPush[] =
{
"\A3\ui_f\data\sound\RscButtonMenuOK\soundPush",
0.09,
1
};
};
class RscButtonMenuCancel
{
idc = 2;
shortcuts[] =
{
"0x00050000 + 1"
};
text = "Cancel";
};
class RscControlsGroup
{
class VScrollbar
{
color[] =
{
1,
1,
1,
1
};
width = 0.021;
autoScrollEnabled = 1;
};
class HScrollbar
{
color[] =
{
1,
1,
1,
1
};
height = 0.028;
};
class Controls
{
};
type = 15;
idc = -1;
x = 0;
y = 0;
w = 1;
h = 1;
shadow = 0;
style = 16;
};
IGN_AHD_Alert =
{
// should be separate function
private ["_Stxt", "_description", "_veh"];
_veh = _this select 0;
_description = _this select 1;
_Stxt = parseText format
["Warning:
%1
", _description];
playSound "alarm_industry";
[_Stxt, 0, 0.2] call BIS_fnc_dynamicText;
};
// Modifies The handling of the vehicle, by adjusting the z velocity with an offset specified by the collective modifier
IGN_AHD_modifyZVelocity =
{
private ["_veh", "_v", "_val"];
_veh = _this;
_val = _veh getVariable "IGN_AHD_engineCollectiveModifier";
_v = velocity _veh;
_veh setVelocity [_v select 0, _v select 1, (_v select 2) - _val];
};
// Updates the engine collective modifier to new value related to damage
IGN_AHD_updateEngineCollective =
{
private ["_veh"];
_veh = _this;
_veh setVariable ["IGN_AHD_engineCollectiveModifier",
(_veh getVariable "IGN_AHD_engineDamageCoefficient") * (_veh getHitPointDamage "HitEngine")];
};
// creates the engine damage effect
IGN_AHD_createEngineDamageEffect =
{
private ["_veh", "_type", "_eff", "_effect"];
_veh = _this select 0;
_type = _this select 1;
if (_type == 0) then
{
_effect = "SMOKE_MEDIUM";
}
else
{
if (_type == 1) then
{
//_effect = "test_EmptyObjectForSmoke";
_effect = "FIRE_SMALL";
};
};
// check if an effect currently exists, delete and replace with new one
if ((_veh getVariable "IGN_AHD_engineHasEffect") != 0) then
{
{deleteVehicle _x} foreach (_veh getVariable "IGN_AHD_engineEffect");
};
_eff = [getpos _veh, _effect] call BIS_fn_createFireEffect;
//_eff = _effect createVehicle (getpos _veh);
{
_x attachTo [_veh,[1.5,-1.8,-0.8]]; // attaches to right engine exhaust, simulates engine smoking
} foreach _eff; // _eff may return smoke and fire
_veh setVariable ["IGN_AHD_engineEffect", _eff];
};
IGN_AHD_deleteEngineEffect =
{
private ["_veh"];
_veh = _this;
if ((_veh getVariable "IGN_AHD_engineHasEffect") != 0) then
{
{
detach _x;
deleteVehicle _x;
} foreach (_veh getVariable "IGN_AHD_engineEffect");
_veh setVariable ["IGN_AHD_engineHasEffect", 0];
};
};
// damage a specific hitpoint component
// _veh = vehicle
// _part = HitPoint Component (not the selection name!)
// _dmg = amount of damage to apply
// calls handleDamage handler to apply appropriate effects
IGN_AHD_damagePart =
{
private ["_veh", "_dmg", "_part", "_selection", "_curDmg"];
_veh = _this select 0;
_part = _this select 1;
_dmg = _this select 2;
if ((damage _veh) == 0) then
{_veh setDamage 0.08;};
_curDmg = _veh getHitPointDamage _part;
_veh setHitPointDamage [_part, _curDmg + _dmg];
_selection = getText(configfile >> "CfgVehicles" >> (typeof _veh) >> "HitPoints" >> _part >> "name");
[_veh, _selection, _dmg] call IGN_AHD_EH_handleDamage; // call the handler
};
// Generates a random malfunction with vehicle, if preference is passed, it will have a 36.66% chance of being selected
IGN_AHD_randomMalfunction =
{
private ["_veh", "_preference", "_damageProbability", "_dmg", "_roll", "_part", "_description"];
_veh = _this select 0;
_preference = _this select 1; // number, denoting the component id
// TODO: Once Munition damage implemented, set roll to random 6
_roll = floor(random 5); // 16.66% chance for each component to be chosen
_part = "";
_dmg = 0;
// if preference is not negative (0 or greater) increase the probability for that component to be selected
if (_preference >= 0) then {
// 30% chance that the preferred component will be selected instead (+ 16.66%)
// CHANGE THIS BACK TO 20% later!!!!
if ((random 100) < 20) then
{
_roll = _preference;
};
};
// translate roll to component name
switch (_roll) do
{
// fuel
case 0:
{_part = "HitFuel"; _description = "Fuel Leak";};
// engine
case 1:
{_part = "HitEngine"; _description = "Engine Anomaly";};
// main rotar
case 2:
{_part = "HitHRotor"; _description = "Main Rotor Anomaly";};
// tail rotar
case 3:
{_part = "HitVRotor"; _description = "ATRQ Rotor Anomaly";};
// instruments
case 4:
{_part = "HitAvionics"; _description = "Power Loss";};
// munitions (UNUSED)
case 5:
{_part = "HitMissiles"; _description = "Weapon Malfunction";};
};
// determine damage severity to be applied
_damageProbability = (random 100);
// 60% chance only light damage will occur
if (_damageProbability >= 0 && _damageProbability < 60) then
{
_dmg = 0.25; //0.15
}
else
{
// 30% chance medium damage will occur
if (_damageProbability >= 60 && _damageProbability < 90) then
{
_dmg = 0.4; //0.4
}
else
{
// 10% chance heavy damage will occur
if (_damageProbability >= 90 && _damageProbability < 100) then
{
_dmg = 0.6; //0.6
};
};
};
//player sidechat format ["_part: %1 _dmg: %2", _part, _dmg];
[_veh, _description] spawn IGN_AHD_Alert;
// damage component
[_veh, _part, _dmg] call IGN_AHD_damagePart;
};
// TRY THIS FOR FIRE/SMOKE EFFECTS
BIS_fn_createFireEffect = {
private["_effect","_pos","_fire","_smoke", "_obj"];
private["_light","_brightness","_color","_ambient","_intensity","_attenuation"];
_pos = _this select 0;
_effect = _this select 1;
_fire = "";
_smoke = "";
_light = objNull;
_obj = []; // return effect
_color = [1,0.85,0.6];
_ambient = [1,0.3,0];
switch (_effect) do {
case "FIRE_SMALL" : {
_fire = "SmallDestructionFire";
_smoke = "MediumDestructionSmoke";
};
case "FIRE_MEDIUM" : {
_fire = "MediumDestructionFire";
_smoke = "MediumDestructionSmoke";
_brightness = 1.0;
_intensity = 400;
_attenuation = [0,0,0,2];
};
case "FIRE_BIG" : {
_fire = "BigDestructionFire";
_smoke = "BigDestructionSmoke";
_brightness = 1.0;
_intensity = 1600;
_attenuation = [0,0,0,1.6];
};
case "SMOKE_SMALL" : {
_smoke = "SmallDestructionSmoke";
};
case "SMOKE_MEDIUM" : {
//_smoke = "MediumSmoke";
_smoke = "MediumDestructionSmoke";
};
case "SMOKE_BIG" : {
_smoke = "BigDestructionSmoke";
};
};
if (_fire != "") then {
_eFire = "#particlesource" createVehicleLocal _pos;
_eFire setParticleClass _fire;
_eFire setPosATL _pos;
_obj = [_eFire];
};
if (_smoke != "") then {
_eSmoke = "#particlesource" createVehicleLocal _pos;
_eSmoke setParticleClass _smoke;
_eSmoke setPosATL _pos;
_obj = _obj + [_eSmoke];
};
//create lightsource
if (_effect in ["FIRE_BIG","FIRE_MEDIUM"]) then {
_pos = [_pos select 0,_pos select 1,(_pos select 2)+1];
_light = createVehicle ["#lightpoint", _pos, [], 0, "CAN_COLLIDE"];
_light setPosATL _pos;
_light setLightBrightness _brightness;
_light setLightColor _color;
_light setLightAmbient _ambient;
_light setLightIntensity _intensity;
_light setLightAttenuation _attenuation;
_light setLightDayLight false;
};
_obj; // return effect object
};// event handler code for handleDamage
IGN_AHD_EH_handleDamage =
{
private ["_veh", "_sel", "_dmgTaken"];
_veh = _this select 0; // assigned handler to this object
_sel = _this select 1; // selection name that was damaged (string)
_dmgTaken = _this select 2; // damage taken
if (_dmgTaken < 0.1) exitWith {_dmgTaken;};
if (_sel == (_veh getVariable "IGN_AHD_engine")) exitWith
{
_veh call IGN_AHD_updateEngineCollective; // update the collective offset
if (!(_veh getVariable "IGN_AHD_isEngineDamaged")) then
{
_veh setVariable ["IGN_AHD_isEngineDamaged", true];
// spawn this handling effect
_veh spawn IGN_AHD_T_modifyHandling;
};
if ( (_veh getHitPointDamage "HitEngine") >= 0.7 && (_veh getVariable "IGN_AHD_engineHasEffect") != 2) then
{
[_veh, 1] call IGN_AHD_createEngineDamageEffect;
_veh setVariable ["IGN_AHD_engineHasEffect", 2];
}
else
{
if ( (_veh getHitPointDamage "HitEngine") >= 0.38 && (_veh getVariable "IGN_AHD_engineHasEffect") == 0) then
{
[_veh, 0] call IGN_AHD_createEngineDamageEffect;
_veh setVariable ["IGN_AHD_engineHasEffect", 1];
};
};
_dmgTaken;
};
_dmgTaken;
};
IGN_AHD_handleRepair =
{
private ["_veh", "_dmg"];
_veh = _this;
if (_veh getVariable "IGN_AHD_isEngineDamaged") then
{
_veh setVariable ["IGN_AHD_isEngineDamaged", false];
};
_veh setVariable ["IGN_AHD_runningTime", 0];
_veh setVariable ["IGN_AHD_interval", 0];
_veh call IGN_AHD_updateEngineCollective;
_veh call IGN_AHD_deleteEngineEffect;
};/*
IGN Authentic Helicopter Damage
Gives more realistic damage to helicopters when receiving damage
*/
/*
Helicopter hitpoints
"tail rotor" - anti torque rotar
"main rotor" - main rotar
"motor" - engines
"munice" - munitions?
"karoserie" - radar?
// better alternative
getText(configfile >> "CfgVehicles" >> "O_Heli_Attack_02_F" >> "HitPoints" >> "HitFuel" >> "name") // fuel
getText(configfile >> "CfgVehicles" >> "O_Heli_Attack_02_F" >> "HitPoints" >> "HitAvionics" >> "name") // instruments
getText(configfile >> "CfgVehicles" >> "O_Heli_Attack_02_F" >> "HitPoints" >> "HitEngine" >> "name") // engines
getText(configfile >> "CfgVehicles" >> "O_Heli_Attack_02_F" >> "HitPoints" >> "HitHRotor" >> "name") // main rotar
getText(configfile >> "CfgVehicles" >> "O_Heli_Attack_02_F" >> "HitPoints" >> "HitMissiles" >> "name") // all munitions (not working)
getText(configfile >> "CfgVehicles" >> "O_Heli_Attack_02_F" >> "HitPoints" >> "HitVRotor" >> "name") // tail rotar
// Engine Damage Visual
EF_fnc_createEffect
smokeParticle attachTo [(vehicle player),[2,-3,-1]]; // attaches to right engine exhaust, simulates engine smoking
coefficient: 1.2222 // multiply this by damage, returns engineCollectiveModifier
*/
private ["_vehicle", "_isEngineDamaged", "_isMissileDamaged", "_chance", "_preference"];
_vehicle = _this select 0;
_chance = _this select 1;
_preference = _this select 2;
if (_chance < 0) exitWith{}; // disables mechanical damage if 'none' was selected
_isEngineDamaged = false;
if ((_vehicle getHitPointDamage "HitEngine") > 0.1) then
{
_isEngineDamaged = true;
};
_isMissileDamaged = false;
if ((_vehicle getHitPointDamage "HitMissiles") > 0.1) then
{
_isMissileDamaged = true;
};
_vehicle setVariable ["IGN_AHD_malfunctionRunning", false];
_vehicle setVariable ["IGN_AHD_runningTime", 0];
_vehicle setVariable ["IGN_AHD_interval", 0];
/*
_vehicle setVariable ["IGN_AHD_isMissileDamaged", _isMissileDamaged];
_vehicle setVariable ["IGN_AHD_missileDamage", _vehicle getHitPointDamage "HitMissiles"];
_vehicle setVariable ["IGN_AHD_missile", getText(configfile >> "CfgVehicles" >> (typeof _vehicle) >> "HitPoints" >> "HitMissiles" >> "name")];
*/
_vehicle setVariable ["IGN_AHD_isEngineDamaged", _isEngineDamaged];
_vehicle setVariable ["IGN_AHD_engineDamage", _vehicle getHitPointDamage "HitEngine"];
_vehicle setVariable ["IGN_AHD_engineDamageCoefficient", 1.1222]; // multiply this by damage, returns engineCollectiveModifier
_vehicle setVariable ["IGN_AHD_engineCollectiveModifier", 0];
_vehicle setVariable ["IGN_AHD_engine", getText(configfile >> "CfgVehicles" >> (typeof _vehicle) >> "HitPoints" >> "HitEngine" >> "name")];
_vehicle setVariable ["IGN_AHD_engineEffect", objNull];
_vehicle setVariable ["IGN_AHD_engineHasEffect", 0];
/* DEBUG PURPOSES
_vehicle spawn
{
while {alive _this} do
{
hint str (velocity _this);
sleep 0.2;
};
};
*/
// add event handlers
_vehicle addEventHandler ["handleDamage", IGN_AHD_EH_HandleDamage];
_vehicle addEventHandler ["Engine",
{
private ["_veh"];
_veh = _this select 0;
if (_veh getVariable "IGN_AHD_isEngineDamaged") then
{
if (_this select 1) then
{
_veh spawn IGN_AHD_T_ModifyHandling;
[_veh, (_veh getVariable "IGN_AHD_engine"), (_veh getHitPointDamage "HitEngine")] call IGN_AHD_EH_HandleDamage;
};
};
}];
// chance
_vehicle setVariable ["IGN_AHD_malfunctionRunning", true];
[_vehicle, _chance, _preference] spawn IGN_AHD_T_malfunction;
call compile preprocessfilelinenumbers "IGN_AHD\functions.sqf";
call compile preprocessfilelinenumbers "IGN_AHD\threads.sqf";
call compile preprocessfilelinenumbers "IGN_AHD\handlers.sqf";RIFFv1 WAVEfmt "V D dataR1 ^ * d T } Q s{ur J=o
e\ |7N q h $ l ~ 9 A%# | S + c l&3 +G9 / e > \ 8 msoG _q o^ "(qt 'O8Uqt=PWMEL=/ =1
jZQ4
i\U Z_+
O(
iL v# iX
b6l
T%
EO
g1~0Mٱz}a I ;
6YNX1
w 05_- y,_DHX
'_`ݠYQۣav |H0
*([ (%[ fUtۺ__~yrH^{")7
r f)pk
_ C eQC< ,
@
fM GI L6֬Jd/Ne5
@&
DE "Q w1ڣNeR
N
j%"
"6^א}:ר:
*u#s J7ml,ѥמkݝڂ>8+
=~ v& @VJ3IیpU
CZ$ i
`h? NkP-ܸN/7
Lt:
o
$
"b
98]K\N};
a'
769&
5
` #
'
tus~ߊC& M
R *)Mx< qo
kT9
g[ \y|oEi"
x/~C
[ `S
)QԄΌR8$4_c
0di_
Vn2t?@շp$v d
C
q# wB Ԭv(
Ds2 &F4Zs L$v^
جbߥ`
|#oRL[\9H
RwGW
T4v+|~ydz ! <nrc)&q߄Z 8Eq)Ri
Bj R*_0Rxm?
Ob$
0:
V>%l܄u`
`-9~"
) I e> H3x 8WEQS LqM
l^E
1g[i #zJցޣ