├── EVO
├── fn_repair.sqf
├── fn_rtoffline.sqf
├── fn_globalSideChat.sqf
├── fn_doArtyFire.sqf
├── fn_endgame.sqf
├── fn_basicRespawn.sqf
├── fn_nearestTownName.sqf
├── fn_demoOnly.sqf
├── fn_sendToServer.sqf
├── fn_getNearest.sqf
├── fn_sendToHC.sqf
├── fn_playersNearby.sqf
├── fn_wrapUp.sqf
├── fn_handleScore.sqf
├── fn_protectBase.sqf
├── fn_spawnGroup.sqf
├── fn_healMen.sqf
├── fn_trackAir.sqf
├── fn_spawnVehicle.sqf
├── fn_paraInsert.sqf
├── fn_rearm.sqf
├── fn_createSniper.sqf
├── fn_supportPoints.sqf
├── fn_buildMagazineArray.sqf
├── fn_getWeaponInfo.sqf
├── fn_hasLOS.sqf
├── fn_getMagazineInfo.sqf
├── fn_gridMarkers.sqf
├── fn_getVehicleInfo.sqf
├── fn_capture.sqf
├── fn_createMinefield.sqf
├── fn_amb.sqf
├── fn_deployMplayer.sqf
├── fn_surrender.sqf
├── fn_newTargetTasks.sqf
├── fn_deployEplayer.sqf
├── fn_createComposition.sqf
├── fn_supportManager.sqf
├── fn_paradrop.sqf
├── fn_support_uav.sqf
├── fn_pickSideMission.sqf
├── fn_support_cas.sqf
├── fn_calculateDelay.sqf
├── fn_respawnRepair.sqf
├── fn_sm_aaHunt.sqf
├── fn_buildAmmoCrate.sqf
├── fn_pinit.sqf
├── fn_support_arty.sqf
├── fn_support_rocket.sqf
├── fn_support_mortar.sqf
└── fn_support_resupply.sqf
├── Vcom
├── Functions
│ └── VCM_Functions
│ │ ├── fn_vehiclecommandeer.sqf
│ │ ├── fn_TransportVehicle.sqf
│ │ ├── fn_isFlatEmpty.sqf
│ │ ├── fn_RMedics.sqf
│ │ ├── fn_Classname.sqf
│ │ ├── fn_SquadExc.sqf
│ │ ├── fn_HealSelf.sqf
│ │ ├── fn_EnemyArray.sqf
│ │ ├── fn_FriendlyArray.sqf
│ │ ├── fn_KnowAbout.sqf
│ │ ├── fn_WyptChk.sqf
│ │ ├── fn_IsTransport.sqf
│ │ ├── fn_KitChk.sqf
│ │ ├── fn_ActRearm.sqf
│ │ ├── fn_ClstEmy.sqf
│ │ ├── fn_EmptyStatic.sqf
│ │ ├── fn_ArtyManage.sqf
│ │ ├── fn_MedicalHandler.sqf
│ │ ├── fn_MedicHeal.sqf
│ │ ├── fn_MineMonitor.sqf
│ │ ├── fn_BoxNrst.sqf
│ │ ├── fn_CheckArty.sqf
│ │ ├── fn_ForceMove.sqf
│ │ ├── fn_HasMine.sqf
│ │ ├── fn_ClearBuilding.sqf
│ │ ├── fn_PackStatic.sqf
│ │ ├── fn_AIHIT.sqf
│ │ ├── fn_GarrisonLight.sqf
│ │ ├── fn_VehicleMove.sqf
│ │ ├── fn_VehicleCheck.sqf
│ │ ├── fn_ClstObj.sqf
│ │ ├── fn_RStatics.sqf
│ │ ├── fn_RearmSelf.sqf
│ │ ├── fn_IRCHECK.sqf
│ │ ├── fn_HearingAids.sqf
│ │ ├── fn_Garrison.sqf
│ │ ├── fn_Heights.sqf
│ │ ├── fn_ArmStatics.sqf
│ │ ├── Playground.sqf
│ │ ├── fn_FrmChnge.sqf
│ │ ├── fn_SatchelPlant.sqf
│ │ └── fn_MinePlant.sqf
├── VcomInit.sqf
└── cfgFunctions.hpp
├── .DS_Store
├── img
├── col.paa
├── cpt.paa
├── evo.paa
├── ltn.paa
├── mjr.paa
├── pvt.paa
├── sgt.paa
└── corp.paa
├── mission.sqm
├── Sound
├── Recall.ogg
├── Paycall.ogg
├── goodjob.ogg
└── incoming.ogg
├── ATM_airdrop
├── data
│ ├── vent.ogg
│ ├── vent2.ogg
│ └── parachute.ogg
├── atm_chem_off.sqf
├── atm_chem_on.sqf
└── atm_airdrop.sqf
├── bon_recruit_units
├── dialog
│ ├── ui_background_controlers_ca.paa
│ ├── definitions.sqf
│ └── recruitment.hpp
├── open_dialog.sqf
├── dismiss.sqf
├── recruitable_units_static.sqf
├── init_newunit.sqf
├── init.sqf
├── build_unitlist.sqf
├── recruitable_units.sqf
├── unit_lifecycle.fsm
└── recruit.sqf
├── CHVD
├── fn_selTerrainQuality.sqf
├── CfgFunctions.hpp
├── fn_onLBSelChanged.sqf
├── fn_updateTerrain.sqf
├── fn_onCheckedChanged.sqf
├── fn_onEBterrainInput.sqf
├── fn_localize.sqf
├── fn_updateSettings.sqf
├── fn_init.sqf
├── fn_openDialog.sqf
├── fn_addonInit.sqf
├── fn_onSliderChange.sqf
└── fn_onEBinput.sqf
├── scripts
├── intro.sqf
└── bonus
│ └── UPSMON_Anim.sqf
├── NSLVR
├── actionMP.sqf
└── abandonMarker.sqf
├── Comps
├── radiotower.sqf
├── aa.sqf
├── mortar.sqf
├── mash.sqf
├── mortar_50.sqf
├── mortar_50_2.sqf
├── radiotower_griffz.sqf
├── mortar_50_tower.sqf
└── farp.sqf
├── LICENSE
├── stringtable.xml
└── README.md
/EVO/fn_repair.sqf:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_vehiclecommandeer.sqf:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/.DS_Store
--------------------------------------------------------------------------------
/img/col.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/img/col.paa
--------------------------------------------------------------------------------
/img/cpt.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/img/cpt.paa
--------------------------------------------------------------------------------
/img/evo.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/img/evo.paa
--------------------------------------------------------------------------------
/img/ltn.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/img/ltn.paa
--------------------------------------------------------------------------------
/img/mjr.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/img/mjr.paa
--------------------------------------------------------------------------------
/img/pvt.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/img/pvt.paa
--------------------------------------------------------------------------------
/img/sgt.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/img/sgt.paa
--------------------------------------------------------------------------------
/mission.sqm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/mission.sqm
--------------------------------------------------------------------------------
/img/corp.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/img/corp.paa
--------------------------------------------------------------------------------
/Sound/Recall.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/Sound/Recall.ogg
--------------------------------------------------------------------------------
/Sound/Paycall.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/Sound/Paycall.ogg
--------------------------------------------------------------------------------
/Sound/goodjob.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/Sound/goodjob.ogg
--------------------------------------------------------------------------------
/Sound/incoming.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/Sound/incoming.ogg
--------------------------------------------------------------------------------
/ATM_airdrop/data/vent.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/ATM_airdrop/data/vent.ogg
--------------------------------------------------------------------------------
/ATM_airdrop/data/vent2.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/ATM_airdrop/data/vent2.ogg
--------------------------------------------------------------------------------
/ATM_airdrop/data/parachute.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/ATM_airdrop/data/parachute.ogg
--------------------------------------------------------------------------------
/EVO/fn_rtoffline.sqf:
--------------------------------------------------------------------------------
1 | private ["_RT","_killer"];
2 |
3 |
4 | _RT = _this select 0;
5 | _killer = _this select 1;
6 | RTonline = false;
7 | publicVariable "RTonline";
--------------------------------------------------------------------------------
/bon_recruit_units/dialog/ui_background_controlers_ca.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Kolmain/Evolution-A3/HEAD/bon_recruit_units/dialog/ui_background_controlers_ca.paa
--------------------------------------------------------------------------------
/EVO/fn_globalSideChat.sqf:
--------------------------------------------------------------------------------
1 | [[[_this select 0, _this select 1], {
2 | (_this select 0) sideChat (_this select 1);
3 | (_this select 0) sideRadio "squelch";
4 | }], "BIS_fnc_spawn", true] call BIS_fnc_MP;
--------------------------------------------------------------------------------
/bon_recruit_units/open_dialog.sqf:
--------------------------------------------------------------------------------
1 | [["Gamemode","recruiting"], 15, "", 35, "", true, true, true, true] call BIS_fnc_advHint;
2 | bon_recruit_barracks = _this select 0;
3 | createDialog "RecruitUnitsDialog";
--------------------------------------------------------------------------------
/bon_recruit_units/dialog/definitions.sqf:
--------------------------------------------------------------------------------
1 | #define BON_RECRUITING_DIALOG 20001
2 | #define BON_RECRUITING_BCKGRND 20002
3 | #define BON_RECRUITING_TITLE 20003
4 | #define BON_RECRUITING_UNITLIST 20004
5 | #define BON_RECRUITING_QUEUE 20005
--------------------------------------------------------------------------------
/EVO/fn_doArtyFire.sqf:
--------------------------------------------------------------------------------
1 | _gun = _this select 0;
2 | _pos = _this select 1;
3 | _rounds = _this select 2;
4 |
5 | _gun setVehicleAmmoDef 1;
6 | _magazine = currentMagazine _gun;
7 | _gun doArtilleryFire [_pos, _magazine, _rounds];
8 | true;
9 |
--------------------------------------------------------------------------------
/EVO/fn_endgame.sqf:
--------------------------------------------------------------------------------
1 | private ["_loop"];
2 | _loop = true;
3 | while {_loop} do {
4 | sleep 300;
5 | if (targetCounter == totalTargets) then {
6 | _loop = false;
7 | ["complete", true, true] call BIS_fnc_endMission;
8 | };
9 | };
10 |
--------------------------------------------------------------------------------
/bon_recruit_units/dismiss.sqf:
--------------------------------------------------------------------------------
1 | _unit = _this select 0;
2 |
3 | _unit action ["eject",vehicle _unit];
4 | sleep 2;
5 |
6 | hint format["%1 %2 has been dismissed",getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayname"),name _unit];
7 | deleteVehicle _unit;
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_TransportVehicle.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 | Generates flanking waypoints.
6 |
7 | Parameter(s):
8 | 0: GROUP
9 | 1: LEADER
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | params ["_grp","_leader"]
16 |
--------------------------------------------------------------------------------
/EVO/fn_basicRespawn.sqf:
--------------------------------------------------------------------------------
1 | _vehicle = [_this, 0, objNull] call BIS_fnc_param;
2 | clearWeaponCargoGlobal _vehicle;
3 | clearMagazineCargoGlobal _vehicle;
4 | clearBackpackCargoGlobal _vehicle;
5 | clearItemCargoGlobal _vehicle;
6 | _nul = [_vehicle, 2, 200, 2, true] execVM "NSLVR\vehrespawn.sqf";
--------------------------------------------------------------------------------
/ATM_airdrop/atm_chem_off.sqf:
--------------------------------------------------------------------------------
1 | _target = _this select 0;
2 | _caller = _this select 1;
3 | _id = _this select 2;
4 |
5 | _ltcolor = (_this select 3) select 0;
6 |
7 | _caller removeAction _id;
8 |
9 |
10 |
11 | deletevehicle (_caller getvariable "lgtarray"); _caller setvariable ["lgtarray",nil,true];
--------------------------------------------------------------------------------
/EVO/fn_nearestTownName.sqf:
--------------------------------------------------------------------------------
1 | private ["_closesttown","_town_name","_town_pos"];
2 | _closesttown = (nearestLocations [(_this select 0),["NameCityCapital","NameCity","NameVillage"],10000]) select 0;
3 |
4 | _town_name = text _closesttown;
5 | _town_pos = position _closesttown;
6 |
7 | [_town_name, _town_pos];
8 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_isFlatEmpty.sqf:
--------------------------------------------------------------------------------
1 | params ["_pos","_dist", "_params"];
2 | _pos = _pos findEmptyPosition [0,_dist];
3 | if (_pos isEqualTo []) exitWith {_pos};
4 | _params =+ _params;
5 | _params set [0, -1];
6 | _pos = _pos isFlatEmpty _params;
7 | if (_pos isEqualTo []) exitWith {_pos};
8 | _pos
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_RMedics.sqf:
--------------------------------------------------------------------------------
1 | //Function to find all medics within a group.
2 | private _MList = [];
3 | {
4 | if (isNull objectParent _x) then
5 | {
6 | if (_x getUnitTrait "Medic") then
7 | {
8 | _MList pushBack _x;
9 | };
10 | };
11 | true;
12 | } count (units _this);
13 |
14 | _MList
--------------------------------------------------------------------------------
/EVO/fn_demoOnly.sqf:
--------------------------------------------------------------------------------
1 | private ["_radio","_tower","_projectile"];
2 |
3 | _radio = _this select 0;
4 |
5 | _radio addEventHandler [ "HandleDamage", {
6 | _tower = _this select 0;
7 | _projectile = _this select 4;
8 |
9 | if !( _projectile isKindOf "PipeBombBase" ) then {
10 | damage _tower;
11 | };
12 | }];
13 |
--------------------------------------------------------------------------------
/EVO/fn_sendToServer.sqf:
--------------------------------------------------------------------------------
1 | private ["_hc","_unit","_hcID"];
2 |
3 | if (!isServer || !isMultiplayer || isNull _hc) exitWith {};
4 |
5 | waitUntil {time > 2};
6 |
7 | _unit = this select 0;
8 | _hc = server;
9 |
10 | _hcID = owner server;
11 |
12 | { _x setOwner _hcID; } count units group _unit;
13 |
14 | group _unit setGroupOwner _hcID;
--------------------------------------------------------------------------------
/bon_recruit_units/recruitable_units_static.sqf:
--------------------------------------------------------------------------------
1 | //bon_recruit_recruitableunits = ["B_Soldier_F"];
2 |
3 | bon_recruit_recruitableunits = ["B_Soldier_F","B_Soldier_GL_F","B_soldier_AR_F","B_soldier_M_F","B_soldier_LAT_F","B_medic_F","B_soldier_repair_F","B_soldier_exp_F","B_Helipilot_F","B_engineer_F","B_soldier_AT_F","B_soldier_AA_F","B_helicrew_F"];
4 |
--------------------------------------------------------------------------------
/EVO/fn_getNearest.sqf:
--------------------------------------------------------------------------------
1 | private ["_pos","_list","_closest","_closestdist"];
2 |
3 | _pos = _this select 0;
4 | _list = _this select 1;
5 | _closest = objNull;
6 | _closestdist = 100000;
7 | {
8 | if (_x distance _pos < _closestdist) then {
9 | _closest = _x;
10 | _closestdist = _x distance _pos;
11 | };
12 | } forEach _list;
13 |
14 | _closest;
--------------------------------------------------------------------------------
/EVO/fn_sendToHC.sqf:
--------------------------------------------------------------------------------
1 | private ["_hc","_unit","_hcID"];
2 |
3 |
4 | if (!isServer || !isMultiplayer || isNull _hc) exitWith {};
5 |
6 | waitUntil {time > 2};
7 |
8 | _unit = this select 0;
9 | _hc = headlessClient;
10 |
11 | _hcID = owner headlessClient;
12 |
13 | { _x setOwner _hcID; } count units group _unit;
14 |
15 | group _unit setGroupOwner _hcID;
--------------------------------------------------------------------------------
/EVO/fn_playersNearby.sqf:
--------------------------------------------------------------------------------
1 | private ["_object","_distance","_return","_players"];
2 | _object = _this select 0;
3 | _distance = _this select 1;
4 | _return = false;
5 | _players = [];
6 | {
7 | if (_x distance _object < _distance) then {
8 | _players pushback _x;
9 | };
10 | } forEach ([] call CBA_fnc_players);
11 |
12 | if (count _players > 0) then {
13 | _return = true;
14 | };
15 |
16 | _return;
17 |
--------------------------------------------------------------------------------
/CHVD/fn_selTerrainQuality.sqf:
--------------------------------------------------------------------------------
1 | private ["_output"];
2 | _terrainGrid = _this select 0;
3 | switch (true) do {
4 | case (_terrainGrid >= 49): {
5 | _output = 0;
6 | };
7 | case (_terrainGrid >= 25): {
8 | _output = 1;
9 | };
10 | case (_terrainGrid >= 12.5): {
11 | _output = 2;
12 | };
13 | case (_terrainGrid >= 3.125): {
14 | _output = 3;
15 | };
16 | default {
17 | _output = 0;
18 | };
19 | };
20 | _output
--------------------------------------------------------------------------------
/EVO/fn_wrapUp.sqf:
--------------------------------------------------------------------------------
1 | private ["_obj","_loop","_players","_veh"];
2 | _obj = _this select 0;
3 | _loop = true;
4 | while {_loop} do {
5 | _players = [_obj, 1000] call EVO_fnc_playersNearby;
6 | if (!_players || !(alive _obj)) then {
7 | _loop = false;
8 | };
9 | };
10 |
11 | _veh = vehicle _obj;
12 | sleep 30;
13 | deleteVehicle _obj;
14 | {
15 | deleteVehicle _x;
16 | } forEach crew _veh;
17 | deleteVehicle _veh;
--------------------------------------------------------------------------------
/CHVD/CfgFunctions.hpp:
--------------------------------------------------------------------------------
1 | class CHVD
2 | {
3 | tag = "CHVD";
4 | class script
5 | {
6 | file = "CHVD";
7 | class onCheckedChanged {};
8 | class onSliderChange {};
9 | class onLBSelChanged {};
10 | class onEBinput {};
11 | class onEBterrainInput {};
12 | class selTerrainQuality {};
13 | class updateTerrain {};
14 | class updateSettings {};
15 | class openDialog {};
16 | class localize {};
17 | class init {postInit = 1;};
18 | };
19 | };
--------------------------------------------------------------------------------
/EVO/fn_handleScore.sqf:
--------------------------------------------------------------------------------
1 | _player = _this select 0;
2 | _source = _this select 1;
3 | _scoreToAdd = _this select 2;
4 | _score = (score _player) + _scoreToAdd;
5 | if (vehicle _player != _player && isPlayer driver vehicle _player) then {
6 | [driver vehicle _player, _scoreToAdd] call BIS_fnc_addScore;
7 | };
8 | if (vehicle _player != _player && isPlayer commander vehicle _player) then {
9 | [commander vehicle _player, _scoreToAdd] call BIS_fnc_addScore;
10 | };
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_Classname.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: BIS, modified by Genesis
4 |
5 | Description:
6 | Check if string is vehicle class
7 |
8 | Parameter(s):
9 | 0: STRING - String to check
10 |
11 | Returns:
12 | STRING
13 | */
14 |
15 | params ["_name"];
16 | private _return = "NotAClass";
17 |
18 | if ((typeName _name) isEqualTo "STRING") then
19 | {
20 | _return = (configFile >> "cfgVehicles" >> _name);
21 | };
22 |
23 | _return
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_SquadExc.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | This function will execute the appropriate code and FSM's onto a group.
7 | These FSM's will run until the group is cleaned. They will be designed to halt when the group is empty or all units are dead.
8 |
9 | Parameter(s):
10 | 0: GROUP
11 |
12 | Returns:
13 | NOTHING
14 | */
15 |
16 | _this spawn VCM_fnc_SQUADBEH;
17 | VcmAI_ActiveList pushback _this;
--------------------------------------------------------------------------------
/scripts/intro.sqf:
--------------------------------------------------------------------------------
1 |
2 | _colorWest = WEST call BIS_fnc_sideColor;
3 | _markers = [["\A3\ui_f\data\map\markers\nato\b_hq.paa", _colorWest, getPos spawnBuilding, 1, 1, 0, "HQ", 0]];
4 |
5 | [
6 | getPos spawnBuilding,
7 | "US Base", // SITREP text
8 | 100, // altitude
9 | 100, // radius
10 | 120, // viewing angle
11 | 1, // movement
12 | _markers
13 | ] call BIS_fnc_establishingShot;
14 |
15 | intro = false;
16 |
17 |
--------------------------------------------------------------------------------
/NSLVR/actionMP.sqf:
--------------------------------------------------------------------------------
1 | _verb = _this select 0;
2 | _veh = _this select 1;
3 |
4 | if (_verb == "add") then {
5 | _NSLVR_actionID = _veh addAction ["set NSLVR position", { (_this select 0) setVariable ["NSLVR_respawnPos", [getPosATL (_this select 0), getDir (_this select 0)], true] },[],0,true,true,"","_this == driver _target"];
6 | _veh setVariable ["NSLVR_actionID", _NSLVR_actionID];
7 | };
8 |
9 | if (_verb == "remove") then {
10 | _veh removeAction (_veh getVariable "NSLVR_actionID");
11 | };
--------------------------------------------------------------------------------
/EVO/fn_protectBase.sqf:
--------------------------------------------------------------------------------
1 | private ["_list","_ent"];
2 | while {true} do {
3 | sleep 30;
4 | if (!(currentSideMission == "baseDef")) then {
5 | _list = (getPos spawnBuilding) nearEntities [["Man", "Car", "Motorcycle", "Tank"], 600];
6 | {
7 | if (side _x == EAST && !isPlayer leader group _x) then {
8 | [_x] spawn {
9 | _ent = _this select 0;
10 | _ent setDamage 1;
11 | sleep 30;
12 | deleteVehicle _ent;
13 | };
14 | };
15 | } forEach _list;
16 | };
17 | };
--------------------------------------------------------------------------------
/EVO/fn_spawnGroup.sqf:
--------------------------------------------------------------------------------
1 | private ["_grp"];
2 | _grp = _this call BIS_fnc_spawnGroup;
3 | {
4 | _x setSkill ["spotdistance", 0.7];
5 | _x setSkill ["aimingspeed", 0.2];
6 | _x setSkill ["aimingaccuracy", 0.3];
7 | _x setSkill ["aimingshake", 0.15];
8 | _x setSkill ["spottime", 0.4];
9 | _x setSkill ["commanding", 0.8];
10 | _x setSkill ["general", 0.8];
11 | _x addPrimaryWeaponItem "acc_flashlight";
12 | if (HCconnected) then {
13 | handle = [_x] call EVO_fnc_sendToHC;
14 | };
15 | } foreach units _grp;
16 |
17 | _grp;
18 |
19 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_HealSelf.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Makes a unit heal itself.
7 |
8 | Parameter(s):
9 | 0: OBJECT - Unit
10 |
11 | Returns:
12 | BOOLEAN - If unit able to treat self: TRUE, else FALSE
13 | */
14 |
15 | private _CanHeal = false;
16 |
17 | if (alive _this && {"FirstAidKit" in (items _this)}) then
18 | {
19 | _this action ["HealSoldierSelf", _this];
20 | _CanHeal = true;
21 | if VCM_DEBUG then {systemChat format ["%1 healing self", _this]};
22 | };
23 |
24 | _CanHeal
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_EnemyArray.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Return array containing all enemies of unit.
7 |
8 | Parameter(s):
9 | 0: OBJECT - Units enemy to this unit will be added to return array.
10 |
11 | Returns:
12 | ARRAY
13 | */
14 |
15 | private _unitSide = side (group _this);
16 | private _targetSide = "";
17 | private _array1 = [];
18 | {
19 | _targetSide = side _x;
20 | if ([_unitSide, _targetSide] call BIS_fnc_sideIsEnemy) then {_array1 pushback _x;};
21 |
22 | } forEach allUnits;
23 | _array1
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_FriendlyArray.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Returns an array containing all of units friendlies.
7 |
8 | Parameter(s):
9 | 0: OBJECT - object whose side to check for friendlies
10 |
11 | Returns:
12 | ARRAY
13 | */
14 |
15 | private _UnitSide = side (group _this);
16 |
17 | private _Array1 = [];
18 | {
19 | private _TargetSide = side _x;
20 | if (!([_UnitSide, _TargetSide] call BIS_fnc_sideIsEnemy) && {!(_x in (units (group _this)))} && {alive _x}) then {_Array1 pushback _x;};
21 | } forEach allUnits;
22 | _Array1
--------------------------------------------------------------------------------
/EVO/fn_healMen.sqf:
--------------------------------------------------------------------------------
1 | private ["_pos","_radius","_nearMen","_mash","_damage"];
2 | _pos = _this select 0;
3 | _radius = _this select 1;
4 | _pts = 0;
5 | _nearMen = [];
6 | _mash = nearestObject [_pos, "MASH_EP1"];
7 | while {alive _mash} do {
8 | {
9 | if (alive _x && side _x == west && damage _x != 0) then {
10 | _damage = damage _x;
11 | _damage = _damage - 0.01;
12 | if (_damage < 0) then {
13 | _damage = 0;
14 | };
15 | _x setDamage _damage;
16 | };
17 | } forEach ((getPos _mash) nearEntities [["Man"], _radius]);
18 | sleep 2;
19 | };
20 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_KnowAbout.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | This function will edit the knowledge of a unit for a specific side.
7 |
8 | Parameter(s):
9 | 0: ARRAY
10 | 1: OBJECT - Unit that will be revealed to above array
11 | 2: NUMBER - Knowledge value to add
12 |
13 | Returns:
14 | NOTHING
15 | */
16 |
17 | params ["_snda","_unit","_toAdd"];
18 | if (isNil "_toAdd") then {_toAdd = 0.25};
19 |
20 | {
21 | if (local _x) then
22 | {
23 | private _kv = _x knowsAbout _unit;
24 | _x reveal [_unit,(_kv + _toAdd)];
25 | };
26 | } foreach _snda;
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_WyptChk.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | This will tell our scripts if certain waypoints are set or not
7 |
8 | Parameter(s):
9 | 0: GROUP
10 |
11 | Returns:
12 | ARRAY
13 | */
14 |
15 | _grp = _this;
16 |
17 | _waypointsToIncriminate = [];
18 |
19 | _index = currentWaypoint _grp;
20 | _waypointIs = waypointType [_grp,_index];
21 | {
22 | if (_waypointIs isEqualTo _x) then {_waypointsToIncriminate pushback _x};
23 | } foreach ["HOLD","GUARD","UNLOAD","LOAD","TR UNLOAD","SENTRY","DESTROY"];
24 |
25 |
26 |
27 | _waypointsToIncriminate
28 |
29 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_IsTransport.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 | Returns if a vehicle is a transport vehicle. Will only consider vehicles "transport" vehicles IF they have AI in cargo slots.
6 |
7 | Parameter(s):
8 | 0: GROUP
9 |
10 | Returns:
11 | 0: BOOL - true = transport vehicle, false = normal vehicle
12 | */
13 |
14 |
15 | private _TransportVehicle = false;
16 |
17 | {
18 | {
19 | if (_x select 1 isEqualTo "cargo") exitWith
20 | {
21 | _TransportVehicle = true;
22 | };
23 | } foreach (fullcrew [_x,"cargo",false]);
24 | } foreach _this;
25 |
26 |
27 | _TransportVehicle
--------------------------------------------------------------------------------
/EVO/fn_trackAir.sqf:
--------------------------------------------------------------------------------
1 | _vehicle = [_this, 0, objNull] call BIS_fnc_param;
2 | if (_vehicle == objNull) exitWith {};
3 | if (isNil ("casMarker")) then {
4 | casMarker = createMarker ["casMarker", position _vehicle];
5 | "casMarker" setMarkerShape "ICON";
6 | "casMarker" setMarkerColor "ColorOPFOR";
7 | "casMarker" setMarkerType "o_plane";
8 | "casMarker" setMarkerDir 0;
9 | "casMarker" setMarkerPos (getPos _vehicle);
10 | "casMarker" setMarkerText "OPFOR CAS";
11 | publicVariable "casMarker";
12 | };
13 | while {alive _vehicle && canMove _vehicle} do {
14 | "casMarker" setMarkerPos (getPos _vehicle);
15 | sleep 1;
16 | };
17 |
18 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_KitChk.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | This function will handle assigning proper variables to units, while returning appropriate arrays.
7 |
8 | Parameter(s):
9 | 0: GROUP - Group to check
10 |
11 | Returns:
12 | ARRAY - Format [_medicArray, _itemList]
13 | */
14 |
15 | //First let's find who the medics are in the team and return that list.
16 | private _medicArray = _this call VCM_fnc_RMedics; //Returns _mList
17 |
18 | private _itemList = _this call VCM_fnc_RStatics; //Returns [_staticList,_satchelList,_mineList];
19 |
20 | private _rtrnList = [_medicArray,_itemList];
21 | _rtrnList
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_ActRearm.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Ensures AI reaches their rearm objective.
7 |
8 | Parameter(s):
9 | 0: OBJECT - the unit to rearm
10 | 1: ARRAY - location to rearm at.
11 |
12 | Returns:
13 | NOTHING
14 |
15 | Example:
16 | [unit1, getPos deadUnit] call VCM_fnc_ActRearm;
17 | */
18 |
19 | params ["_unitToRearm","_rearmLocation"];
20 |
21 | while {(_unitToRearm distance _rearmLocation) > 5 && {(_unitToRearm distance _rearmLocation) < 200}} do
22 | {
23 | _unitToRearm domove (getpos _rearmLocation);
24 | sleep 4;
25 | };
26 |
27 | _unitToRearm action ["rearm", _rearmLocation];
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_ClstEmy.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis, tweaked by Freddo
4 |
5 | Description:
6 | Finds closest known enemy to unit
7 |
8 | Parameter(s):
9 | 0: OBJECT - Unit to search from
10 |
11 | Returns:
12 | OBJECT
13 | if none found, ARRAY
14 | */
15 |
16 | private _unitSide = (side _this);
17 | private _a1 = [];
18 | {
19 | private _targetSide = side _x;
20 | if ([_unitSide, _targetSide] call BIS_fnc_sideIsEnemy && {!(vehicle _X isKindOf "Air")}) then {_a1 pushback _x;};
21 | } forEach allUnits;
22 |
23 | private _rtrn = [_a1,_this,true,"1"] call VCM_fnc_ClstObj;
24 | if (isNil "_rtrn") then {_rtrn = [0,0,0]};
25 |
26 | _rtrn
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_EmptyStatic.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Check if there are statics nearby
7 |
8 | Parameter(s):
9 | 0: GROUP - Group to search from
10 | 1 (Optional): NUMBER - Search distance
11 |
12 | Returns:
13 | BOOLEAN
14 | */
15 |
16 | params ["_grp","_searchDist"];
17 | if (isNil "_searchDist") then {_searchDist = 100};
18 | private _returned = false;
19 | {
20 | private _weap = nearestObject [(getpos _x),"StaticWeapon"];
21 | if (!(isNull _weap) || {!((_weap distance2D _x) > _searchDist)}) exitWith
22 | {
23 | _returned = true;
24 | _returned
25 | }
26 |
27 | } foreach (units _grp);
28 |
29 | _returned
--------------------------------------------------------------------------------
/Comps/radiotower.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Grab data:
3 | Mission: otl7_dyno_a3
4 | World: VR
5 | Anchor position: [6959.54, 7505.78]
6 | Area size: 200
7 | Using orientation of objects: yes
8 | */
9 |
10 | [
11 | ["Land_Radar",[-0.00927734,1.51172,0],0,1,0,[0,0],"","",true,false],
12 | ["Land_HBarrierWall_corner_F",[-2.19141,-2.31982,0],179.243,1,0,[0,-0],"","",true,false],
13 | ["Land_PowerGenerator_F",[3.0376,2.05957,0],192.448,1,0,[0,0],"","",true,false],
14 | ["Land_spp_Mirror_F",[2.74463,3.93262,0],62.286,1,0,[0,0],"","",true,false],
15 | ["Land_HBarrier_5_F",[6.43896,0.219238,0],139.886,1,0,[0,0],"","",true,false],
16 | ["Land_Loudspeakers_F",[-2.74951,4.79004,0],157.967,1,0,[0,-0],"","",true,false]
17 | ]
--------------------------------------------------------------------------------
/CHVD/fn_onLBSelChanged.sqf:
--------------------------------------------------------------------------------
1 | private ["_index","_terrainGrid"];
2 | _index = _this select 0;
3 | _varType = _this select 1;
4 | _text = _this select 2;
5 |
6 | if (!CHVD_allowNoGrass) then {
7 | _index = _index + 1;
8 | };
9 |
10 | switch (_index) do {
11 | case 0: {_terrainGrid = 50};
12 | case 1: {_terrainGrid = 25};
13 | case 2: {_terrainGrid = 12.5};
14 | case 3: {_terrainGrid = 3.125};
15 | };
16 |
17 | if (!CHVD_allowNoGrass) then {
18 | _terrainGrid = _terrainGrid min 48.99;
19 | };
20 | ctrlSetText [_text, str _terrainGrid];
21 | call compile format ["%1 = %2",_varType, _terrainGrid];
22 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType];
23 | [] call CHVD_fnc_updateTerrain;
--------------------------------------------------------------------------------
/EVO/fn_spawnVehicle.sqf:
--------------------------------------------------------------------------------
1 | private ["_ret","_veh","_grp"];
2 | _ret = _this call BIS_fnc_spawnvehicle;
3 | _veh = _ret select 0;
4 | _grp = _ret select 2;
5 | {
6 | _x setSkill ["spotdistance", 0.75];
7 | _x setSkill ["aimingspeed", 0.15];
8 | _x setSkill ["aimingaccuracy", 0.2];
9 | _x setSkill ["aimingshake", 0.15];
10 | _x setSkill ["spottime", 0.4];
11 | _x setSkill ["commanding", 0.8];
12 | _x setSkill ["general", 0.8];
13 | if (HCconnected) then {
14 | handle = [_x] call EVO_fnc_sendToHC;
15 | };
16 | } foreach units _grp;
17 | _veh disableAI "LIGHTS";
18 | _veh setPilotLight true;
19 | _veh setCollisionLight true;
20 | if ([true, false] call BIS_fnc_selectRandom) then {
21 | _veh allowCrewInImmobile true;
22 | };
23 |
24 |
25 | _ret;
--------------------------------------------------------------------------------
/NSLVR/abandonMarker.sqf:
--------------------------------------------------------------------------------
1 | _veh = _this select 0;
2 | _timeout = _this select 1;
3 | _group = _this select 2;
4 |
5 |
6 | _vehIcon = getText (configFile >> "cfgvehicles" >> typeOf _veh >> "icon");
7 | ["vehDesertion",[_timeout,_vehIcon,_group]] call BIS_fnc_showNotification;
8 |
9 | _markerName = format ["NSLVR_%1", _veh];
10 | _abandondMarker = createMarkerLocal[ _markerName , getPosATL _veh];
11 | _abandondMarker setMarkerShapeLocal "ICON";
12 | _abandondMarker setMarkerTypeLocal "respawn_motor";
13 | _abandondMarker setMarkerTextLocal "Abandond Vehicle";
14 |
15 | _timeout = _timeout + time;
16 | while {time < _timeout} do {
17 | _abandondMarker setMarkerAlphaLocal (time mod 2);
18 | sleep 0.1;
19 | };
20 |
21 | deleteMarkerLocal _abandondMarker;
22 |
--------------------------------------------------------------------------------
/EVO/fn_paraInsert.sqf:
--------------------------------------------------------------------------------
1 | private ["_spendable","_score","_txt"];
2 | _spendable = [player] call EVO_fnc_supportPoints;
3 |
4 | if (player getVariable ["EVOrank", "PRIVATE"] == "PRIVATE" || _spendable > 2) then {
5 | if (player getVariable ["EVOrank", "PRIVATE"] == "PRIVATE") then {
6 | null = [] execVM "ATM_airdrop\atm_airdrop.sqf";
7 | ["PointsRemoved",["HALO insertion initiated.", 0]] call BIS_fnc_showNotification;
8 | } else {
9 | [player, -2] call BIS_fnc_addScore;
10 | null = [] execVM "ATM_airdrop\atm_airdrop.sqf";
11 | ["PointsRemoved",["HALO insertion initiated.", 2]] call BIS_fnc_showNotification;
12 | };
13 | } else {
14 | _txt = "You don't have enough points to HALO drop.";
15 | ["notQualified",[_txt]] call BIS_fnc_showNotification;
16 | };
17 |
--------------------------------------------------------------------------------
/EVO/fn_rearm.sqf:
--------------------------------------------------------------------------------
1 | _veh = vehicle player;
2 |
3 | _veh setFuel 0;
4 | [
5 | [
6 | ["REARMING...", "%1"]
7 | ]
8 | ] spawn BIS_fnc_typeText;
9 | sleep 6;
10 | _veh setVehicleAmmo 1;
11 | [
12 | [
13 | ["REPAIRING...", "%1"]
14 | ]
15 | ] spawn BIS_fnc_typeText;
16 | sleep 8;
17 | _veh setDamage 0;
18 | [
19 | [
20 | ["REFUELING...", "%1"]
21 | ]
22 | ] spawn BIS_fnc_typeText;
23 | sleep 7;
24 | _veh setFuel 1;
25 | [
26 | [
27 | ["VEHICLE READY.", "%1"]
28 | ]
29 | ] spawn BIS_fnc_typeText;
--------------------------------------------------------------------------------
/EVO/fn_createSniper.sqf:
--------------------------------------------------------------------------------
1 | _pos = _this select 0;
2 | _overwatchPos = [_pos, 600, 200] call BIS_fnc_findOverwatch;
3 | if (isNil "_overwatchPos") exitWith {};
4 | _grp = createGroup EAST;
5 | _class = EVO_opforSnipers call BIS_fnc_selectRandom;
6 | _sniper = _grp createUnit [_class, _overwatchPos, [], 0, "NONE"];
7 | _sniper doWatch _pos;
8 | _grp setBehaviour "STEALTH";
9 | _grp setCombatMode "RED";
10 |
11 | {
12 | _x setSkill ["spotdistance", 1];
13 | _x setSkill ["aimingspeed", 1];
14 | _x setSkill ["aimingaccuracy", 0.9];
15 | _x setSkill ["aimingshake", 1];
16 | _x setSkill ["spottime", 0.8];
17 | _x setSkill ["commanding",1];
18 | _x setSkill ["general", 1];
19 | if (HCconnected) then {
20 | handle = [_x] call EVO_fnc_sendToHC;
21 | };
22 | } foreach units _grp;
--------------------------------------------------------------------------------
/bon_recruit_units/init_newunit.sqf:
--------------------------------------------------------------------------------
1 | _unit = _this select 0;
2 |
3 | /*****************************************************************
4 | following section to run only on server.
5 | Note: duplicate respective code in the pve in the init.sqf
6 | ******************************************************************/
7 | if(isServer) then{
8 | [_unit] execFSM (BON_RECRUIT_PATH+"unit_lifecycle.fsm");
9 | } else {
10 | bon_recruit_newunit = _unit;
11 | publicVariable "bon_recruit_newunit";
12 | };
13 |
14 |
15 |
16 |
17 | /*****************************************************************
18 | Client Stuff
19 | ******************************************************************/
20 | _unit addAction ["Dismiss",BON_RECRUIT_PATH+"dismiss.sqf",[],-10,false,true,""];
--------------------------------------------------------------------------------
/scripts/bonus/UPSMON_Anim.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Stances
3 | [
4 | "STAND",
5 | "STAND_IA",
6 | "GUARD",
7 | "SIT_LOW",
8 | "KNEEL",
9 | "LEAN",
10 | "WATCH",
11 | "WATCH1",
12 | "WATCH2"
13 | ];
14 | gear
15 | [
16 | "NONE",
17 | "LIGHT",
18 | "MEDIUM",
19 | "FULL",
20 | "ASIS",
21 | "RANDOM"
22 | ];
23 | */
24 |
25 |
26 | _unit = _this select 0;
27 | _anim = _this select 1;
28 | _clothes = _this select 2;
29 |
30 |
31 | if (isNil("UPSMON_INIT")) then {
32 | UPSMON_INIT=0;
33 | };
34 |
35 | waitUntil {UPSMON_INIT==1};
36 |
37 | If (Alive _unit && canmove _unit) then
38 | {
39 | [_unit,_anim,_clothes,{lifestate _unit == "INJURED" || !alive _unit ||_unit getvariable ["UPSMON_SUPSTATUS",""] != "" || !IsNull ((group _unit) getvariable ["UPSMON_GrpTarget",ObjNull])}] call BIS_fnc_ambientAnimCombat;
40 | };
--------------------------------------------------------------------------------
/EVO/fn_supportPoints.sqf:
--------------------------------------------------------------------------------
1 | private ["_unit","_score","_rank","_minimum","_pointsToSpend"];
2 |
3 | _unit = player;
4 | _score = score _unit;
5 | _rank = rank _unit;
6 | _minimum = 0;
7 | switch (_rank) do {
8 | case "PRIVATE": {
9 | _minimum = 0;
10 | };
11 | case "CORPORAL": {
12 | _minimum = rank1;
13 | };
14 | case "SERGEANT": {
15 | _minimum = rank2;
16 | };
17 | case "LIEUTENANT": {
18 | _minimum = rank3;
19 | };
20 | case "CAPTAIN": {
21 | _minimum = rank4;
22 | };
23 | case "MAJOR": {
24 | _minimum = rank5;
25 | };
26 | case "COLONEL": {
27 | _minimum = rank6;
28 | };
29 | default {
30 | _minimum = 0;
31 | };
32 | };
33 | _pointsToSpend = _score - _minimum;
34 | if (_pointsToSpend < 0) then { _pointsToSpend = 0};
35 | _pointsToSpend;
--------------------------------------------------------------------------------
/CHVD/fn_updateTerrain.sqf:
--------------------------------------------------------------------------------
1 | _inUAV = if (isNil {_this select 0}) then {UAVControl (getConnectedUAV player) select 1 != ""} else {_this select 0};
2 |
3 | if (_inUAV) then {
4 | switch (true) do {
5 | case (getConnectedUAV player isKindOf "LandVehicle" || getConnectedUAV player isKindOf "Ship"): {
6 | setTerrainGrid CHVD_carTerrain;
7 | };
8 | case (getConnectedUAV player isKindOf "Man"): {
9 | setTerrainGrid CHVD_footTerrain;
10 | };
11 | default {
12 | setTerrainGrid CHVD_airTerrain;
13 | };
14 | };
15 | } else {
16 | switch (true) do {
17 | case (vehicle player isKindOf "LandVehicle" || vehicle player isKindOf "Ship"): {
18 | setTerrainGrid CHVD_carTerrain;
19 | };
20 | case (vehicle player isKindOf "Air"): {
21 | setTerrainGrid CHVD_airTerrain;
22 | };
23 | default {
24 | setTerrainGrid CHVD_footTerrain;
25 | };
26 | };
27 | };
--------------------------------------------------------------------------------
/EVO/fn_buildMagazineArray.sqf:
--------------------------------------------------------------------------------
1 | private ["_weaponArray","_return","_weapon","_muzzles","_mags"];
2 | _weaponArray = _this;
3 | _return = [];
4 | {
5 | _weapon = _x;
6 | _muzzles = getArray(configfile >> "cfgWeapons" >> (_weapon) >> "muzzles");
7 |
8 | {
9 | if (_x isEqualTo "this") then
10 | {
11 | _mags = getArray(configfile >> "cfgWeapons" >> (_weapon) >> "magazines");
12 | _return = _return + _mags;
13 | }
14 | else
15 | {
16 | _mags = getArray(configfile >> "cfgWeapons" >> (_weapon) >> _x >> "magazines");
17 | _return = _return + _mags;
18 | };
19 | } forEach _muzzles;
20 | } forEach _weaponArray;
21 |
22 | _return = _return + ["HandGrenade", "SmokeShell", "SmokeShellBlue", "Chemlight_blue", "B_IR_Grenade", "DemoCharge_Remote_Mag"];
23 |
24 |
25 | _return
26 |
--------------------------------------------------------------------------------
/bon_recruit_units/init.sqf:
--------------------------------------------------------------------------------
1 | //by Bon_Inf*
2 | //Modified by Moser 07/20/2014
3 |
4 | BON_RECRUIT_PATH = "bon_recruit_units\";
5 |
6 | bon_max_units_allowed = 12;
7 | bon_recruit_recruitableunits = ["B_Soldier_F","B_Soldier_GL_F","B_soldier_AR_F","B_soldier_M_F","B_soldier_LAT_F","B_medic_F","B_soldier_repair_F","B_soldier_exp_F","B_Helipilot_F","B_engineer_F","B_soldier_AT_F","B_soldier_AA_F","B_helicrew_F"];
8 | bon_recruit_queue = [];
9 |
10 | //Select false if you want to use a a static unit list
11 | //You can customize static lists in recruitable_units_static.sqf
12 | bon_dynamic_list = false;
13 |
14 | if(isServer) then{
15 | "bon_recruit_newunit" addPublicVariableEventHandler {
16 | _newunit = _this select 1;
17 | [_newunit] execFSM (BON_RECRUIT_PATH+"unit_lifecycle.fsm");
18 | };
19 | };
20 | if(isDedicated) exitWith{};
21 |
22 |
23 | // Client stuff...
24 |
--------------------------------------------------------------------------------
/EVO/fn_getWeaponInfo.sqf:
--------------------------------------------------------------------------------
1 | private["_cfg", "_name", "_DescShort", "_DescLong", "_Pic", "_Type"];
2 | _name = _this;
3 | _cfg = (configFile >> "CfgWeapons" >> _name);
4 | _DescShort = if (isText(_cfg >> "displayName")) then {
5 | getText(_cfg >> "displayName")
6 | }
7 | else {
8 | "/"
9 | };
10 |
11 | _DescLong = if (isText(_cfg >> "Library" >> "libTextDesc")) then {
12 | getText(_cfg >> "Library" >> "libTextDesc")
13 | }
14 | else {
15 | "/"
16 | };
17 |
18 | _Pic = if (isText(_cfg >> "picture")) then {
19 | getText(_cfg >> "picture")
20 | }
21 | else {
22 | "/"
23 | };
24 |
25 | _Type = if (isText(_cfg >> "type")) then {
26 | parseNumber(getText(_cfg >> "type"))
27 | }
28 | else {
29 | getNumber(_cfg >> "type")
30 | };
31 |
32 | [_DescShort, _DescLong, _Type, _Pic]
33 |
34 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_ArtyManage.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Scans group for artillery pieces, found artillery is added to VCM_ARTYLST.
7 |
8 | Parameter(s):
9 | 0: GROUP - group to scan for artillery pieces
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | private _ArtyGroupBool = false;
16 |
17 | {
18 | private _veh = (vehicle _x);
19 | private _num = VCM_ARTYLST findIf {_x isEqualTo _veh};
20 | if (_num isEqualTo -1) then
21 | {
22 | private _class = typeOf _veh;
23 | if !(isNil ("_class")) then
24 | {
25 | private _artyChk = getNumber(configfile/"CfgVehicles"/_class/"artilleryScanner");
26 | if (_artyChk isEqualTo 1) then
27 | {
28 | VCM_ARTYLST pushback _veh;
29 | _ArtyGroupBool = true;
30 | };
31 | };
32 | }
33 | else
34 | {
35 | _ArtyGroupBool = true;
36 | };
37 | } foreach (units _this);
38 |
39 |
40 | _ArtyGroupBool
--------------------------------------------------------------------------------
/EVO/fn_hasLOS.sqf:
--------------------------------------------------------------------------------
1 | // fnc_HasLOS.sqf
2 | // usage: [,,(,)] call FLAY_fnc_knowsAbout;
3 | // returns true if can see and is less than meters from , otherwise returns false.
4 |
5 | private ["_unit", "_target", "_range", "_fov", "_inView", "_inSight", "_inRange", "_knowsAbout"];
6 |
7 | _unit = [_this,0] call BIS_fnc_param;
8 | _target = [_this,1] call BIS_fnc_param;
9 | _range = [_this,2,100,[0]] call BIS_fnc_param;
10 | _fov = [_this,3,130,[0]] call BIS_fnc_param;
11 | if ([_unit, _target] call BIS_fnc_distance2D > 600) exitWith {false};
12 | _knowsAbout = false;
13 | _inRange = (_unit distance _target) < _range;
14 | if (_inRange) then {
15 | _inView = [position _unit, getdir _unit, _fov, position _target] call BIS_fnc_inAngleSector;
16 | _inSight = count (lineIntersectsWith [eyePos _unit, eyepos _target, _unit, _target]) == 0;
17 | _knowsAbout = _inView && _inSight;
18 | };
19 | _knowsAbout;
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_MedicalHandler.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 | Makes group check medical status, and order medics about
6 |
7 | Parameter(s):
8 | 0: GROUP
9 |
10 | Returns:
11 | NOTHING
12 | */
13 |
14 | if !(VCM_MEDICALACTIVE) exitWith {};
15 |
16 | params ["_group","_MedList"];
17 | private _units = units _group;
18 | private _Medics = _MedList;
19 |
20 | {
21 | if (getDammage _x > 0) then
22 | {
23 | if !(_x call VCM_fnc_HealSelf) then
24 | {
25 | if (count _Medics > 0) then
26 | {
27 |
28 | private _FinalMedics = [];
29 | {
30 | if !(_x getVariable ["VCM_MBUSY", false]) then
31 | {
32 | _FinalMedics pushback _x;
33 | };
34 | } foreach _Medics;
35 |
36 | private _Medic = [_FinalMedics,_x,true,"MedicalHandler"] call VCM_fnc_ClstObj;
37 | [_Medic,_x] spawn VCM_fnc_MedicHeal;
38 |
39 | };
40 | };
41 | };
42 | } foreach _units;
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_MedicHeal.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Makes medic move to a soldier and heal him.
7 |
8 | Parameter(s):
9 | 0: OBJECT - Medic
10 | 1: OBJECT - Injured unit
11 |
12 | Returns:
13 | NOTHING
14 | */
15 |
16 | params ["_medic","_unit"];
17 |
18 | if (_medic isEqualType [] || {!(alive _medic)} || {!(alive _unit)} || {_unit distance2D _medic > 75}) exitWith {};
19 |
20 | if (VCM_DEBUG) then {systemChat format ["%1 attempting to heal %2", _medic, _unit];};
21 |
22 | _medic setVariable ["VCM_MBUSY", true];
23 |
24 | while {alive _medic && {alive _unit} && {_unit distance2D _medic > 3}} do
25 | {
26 | _medic doMove getPos _unit;
27 | sleep 3;
28 | };
29 |
30 | if (!(alive _medic) || {!(alive _unit)} || {_unit distance2D _medic > 75}) exitWith {};
31 |
32 | doStop _unit;
33 | doStop _medic;
34 |
35 | _medic action ["HealSoldier",_unit];
36 | sleep 4;
37 | _unit setdamage 0;
38 |
39 | _medic setVariable ["VCM_MBUSY", false]; // No longer busy
--------------------------------------------------------------------------------
/Comps/aa.sqf:
--------------------------------------------------------------------------------
1 |
2 | //_newComp = [getpos player, (getDir player), "Comps\aa.sqf", false] call (compile (preprocessFileLineNumbers "dyno_a3\otl7_Mapper.sqf"));
3 | // copyToClipboard([getPos player, 200, true] call BIS_fnc_objectsGrabber)
4 |
5 | /*
6 | Grab data:
7 | Mission: otl7_dyno_a3
8 | World: VR
9 | Anchor position: [6959.55, 7505.77]
10 | Area size: 200
11 | Using orientation of objects: yes
12 | */
13 |
14 | [
15 | ["O_APC_Tracked_02_AA_F",[-0.0126953,-0.0249023,-0.0537124],360,1,0,[0.92288,-0.0428938],"","",true,false],
16 | ["Land_HBarrierBig_F",[3.79834,-0.851563,0],90.7679,1,0,[0,-0],"","",true,false],
17 | ["Land_HBarrierBig_F",[-4.28271,-0.567871,0],90.7679,1,0,[0,-0],"","",true,false],
18 | ["Land_HBarrierBig_F",[0.0527344,4.80908,0],180.17,1,0,[0,0],"","",true,false],
19 | ["Land_PaperBox_open_empty_F",[-0.566406,-8.10596,0],0,1,0,[0,0],"","",true,false],
20 | ["Box_East_AmmoVeh_F",[1.05859,-8.22754,0.0305448],359.992,1,0.0368633,[0.000122439,-0.000447447],"","",true,false],
21 | ["Land_HBarrier_5_F",[-2.23389,-9.89404,0],0,1,0,[0,0],"","",true,false]
22 | ]
--------------------------------------------------------------------------------
/EVO/fn_getMagazineInfo.sqf:
--------------------------------------------------------------------------------
1 | private["_cfg", "_name", "_DescShort", "_DescLong", "_Type", "_Count", "_Pic"];
2 | _name = _this;
3 | _cfg = (configFile >> "CfgMagazines" >> _name);
4 |
5 | _DescShort = if (isText(_cfg >> "displayName")) then {
6 | getText(_cfg >>"displayName")
7 | }
8 | else {
9 | "/"
10 | };
11 |
12 | _DescLong = if (isText(_cfg >> "Library" >> "libTextDesc")) then {
13 | getText(_cfg >> "Library" >>"libTextDesc")
14 | }
15 | else {
16 | "/"
17 | };
18 |
19 | _Pic = if (isText(_cfg >> "picture")) then {
20 | getText(_cfg >> "picture")
21 | }
22 | else {
23 | "/"
24 | };
25 |
26 | _Type = if (isText(_cfg >> "type")) then {
27 | parseNumber(getText(_cfg >>"type"))
28 | }
29 | else {
30 | getNumber(_cfg >> "type")
31 | };
32 |
33 | _Count = if (isText(_cfg >> "count")) then {
34 | parseNumber(getText(_cfg >> "count"))
35 | }
36 | else {
37 | getNumber(_cfg >> "count")
38 | };
39 |
40 | [_DescShort, _DescLong, _Type, _Pic]
41 |
--------------------------------------------------------------------------------
/bon_recruit_units/build_unitlist.sqf:
--------------------------------------------------------------------------------
1 | // by Bon_Inf*
2 | //Modified by Moser -- 07/18/2014
3 |
4 | #include "dialog\definitions.sqf"
5 | disableSerialization;
6 |
7 | if (bon_dynamic_list) then {
8 | _scripthandler =[] execVM "bon_recruit_units\recruitable_units.sqf"; //executes dynamic arrray builder to find units of player's subfaction
9 | waitUntil{ ScriptDone _scripthandler }; //MUST wait for script to finish
10 | } else {
11 | if (isNil "bon_recruit_recruitableunits") then {bon_recruit_recruitableunits = ["B_Soldier_F"]};
12 | };
13 |
14 | _display = findDisplay BON_RECRUITING_DIALOG;
15 | _unitlist = _display displayCtrl BON_RECRUITING_UNITLIST;
16 | _queuelist = _display displayCtrl BON_RECRUITING_QUEUE;
17 |
18 | _queuelist ctrlSetText format["Units queued: %1",count bon_recruit_queue];
19 |
20 |
21 | _weaponstring = "";
22 | {
23 | _displname = getText (configFile >> "CfgVehicles" >> _x >> "displayName");
24 | _picture = getText (configFile >> "CfgVehicles" >> _x >> "portrait");
25 | _weaponstring = format["%1",_displname,_picture];
26 | _unitlist lbAdd _weaponstring;
27 | } foreach bon_recruit_recruitableunits;
28 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Kirk Main
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/Comps/mortar.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Grab data:
3 | Mission: otl7_dyno_a3
4 | World: VR
5 | Anchor position: [6959.33, 7504.99]
6 | Area size: 200
7 | Using orientation of objects: yes
8 | */
9 |
10 | [
11 | ["O_Mortar_01_F",[0.141602,0.461914,-0.0323834],359.994,1,0,[-0.20642,0.0881126],"","",true,false],
12 | ["Land_BagFence_Corner_F",[-1.43848,-0.583496,-0.000999928],179.475,1,0,[0,-0],"","",true,false],
13 | ["Land_BagFence_Corner_F",[2.03516,-0.587891,-0.000999928],90.4802,1,0,[0,-0],"","",true,false],
14 | ["Land_BagFence_Corner_F",[-1.41602,2.90186,-0.000999928],270.623,1,0,[0,0],"","",true,false],
15 | ["Land_BagFence_Corner_F",[2.04639,2.88477,-0.000999928],0.198943,1,0,[0,0],"","",true,false],
16 | ["Box_East_AmmoVeh_F",[2.9834,1.33691,0.0305414],359.995,1,0.0106075,[0.000565995,-0.000620482],"","",true,false],
17 | ["Land_HBarrier_5_F",[-1.95947,-3.70215,0],0,1,0,[0,0],"","",true,false],
18 | ["Land_HBarrier_1_F",[-1.28857,4.35449,0],86.1195,1,0,[0,0],"","",true,false],
19 | ["Land_HBarrier_1_F",[1.68799,4.41895,0],112.058,1,0,[0,0],"","",true,false],
20 | ["Land_HBarrier_5_F",[-4.60547,3.59277,0],89.5874,1,0,[0,0],"","",true,false],
21 | ["Land_HBarrier_5_F",[5.05566,3.47217,0],89.5874,1,0,[0,0],"","",true,false]
22 | ]
--------------------------------------------------------------------------------
/CHVD/fn_onCheckedChanged.sqf:
--------------------------------------------------------------------------------
1 | _state = [_this, 0, 0, [0]] call BIS_fnc_param;
2 | _syncVar = [_this, 1, "", [""]] call BIS_fnc_param;
3 | _slider = [_this, 2, controlNull, [0, controlNull]] call BIS_fnc_param;
4 | _text = [_this, 3, controlNull, [0, controlNull]] call BIS_fnc_param;
5 | _sliderView = [_this, 4, controlNull, [0, controlNull]] call BIS_fnc_param;
6 | _varType = [_this, 5, "", [""]] call BIS_fnc_param;
7 |
8 | if (_state == 1) then {
9 | call compile format ["%1 = true",_syncVar];
10 | call compile format ["profileNamespace setVariable ['%1',%1]", _syncVar];
11 | ctrlEnable [_slider, false];
12 | ctrlEnable [_text, false];
13 |
14 | ctrlSetText [_text, str round ((sliderPosition _sliderView) min CHVD_maxObj)];
15 | sliderSetPosition [_slider, (sliderPosition _sliderView) min CHVD_maxObj];
16 |
17 | call compile format ["%1 = %2", _varType, (sliderPosition _sliderView) min CHVD_maxObj];
18 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType];
19 | [3] call CHVD_fnc_updateSettings;
20 | } else {
21 | call compile format ["%1 = false",_syncVar];
22 | call compile format ["profileNamespace setVariable ['%1',%1]", _syncVar];
23 | ctrlEnable [_slider, true];
24 | ctrlEnable [_text, true];
25 | };
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_MineMonitor.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | This function will monitor all placed Vcom mines. Better than each mine having its own spawn.
7 |
8 | Parameter(s):
9 | NONE
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | //This list is all local.
16 | private _RemoveLst = [];
17 | {
18 | private _Mine = _x select 0;
19 | if (alive _Mine) then
20 | {
21 | private _Side = _x select 1;
22 | private _EL = [];
23 | private _TargetSide = "";
24 | private _Nearbylist = _Mine nearEntities [["Man","LandVehicle"], 2.5];
25 |
26 | if (count _Nearbylist > 0) then
27 | {
28 | {
29 | _TargetSide = side _x;
30 | if ([_Side, _TargetSide] call BIS_fnc_sideIsEnemy) then {_EL pushback _x;};
31 | } forEach _Nearbylist;
32 |
33 | if (count _EL > 0) then
34 | {
35 | [_Mine, true] remoteExecCall ["enableSimulationGlobal",2];
36 | _Mine spawn {sleep 0.25;_this setdamage 1;};
37 | };
38 | };
39 | }
40 | else
41 | {
42 | _RemoveLst pushback _x;
43 | };
44 |
45 |
46 |
47 |
48 |
49 |
50 | } foreach VCOM_MINEARRAY;
51 |
52 | {
53 | private _A = _x;
54 | VCOM_MINEARRAY deleteAt (VCOM_MINEARRAY findIf {_A isEqualTo _x;});
55 | } foreach _RemoveLst;
--------------------------------------------------------------------------------
/EVO/fn_gridMarkers.sqf:
--------------------------------------------------------------------------------
1 | private ["_pos","_px","_py","_nam","_col"];
2 | gridmarkers = [];
3 | startAlpha = 0.2;
4 | changeAlpha = 0.2;
5 | while {true} do {
6 | {deleteMarkerLocal _x;} count gridmarkers;
7 | gridmarkers = [];
8 | {
9 | if ( !((side _x) isEqualTo civilian) ) then {
10 | _pos = getPosATL _x;
11 | _px = floor ( (_pos select 0) / 100);
12 | _py = floor ( (_pos select 1) / 100);
13 | _nam = format["grid_%1_%2",_px,_py];
14 | _col = format["Color%1",side _x];
15 | if ( (markerShape _nam) isEqualTo "RECTANGLE" ) then {
16 | if ( ((markerColor _nam) isEqualTo _col) ) then {
17 | _nam setMarkerAlphaLocal ( (markerAlpha _nam) + changeAlpha);
18 | } else {
19 | _nam setMarkerColorLocal "ColorOrange";
20 | _nam setMarkerAlphaLocal ( (markerAlpha _nam) + changeAlpha);
21 | };
22 | } else {
23 | createMarkerLocal[_nam,[(_px*100)+50,(_py*100)+50,0]];
24 | _nam setMarkerShapeLocal "RECTANGLE";
25 | _nam setMarkerSizeLocal [50,50];
26 | _nam setMarkerColorLocal _col;
27 | _nam setMarkerAlpha startAlpha;
28 | gridmarkers pushBack _nam;
29 | };
30 | };
31 | true
32 | } count currentAOunits;
33 | sleep 10;
34 | };
35 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_BoxNrst.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Function for finding the closest WorldPos position (Left, Ride, Front, Rear) to an entity. And then finding a suitable position near that entity.
7 |
8 | Parameter(s):
9 | 0: OBJECT - Entity
10 | 1: OBJECT - Unit
11 |
12 | Returns:
13 | ARRAY - Position
14 |
15 | Note:
16 | DEPRECATED
17 | */
18 |
19 | params ["_ent","_unit"];
20 | private _div = 1;
21 | if (_ent isKindOf "landvehicle" || _ent isKindOf "air") then {_div = 2;};
22 |
23 | //First we need to get all the positions around the object, and mark each as front,rear,left,right.
24 | private _entBX = boundingBoxReal _ent;
25 | private _p1 = _entBX select 0;
26 | private _p2 = _entBX select 1;
27 | private _maxWidth = abs ((_p2 select 0) - (_p1 select 0));
28 | private _maxLength = abs ((_p2 select 1) - (_p1 select 1));
29 |
30 | private _left = _ent modelToWorld [-((_maxWidth)/_div),0,0];
31 | private _right = _ent modelToWorld [(_maxWidth/_div),0,0];
32 | private _front = _ent modelToWorld [0,(_maxLength/_div),0];
33 | private _behind = _ent modelToWorld [0,(-(_maxLength)/_div),0];
34 | private _ClstPos = [[_left,_right,_front,_behind],_unit,true,"NrstPos"] call DGN_fnc_ClosestObj;
35 |
36 |
37 | _ClstPos
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_CheckArty.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Function for defining AI who are in artillery pieces.
7 |
8 | Parameter(s):
9 | 0: OBJECT - Unit to check if it is in an artillery piece.
10 |
11 | Returns:
12 | NOTHING
13 |
14 | Note:
15 | Deprecated in favour of Rydigiers "Fire for Effect: The God Of War"
16 | */
17 |
18 | _veh = (vehicle _this);
19 | if (_veh in Vcm_ArtilleryArray) exitWith {};
20 |
21 | //Get the vehicles class name.
22 | private _class = typeOf _veh;
23 | if (isNil ("_class")) exitWith {};
24 |
25 | //Figure out if it is defined as artillery
26 | private _artyScan = getNumber(configfile/"CfgVehicles"/_class/"artilleryScanner");
27 |
28 | //Exit the script if it is not defined as artillery
29 | if (isNil "_artyScan") exitWith
30 | {
31 |
32 | //Check if unit somehow is in the Vcm_ArtilleryArray and remove them. This can happen to units who were inside artillery pieces but ejected or moved out due to a divine intervention.
33 | if (_veh in Vcm_ArtilleryArray) then
34 | {
35 | private _t = Vcm_ArtilleryArray findIf {_veh isEqualTo _x};
36 | Vcm_ArtilleryArray deleteAt _t;
37 | };
38 |
39 | };
40 |
41 | if (_artyScan isEqualTo 1) then
42 | {
43 |
44 | Vcm_ArtilleryArray pushBack _veh;
45 | };
--------------------------------------------------------------------------------
/CHVD/fn_onEBterrainInput.sqf:
--------------------------------------------------------------------------------
1 | private ["_textValue"];
2 | _varType = [_this, 0, "", [""]] call BIS_fnc_param;
3 | _textCtrl = [_this, 1, controlNull, [0, controlNull]] call BIS_fnc_param;
4 | _listbox = [_this, 2, controlNull, [0, controlNull]] call BIS_fnc_param;
5 |
6 | _textValue = [ctrlText _textCtrl, "0123456789."] call BIS_fnc_filterString;
7 | _textValue = if (_textValue == "") then {50} else {call compile _textValue min 50 max 3.125};
8 |
9 |
10 | if (!CHVD_allowNoGrass) then {
11 | _textValue = _textValue min 48.99;
12 | };
13 |
14 | //update listbox
15 | _listboxCtrl = (finddisplay 2900) displayCtrl _listbox;
16 | //remove EH not to cause huge lag
17 | _listboxCtrl ctrlRemoveAllEventHandlers "LBSelChanged";
18 | _sel = [_textValue] call CHVD_fnc_selTerrainQuality;
19 | if (CHVD_allowNoGrass) then {
20 | _listboxCtrl lbSetCurSel _sel;
21 | } else {
22 | _listboxCtrl lbSetCurSel (_sel - 1);
23 | };
24 | //add EH again
25 | _listboxCtrl ctrlSetEventHandler ["LBSelChanged",
26 | format ["[_this select 1, '%1', %2] call CHVD_fnc_onLBSelChanged", _varType, _textCtrl]
27 | ];
28 |
29 | //ctrlSetText [_textCtrl, str _textValue];
30 | call compile format ["%1 = %2",_varType, _textValue];
31 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType];
32 |
33 | [] call CHVD_fnc_updateTerrain;
--------------------------------------------------------------------------------
/Comps/mash.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Grab data:
3 | Mission: otl7_dyno_a3
4 | World: VR
5 | Anchor position: [6958.82, 7506.23]
6 | Area size: 200
7 | Using orientation of objects: yes
8 | */
9 |
10 | [
11 | ["Land_Sun_chair_green_F",[-1.30908,1.45166,0.0199656],13.6209,1,0.282858,[0.0120664,-0.000614466],"","",true,false],
12 | ["Land_BarrelWater_F",[2.3252,1.74902,5.91278e-005],172.258,1,0,[-0.0128672,-0.0140516],"","",true,false],
13 | ["Land_Sun_chair_green_F",[-2.81299,1.77441,0.0199661],13.6349,1,0.25146,[0.00993228,3.98016e-005],"","",true,false],
14 | ["Land_Medevac_house_V1_F",[0.674805,4.68604,0],13.6262,1,0,[0,0],"","",true,false],
15 | ["PortableHelipadLight_01_red_F",[2.67529,-2.81738,0],13.5577,1,0,[-0.00362615,-0.00401771],"","",true,false],
16 | ["PortableHelipadLight_01_red_F",[-4.13867,-2.20752,4.76837e-007],13.5616,1,0,[-0.00852467,-0.00174343],"","",true,false],
17 | ["CamoNet_BLUFOR_big_Curator_F",[0.568359,4.43945,-1.18562],13.6262,1,0,[0,0],"","",true,false],
18 | ["Land_Sun_chair_green_F",[-4.50732,2.24365,0.0199656],13.6212,1,0.230339,[0.0115533,-0.000138259],"","",true,false],
19 | ["CargoNet_01_box_F",[4.71924,3.07568,4.76837e-007],192.565,1,0,[0.000438452,0.000445828],"","",true,false],
20 | ["CargoNet_01_barrels_F",[5.51611,5.86328,0],195.136,1,0,[-1.07811e-005,-0.000337893],"","",true,false]
21 | ]
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_ForceMove.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 | Description:
5 | Forces AI to move towards enemies, failing that move towards waypoint.
6 |
7 | Parameter(s):
8 | 0: OBJECT - Group leader to get moving
9 | 1 (Optional): NUMBER - Distance to move
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | params ["_leader","_moveDist"];
16 | if (isNil "_moveDist") then {private _moveDist = 100};
17 | private _grp = (group _leader);
18 | private _units = (units _grp) select {alive _x};
19 | private _nearestEnemy = _leader findNearestEnemy _leader;
20 | if (isNull _nearestEnemy) then
21 | {
22 | _nearestEnemy = _leader call VCM_fnc_ClstEmy;
23 | };
24 |
25 |
26 | private _curwp = currentWaypoint _grp;
27 | private _wPos = waypointPosition [_grp,_curwp];
28 | private _dir = _wPos;
29 | if (_wPos isEqualTo [0,0,0]) then
30 | {
31 | _wPos = (getpos _leader);
32 | _dir = _nearestEnemy;
33 | };
34 |
35 | private _movePosition = (([_leader,_moveDist,([_leader, _dir] call BIS_fnc_dirTo)]) call BIS_fnc_relPos) getpos [25, (random 360)];
36 |
37 | {
38 | if (isNull objectParent _x) then
39 | {
40 | [_x,_movePosition] spawn
41 | {
42 | params ["_unit","_movePos"];
43 | sleep (1 + (random 10));
44 | dostop _unit;
45 | _unit domove _movePos;
46 | };
47 | };
48 | } foreach _units;
49 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_HasMine.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | This function will determine if the unit has a mine, satchel, or another explosive that could be used to blow shit up.
7 |
8 | Parameter(s):
9 | 0: OBJECT - Unit
10 |
11 | Returns:
12 | ARRAY - format [_hasSatchel, _actualObj, _hasMine, _satchelArray];
13 | */
14 |
15 | private _hasMine = false;
16 | private _magsAmmo = magazinesAmmo _this;
17 | private "_pushArray";
18 | if (isNil "_magsAmmo") exitWith {_pushArray = [false,[],false,[]];_pushArray};
19 | private _hasSatchel = false;
20 | private _actualObj = [];
21 | private _satchelArray = [];
22 |
23 | {
24 | private _mag = _x select 0;
25 | private _value = (configfile >> "CfgMagazines" >> _mag >> "nameSound") call BIS_fnc_getCfgData;
26 |
27 | if (_value isEqualTo "satchelcharge") then
28 | {
29 |
30 | _satchelArray pushback [((configfile >> "CfgMagazines" >> _mag >> "ammo") call BIS_fnc_getCfgData),_mag];
31 | _hasSatchel = true;
32 |
33 | };
34 | if (_value isEqualTo "mine") then
35 | {
36 | _hasMine = true;
37 | _actualObj pushback [((configfile >> "CfgMagazines" >> _mag >> "ammo") call BIS_fnc_getCfgData),_mag];
38 | };
39 |
40 |
41 | } forEach _magsAmmo;
42 |
43 | _pushArray = [_hasSatchel,_actualObj,_hasMine,_satchelArray];
44 |
45 | _pushArray
--------------------------------------------------------------------------------
/stringtable.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Altitude:
6 | Altitude:
7 |
8 |
9 | Select Key:
10 | Choisir Une touche:
11 |
12 |
13 | Choose your Altitude and Cut Key
14 | Choisir votre altitude et une touche
15 |
16 |
17 | Your select Altitude
18 | Votre Altitude choisi
19 |
20 |
21 | Select Altitude and Designate LZ for HALO Jump on the map
22 | Sélectionner votre Altitude et désigner une LZ sur la carte
23 |
24 |
25 | PRESS KEY TO CUT-AWAY ROPES
26 | Appuyer sur votre touche pour couper les suspentes
27 |
28 |
29 | loading loadout ...
30 | Chargement de votre équipement ...
31 |
32 |
33 | Close
34 | Fermer
35 |
36 |
37 |
--------------------------------------------------------------------------------
/EVO/fn_getVehicleInfo.sqf:
--------------------------------------------------------------------------------
1 | private["_cfg", "_name", "_DescShort", "_DescLong", "_Type", "_MaxSpeed", "_MaxFuel", "_Pic"];
2 | _name = _this;
3 | _cfg = (configFile >> "CfgVehicles" >> _name);
4 |
5 | _DescShort = if (isText(_cfg >> "displayName")) then {
6 | getText(_cfg >> "displayName")
7 | }
8 | else {
9 | "/"
10 | };
11 |
12 | _DescLong = if (isText(_cfg >> "Library" >> "libTextDesc")) then {
13 | getText(_cfg >> "Library" >> "libTextDesc")
14 | }
15 | else {
16 | "/"
17 | };
18 |
19 | _Pic = if (isText(_cfg >> "picture")) then {
20 | getText(_cfg >> "picture")
21 | }
22 | else {
23 | "/"
24 | };
25 |
26 | _Type = if (isText(_cfg >> "type")) then {
27 | parseNumber(getText(_cfg >> "type"))
28 | }
29 | else {
30 | getNumber(_cfg >> "type")
31 | };
32 |
33 | _MaxSpeed = if (isText(_cfg >> "maxSpeed")) then {
34 | parseNumber(getText(_cfg >> "maxSpeed"))
35 | }
36 | else {
37 | getNumber(_cfg >> "maxSpeed")
38 | };
39 |
40 | _MaxFuel = if (isText(_cfg >> "fuelCapacity")) then {
41 | parseNumber(getText(_cfg >> "fuelCapacity"))
42 | }
43 | else {
44 | getNumber(_cfg >>"fuelCapacity")
45 | };
46 |
47 | [_DescShort, _DescLong, _Type, _Pic, _MaxSpeed, _MaxFuel]
48 |
--------------------------------------------------------------------------------
/Comps/mortar_50.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Grab data:
3 | Mission: otl7_dyno_a3
4 | World: VR
5 | Anchor position: [6959.38, 7504.99]
6 | Area size: 200
7 | Using orientation of objects: yes
8 | */
9 |
10 | [
11 | ["CUP_O_2b14_82mm_RU",[0.0913086,0.455078,-0.0351028],359.964,1,0,[-0.000840396,-0.000545936],"","",true,false],
12 | ["Land_BagFence_Corner_F",[-1.4873,-0.585449,-0.000999928],179.475,1,0,[0,-0],"","",true,false],
13 | ["Land_BagFence_Corner_F",[1.98633,-0.589844,-0.000999928],90.4802,1,0,[0,-0],"","",true,false],
14 | ["Land_BagFence_Corner_F",[-1.46484,2.8999,-0.000999928],270.623,1,0,[0,0],"","",true,false],
15 | ["Land_BagFence_Corner_F",[1.99756,2.88281,-0.000999928],0.198943,1,0,[0,0],"","",true,false],
16 | ["Land_HBarrier_5_F",[-2.0083,-3.7041,0],0,1,0,[0,0],"","",true,false],
17 | ["Land_HBarrier_5_F",[-4.6543,3.59082,0],89.5874,1,0,[0,0],"","",true,false],
18 | ["Land_HBarrier_5_F",[5.00684,3.47021,0],89.5874,1,0,[0,0],"","",true,false],
19 | ["Land_HBarrier_5_F",[-2.1709,6.01172,0],0,1,0,[0,0],"","",true,false],
20 | ["O_HMG_01_high_F",[4.39258,5.1709,-0.0871186],8.48436,1,0,[-0.000651759,0.000427722],"","",true,false],
21 | ["Land_HBarrier_1_F",[-5.72803,-4.60352,0],135.341,1,0,[0,0],"","",true,false],
22 | ["Land_HBarrier_1_F",[6.13965,-4.73682,0],228.33,1,0,[0,0],"","",true,false],
23 | ["Land_BagFence_Round_F",[4.41211,7.01318,-0.00130081],192.872,1,0,[0,0],"","",true,false]
24 | ]
--------------------------------------------------------------------------------
/Comps/mortar_50_2.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Grab data:
3 | Mission: otl7_dyno_a3
4 | World: VR
5 | Anchor position: [6959.39, 7504.7]
6 | Area size: 200
7 | Using orientation of objects: yes
8 | */
9 |
10 | [
11 | ["CUP_O_2b14_82mm_RU",[0.0751953,0.744141,-0.0351019],359.95,1,0,[-0.000849019,-0.00055258],"","",true,false],
12 | ["Land_BagFence_Corner_F",[-1.50391,-0.296387,-0.000999928],179.475,1,0,[0,-0],"","",true,false],
13 | ["Land_BagFence_Corner_F",[1.96973,-0.300781,-0.000999928],90.4802,1,0,[0,-0],"","",true,false],
14 | ["Land_BagFence_Corner_F",[-1.48145,3.18896,-0.000999928],270.623,1,0,[0,0],"","",true,false],
15 | ["Land_BagFence_Corner_F",[1.98096,3.17188,-0.000999928],0.198943,1,0,[0,0],"","",true,false],
16 | ["Land_HBarrier_5_F",[-2.0249,-3.41504,0],0,1,0,[0,0],"","",true,false],
17 | ["Land_HBarrier_5_F",[-4.6709,3.87988,0],89.5874,1,0,[0,0],"","",true,false],
18 | ["Land_HBarrier_5_F",[4.99023,3.75928,0],89.5874,1,0,[0,0],"","",true,false],
19 | ["O_HMG_01_high_F",[-3.19238,4.99512,-0.0871181],341.516,1,0,[-0.000325967,0.000754371],"","",true,false],
20 | ["Land_HBarrier_5_F",[-2.1875,6.30078,0],0,1,0,[0,0],"","",true,false],
21 | ["Land_HBarrier_1_F",[-5.74463,-4.31445,0],135.341,1,0,[0,0],"","",true,false],
22 | ["Land_BagFence_Round_F",[-4.07031,6.5332,-0.00130081],159.602,1,0,[0,-0],"","",true,false],
23 | ["Land_HBarrier_1_F",[6.12305,-4.44775,0],228.33,1,0,[0,0],"","",true,false]
24 | ]
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_ClearBuilding.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Orders group to clear building
7 |
8 | Parameter(s):
9 | 0: GROUP - Clearing group
10 | 1: OBJECT - Enemy to clear out
11 |
12 | Returns:
13 | STRING
14 | */
15 |
16 | params ["_group","_enemy"];
17 |
18 | private _nBuildingLst = nearestObjects [_enemy, ["House", "Building"], 25];
19 | if (count _nBuildingLst < 1) exitWith {};
20 |
21 | private _buildingPositions = [];
22 |
23 | {
24 | if (count ([_x] call BIS_fnc_buildingPositions) > 3) then {_buildingPositions pushback _x;};
25 | } foreach _nBuildingLst;
26 |
27 | if (count _buildingPositions < 1) exitWith {};
28 | private _finalSel = [_buildingPositions,_enemy,true,"Clear0"] call VCM_fnc_ClstObj;
29 | private _tempA = _finalSel call BIS_fnc_buildingPositions;
30 | private _tempB = _tempA;
31 |
32 | //Filter down the closest positions
33 | private _unitPosition = getposATL _enemy;
34 | private _acceptableRange = _unitPosition select 2;
35 | {
36 | if ((_x select 2) < (_acceptableRange - 1) || (_x select 2) > (_acceptableRange + 1)) then
37 | {
38 | _tempA deleteAt _forEachIndex;
39 | };
40 |
41 | } foreach _tempA;
42 |
43 | if (_tempA isEqualTo []) then {_tempA = _tempB;};
44 |
45 | private _clstP = [_tempA,_enemy,true,"Clear1"] call VCM_fnc_ClstObj;
46 |
47 | {
48 | doStop _x;
49 | _x doMove _clstP;
50 | } foreach (units _group);
--------------------------------------------------------------------------------
/Comps/radiotower_griffz.sqf:
--------------------------------------------------------------------------------
1 |
2 | [
3 | ["Land_BagFence_Long_F",[0.894287,43.0703,-0.000999928],170.203,1,0,[0,0],"","",true,false],
4 | ["Land_BagFence_Round_F",[-4.23901,42.8948,-0.00130129],4.70387,1,0,[0,0],"","",true,false],
5 | ["O_GMG_01_high_F",[-4.61743,44.7283,-0.0868082],229.019,1,0,[-0.000155565,0.000412643],"","",true,false],
6 | ["Land_BagFence_Round_F",[-6.11548,45.0356,-0.00130129],89.1514,1,0,[0,0],"","",true,false],
7 | ["Land_BagFence_Long_F",[5.32422,45.5198,-0.000999928],137.302,1,0,[0,-0],"","",true,false],
8 | ["Land_BagFence_Long_F",[-5.27393,49.1321,-0.000999928],286.448,1,0,[0,-0],"","",true,false],
9 | ["Land_Radar",[1.45068,50.0818,0],0,1,0,[0,0],"","",true,false],
10 | ["Land_PowerGenerator_F",[2.75391,50.1196,0],91.2121,1,0,[0,0],"","",true,false],
11 | ["Land_BagFence_Long_F",[8.89429,50.0396,-0.000999928],113.133,1,0,[0,-0],"","",true,false],
12 | ["Land_BagFence_Long_F",[-2.87061,53.4644,-0.000999928],312.006,1,0,[0,0],"","",true,false],
13 | ["Land_BagFence_Long_F",[0.756104,56.3025,-0.000999928],335.657,1,0,[0,-0],"","",true,false],
14 | ["O_HMG_01_high_F",[6.15381,56.0339,-0.0871077],18.3143,1,0,[-0.000266404,-0.00120152],"","",true,false],
15 | ["Land_BagFence_Round_F",[7.84985,56.8313,-0.00130129],243.842,1,0,[0,0],"","",true,false],
16 | ["Land_BagFence_Round_F",[5.09473,58.0364,-0.00130129],159.92,1,0,[0,-0],"","",true,false],
17 | ["ModuleCurator_F",[-70.6636,-26.3508,0],0,1,0,[0,0],"","",true,false]
18 | ]
19 |
20 |
--------------------------------------------------------------------------------
/Comps/mortar_50_tower.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Grab data:
3 | Mission: otl7_dyno_a3
4 | World: VR
5 | Anchor position: [6958.83, 7505.09]
6 | Area size: 200
7 | Using orientation of objects: yes
8 | */
9 |
10 | [
11 | ["CUP_O_2b14_82mm_RU",[0.742676,-0.0893555,-0.0360126],90.4821,1,0,[0.0445225,-0.074553],"","",true,false],
12 | ["Land_BagFence_Corner_F",[-0.319824,1.49072,-0.000999928],269.312,1,0,[0,0],"","",true,false],
13 | ["Land_BagFence_Corner_F",[-0.313965,-1.98291,-0.000999928],180.317,1,0,[0,0],"","",true,false],
14 | ["Land_BagFence_Corner_F",[3.16602,1.47803,-0.000999928],0.460255,1,0,[0,0],"","",true,false],
15 | ["Land_BagFence_Corner_F",[3.15869,-1.98438,-0.000999928],90.0362,1,0,[0,-0],"","",true,false],
16 | ["Box_East_AmmoVeh_F",[1.61328,-2.92578,0.0305448],89.8349,1,0.0106008,[0.000310116,-0.000415389],"","",true,false],
17 | ["Land_HBarrier_5_F",[-3.43994,2.00293,0],89.8373,1,0,[0,0],"","",true,false],
18 | ["Land_HBarrier_1_F",[4.61865,1.35498,0],175.957,1,0,[0,-0],"","",true,false],
19 | ["Land_HBarrier_5_F",[3.84766,4.66943,0],179.425,1,0,[0,-0],"","",true,false],
20 | ["Land_HBarrier_1_F",[4.69189,-1.62158,0],201.895,1,0,[0,0],"","",true,false],
21 | ["Land_HBarrier_5_F",[3.75439,-4.9917,0],179.425,1,0,[0,0],"","",true,false],
22 | ["Land_Cargo_Patrol_V3_F",[8.60742,-0.211426,0],269.703,1,0,[0,0],"","",true,false],
23 | ["O_HMG_01_high_F",[7.95996,-1.85107,-0.0871186],89.8436,1,0,[-0.00068354,0.000461488],"","",true,false]
24 | ]
25 |
26 |
27 |
--------------------------------------------------------------------------------
/EVO/fn_capture.sqf:
--------------------------------------------------------------------------------
1 | private ["_pow","_capturer","_msg","_score"];
2 | _pow = _this select 0;
3 | _capturer = _this select 1;
4 | _id = _this select 2;
5 | [_pow] join _capturer;
6 | _pow enableAI "ANIM";
7 | _pow enableAI "FSM";
8 | [[[_pow], {_this select 0 switchMove ""}], "BIS_fnc_spawn", true] call BIS_fnc_MP;
9 |
10 | if (_pow == currentTargetOF) then {
11 | [[[], {
12 | if (!isDedicated) then {
13 | _msg = format ["Colonel %1 has been found, extract him!", name currentTargetOF];
14 | ["TaskUpdated",["OFFICER FOUND", _msg]] call BIS_fnc_showNotification;
15 | waitUntil {(currentTargetOF distance hqBox < 50)};
16 | _msg = format ["Colonel %1 has been secured.", name currentTargetOF];
17 | ["TaskSucceeded",["OFFICER SECURED", _msg]] call BIS_fnc_showNotification;
18 | playsound "goodjob";
19 | [player, 5] call bis_fnc_addScore;
20 | ["PointsAdded",["BLUFOR completed a mission objective.", 5]] call BIS_fnc_showNotification;
21 | if (leader group currentTargetOF == player) then {
22 | [player, 5] call bis_fnc_addScore;
23 | ["PointsAdded",[format["You captured Colonel %1.", name currentTargetOF], 5]] call BIS_fnc_showNotification;
24 | };
25 | };
26 | if (isServer) then {
27 | [officerTask, "Succeeded", false] call bis_fnc_taskSetState;
28 | waitUntil {(currentTargetOF distance hqBox < 50)};
29 | sleep 5;
30 | deleteVehicle currentTargetOF;
31 | };
32 | }], "BIS_fnc_spawn", true] call BIS_fnc_MP;
33 | };
34 |
35 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_PackStatic.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | This function will constantly monitor the unit and see if the static weapon needs to be dissassembled or not.
7 | The amount of time on a static will be a base variable with additional time every time an enemy is spotted.
8 |
9 | Parameter(s):
10 | 0: OBJECT - Gunner
11 | 1: STRING - Backpack classname
12 | 2: OBJECT - Static weapon
13 |
14 | Returns:
15 | NOTHING
16 | */
17 |
18 | params ["_unit","_backpack","_staticCreated"];
19 |
20 | sleep 10;
21 |
22 | private _staticGreen = true;
23 | private _statictime = 180;
24 |
25 | while {_staticGreen && {alive _unit} && {alive _staticCreated} && {!(isNull (gunner _staticCreated))}} do
26 | {
27 | sleep 5;
28 | private _enemy = _unit findNearestEnemy _unit;
29 | if (!(isNull _enemy)) then
30 | {
31 | private _cansee = [_unit, "VIEW"] checkVisibility [eyePos _unit, eyePos _enemy];
32 | if (_cansee > 0) then {_statictime = _statictime + 3;} else {_statictime = _statictime - 5;};
33 | }
34 | else
35 | {
36 | _statictime = _statictime - 5;
37 | };
38 | if (_statictime < 1) then {_staticGreen = false;};
39 | };
40 |
41 | //Okay, time to move!
42 | if (alive _unit) then
43 | {
44 | _unit leaveVehicle _staticCreated;
45 | [_unit,"AinvPknlMstpSnonWnonDnon_Putdown_AmovPknlMstpSnonWnonDnon"] remoteExec ["Vcm_PMN",0];
46 | sleep 3;
47 | deleteVehicle _staticCreated;
48 | sleep 1;
49 | _unit addBackpackGlobal _backpack;
50 | };
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_AIHIT.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis, improved by Freddo
4 |
5 | Description:
6 | Plays appropiate hit reactions on unit
7 |
8 | Parameter(s):
9 | 0: OBJECT - Object affected
10 | 1 (Optional): OBJECT - Object that caused damage
11 | 2: NUMBER - Level of damage caused
12 | 3: OBJECT - Object that pulled the trigger
13 |
14 | Returns:
15 | NOTHING
16 |
17 | Example1:
18 | this addEventHandler ["Hit", {
19 | _this call VCM_fnc_AIHIT;
20 | }];
21 |
22 | NOTE:
23 | Meant to be called from a "HIT" eventhandler
24 | */
25 | params ["_unit", "_source", "_damage", "_instigator"];
26 |
27 | if (VCM_MEDICALACTIVE) exitWith {};
28 |
29 | //Lay down
30 | private _GetUnitStance = unitPos _unit;
31 | if !(_GetUnitStance isEqualTo "DOWN") then
32 | {
33 | _unit setUnitPos "DOWN";
34 | [_unit,_GetUnitStance] spawn
35 | {
36 | params ["_Unit","_Pos"];
37 | sleep 5;
38 | if (alive _unit) then
39 | {
40 | _unit setUnitPos _Pos;
41 | };
42 | };
43 | };
44 |
45 | if (VCM_RAGDOLL && {_damage > 0.1} && {!(lifestate _unit isEqualTo "INCAPACITATED")} && {VCM_RAGDOLLCHC > (random 100)}) then
46 | {
47 | _unit setUnconscious true;
48 | _unit spawn
49 | {
50 | sleep 2;
51 | _this setUnconscious false;
52 | //A check if the unit is still unconscious after a 30 second time. Sometimes AI remain unconscious - this should hopefully prevent this.
53 | sleep 30;
54 | if (alive _this && {lifeState _this isEqualTo "INCAPACITATED"}) then {_this setUnconscious false;};
55 | };
56 | };
57 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_GarrisonLight.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Function for telling a group to temporarily garrison a structure. The group will leave it shortly after.
7 |
8 | Parameter(s):
9 | 0: GROUP
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | private _leader = (leader _this);
16 | private _nBuildingLst = nearestObjects [_leader, ["House", "Building"], 50];
17 | private _buildingPositions = [];
18 |
19 | {
20 | if (count ([_x] call BIS_fnc_buildingPositions) > 3) then {_buildingPositions pushback _x;};
21 | } foreach _nBuildingLst;
22 |
23 | //Exit if no compatible buildings found
24 | if (_buildingPositions isEqualTo []) exitWith {};
25 |
26 | private _tempA = [(selectRandom _buildingPositions)] call BIS_fnc_buildingPositions;
27 | private _groupUnits = units _this;
28 | if (count _tempA > 0) then
29 | {
30 | {
31 | private _foot = isNull objectParent _x;
32 | if (_foot) then
33 | {
34 | private _buildingLocation = selectRandom _tempA;
35 | if !(isNil "_buildingLocation") then
36 | {
37 | _x doMove _buildingLocation;
38 | [_x,_buildingLocation] spawn
39 | {
40 | params ["_leader","_buildingLocation"];
41 | if (isNil "_buildingLocation") exitWith {};
42 | while {(alive _leader) && {_leader distance2D _buildingLocation < 1.3}} do
43 | {
44 | sleep 3;
45 | _leader doMove _buildingLocation;
46 | };
47 | };
48 | private _rmv = _tempA findIf {_buildingLocation isEqualTo _x};
49 | _tempA deleteAt _rmv;
50 | };
51 | };
52 | } foreach _groupUnits;
53 | };
--------------------------------------------------------------------------------
/EVO/fn_createMinefield.sqf:
--------------------------------------------------------------------------------
1 | _startPos = _this select 0;
2 | _mineClass = _this select 1;
3 |
4 | if (_mineClass == "ATMine") then {
5 | //Place AT On Roads
6 |
7 | _roads = _startPos nearRoads 250;
8 | _nearestRoad = [_startPos, _roads] call EVO_fnc_getNearest;
9 | _startPos = getPos _nearestRoad;
10 | _lastPos = _startPos;
11 | for "_i" from 1 to (10 + random(10)) step 1 do {
12 | _dir = (((getDir _nearestRoad) - 90) + (random 90) - (random 90));
13 | _minePos = [_lastPos, ((random 3) + 3) , _dir] call BIS_fnc_relPos;
14 | _mine = createMine [_mineClass, [_minePos select 0, _minePos select 1, 0.2], [], 0];
15 | EAST revealMine _mine;
16 | _mine setDir (random 360);
17 | _lastPos = getPos _mine;
18 | };
19 | for "_i" from 1 to 3 step 1 do {
20 | _signPos = [_startPos, 15, random 360 ] call BIS_fnc_relPos;
21 | _sign = createVehicle ["Land_Sign_Mines_F", _signPos, [], 0, "NONE"];
22 | _sign setDir (random 360);
23 | };
24 |
25 | } else {
26 | //Place AI Anywhere
27 | _lastPos = _startPos;
28 | for "_i" from 1 to (10 + (random 10)) step 1 do {
29 | _minePos = [_lastPos, ((random 8) + 3) , (random 360)] call BIS_fnc_relPos;
30 | _mine = createMine [_mineClass, [_minePos select 0, _minePos select 1, 0.2], [], 0];
31 | EAST revealMine _mine;
32 | //_mine = createVehicle [_mineClass, _minePos, [], 0, "NONE"];
33 | _mine setDir (random 360);
34 | _lastPos = getPos _mine;
35 | };
36 | for "_i" from 1 to 3 step 1 do {
37 | _signPos = [_startPos, 15, random 360 ] call BIS_fnc_relPos;
38 | _sign = createVehicle ["Land_Sign_Mines_F", _signPos, [], 0, "NONE"];
39 | _sign setDir (random 360);
40 | };
41 | };
42 | true;
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_VehicleMove.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 | Handles waypoints for vehicles. Transport vehicles will recieved a different style of waypoints.
6 |
7 | Parameter(s):
8 | 0: GROUP
9 | 1: TRANSPORT VEHICLE?
10 | 2: ARRAY OF VEHICLES
11 |
12 | Returns:
13 | NOTHING
14 | */
15 |
16 | params ["_Group","_Transport","_VehFullArr"];
17 |
18 | if ((count (waypoints _Group)) >= 3) exitWith {};
19 | if (count (_group call VCM_fnc_WyptChk) > 0) exitWith {};
20 |
21 | //If the vehicle has units to transport is should then find a secure location to drop the troops off!
22 | private _Leader = leader _Group;
23 | private _Units = units _Group;
24 |
25 |
26 | if (_Transport) then
27 | {
28 | //Exit the function if the driver is NOT in the leaders group
29 | if !(driver (vehicle _leader) in _Units) exitWith {};
30 |
31 | //Let's find the nearest enemies and friendlies!
32 | private _nearestEnemy = _leader call VCM_fnc_ClstEmy;
33 | private _nearestFriend = _nearestEnemy call VCM_fnc_ClstEmy;
34 | private _DisembarkLocation1 = getPosWorld _nearestFriend;
35 |
36 | if (_DisembarkLocation1 distance2D _leader > VCM_HEARINGDISTANCE) exitWith {};
37 | //First find a good location to disembark.
38 | private _FinalDisembarkLocation = [_DisembarkLocation1,25, [1, -1, 0.1, 0, 0, false, objNull]] call VCM_fnc_isFlatEmpty;
39 |
40 |
41 | private _waypoint0 = _Group addwaypoint [_FinalDisembarkLocation,0];
42 | _waypoint0 setwaypointtype "TR UNLOAD";
43 | _waypoint0 setWaypointSpeed "FULL";
44 | _Group setCurrentWaypoint [_Group,(_waypoint0 select 1)];
45 | }
46 | else
47 | {
48 | [_Leader] spawn VCM_fnc_FlankMove;
49 | };
--------------------------------------------------------------------------------
/EVO/fn_amb.sqf:
--------------------------------------------------------------------------------
1 | private ["_explosions"];
2 | _explosions = [
3 | "BattlefieldExplosions1_3D",
4 | "BattlefieldExplosions2_3D",
5 | "BattlefieldExplosions3_3D",
6 | "BattlefieldExplosions4_3D",
7 | "BattlefieldExplosions5_3D"
8 | ];
9 |
10 | private ["_fireFights"];
11 | _fireFights = [
12 | "BattlefieldFirefight1_3D",
13 | "BattlefieldFirefight2_3D",
14 | "BattlefieldFirefight3_3D",
15 | "BattlefieldFirefight4_3D"
16 | ];
17 |
18 | {
19 | [_explosions, _fireFights] spawn {
20 | private ["_explosions", "_fireFights", "_helis"];
21 | _explosions = _this select 0;
22 | _fireFights = _this select 1;
23 |
24 | while {true} do {
25 | sleep (1 + random 59);
26 |
27 | private ["_sound"];
28 | _sound = if (random 1 < 0.5) then {
29 | // Explosions
30 | _explosions call BIS_fnc_selectRandom
31 | } else {
32 | // Firefights
33 | _fireFights call BIS_fnc_selectRandom
34 | };
35 |
36 | // Play ambient sound
37 | playSound _sound;
38 | };
39 | };
40 | } forEach [0,1,2];
41 |
42 | private ["_helis"];
43 | _helis = [
44 | "BattlefieldHeli1_3D",
45 | "BattlefieldHeli2_3D",
46 | "BattlefieldHeli3_3D",
47 | "BattlefieldJet1_3D",
48 | "BattlefieldJet2_3D",
49 | "BattlefieldJet3_3D"
50 | ];
51 |
52 | _helis spawn {
53 | private ["_helis", "_used"];
54 | _helis = _this;
55 | _used = [];
56 |
57 | while {true} do {
58 | if (count _used == count _helis) then {_used = []};
59 |
60 | sleep (30 + random 90);
61 |
62 | // Choose random sound
63 | private ["_sound"];
64 | _sound = (_helis - _used) call BIS_fnc_selectRandom;
65 | _used = _used + [_sound];
66 |
67 | // Play ambient sound
68 | playSound _sound;
69 | };
70 | };
--------------------------------------------------------------------------------
/EVO/fn_deployMplayer.sqf:
--------------------------------------------------------------------------------
1 | _truck = nearestObject [player, "B_Truck_01_medical_F"];
2 | if (isNil "_truck" || (player distance _truck > 25)) exitWith {
3 | _msg = format ["You can't deploy a MASH without an ambulance."];
4 | ["deployed",["MASH NOT DEPLOYED", _msg]] call BIS_fnc_showNotification;
5 | };
6 |
7 | _enemyArray = (getPos player) nearEntities [["Man"], 15];
8 | {
9 | if (side _x == EAST) exitWith {
10 | _msg = format ["You can't deploy a MASH near hostiles."];
11 | ["deployed",["MASH NOT DEPLOYED", _msg]] call BIS_fnc_showNotification;
12 | };
13 | } forEach _enemyArray;
14 | player playMoveNow "Acts_carFixingWheel";
15 |
16 | if (!isNil "MASH") then {
17 | deleteVehicle MASH;
18 | _msg = format ["Your previous MASH has been removed."];
19 | ["deployed",["MASH REMOVED", _msg]] call BIS_fnc_showNotification;
20 | };
21 |
22 | if (!isNil "playerRespawnPoint") then {
23 | playerRespawnPoint call BIS_fnc_removeRespawnPosition;
24 | };
25 |
26 | _mark = format["%1mash",(name player)];
27 | deleteMarker _mark;
28 | _pos = [position player, 10, 15, 10, 0, 2, 0] call BIS_fnc_findSafePos;
29 | MASH = "USMC_WarfareBFieldhHospital" createVehicle _pos;
30 | MASH allowDamage false;
31 | _mssg = format["%2 %1's MASH",(name player), (rank player)];
32 | playerRespawnPoint = [(side player), (getPos player), _mssg] call BIS_fnc_addRespawnPosition;
33 | _medmark = createMarker [_mark, getPos player];
34 | _medmark setMarkerShape "ICON";
35 | _medmark setMarkerType "b_med";
36 | _medmark setMarkerColor "ColorBlue";
37 | _medmark setMarkerText _mssg;
38 | _medmark setMarkerSize [1, 1];
39 | sleep 5;
40 | _msg = format ["Your MASH has been deployed at map grid %1.", mapGridPosition player];
41 | ["deployed",["MASH DEPLOYED", _msg]] call BIS_fnc_showNotification;
--------------------------------------------------------------------------------
/EVO/fn_surrender.sqf:
--------------------------------------------------------------------------------
1 | private ["_unit","_grp","_players","_loop","_captured","_msg","_score"];
2 |
3 | _unit = _this select 0;
4 |
5 | [[[_unit], {
6 | _unit = _this select 0;
7 | _unit playMoveNow "AmovPercMstpSsurWnonDnon";
8 | _unit addAction [format["Capture %2 %1", name _unit, rank _unit],"_this spawn EVO_fnc_capture", [], 1, true, false, "", "_target distance _this < 10 && side leader group _unit != WEST"];
9 |
10 | }], "BIS_fnc_spawn"] call BIS_fnc_MP;
11 | _unit disableAI "ANIM";
12 | _unit disableAI "FSM";
13 | _result = [_unit, primaryWeapon _unit] call CBA_fnc_dropWeapon;
14 | _result = [_unit, secondaryWeapon _unit] call CBA_fnc_dropWeapon;
15 | _result = [_unit, handgunWeapon _unit] call CBA_fnc_dropWeapon;
16 | _unit setCaptive true;
17 | _grp = createGroup side _unit;
18 | [_unit] joinSilent _grp;
19 | _players = true;
20 | _loop = true;
21 | while {_loop} do {
22 | _captured = false;
23 | _players = [_unit, 1000] call EVO_fnc_playersNearby;
24 | if (!_players || !alive _unit || (_unit distance powCamp < 50)) then {
25 | _loop = false;
26 | };
27 | if (isPlayer(leader group _unit) && !_captured) then {
28 | [[[_unit], {
29 | _unit = _this select 0;
30 | _unit switchMove "";
31 | _unit enableAI "ANIM";
32 | _unit enableAI "FSM";
33 | }], "BIS_fnc_spawn"] call BIS_fnc_MP;
34 | _captured = true;
35 | };
36 | };
37 | [[[_unit], {
38 | _unit = _this select 0;
39 | if (leader group _unit == player) then {
40 | _msg = format ["%2 %1 has been secured.", name _unit, rank _unit];
41 | playsound "goodjob";
42 | [player, 3] call bis_fnc_addScore;
43 | ["PointsAdded",["You captured a POW.", 3]] call BIS_fnc_showNotification;
44 | };
45 | }], "BIS_fnc_spawn"] call BIS_fnc_MP;
46 |
47 | deleteVehicle _unit;
--------------------------------------------------------------------------------
/CHVD/fn_localize.sqf:
--------------------------------------------------------------------------------
1 | _display = (_this select 0) select 0;
2 |
3 | if (isLocalized "STR_chvd_title") then {
4 | (_display displayCtrl 1000) ctrlSetText (toUpper (localize "STR_chvd_title"));
5 | };
6 | if (isLocalized "STR_chvd_foot") then {
7 | (_display displayCtrl 1001) ctrlSetText (localize "STR_chvd_foot");
8 | };
9 | if (isLocalized "STR_chvd_car") then {
10 | (_display displayCtrl 1008) ctrlSetText (localize "STR_chvd_car");
11 | };
12 | if (isLocalized "STR_chvd_air") then {
13 | (_display displayCtrl 1015) ctrlSetText (localize "STR_chvd_air");
14 | };
15 | if (isLocalized "STR_chvd_view") then {
16 | (_display displayCtrl 1002) ctrlSetText (localize "STR_chvd_view");
17 | (_display displayCtrl 1010) ctrlSetText (localize "STR_chvd_view");
18 | (_display displayCtrl 1016) ctrlSetText (localize "STR_chvd_view");
19 | };
20 | if (isLocalized "STR_chvd_object") then {
21 | (_display displayCtrl 1003) ctrlSetText (localize "STR_chvd_object");
22 | (_display displayCtrl 1011) ctrlSetText (localize "STR_chvd_object");
23 | (_display displayCtrl 1021) ctrlSetText (localize "STR_chvd_object");
24 | };
25 | if (isLocalized "STR_chvd_terrain") then {
26 | (_display displayCtrl 1005) ctrlSetText (localize "STR_chvd_terrain");
27 | (_display displayCtrl 1012) ctrlSetText (localize "STR_chvd_terrain");
28 | (_display displayCtrl 1019) ctrlSetText (localize "STR_chvd_terrain");
29 | };
30 | if (isLocalized "STR_chvd_sync") then {
31 | (_display displayCtrl 1009) ctrlSetText (localize "STR_chvd_sync");
32 | (_display displayCtrl 1004) ctrlSetText (localize "STR_chvd_sync");
33 | (_display displayCtrl 1020) ctrlSetText (localize "STR_chvd_sync");
34 | };
35 | if (isLocalized "STR_chvd_close") then {
36 | (_display displayCtrl 1612) ctrlSetText (localize "STR_chvd_close");
37 | };
--------------------------------------------------------------------------------
/EVO/fn_newTargetTasks.sqf:
--------------------------------------------------------------------------------
1 | private ["_type","_tskDisplayName","_tskDescription","_pos"];
2 | _type = "";
3 | if (currentTargetType == "NameVillage") then {
4 | _type = "village";
5 | } else {
6 | _type = "city";
7 | };
8 | _tskDisplayName = format ["Clear %1", currentTargetName];
9 | attackTask = format ["%1_task", currentTargetName];
10 | _tskDescription = format ["Clear the %1 of %2.", _type, currentTargetName];
11 | [WEST, [attackTask], [_tskDescription, _tskDescription, currentTargetMarkerName], (getMarkerPos currentTargetMarkerName), 1, 2, true] call BIS_fnc_taskCreate;
12 |
13 | _tskDisplayName = format ["Destroy Radio Tower"];
14 | towerTask = format ["%1_RTtask", currentTargetName];
15 | _pos = [position currentTarget , 100, 300, 10, 0, 0.3, 0] call BIS_fnc_findSafePos;
16 | _tskDescription = format ["Destroy %1's communications tower. Until this is completed, SLA reinforcements will continue to arrive from %2.", currentTargetName, text (targetLocations select (targetCounter + 1))];
17 | [WEST, [towerTask, attackTask], [_tskDescription, _tskDisplayName, currentTargetMarkerName], _pos, 1, 2, true] call BIS_fnc_taskCreate;
18 |
19 | _tskDisplayName = format ["Capture Colonel %1", name currentTargetOF];
20 | officerTask = format ["%1_OFtask", currentTargetName];
21 | _pos = [position currentTarget , 100, 300, 10, 0, 0.3, 0] call BIS_fnc_findSafePos;
22 | _tskDescription = format ["Find and capture Colonel %1. Once he is in custody at the staging base we will gather any intel we can and distribute it to our deployed units.", name currentTargetOF];
23 | [WEST, [officerTask, attackTask], [_tskDescription, _tskDisplayName, currentTargetMarkerName], _pos, 1, 2, true] call BIS_fnc_taskCreate;
24 |
25 | publicVariable "attackTask";
26 | publicVariable "towerTask";
27 | publicVariable "officerTask";
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_VehicleCheck.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 |
6 |
7 | Parameter(s):
8 | 0: GROUP
9 |
10 | Returns:
11 | 0: BOOL - Are all units inside of a vehicle?
12 | */
13 |
14 | params ["_Group"];
15 | private _Leader = leader _group;
16 |
17 | //Are they in a vehicle?
18 | private _AllInVehicle = true;
19 | private _VehArr = [];
20 | {
21 | private _Veh = objectParent _x;
22 | if !(isNull _Veh) then
23 | {
24 | _VehArr pushBackUnique _Veh;
25 | }
26 | else
27 | {
28 | _AllInVehicle = false;
29 | }
30 | } foreach (units _Group);
31 |
32 |
33 | //Once we have a list of all the vehicles, we can now do our thang!
34 |
35 | if (count _VehArr > 0) then
36 | {
37 | if (VCM_CARGOCHNG) then
38 | {
39 | {
40 | if (local _x) then
41 | {
42 | private _NE = _leader call VCM_fnc_ClstEmy;
43 | if (_NE distance2D _leader <= VCM_DISEMBARKRANGE) then
44 | {
45 | _x setUnloadInCombat [true, VCM_TURRETUNLOAD];
46 | if (VCM_Debug) then {diag_log format ["VEHICLECHECK: Group can unload! %1",_group];};
47 | }
48 | else
49 | {
50 | if (damage _x > 0.2) then
51 | {
52 | _x setUnloadInCombat [true, VCM_TURRETUNLOAD];
53 | if (VCM_Debug) then {diag_log format ["VEHICLECHECK: Group can unload! Damaged vehicle! %1",_group];};
54 | }
55 | else
56 | {
57 | _x setUnloadInCombat [false, false];
58 | if (VCM_Debug) then {diag_log format ["VEHICLECHECK: Group cant unload! %1",_group];};
59 | };
60 | };
61 | };
62 | } foreach _VehArr;
63 | }
64 | else
65 | {
66 | //If we only want to impact turrets
67 | {
68 | _x setUnloadInCombat [true, VCM_TURRETUNLOAD];
69 | } foreach _VehArr;
70 | };
71 | };
72 |
73 |
74 | private _Rtrn = [_AllInVehicle,_VehArr];
75 |
76 | _Rtrn
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_ClstObj.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Finds closest object from an array of objects
7 |
8 | Parameter(s):
9 | 0: ARRAY - Array to search for closest object
10 | 1: OBJECT - Object to search away from
11 | 2: (Optional): BOOLEAN - Defines order to sort array. True: Ascending, false, descending
12 | 3: (Optional): ???
13 |
14 | Returns:
15 | OBJECT
16 | */
17 |
18 | params ["_list","_object","_order","_script"];
19 |
20 | if (isNil "_order") then {_order = true};
21 | if (isNil "_script") then {_script = "Nil";};
22 |
23 | private _position = [0,0,0];
24 | if (isNil "_object" || {isNil "_list"}) exitWith {_closestObject = [0,0,0];_closestObject};
25 |
26 | switch (TypeName _object) do
27 | {
28 | case "OBJECT": {_position = getPosATL _object;};
29 | case "STRING": {_position = getMarkerPos _object;};
30 | case "ARRAY": {_position = _object;};
31 | case "GROUP": {_position = (getPosATL (leader _object));};
32 | };
33 |
34 | private _distanceArray = [];
35 | if (typeName _list isEqualTo "SCALAR") then {systemChat format ["_script: %1",_script];};
36 | private _newObjectDistance = 0;
37 | {
38 | if !(isNil "_x") then
39 | {
40 | _compareObjectPos = [0,0,0];
41 | switch (TypeName _x) do
42 | {
43 | case "OBJECT": {_compareObjectPos = getPosATL _x;};
44 | case "STRING": {_compareObjectPos = getMarkerPos _x;};
45 | case "ARRAY": {_compareObjectPos = _x;};
46 | case "GROUP": {_compareObjectPos = (getPosATL (leader _x));};
47 | };
48 | _newObjectDistance = _compareObjectPos distance2D _position;
49 | _distanceArray pushback [_newObjectDistance,_x];
50 | };
51 | } forEach _list;
52 |
53 | _distanceArray sort _order;
54 |
55 | private _closestObject = ((_distanceArray select 0) select 1);
56 |
57 | if (isNil "_closestObject") then {_closestObject = [0,0,0];};
58 | _closestObject
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_RStatics.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Function for defining the list of units with statics and etc.
7 |
8 | Parameter(s):
9 | 0: GROUP - Group to check for statics.
10 |
11 | Returns:
12 | ARRAY - Format [staticList, satchelList, mineList]
13 | */
14 |
15 | private _staticList = [];
16 | private _satchelList = [];
17 | private _mineList = [];
18 |
19 | {
20 | if (isNull objectParent _x) then
21 | {
22 | //Define static weapon
23 | private _currentBackPack = backpack _x;
24 | private _class = "";
25 | if !(_currentBackPack isEqualTo "") then
26 | {
27 | _class = [_currentBackPack] call VCM_fnc_Classname;
28 | private _parents = [_class,true] call BIS_fnc_returnParents;
29 | if (!(isNil "_parents")) then
30 | {
31 | if (("StaticWeapon" in _parents) || {("Weapon_Bag_Base" in _parents)}) then
32 | {
33 | private _VCOM_HASUAV = false;
34 | if (["UAV",_currentBackPack,false] call BIS_fnc_inString) then {_VCOM_HASUAV = true;};
35 | _staticList pushBack [_x,_currentBackPack,_VCOM_HASUAV];
36 | };
37 | };
38 | };
39 | //END STATIC WEAPON
40 |
41 | //_PushArray = [_hasSatchel,_ActualObj,_hasMine,_satchelArray];
42 | private _mineArray = _x call VCM_fnc_HasMine;
43 | private _hasSatchel = _mineArray select 0;
44 | private _mineObject = _mineArray select 1;
45 | private _hasMine = _mineArray select 2;
46 | private _satchelArray = _mineArray select 3;
47 |
48 | if (_hasMine) then
49 | {
50 | _mineList pushback [_x,(_mineObject select 0)];
51 | };
52 | if (_hasSatchel) then
53 | {
54 | _satchelList pushback [_x,(_satchelArray select 0)];
55 | };
56 |
57 | if (VCM_ARTYENABLE) then {_x call VCM_fnc_CheckArty;};
58 | };
59 | true;
60 | } count (units _this);
61 |
62 | private _finalList = [_staticList,_satchelList,_mineList];
63 | _finalList
--------------------------------------------------------------------------------
/EVO/fn_deployEplayer.sqf:
--------------------------------------------------------------------------------
1 | _truck = nearestObject [player, "B_Truck_01_Repair_F"];
2 | if (isNil "_truck" || (player distance _truck > 25)) exitWith {
3 | _msg = format ["You can't deploy a FARP without a Repair Truck."];
4 | ["deployed",["FARP NOT DEPLOYED", _msg]] call BIS_fnc_showNotification;
5 | };
6 |
7 | _enemyArray = (getPos player) nearEntities [["Man"], 15];
8 | {
9 | if (side _x == EAST) exitWith {
10 | _msg = format ["You can't deploy a FARP near hostiles."];
11 | ["deployed",["FARP NOT DEPLOYED", _msg]] call BIS_fnc_showNotification;
12 | };
13 | } forEach _enemyArray;
14 |
15 | if (!isNil "MASH") then {
16 | deleteVehicle MASH;
17 | _msg = format ["Your previous FARP has been removed."];
18 | ["deployed",["FARP REMOVED", _msg]] call BIS_fnc_showNotification;
19 | };
20 |
21 | if (!isNil "MASH") then {
22 | playerRespawnPoint call BIS_fnc_removeRespawnPosition;
23 | };
24 |
25 | _pos = [position player, 5, 15, 10, 0, 2, 0] call BIS_fnc_findSafePos;
26 | MASH = "USMC_WarfareBBarracks" createVehicle _pos;
27 | MASH allowDamage false;
28 | EVO_vaCrates pushBack MASH;
29 | publicVariable "EVO_vaCrates";
30 | {
31 | [_x, rank player] call EVO_fnc_buildAmmoCrate;
32 | } forEach EVO_vaCrates;
33 | player playMoveNow "Acts_carFixingWheel";
34 |
35 | _mark = format["%1mash",(name player)];
36 | deleteMarker _mark;
37 |
38 | _mssg = format["%2 %1's FARP",(name player), (rank player)];
39 | playerRespawnPoint = [(side player), (getPos player), _mssg] call BIS_fnc_addRespawnPosition;
40 | _medmark = createMarker [_mark, getPos player];
41 | _medmark setMarkerShape "ICON";
42 | _medmark setMarkerType "b_maint";
43 | _medmark setMarkerColor "ColorBlue";
44 | _medmark setMarkerText _mssg;
45 | _medmark setMarkerSize [1, 1];
46 | sleep 5;
47 | _msg = format ["Your FARP has been deployed at map grid %1.", mapGridPosition player];
48 | ["deployed",["FARP DEPLOYED", _msg]] call BIS_fnc_showNotification;
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_RearmSelf.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | This function will determine if an group is low on ammo and needs to re-arm.
7 |
8 | Parameter(s):
9 | 0: GROUP - Group to check ammo
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | private _magLimit = VCM_AIMagLimit;
16 | {
17 | private _orgUnit = _x;
18 | if !(vehicle _x isEqualTo _x) exitWith {};
19 |
20 | //The first thing we want to do. Is figure out what ammo this unit is using.
21 | private _curMag = currentMagazine _x;
22 |
23 | //Now, we want to compare this classname to all the other ammo classnames this unit may have and count the number.
24 | private _mags = magazines _x;
25 |
26 | //Count the total number of mags.
27 | private _magCount = 0;
28 | { if (_x isEqualTo _curMag) then {_magCount = _magCount + 1};true;} count _mags;
29 |
30 | //If unit has less than the wanted limit, then make the unit find ammo!
31 | if (_magCount < _magLimit) then {
32 | //Find closest men!
33 | _potRearm = _x nearEntities [["WeaponHolderSimulated", "Man", "Air", "Car", "Motorcycle", "Tank"], 200];
34 | _potRearm = _potRearm - [_x];
35 | {
36 | if (alive _x && {_x isKindOf "Man"}) then {_potRearm = _potRearm - [_x];};
37 | true;
38 | } count _potRearm;
39 |
40 | //If men are around see if we can take ammo from them first.
41 | _stop = false;
42 | if (count _potRearm != 0) then {
43 | {
44 | _mags = [];
45 | _unit = _x;
46 | if (_unit isKindOf "Man") then {
47 | _mags = magazines _unit;
48 | } else {
49 | _mags = magazineCargo _unit;
50 | };
51 | if (isNil "_mags") then {_mags = [];};
52 | {
53 | if (_x isEqualTo _curMag) exitwith {
54 | [_orgUnit,_unit] spawn VCM_fnc_ActRearm;
55 | _stop = true;
56 | };
57 | true;
58 | } count _mags;
59 | if ( _stop ) exitwith {};
60 | true;
61 | } count _potRearm;
62 | };
63 | };
64 | true;
65 | } count (units _this);
--------------------------------------------------------------------------------
/EVO/fn_createComposition.sqf:
--------------------------------------------------------------------------------
1 | private ["_pos","_composition","_sortedByDist","_frstNum","_secNum","_biggestOffset","_biggestOffsetAbs","_boundingSize","_type","_bbdummy","_boundingBox","_radius","_sortedBySize","_flatPos"];
2 |
3 | _pos = _this select 0;
4 | _composition = call (compile (preprocessFileLineNumbers (_this select 1)));
5 | _sortedByDist = [_composition,[],{
6 | _frstNum = abs (_x select 1 select 0);
7 | _secNum = abs (_x select 1 select 1);
8 | if (_frstNum > _secNum) then {_frstNum} else {_secNum}
9 | },"DESCEND"] call BIS_fnc_sortBy;
10 | _biggestOffset = (_sortedByDist select 0) select 1;
11 | _biggestOffsetAbs = if (abs (_biggestOffset select 0) > abs (_biggestOffset select 1)) then {abs (_biggestOffset select 0)} else {abs (_biggestOffset select 1)};
12 | _boundingSize = [_sortedByDist select 0 select 0] call {
13 | _type = _this select 0;
14 | _bbdummy = _type createVehicleLocal [0,0,0];
15 | _boundingBox = (boundingBox _bbdummy) select 1;
16 | deleteVehicle _bbdummy;
17 | _boundingSize = if (_boundingBox select 0 > _boundingBox select 1) then {_boundingBox select 0} else {_boundingBox select 1};
18 | _boundingSize
19 | };
20 | _radius = _biggestOffsetAbs + _boundingSize;
21 | _sortedBySize = [_composition,[],{sizeOf (_x select 0)},"DESCEND"] call BIS_fnc_sortBy;
22 | _boundingSize = [_sortedBySize select 0 select 0] call {
23 | _type = _this select 0;
24 | _bbdummy = _type createVehicleLocal [0,0,0];
25 | _boundingBox = (boundingBox _bbdummy) select 1;
26 | deleteVehicle _bbdummy;
27 | _boundingSize = if (_boundingBox select 0 > _boundingBox select 1) then {_boundingBox select 0} else {_boundingBox select 1};
28 | _boundingSize
29 | };
30 | if (_boundingSize > _radius) then {
31 | _radius = _boundingSize;
32 | };
33 |
34 |
35 | _safePosition = [_pos, 1, 100, _radius, 0, 3, 0] call BIS_fnc_findSafePos;
36 | _compComplete = [_pos, random 360, _composition] call BIS_fnc_ObjectsMapper;
37 |
38 | _compComplete;
--------------------------------------------------------------------------------
/bon_recruit_units/recruitable_units.sqf:
--------------------------------------------------------------------------------
1 | //Adapted from Zonekiller's Array Builder -- Moser 07/18/2014
2 | //http://forums.bistudio.com/showthread.php?109423-Zonekiller-s-Array-Builder
3 |
4 | //Determines faction and classname of player, then convert them to strings (strings are easier to work with configs!)
5 |
6 | _faction = [format["%1",faction player]];
7 | _classname = format["%1",typeOf player];
8 |
9 | _allowedmenclass = ["Man"]; //required if you want to only find men and not vehicles
10 |
11 | // Men not to add -- optional
12 |
13 | _forbidedmenclass = [];
14 |
15 | // List of arrays it will make -- only need one global array to pass to the rest of Bon's scripts
16 | //-----------------------------------
17 |
18 | bon_recruit_recruitableunits = [];
19 |
20 | //--------------------------------
21 |
22 | //Some config functions
23 |
24 | _CfgVehicles = configFile >> "CfgVehicles";
25 | _CfgVehicleClass = configFile >> "CfgVehicleClass";
26 |
27 | //Find player's subfaction
28 |
29 | _subfaction = [getText(_CfgVehicles >> _classname >> "vehicleClass")];
30 |
31 | for "_i" from 1 to ((count _CfgVehicles) - 1) do
32 | {
33 | _Vehicle = _CfgVehicles select _i;
34 |
35 | if ((isClass _Vehicle) && ((getnumber(_Vehicle >> "scope")) == 2) && !((configName _Vehicle) isKindOf "Building") && !((configName _Vehicle) isKindOf "Thing")) then
36 | {
37 |
38 | _go = 0;
39 |
40 | {if ((configName _Vehicle) isKindOf _x) exitwith {_go = 1;
41 |
42 | {if ((configName _Vehicle) isKindOf _x) exitwith {_go = 0}} foreach _forbidedmenclass;
43 |
44 | // Makes arrays of men from the faction and subfaction
45 |
46 | if (_go == 1) then
47 | {
48 | if ((getText(_Vehicle >> "faction") in _faction) && (getText(_Vehicle >> "vehicleClass") in _subfaction)) then {bon_recruit_recruitableunits = bon_recruit_recruitableunits + [configName _Vehicle]};
49 | };
50 |
51 | _go = 0;
52 |
53 | }} foreach _allowedmenclass;
54 | };
55 | };
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_IRCHECK.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Reveals players using IR-laser to enemies with NVGs.
7 |
8 | Parameter(s):
9 | NONE
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | while {alive player && {Vcm_ActivateAI}} do
16 | {
17 | if (player isIRLaserOn currentWeapon player) then
18 | {
19 | private _side = side player;
20 |
21 | private _wepDir = (player weaponDirection currentWeapon player) vectorMultiply 1000;
22 | private _eyePosS = eyePos player;
23 | private _eyePosB = [_eyePosS select 0,_eyePosS select 1,(_eyePosS select 2 - 0.25)];
24 | private _endSight = _eyePosB vectoradd _wepDir;
25 | private _lineInter = lineIntersectsSurfaces [_eyePosB, _endSight, player, player, true, 1];
26 |
27 | if !(_lineInter isEqualTo []) then
28 | {
29 | private _finalPos = (_lineInter select 0 select 0);
30 | private _enemies = allUnits select {[_side,(side _x)] call BIS_fnc_sideIsEnemy && (currentVisionMode _x isEqualTo 1)};
31 | private _dirPlayer = getdir Player;
32 | if !(_enemies isEqualTo []) then
33 | {
34 | private _startPos = (getpos player);
35 | private _toalDist = _startPos distance2D _finalPos;
36 | private _chunks = round (_toalDist/100);
37 | private _chunkN = 0;
38 | while {_chunks > _chunkN} do
39 | {
40 | _startPos = [_startPos,100,_dirPlayer] call BIS_fnc_relPos;
41 | private _ne = [_enemies,_startPos,true,"IR"] call VCM_fnc_ClstObj;
42 | if (_ne distance2D _startPos < 65) exitWith
43 | {
44 | [
45 | [_ne,player],
46 | {
47 | params ["_ne","_unit"];
48 | if (local _ne) then
49 | {
50 | private _kv = _ne knowsAbout _unit;
51 | _ne reveal [_unit,(_kv + 0.4)];
52 | };
53 | }
54 | ] remoteExec ["bis_fnc_call",0];
55 | };
56 | _chunkN = _chunkN + 1;
57 | sleep 0.1;
58 | };
59 | };
60 | sleep 0.25;
61 | };
62 | };
63 | sleep 0.25;
64 | };
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_HearingAids.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Firing unsuppressed shots reveals unit.
7 |
8 | Parameter(s):
9 | 0: OBJECT - Unit that fired
10 | 1: STRING - Weapon fired
11 | 2: STRING - Muzzle used
12 | 3: STRING - Firing mode
13 | 4: STRING - Ammo used
14 | 5: STRING - Magazine used
15 | 6: OBJECT - Projectile created
16 | 7: OBJECT - Gunner whose weapon was fired (For use with vehicles)
17 |
18 | Returns:
19 | NOTHING
20 |
21 | Note:
22 | For use with "Fired" eventhandler
23 |
24 | Example1:
25 | this addEventHandler ["Fired", {
26 | _this call VCM_fnc_HearingAids;
27 | }];
28 | */
29 |
30 | params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_bullet","_gunner"];
31 |
32 | if (_weapon isEqualTo "Put" || {_weapon isEqualTo "Throw"}) exitwith {};
33 |
34 | private _timeShot = _unit getVariable ["VCM_FTH",-60];
35 |
36 | if ((_timeShot + 10) < time) then
37 | {
38 |
39 | if ((group _unit) getVariable ["VCM_NOFLANK",false]) exitWith {};
40 |
41 | //Check if unit has suppressor on weapon.
42 | private _mzl = currentMuzzle _unit;
43 | private _mzl = if (_mzl isEqualType "") then {_mzl} else {""};
44 | private _atch = _unit weaponAccessories _mzl param [0, ""];
45 | private _return = (!(_atch isEqualTo "")) && {getNumber(configFile >> "CfgWeapons" >> _atch >> "ItemInfo" >> "AmmoCoef" >> "audibleFire") < 1};
46 |
47 | if (VCM_Debug) then {diag_log (format ["%2: WEAPON SUPRRESSED - %1",_return,_unit])};
48 |
49 | //systemchat format ["%1",_sup];
50 | if !(_return) then
51 | {
52 | private _array1 = _unit call VCM_fnc_EnemyArray;
53 | private _snda = [];
54 | {
55 | if ((_x distance2D _unit) < VCM_HEARINGDISTANCE) then
56 | {
57 | _snda pushback _x;
58 | };
59 | } foreach _array1;
60 |
61 | if (count _snda > 0) then
62 | {
63 | [_snda,_unit,0.1] remoteExec ["VCM_fnc_KnowAbout",0];
64 | };
65 |
66 | _unit setVariable ["VCM_FTH",time];
67 | };
68 |
69 | };
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_Garrison.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis, tweaked by Freddo
4 |
5 | Description:
6 | Function for getting AI to garrison buildings and then move around inside them.
7 |
8 | Parameter(s):
9 | 0: GROUP
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | //Lets find the closest building
16 |
17 | private _unit = (leader _this);
18 | private _nBuildingLst = nearestObjects [waypointPosition [_this, 1], ["House", "Building"], 50];
19 | private _nBuilding = [0,0,0];
20 | private _buildingPositions = [];
21 | {
22 | _buildingPositions = [_x] call BIS_fnc_buildingPositions;
23 | if ((count _buildingPositions) > 2) exitWith {_nBuilding = _x;};
24 | } forEach _nBuildingLst;
25 |
26 |
27 | //waitUntil unit is within 50m of building closest to waypoint
28 | waitUntil {isNull _unit || {!alive _unit} || {_nBuilding distance2D _unit < 50}};
29 |
30 |
31 | //If the array is not more than 0 - then exit.
32 |
33 |
34 | //Find the units in the group!
35 | _groupUnits = units _this;
36 | _this setVariable ["VCOM_GARRISONED",true,false];
37 | private _waypointIs = "HOLD";
38 | while {_waypointIs isEqualTo "HOLD"} do
39 | {
40 | private _index = currentWaypoint _this;
41 | private _waypointIs = waypointType [_this,_index];
42 | private _tempA = _buildingPositions;
43 | if (count _tempA > 0) then
44 | {
45 | {
46 | private _foot = isNull objectParent _x;
47 | if (_foot) then
48 | {
49 | private _buildingLocation = selectRandom _tempA;
50 | if !(isNil "_buildingLocation") then
51 | {
52 | _x doMove _buildingLocation;
53 | _x setUnitPos "UP";
54 | [_x,_buildingLocation] spawn
55 | {
56 | params ["_unit","_buildingLocation"];
57 | if (isNil "_buildingLocation") exitWith {};
58 | waitUntil {!alive _unit || {_unit distance _buildingLocation < 1.3}};
59 | _unit disableAI "PATH";
60 | };
61 | private _RMV = _tempA findIf {_buildingLocation isEqualTo _x};
62 | _tempA deleteAt _RMV;
63 | };
64 | };
65 | } forEach _groupUnits;
66 |
67 |
68 | };
69 | sleep (30 + (random 60));
70 | };
71 |
--------------------------------------------------------------------------------
/EVO/fn_supportManager.sqf:
--------------------------------------------------------------------------------
1 | private ["_spendable","_lastSpendable"];
2 | hasCas = false;
3 | hasArty = false;
4 | hasMortar = false;
5 | hasRocket = false;
6 | hasRessuply = false;
7 | hasUAV = false;
8 | spendable = 0;
9 | lastSpendable = 0;
10 | spendable = [player] call EVO_fnc_supportPoints;
11 | if (spendable != lastSpendable) then {
12 | if (spendable >= 4 && !hasMortar) then {
13 | uavComm = [player, "uavRequest"] call BIS_fnc_addCommMenuItem;
14 | hasUAV = true;
15 | };
16 | if (spendable >= 5 && !hasMortar) then {
17 | mortarStrikeComm = [player, "mortarStrike"] call BIS_fnc_addCommMenuItem;
18 | hasMortar = true;
19 | };
20 |
21 | if (spendable >= 6 && !hasArty) then {
22 | artyStrikeComm = [player, "artyStrike"] call BIS_fnc_addCommMenuItem;
23 | hasArty = true;
24 | };
25 |
26 | if (spendable >= 7 && !hasCas) then {
27 | casStrikeComm = [player, "fixedCasStrike"] call BIS_fnc_addCommMenuItem;
28 | hasCas = true;
29 | };
30 |
31 | if (spendable >= 8 && !hasRocket) then {
32 | rocketStrikeComm = [player, "rocketStrike"] call BIS_fnc_addCommMenuItem;
33 | hasRocket = true;
34 | };
35 |
36 | if (_spendable >= 9) then {
37 | //arty?
38 | };
39 |
40 | if (_spendable >= 10) then {
41 | //icbm?
42 | };
43 |
44 | //
45 | //
46 | //
47 |
48 | if (_spendable < 5) then {
49 | [player, mortarStrikeComm] call BIS_fnc_removeCommMenuItem;
50 | hasMortar = false;
51 | };
52 |
53 | if (_spendable < 6) then {
54 | [player, artyStrikeComm] call BIS_fnc_removeCommMenuItem;
55 | hasArty = false;
56 | };
57 |
58 | if (_spendable < 7) then {
59 | [player, casStrikeComm] call BIS_fnc_removeCommMenuItem;
60 | hasCas = false;
61 | };
62 |
63 | if (_spendable < 8) then {
64 | [player, rocketStrikeComm] call BIS_fnc_removeCommMenuItem;
65 | hasRocket = false;
66 | };
67 |
68 | if (_spendable < 9) then {
69 |
70 | };
71 |
72 | if (_spendable < 10) then {
73 |
74 | };
75 |
76 | lastSpendable = spendable;
77 | };
78 |
--------------------------------------------------------------------------------
/EVO/fn_paradrop.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Filename: Simple ParaDrop Script v0.8 Beta eject.sqf
3 | Author: Beerkan:
4 | Additional contributions cobra4v320
5 |
6 | Description:
7 | A simple paradrop script that ejects all units assigned as cargo onboard, including players and AI (excluding crew) regardless of group assignments, side etc.
8 | If you're in the aircraft you're getting thrown out.
9 |
10 | Parameter(s):
11 | 0: VEHICLE - vehicle that will be doing the paradrop (object)
12 | 1: ALTITUDE - (optional) the altitude where the group will open their parachute (number)
13 |
14 | Example:
15 | _drop = [vehicle, altitude] execVM "eject.sqf"
16 | */
17 |
18 | if (!isServer && hasInterface) exitWith {};
19 | private ["_vehicle","_chuteheight","_paras","_dir"];
20 | _vehicle = _this select 0;
21 | _chuteheight = 150;
22 | _paras = assignedcargo _vehicle;
23 | _dir = direction _vehicle;
24 | [_paras] allowGetIn false;
25 |
26 | paraLandSafe =
27 | {
28 | private ["_unit"];
29 | _unit = _this select 0;
30 | (vehicle _unit) allowDamage false;// Set parachute invincible to prevent exploding if it hits buildings
31 | waitUntil {isTouchingGround _unit || (position _unit select 2) < 1 };
32 | _unit allowDamage false;
33 | _unit action ["EJECT", vehicle _unit];
34 | _unit setvelocity [0,0,0];
35 | sleep 1;// Para Units sometimes get damaged on landing. Wait to prevent this.
36 | _unit allowDamage true;
37 | };
38 |
39 | {
40 | _x disableCollisionWith _vehicle;
41 | _x allowdamage false;
42 | unassignvehicle _x;
43 | _x action ["GETOUT", _vehicle];
44 | _x setDir (_dir + 90);
45 | sleep 0.35;//So units are not too far spread out when they land.
46 | } forEach _paras;
47 |
48 | {
49 | waitUntil {(position _x select 2) <= _chuteheight};
50 | if (vehicle _x != _x) exitWith {};
51 | _chute = createVehicle ["Steerable_Parachute_F", position _x, [], ((_dir)- 5 + (random 10)), 'FLY'];
52 | _chute setPos (getPos _x);
53 | _x assignAsDriver _chute;
54 | _x moveIndriver _chute;
55 | _x allowdamage true;
56 | } forEach _paras;
57 |
58 | {
59 | [_x] spawn paraLandSafe;
60 | } forEach _paras;
--------------------------------------------------------------------------------
/Comps/farp.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Grab data:
3 | Mission: otl7_dyno_a3
4 | World: VR
5 | Anchor position: [6959.54, 7505.78]
6 | Area size: 200
7 | Using orientation of objects: yes
8 | */
9 |
10 | [
11 | ["CamoNet_BLUFOR_open_Curator_F",[0.194824,-0.445313,0],0,1,0,[0,0],"","",true,false],
12 | ["Land_CampingChair_V2_F",[2.24121,-1.18945,2.14577e-005],266.753,1,0,[0.00235812,-0.00299848],"","",true,false],
13 | ["Land_Camping_Light_F",[2.56445,-0.270508,-0.00113392],0.129508,1,0,[-0.106925,0.0654395],"","",true,false],
14 | ["Land_Pallets_F",[-1.18359,-3.10498,0.097342],299.142,1,0,[0,0],"","",true,false],
15 | ["Land_CampingTable_small_F",[2.75488,-2.1123,-7.62939e-006],39.2759,1,0,[-0.00288449,0.000414949],"","",true,false],
16 | ["Campfire_burning_F",[4.06494,-0.938965,0.0299988],0,1,0,[0,0],"","",true,false],
17 | ["CargoNet_01_box_F",[-4.3667,-0.788086,1.43051e-006],326.102,1,0,[0.0001548,-4.82198e-005],"","",true,false],
18 | ["Land_CampingChair_V1_folded_F",[3.77686,-2.54346,0],0,1,0,[0,0],"","",true,false],
19 | ["Land_PaperBox_open_empty_F",[-4.32666,-3.13135,0],0,1,0,[0,0],"","",true,false],
20 | ["Land_MetalBarrel_F",[3.26367,4.37256,5.38826e-005],14.1208,1,1,[0.000964497,-0.0156054],"","",true,false],
21 | ["CargoNet_01_barrels_F",[4.60693,2.99902,1.43051e-006],66.2272,1,0,[-0.000621746,0.00010432],"","",true,false],
22 | ["Land_MetalBarrel_F",[4.15137,4.87598,5.48363e-005],68.3139,1,1,[0.000570037,-0.0156993],"","",true,false],
23 | ["Land_PaperBox_closed_F",[-6.23438,-1.46484,0],73.5976,1,0,[0,0],"","",true,false],
24 | ["Land_TentA_F",[6.64502,-1.97705,0.0102367],116.467,1,0,[0,-0],"","",true,false],
25 | ["PortableHelipadLight_01_blue_F",[-5.59814,6.58008,4.76837e-007],358.838,1,0,[-0.00314739,-0.00418967],"","",true,false],
26 | ["PortableHelipadLight_01_blue_F",[5.70117,6.5498,4.76837e-007],0.0399257,1,0,[-0.00319844,-0.00414758],"","",true,false],
27 | ["Land_HelipadSquare_F",[0.0571289,12.2422,0],0,1,0,[0,0],"","",true,false],
28 | ["Windsock_01_F",[-8.32129,12.5205,0],0,1,0,[0,0],"","",true,false],
29 | ["PortableHelipadLight_01_blue_F",[-5.61865,17.8525,4.76837e-007],359.987,1,0,[-0.00320881,-0.00412181],"","",true,false],
30 | ["PortableHelipadLight_01_blue_F",[5.70068,17.8564,4.76837e-007],359.973,1,0,[-0.00320492,-0.00414291],"","",true,false]
31 | ]
--------------------------------------------------------------------------------
/CHVD/fn_updateSettings.sqf:
--------------------------------------------------------------------------------
1 | _updateType = [_this, 0, 0, [0]] call BIS_fnc_param; // 1 - view, 2 - obj, 3 - both, 0 - both and terrain
2 | _inUAV = if (isNil {_this select 1}) then {UAVControl (getConnectedUAV player) select 1 != ""} else {_this select 1};
3 |
4 | if (_inUAV) then {
5 | switch (true) do {
6 | case (getConnectedUAV player isKindOf "LandVehicle" || getConnectedUAV player isKindOf "Ship"): {
7 | if (_updateType == 1 || _updateType == 0 || _updateType == 3) then {
8 | setViewDistance CHVD_car;
9 | };
10 | if (_updateType == 2 || _updateType == 0 || _updateType == 3) then {
11 | setObjectViewDistance CHVD_carObj;
12 | };
13 | };
14 | case (getConnectedUAV player isKindOf "Man"): {
15 | if (_updateType == 1 || _updateType == 0 || _updateType == 3) then {
16 | setViewDistance CHVD_foot;
17 | };
18 | if (_updateType == 2 || _updateType == 0 || _updateType == 3) then {
19 | setObjectViewDistance CHVD_footObj;
20 | };
21 | };
22 | default {
23 | if (_updateType == 1 || _updateType == 0 || _updateType == 3) then {
24 | setViewDistance CHVD_air;
25 | };
26 | if (_updateType == 2 || _updateType == 0 || _updateType == 3) then {
27 | setObjectViewDistance CHVD_airObj;
28 | };
29 | };
30 | };
31 | } else {
32 | switch (true) do {
33 | case (vehicle player isKindOf "LandVehicle" || vehicle player isKindOf "Ship"): {
34 | if (_updateType == 1 || _updateType == 0 || _updateType == 3) then {
35 | setViewDistance CHVD_car;
36 | };
37 | if (_updateType == 2 || _updateType == 0 || _updateType == 3) then {
38 | setObjectViewDistance CHVD_carObj;
39 | };
40 | };
41 | case (vehicle player isKindOf "Air"): {
42 | if (_updateType == 1 || _updateType == 0 || _updateType == 3) then {
43 | setViewDistance CHVD_air;
44 | };
45 | if (_updateType == 2 || _updateType == 0 || _updateType == 3) then {
46 | setObjectViewDistance CHVD_airObj;
47 | };
48 | };
49 | default {
50 | if (_updateType == 1 || _updateType == 0 || _updateType == 3) then {
51 | setViewDistance CHVD_foot;
52 | };
53 | if (_updateType == 2 || _updateType == 0 || _updateType == 3) then {
54 | setObjectViewDistance CHVD_footObj;
55 | };
56 | };
57 | };
58 | };
59 | if (_updateType == 0) then {
60 | [_inUAV] call CHVD_fnc_updateTerrain;
61 | };
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_Heights.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 | Finds highest and lowest points in an area.
6 |
7 | Parameter(s):
8 | 0: OBJECT - Center object
9 | 1: NUMBER - Radius around object to search
10 | 2 (Optional): NUMBER - Precision, recommended not setting lower than 5 (Default 50)
11 | 3 (Optional): BOOLEAN - Sort output. true: ascending, false: descending (Default: true)
12 |
13 | Returns:
14 | ARRAY
15 |
16 | Example1:
17 | _Test = [Object Center,radius,Precision (Recommended no lower than 5),false] call VCM_fnc_Heights;
18 | //player setposASL (_Test select 0 select 1); -> Highest point
19 | //player setposASL (_Test ((count _Test) - 1) select 1); -> Lowest Point
20 | */
21 |
22 | params ["_obj","_range","_prec","_sort"];
23 | if (isNil "_prec") then {private _prec = 50};
24 | if (_prec < 1) then {_prec = 1};
25 | if (isNil "_sort") then {private _sort = true};
26 |
27 | private _rng = (_range/2);
28 | private _array1 = [];
29 | private _centerPos = (getpos _obj);
30 | private _startingPos = [(_centerPos select 0) - _rng,(_centerPos select 1) - _rng,(_centerPos select 2)];
31 | private _endingPos = [(_centerPos select 0) + _rng,(_centerPos select 1) + _rng,(_centerPos select 2)];
32 | private _starterArray = [];
33 | private _counter = 0;
34 | private _limit = (round (_range/_prec));
35 | while {_counter < _limit} do
36 | {
37 | _starterArray pushback _startingPos;
38 | _startingPos = [(_startingPos select 0),(_startingPos select 1)+_prec,(_startingPos select 2)];
39 | _array1 pushback _startingPos;
40 | _counter = _counter + 1;
41 | };
42 |
43 | {
44 | _markerPos = _x;
45 | _startingPos = [(_markerPos select 0)+_prec,(_markerPos select 1),(_markerPos select 2)];
46 | _counter = 0;
47 | while {_counter < _limit} do
48 | {
49 | _array1 pushback _startingPos;
50 | _startingPos = [(_startingPos select 0) + _prec,(_startingPos select 1),(_startingPos select 2)];
51 | _counter = _counter + 1;
52 | };
53 | } foreach _starterArray;
54 |
55 | private _finalArray = [];
56 | {
57 | private _height = [(_x select 0),(_x select 1),(getTerrainHeightASL _x)];
58 | private _FinalPush = [(_height select 2),_height];
59 | _finalArray pushback _FinalPush;
60 | } foreach _array1;
61 |
62 | //False is the highest. True is the shortest.
63 | _finalArray sort _sort;
64 |
65 | _finalArray
66 |
67 |
--------------------------------------------------------------------------------
/EVO/fn_support_uav.sqf:
--------------------------------------------------------------------------------
1 | private ["_caller","_pos","_is3D","_ID","_grpSide","_grp","_score","_newUaVrequest","_spawnPos","_retArray","_uav","_vehicle"];
2 |
3 | _caller = _this select 0;
4 | _caller playMoveNow "Acts_listeningToRadio_Loop";
5 | _pos = _this select 1;
6 | _target = _this select 2;
7 | _is3D = _this select 3;
8 | _ID = _this select 4;
9 | _grpSide = side _caller;
10 | _uav = uav_west;
11 | _busy = _uav getVariable ["EVO_support_busy", false];
12 | if (_busy) exitWith {
13 | [_caller, format["Crossroads, this is %1, requesting UAV support, over.", groupID (group _caller)]] call EVO_fnc_globalSideChat;
14 | sleep 3.5;
15 | [Crossroads, format["%1, this is Crossroads, UAV is unavailable, out.", groupID (group _caller)]] call EVO_fnc_globalSideChat;
16 | };
17 | _grp = group _caller;
18 | [_caller, -10] call bis_fnc_addScore;
19 | ["PointsRemoved",["UAV request initiated.", 10]] call BIS_fnc_showNotification;
20 | if (!("B_UavTerminal" in (assignedItems _caller))) exitWith {
21 | [_caller, format["Crossroads, this is %1, requesting UAV support, over.", groupID (group _caller)]] call EVO_fnc_globalSideChat;
22 | sleep 3.5;
23 | [Crossroads, format["%1, this is Crossroads, you're not deployed with a UAV terminal, RTB and pick it up at the staging base, out.", groupID (group _caller)]] call EVO_fnc_globalSideChat;
24 | _newUaVrequest = [_caller, "uavRequest"] call BIS_fnc_addCommMenuItem;
25 | [_caller, 10] call bis_fnc_addScore;
26 | ["PointsAdded",["UAV request canceled.", 10]] call BIS_fnc_showNotification;
27 | };
28 | _uav setVariable ["EVO_support_busy", true, true];
29 | [_caller, format["Crossroads, this is %1, requesting a UAV, over.", groupID (group _caller)]] call EVO_fnc_globalSideChat;
30 | sleep 3;
31 | [Crossroads, format["%1, this is Crossroads, copy your last. Wait one, over.", groupID (group _caller)]] call EVO_fnc_globalSideChat;
32 | sleep 10;
33 | _caller connectTerminalToUAV _uav;
34 | _uav setFuel 1;
35 | _uav setVehicleAmmo 1;
36 | _uav setDamage 0;
37 | [_caller, _uav] spawn {
38 | _caller = _this select 0;
39 | _uav = _this select 1;
40 | sleep 300;
41 | _caller connectTerminalToUAV objNull; //disconnect
42 | _uav setVariable ["EVO_support_busy", false, true];
43 | [Crossroads, format["%1, this is Crossroads. UAV is needed elsewhere, we're reallocating support, out.", groupID (group _caller)]] call EVO_fnc_globalSideChat;
44 | }
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_ArmStatics.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 | Makes group arm nearby static weapons.
6 |
7 | Parameter(s):
8 | 0: GROUP - Affected group
9 |
10 | Returns:
11 | NOTHING
12 |
13 | Example1: groupAlpha call VCM_fnc_ArmStatics;
14 | */
15 |
16 | private _leader = (leader _this);
17 | private _weaps = nearestObjects [_leader, ["StaticWeapon"], 150];
18 | private _unitArray = (units _this);
19 | if (count _weaps < 0) exitWith {};
20 | private _assignedPairs = []; //Static weapon - Gunner pair
21 |
22 | {
23 | private _unit = [_unitArray,_x,true,"W1"] call VCM_fnc_ClstObj;
24 |
25 | //VCM_fnc_ClstObj returns [0,0,0] if nothing found
26 | if (_unit isEqualTo [0,0,0]) exitWith {};
27 |
28 | private _foot = isNull objectParent _unit;
29 | if (_foot) then
30 | {
31 | if (_unit distance2D _x < 100) then
32 | {
33 | _assignedPairs pushback [_unit,_x];
34 | _unitArray deleteAt (_unitArray findIf {_x isEqualTo _unit});
35 | };
36 | };
37 | } foreach _weaps;
38 |
39 | if (count _assignedPairs isEqualTo 0) exitWith {};
40 |
41 | {
42 | _x spawn
43 | {
44 | params ["_unit","_weap"];
45 | private _assignedGunner = assignedGunner _weap;
46 | if (isNull _assignedGunner) then
47 | {
48 | _unit doMove (getposATL _weap);
49 | _unit assignAsGunner _weap;
50 | [_unit] orderGetIn true;
51 | _Waiting = 0;
52 | while {(alive _unit) && {_unit distance _weap > 4}} do
53 | {
54 | sleep 1;
55 | };
56 | _unit moveInGunner _weap;
57 | [_unit,_weap] spawn
58 | {
59 | params ["_unit","_weap"];
60 | private _staticGreen = true;
61 | private _statictime = VCM_STATICARMT;
62 |
63 | while {_staticGreen && {alive _unit} && {alive _weap} && {!(isNull (gunner _weap))} && {_unit distance2D (leader (group _unit)) < 500} && {behaviour _unit isEqualTo "COMBAT"}} do
64 | {
65 | sleep 5;
66 | private _enemy = _unit findNearestEnemy _unit;
67 | if (!(isNull _enemy)) then
68 | {
69 | private _cansee = [_unit, "VIEW"] checkVisibility [eyePos _unit, eyePos _enemy];
70 | if (_cansee > 0) then {_statictime = _statictime + 3;} else {_statictime = _statictime - 5;};
71 | }
72 | else
73 | {
74 | _statictime = _statictime - 5;
75 | };
76 | if (_statictime < 1) then {_staticGreen = false;};
77 | };
78 |
79 | unassignVehicle _unit;
80 | _unit leaveVehicle _weap;
81 | doGetOut _unit;
82 |
83 | };
84 | };
85 | };
86 | } foreach _assignedPairs;
--------------------------------------------------------------------------------
/bon_recruit_units/dialog/recruitment.hpp:
--------------------------------------------------------------------------------
1 | // by Bon_Inf*
2 | //Modified by Moser -- 07/18/2014
3 |
4 | #include "definitions.sqf"
5 |
6 | class RecruitUnitsDialog {
7 | idd = BON_RECRUITING_DIALOG;
8 | movingEnable = true;
9 | enableSimulation = true;
10 | onLoad = "[] execVM 'bon_recruit_units\build_unitlist.sqf'";
11 |
12 | __EXEC( _xSpacing = 0.0075; _ySpacing = 0.01;)
13 | __EXEC( _xInit = 12 * _xSpacing; _yInit = 18 * _ySpacing;)
14 | __EXEC( _windowWidth = 101; _windowHeight = 64;)
15 | __EXEC( _windowBorder = 1;)
16 |
17 | class controlsBackground {
18 | class Mainbackgrnd : BON_RscPicture {
19 | moving = true;
20 | idc = BON_RECRUITING_BCKGRND;
21 | x = 0.1; y = 0.101;
22 | w = 0.55; h = 0.8;
23 | text = "bon_recruit_units\dialog\ui_background_controlers_ca.paa";
24 | };
25 | class RecruitUnitsTitle : BON_RscText {
26 | idc = BON_RECRUITING_TITLE;
27 | x = 0.22; y = 0.13;
28 | w = __EVAL(50 * _xSpacing);
29 | h = __EVAL(3 * _ySpacing);
30 | colorText[] = Color_White;
31 | colorBackground[] = { 1, 1, 1, 0 };
32 | sizeEx = 0.04;
33 | text = "Unit Recruitment";
34 | };
35 | };
36 | class controls {
37 | class RecruitQueue : BON_RscText {
38 | idc = BON_RECRUITING_QUEUE;
39 | x = 0.25; y = 0.2;
40 | w = __EVAL(50 * _xSpacing);
41 | h = __EVAL(3 * _ySpacing);
42 | colorText[] = { 1, 1, 1, 0.8 };
43 | colorBackground[] = { 1, 1, 1, 0 };
44 | sizeEx = 0.03;
45 | text = "";
46 | };
47 | class Unitlist: BON_RscListBox {
48 | idc = BON_RECRUITING_UNITLIST;
49 | default = 1;
50 | x = 0.101; y = 0.275;
51 | w = 0.405; h = 0.50;
52 | //lineSpacing = 0;
53 | colorSelect[] = {0, 0, 0, 0.9};
54 | colorSelect2[] = {0, 0, 0, 0.9};
55 | colorSelectBackground[] = {1, 1, 1, 0.3};
56 | colorSelectBackground2[] = {1, 1, 1, 0.9};
57 | onLBSelChanged = "";
58 | onLBDblClick = "execVM 'bon_recruit_units\recruit.sqf'";
59 | rowHeight = 0.025;
60 | soundSelect[] = {"\A3\ui_f\data\Sound\RscButtonMenu\soundClick", 0.07, 1};
61 | maxHistoryDelay = 10;
62 | canDrag = 0;
63 | xcolumn1 = "0.1f";
64 | xcolumn2 = "0.25f";
65 | xcolumn3 = "0.85f";
66 | };
67 | class RecruitButton: HW_RscGUIShortcutButton {
68 | x = 0.325; y = 0.825;
69 | w = 0.125; h = 0.05;
70 | text = "Recruit";
71 | onButtonClick = "execVM 'bon_recruit_units\recruit.sqf'";
72 | };
73 | class CloseButton: RecruitButton {
74 | x = 0.15;
75 | text = "Close";
76 | onButtonClick = "CloseDialog 0;";
77 | };
78 | };
79 | };
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/Playground.sqf:
--------------------------------------------------------------------------------
1 | //params ["_pos","_dist", "_params"];
2 | private _pos = getpos player;
3 | private _dist = 25;
4 | private _params = [1, -1, 0.1, 0, 0, false, objNull];
5 | _pos = _pos findEmptyPosition [0,_dist];
6 | if (_pos isEqualTo []) exitWith {_pos};
7 | _params =+ _params;
8 | _params set [0, -1];
9 | _pos = _pos isFlatEmpty _params;
10 | if (_pos isEqualTo []) exitWith {_pos};
11 | _pos
12 |
13 |
14 |
15 |
16 | [] spawn {
17 | VCOMTEST = true;
18 | while {VCOMTEST} do {
19 | {
20 | systemchat format ["%2: %1",(getSuppression _x),(typeof _x)];
21 |
22 | } foreach allunits;
23 | sleep 0.05;
24 | };
25 |
26 | };
27 |
28 |
29 |
30 |
31 |
32 | //[_x,_CurrentBackPack,_VCOM_HASUAV]
33 |
34 | if (VCM_Debug) then {diag_log "Static Weapon Check"};
35 |
36 | private ["_t", "_wait"];
37 | _t = time;
38 | _wait = 3;
39 |
40 | {
41 | private _Unit = _x select 0;
42 | private _Foot = isNull objectParent _Unit;
43 | if (_Foot) then
44 | {
45 | private _BackPack = _x select 1;
46 | private _HASUAV = _x select 2;
47 |
48 | private _NearestEnemy = _leader findNearestEnemy _leader;
49 | if (isNull _NearestEnemy) then
50 | {
51 | _NearestEnemy = _leader call VCM_fnc_ClstEmy;
52 | };
53 |
54 | //If the unit is in a building, or can see the enemy, we don't want them deploying mortars.
55 | private _CurrentBackPack = backpack _Unit;
56 | private _Vcom_Indoor = false;
57 | private _Position = getposATL _Unit;
58 | private _Array = lineIntersectsObjs [_Position,[_Position select 0,_Position select 1,(_Position select 2) + 10], objnull, objnull, true, 4];
59 | {
60 | if (_x isKindof "Building") exitWith {_Vcom_Indoor = true;};
61 | } foreach _Array;
62 |
63 | if !(_Vcom_Indoor) then
64 | {
65 | private _AssembledG = getText (configfile >> "CfgVehicles" >> _CurrentBackPack >> "assembleInfo" >> "assembleTo");
66 | if !(_AssembledG isEqualTo "") then
67 | {
68 | private _StaticCreated = _AssembledG createvehicle [0,0,0];
69 | _StaticCreated setposATL (getposATL _Unit);
70 |
71 | [_Unit,_StaticCreated,_NearestEnemy] spawn
72 | {
73 | params ["_Unit","_StaticCreated","_NearestEnemy"];
74 |
75 | [_Unit,"AinvPknlMstpSnonWnonDnon_Putdown_AmovPknlMstpSnonWnonDnon"] remoteExec ["Vcm_PMN",0];
76 | sleep 3.5;
77 | _Unit assignAsGunner _StaticCreated;
78 | [_Unit] orderGetIn true;
79 | _Unit moveInGunner _StaticCreated;
80 | removeBackpackGlobal _Unit;
81 |
82 | private _dirTo = _StaticCreated getDir _NearestEnemy;
83 | _StaticCreated setDir _dirTo;
84 | (Vehicle _Unit) setDir _dirTo;
85 | };
86 |
87 | _StaticList deleteat _foreachindex;
88 | [_Unit,_CurrentBackPack,_StaticCreated] spawn VCM_fnc_PackStatic;
89 | };
90 |
91 | };
92 | };
93 | } foreach _StaticList;
94 | _BackbkC4 = time;
--------------------------------------------------------------------------------
/ATM_airdrop/atm_chem_on.sqf:
--------------------------------------------------------------------------------
1 | _target = _this select 0;
2 | _caller = _this select 1;
3 | _id = _this select 2;
4 | _caller removeAction _id;
5 |
6 |
7 | _ltcolor = (_this select 3) select 0;
8 |
9 | _lgt = _ltcolor createVehicle [0,0,0];
10 | _lgt attachTo [_caller, [0,-0.03,0.07], "LeftShoulder"];
11 | _caller setvariable ["lgtarray", _lgt,true];
12 |
13 |
14 | if (_ltcolor =="Chemlight_Red") then {
15 | RedOff = _caller addAction["Chemlight Red OFF", "ATM_airdrop\atm_chem_off.sqf",[_ltcolor],6,false,false,"", "_target == ( player)"];
16 | _caller removeaction blueon;_caller removeaction yellowon;_caller removeaction greenon;_caller removeaction Iron;
17 | };
18 | if (_ltcolor =="Chemlight_Blue") then {
19 | actionBlueOff = _caller addAction["Chemlight Blue OFF", "ATM_airdrop\atm_chem_off.sqf",[_ltcolor],6,false,false,"","_target == ( player)"];
20 | _caller removeaction redon;_caller removeaction yellowon;_caller removeaction greenon;_caller removeaction Iron;
21 | };
22 | if (_ltcolor =="Chemlight_Yellow") then {
23 | actionYellowOff = _caller addAction["Chemlight Yellow OFF", "ATM_airdrop\atm_chem_off.sqf",[_ltcolor],6,false,false,"", "_target == (player)"];
24 | _caller removeaction blueon;_caller removeaction redon;_caller removeaction greenon;_caller removeaction Iron;
25 | };
26 | if (_ltcolor =="Chemlight_Green") then {
27 | actionGreenOff = _caller addAction["Chemlight Green OFF", "ATM_airdrop\atm_chem_off.sqf",[_ltcolor],6,false,false,"", "_target == ( player)"];
28 | _caller removeaction blueon;_caller removeaction yellowon;_caller removeaction redon;_caller removeaction Iron;
29 | };
30 | if (_ltcolor =="NVG_TargetC") then {
31 | actionIROff = _caller addAction["Strobe IR OFF", "ATM_airdrop\atm_chem_off.sqf",[_ltcolor],6,false,false,"", "_target == ( player)"];
32 | _caller removeaction blueon;_caller removeaction yellowon;_caller removeaction redon;_caller removeaction greenon;
33 | };
34 |
35 | while {(getPos _caller select 2) > 2} do {
36 |
37 | if(getPos _caller select 2 < 3) then{
38 | if (_ltcolor =="Chemlight_Red") then {
39 | _caller removeaction RedOff;
40 | };
41 | if (_ltcolor =="Chemlight_Blue") then {
42 | _caller removeaction actionBlueOff;
43 | };
44 | if (_ltcolor =="Chemlight_Yellow") then {
45 | _caller removeaction actionYellowOff;
46 | };
47 | if (_ltcolor =="Chemlight_Green") then {
48 | _caller removeaction actionGreenOff;
49 | };
50 | if (_ltcolor =="NVG_TargetC") then {
51 | _caller removeaction Iron;
52 | };
53 | }
54 | };
--------------------------------------------------------------------------------
/CHVD/fn_init.sqf:
--------------------------------------------------------------------------------
1 | [] spawn {
2 | CHVD_scriptRunning = true;
3 | //Wait for mission init, in case there are variables defined some place else
4 | waitUntil {time > 0};
5 |
6 | //Define variables, load from profileNamespace
7 | CHVD_allowNoGrass = if (isNil "CHVD_allowNoGrass") then {true} else {CHVD_allowNoGrass};
8 | CHVD_maxView = if (isNil "CHVD_maxView") then {12000} else {CHVD_maxView};
9 | CHVD_maxObj = if (isNil "CHVD_maxObj") then {12000} else {CHVD_maxObj};
10 |
11 | CHVD_footSyncObj = profileNamespace getVariable ["CHVD_footSyncObj",false];
12 | CHVD_carSyncObj = profileNamespace getVariable ["CHVD_carSyncObj",false];
13 | CHVD_airSyncObj = profileNamespace getVariable ["CHVD_airSyncObj",false];
14 |
15 | CHVD_foot = (profileNamespace getVariable ["CHVD_foot",viewDistance]) min CHVD_maxView;
16 | CHVD_car = (profileNamespace getVariable ["CHVD_car",viewDistance]) min CHVD_maxView;
17 | CHVD_air = (profileNamespace getVariable ["CHVD_air",viewDistance]) min CHVD_maxView;
18 |
19 | CHVD_footObj = (profileNamespace getVariable ["CHVD_footObj",viewDistance]) min CHVD_maxObj;
20 | CHVD_carObj = (profileNamespace getVariable ["CHVD_carObj",viewDistance]) min CHVD_maxObj;
21 | CHVD_airObj = (profileNamespace getVariable ["CHVD_airObj",viewDistance]) min CHVD_maxObj;
22 |
23 | CHVD_footTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_footTerrain",25]} else {(profileNamespace getVariable ["CHVD_footTerrain",25]) min 48.99 max 3.125};
24 | CHVD_carTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_carTerrain",25]} else {(profileNamespace getVariable ["CHVD_carTerrain",25]) min 48.99 max 3.125};
25 | CHVD_airTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_airTerrain",25]} else {(profileNamespace getVariable ["CHVD_airTerrain",25]) min 48.99 max 3.125};
26 |
27 | //Begin initialization
28 | waitUntil {!isNull player};
29 | waitUntil {!isNull findDisplay 46};
30 | /*
31 | _actionText = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"} else {"View Distance Settings"};
32 | player addAction [_actionText, CHVD_fnc_openDialog, [], -99, false, true];
33 | player addEventHandler ["Respawn", format ["player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]", _actionText]];
34 | */
35 | //Detect when to change setting type
36 | [] spawn {
37 | for "_i" from 0 to 1 step 0 do {
38 | [nil, false] call CHVD_fnc_updateSettings;
39 | _currentVehicle = vehicle player;
40 | waitUntil {_currentVehicle != vehicle player};
41 | };
42 | };
43 | [] spawn {
44 | for "_i" from 0 to 1 step 0 do {
45 | waitUntil {UAVControl (getConnectedUAV player) select 1 != ""};
46 | [nil, true] call CHVD_fnc_updateSettings;
47 | waitUntil {UAVControl (getConnectedUAV player) select 1 == ""};
48 | [nil, false] call CHVD_fnc_updateSettings;
49 | };
50 | };
51 | };
--------------------------------------------------------------------------------
/ATM_airdrop/atm_airdrop.sqf:
--------------------------------------------------------------------------------
1 | private ["_position","_cut","_dialog","_s_alt","_s_alt_text","_sound","_sound2","_soundPath"];
2 | waitUntil { !isNull player };
3 | [] execVM "ATM_airdrop\functions.sqf";
4 |
5 | _position = GetPos player;
6 | _z = _position select 2;
7 | Altitude = 500;
8 |
9 |
10 | openMap true;
11 | hint "SELECT DROP LOCATION VIA SINGLE LEFT CLICK.";
12 | ATM_Jump_mapclick = false;
13 | ["atmMapClickEH", "onMapSingleClick", {
14 | ATM_Jump_clickpos = _pos;
15 | ATM_Jump_mapclick = true;
16 | ["atmMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
17 | }] call BIS_fnc_addStackedEventHandler;
18 | waitUntil {ATM_Jump_mapclick or !(visiblemap)};
19 | if (!visiblemap) exitWith {
20 | ["atmMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
21 | if (player getVariable "EVOrank" != "PRIVATE") then {
22 | [player, 3] call bis_fnc_addScore;
23 | ["PointsAdded",["HALO insertion canceled.", 3]] call BIS_fnc_showNotification;
24 | } else {
25 | ["PointsAdded",["HALO insertion canceled.", 0]] call BIS_fnc_showNotification;
26 | };
27 | breakOut "main";
28 | };
29 | _pos = ATM_Jump_clickpos;
30 | ATM_Jump_mapclick = if(true) then{
31 | call compile format ['
32 | mkr_halo = createmarker ["mkr_halo", ATM_Jump_Clickpos];
33 | "mkr_halo" setMarkerTypeLocal "hd_dot";
34 | "mkr_halo" setMarkerColorLocal "ColorGreen";
35 | "mkr_halo" setMarkerTextLocal "Jump";'];
36 | };
37 |
38 | _target = player;
39 |
40 | _loadout=[_target] call Getloadout;
41 |
42 | _posJump = getMarkerPos "mkr_halo";
43 | _x = _posJump select 0;
44 | _y = _posJump select 1;
45 | _z = _posJump select 2;
46 | _target setPos [_x,_y,_z+1000];
47 |
48 | openMap false;
49 | deleteMarker "mkr_halo";
50 |
51 | 0=[_target] call Frontpack;
52 |
53 | removeBackpack _target;
54 | sleep 0,5;
55 | _target addBackpack "B_Parachute";
56 | if ((getPos _target select 2) >= 8000) then{
57 | removeHeadgear _target;
58 | _target addHeadgear "H_CrewHelmetHeli_B";
59 | sleep 0,5;
60 | };
61 |
62 | _height = getPos _target select 2;
63 |
64 | while {(getPos _target select 2) > 2} do {
65 | if(isTouchingGround _target and player == vehicle player) then{
66 | }
67 | else{
68 | playSound "Vent";
69 | playSound "Vent2";
70 | sleep 5;
71 |
72 | };
73 | if (getPos _target select 2 < 150) then {
74 | _target action ["OpenParachute", _target];
75 | };
76 | if(!alive _target) then {
77 | _target setPos [getPos _target select 0, getPos _target select 1, 0];
78 | 0=[_target,_loadout] call Setloadout;
79 | };
80 | };
81 |
82 | deletevehicle (_target getvariable "frontpack"); _target setvariable ["frontpack",nil,true];
83 | deletevehicle (_target getvariable "lgtarray"); _target setvariable ["lgtarray",nil,true];
84 |
85 | sleep 3;
86 | //hintsilent "";
87 | sleep 1;
88 |
89 | 0=[_target,_loadout] call Setloadout;
90 |
91 | if (true) exitWith {};
92 |
--------------------------------------------------------------------------------
/Vcom/VcomInit.sqf:
--------------------------------------------------------------------------------
1 | //Parameters
2 | VCM_PublicScript = compileFinal "[] call (_this select 0);";
3 | VCM_ServerAsk = compileFinal "(_this select 1) publicVariableClient (_this select 0);";
4 |
5 | if (isServer) then
6 | {
7 | if (isFilePatchingEnabled) then
8 | {
9 | private _Filecheck = loadFile "\userconfig\VCOM_AI\AISettingsV3.hpp";
10 |
11 | if !(_FileCheck isEqualTo "") then
12 | {
13 | [] call compile preprocessFileLineNumbers "\userconfig\VCOM_AI\AISettingsV3.hpp";
14 | [Vcm_Settings] remoteExec ["VCM_PublicScript",0,false];
15 | }
16 | else
17 | {
18 | [] call compile preprocessFileLineNumbers "Vcom\Functions\VCOMAI_DefaultSettings.sqf";
19 | [Vcm_Settings] remoteExec ["VCM_PublicScript",0,false];
20 | };
21 | }
22 | else
23 | {
24 | [] call compile preprocessFileLineNumbers "Vcom\Functions\VCOMAI_DefaultSettings.sqf";
25 | [Vcm_Settings] remoteExec ["VCM_PublicScript",0,false];
26 | };
27 | }
28 | else
29 | {
30 | private _id = clientOwner;
31 | ["Vcm_Settings",_id] remoteExec ["VCM_ServerAsk",2,false];
32 | waitUntil {!(isNil "Vcm_Settings")};
33 | [] call Vcm_Settings;
34 | };
35 |
36 | waitUntil {!(isNil "VCM_AIMagLimit")};
37 |
38 | //Mod checks
39 | //ACE CHECK
40 | if (!(isNil "ACE_Medical_enableFor") && {ACE_Medical_enableFor isEqualTo 1}) then {VCM_MEDICALACTIVE = false;} else {VCM_MEDICALACTIVE = true;};
41 | //CBA CHECK
42 | if (isClass(configFile >> "CfgPatches" >> "cba_main")) then {CBAACT = true;} else {CBAACT = false;};
43 |
44 | //Global actions compiles
45 | Vcm_PMN = compileFinal "(_this select 0) playMoveNow (_this select 1);";
46 | Vcm_SM = compileFinal "(_this select 0) switchMove (_this select 1);";
47 | Vcm_PAN = compileFinal "(_this select 0) playActionNow (_this select 1);";
48 | VCOM_MINEARRAY = [];
49 |
50 | //OnEachFrame monitor for mines. Should make them more responsive, without a significant impact on FPS.
51 | ["VCMMINEMONITOR", "onEachFrame", {[] call VCM_fnc_MineMonitor}] call BIS_fnc_addStackedEventHandler;
52 |
53 | //Below is loop to check for new AI spawning in to be added to the list
54 | [] spawn
55 | {
56 | sleep 2;
57 | if (hasInterface) then
58 | {
59 | //Event handlers for players
60 | player addEventHandler ["Fired",{_this call VCM_fnc_HearingAids;}];
61 | player spawn VCM_fnc_IRCHECK;
62 | player addEventHandler ["Respawn",{_this spawn VCM_fnc_IRCHECK;}];
63 | };
64 |
65 | while {true} do
66 | {
67 | if (Vcm_ActivateAI) then
68 | {
69 | {
70 | if (local _x && {simulationEnabled (leader _x)} && {!(isplayer (leader _x))} && {(leader _x) isKindOf "Man"}) then
71 | {
72 | private _Grp = _x;
73 | if !(_Grp in VcmAI_ActiveList) then //{!(VCM_SIDEENABLED findIf {_x isEqualTo (side _Grp)} isEqualTo -1)}
74 | {
75 | if !(((units _Grp) findIf {alive _x}) isEqualTo -1) then
76 | {
77 | _x call VCM_fnc_SquadExc;
78 | };
79 | };
80 | };
81 | } foreach allGroups;
82 | };
83 | sleep 10;
84 | };
85 | };
--------------------------------------------------------------------------------
/CHVD/fn_openDialog.sqf:
--------------------------------------------------------------------------------
1 | _dialog = createDialog "CHVD_dialog";
2 | if (!_dialog) exitWith {systemChat "Error: Can't open 'CH View Distance' dialog."};
3 | disableSerialization;
4 |
5 | {
6 | ctrlSetText _x;
7 | } forEach [[1006, str round CHVD_foot],[1007, str round CHVD_footObj],[1013, str round CHVD_car],[1014, str round CHVD_carObj],[1017, str round CHVD_air],[1018, str round CHVD_airObj],[1400, str CHVD_footTerrain],[1401, str CHVD_carTerrain],[1402, str CHVD_airTerrain]];
8 |
9 | {
10 | sliderSetRange [_x select 0, 0, _x select 2];
11 | sliderSetRange [_x select 3, 0, (_x select 5) min (_x select 1)];
12 | sliderSetSpeed [_x select 0, 500, 500];
13 | sliderSetSpeed [_x select 3, 500, 500];
14 | sliderSetPosition [_x select 0, _x select 1];
15 | sliderSetPosition [_x select 3, (_x select 4) min (_x select 1)];
16 | } forEach [[1900,CHVD_foot,CHVD_maxView,1901,CHVD_footObj,CHVD_maxObj],[1902,CHVD_car,CHVD_maxView,1903,CHVD_carObj,CHVD_maxObj],[1904,CHVD_air,CHVD_maxView,1905,CHVD_airObj,CHVD_maxObj]];
17 |
18 | {
19 | ((finddisplay 2900) displayCtrl (_x select 0)) cbSetChecked (_x select 1);
20 | } forEach [[2800,CHVD_footSyncObj],[2801,CHVD_carSyncObj],[2802,CHVD_airSyncObj]];
21 |
22 | {
23 | _ctrl = ((finddisplay 2900) displayCtrl (_x select 0));
24 | if (CHVD_allowNoGrass) then {
25 | _textLow = if (isLocalized "STR_chvd_low") then {localize "STR_chvd_low"} else {"Low"};
26 | _ctrl lbAdd _textLow;
27 | };
28 | _textStandard = if (isLocalized "STR_chvd_standard") then {localize "STR_chvd_standard"} else {"Standard"};
29 | _ctrl lbAdd _textStandard;
30 | _textHigh = if (isLocalized "STR_chvd_high") then {localize "STR_chvd_high"} else {"High"};
31 | _ctrl lbAdd _textHigh;
32 | _textVeryHigh = if (isLocalized "STR_chvd_veryHigh") then {localize "STR_chvd_veryHigh"} else {"Very High"};
33 | _ctrl lbAdd _textVeryHigh;
34 |
35 | _sel = [_x select 1] call CHVD_fnc_selTerrainQuality;
36 | if (CHVD_allowNoGrass) then {
37 | _ctrl lbSetCurSel _sel;
38 | } else {
39 | _ctrl lbSetCurSel (_sel - 1);
40 | };
41 | } forEach [[1500,CHVD_footTerrain],[1501,CHVD_carTerrain],[1502,CHVD_airTerrain]];
42 |
43 | {
44 | _ctrl = ((finddisplay 2900) displayCtrl (_x select 0));
45 | _handle = _ctrl ctrlSetEventHandler ["LBSelChanged",
46 | format ["[_this select 1, '%1', %2] call CHVD_fnc_onLBSelChanged", _x select 1, _x select 2]
47 | ];
48 | } forEach [[1500,"CHVD_footTerrain",1400],[1501,"CHVD_carTerrain",1401],[1502,"CHVD_airTerrain",1402]];
49 |
50 |
51 | if (CHVD_footSyncObj) then {
52 | ctrlEnable [1901,false];
53 | ctrlEnable [1007,false];
54 | } else {
55 | ctrlEnable [1901,true];
56 | ctrlEnable [1007,true];
57 | };
58 |
59 | if (CHVD_carSyncObj) then {
60 | ctrlEnable [1903,false];
61 | ctrlEnable [1014,false];
62 | } else {
63 | ctrlEnable [1903,true];
64 | ctrlEnable [1014,true];
65 | };
66 |
67 | if (CHVD_airSyncObj) then {
68 | ctrlEnable [1905,false];
69 | ctrlEnable [1018,false];
70 | } else {
71 | ctrlEnable [1905,true];
72 | ctrlEnable [1018,true];
73 | };
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Evolution Blue *Classic*
2 | 
3 | Evolution-A3 is a remake of the popular Armed Assualt (ArmA) mission, Evolution Blue by KilJoy.
4 | Evolution-A3 features all of the original gameplay mechanics, either in their original form, redesigned by myself, or with similair community content replacing the functionality of the original outdated code.
5 |
6 | # Features
7 |
8 | - All features can be *disabled/enabled* via **mission parameters**.
9 | - AI units can be recruited via **bon_recruit_units** at the staging base via *action menu*, and airdropped in the field via *BI's communication menu*.
10 | - Dynamic view distance settings with **CHVD** can be set via action menu in the staging base.
11 | - HALO insertions using **ATM_airdrop** via action menu in the staging base.
12 | - Player loadout saved to user profile and modified via BI's **Virtual Arsenal**.
13 | - The **original Evolution** sounds!
14 | - **BI's dynamic groups** interface can be used via action menu at the staging base or at anytime by pressing 'U'.
15 | - **Meatball's randomWeather2** generates random, MP-sync'd weather throughout the game.
16 | - **Quiksilver's cleanup** and BI's **wreck and corpse management** keeps the mission running smooth throughout the entire game.
17 | - Overall OPFOR unit management moved to **VCOM AI** for complex AI counterparts.
18 | - **Headless Client implementation** automatically detects and offloads AI to your HC.
19 | - **Pilot loadout requirements** enforced to fly aircraft, includes auto-switching of loadout if you're in the base.
20 | - **Modular sidemissions** that provide bonus points to all players, and extra bonus points to the players responsible for completing the task, including: CSAR, Defend, Attack, Defend the Base, Ambush, and AAA hunt.
21 | - **Officer and POW Capturing** in every area of operation for bonus points!
22 | - **OPFOR support assets** may be available at the AO including mortar, anti-air, CAS, and sniper support.
23 | - All powered by the **Community Upgrade Project**.
24 |
25 |
26 | > The overall goal of this project is to bring Evolution Blue up to ArmA 3 standards while preserving as much original gameplay as possible. Minor additions such as Revive and Support Assets that delineate from the origional concept should be added with optional paramters.
27 |
28 |
29 | ### Current Version
30 |
31 | Latest version available on [Steam Workshop](http://steamcommunity.com/sharedfiles/filedetails/?id=677540897).
32 |
33 | Discussion available at [Bohemia Interactive Forums](http://forums.bistudio.com/showthread.php?191210-(Co30)-Evolution-A3).
34 |
35 |
36 | ### Requirements
37 |
38 | Evolution-A3 Classic requires the [Community Upgrade Project](https://steamcommunity.com/workshop/filedetails/?id=583575232).
39 | 
40 |
--------------------------------------------------------------------------------
/CHVD/fn_addonInit.sqf:
--------------------------------------------------------------------------------
1 | [] spawn {
2 | //Wait for mission init, in case there are variables defined some place else
3 | waitUntil {time > 0};
4 |
5 | CHVD_scriptRunning = if (isNil "CHVD_scriptRunning") then {false} else {CHVD_scriptRunning};
6 | if (CHVD_scriptRunning) exitWith {systemChat "CHVD script is running. Addon disabled"};
7 |
8 | //Define variables, load from profileNamespace
9 | CHVD_allowNoGrass = if (isNil "CHVD_allowNoGrass") then {true} else {CHVD_allowNoGrass};
10 | CHVD_maxView = if (isNil "CHVD_maxView") then {12000} else {CHVD_maxView};
11 | CHVD_maxObj = if (isNil "CHVD_maxObj") then {12000} else {CHVD_maxObj};
12 |
13 | CHVD_footSyncObj = profileNamespace getVariable ["CHVD_footSyncObj",false];
14 | CHVD_carSyncObj = profileNamespace getVariable ["CHVD_carSyncObj",false];
15 | CHVD_airSyncObj = profileNamespace getVariable ["CHVD_airSyncObj",false];
16 |
17 | CHVD_foot = (profileNamespace getVariable ["CHVD_foot",viewDistance]) min CHVD_maxView;
18 | CHVD_car = (profileNamespace getVariable ["CHVD_car",viewDistance]) min CHVD_maxView;
19 | CHVD_air = (profileNamespace getVariable ["CHVD_air",viewDistance]) min CHVD_maxView;
20 |
21 | CHVD_footObj = (profileNamespace getVariable ["CHVD_footObj",viewDistance]) min CHVD_maxObj;
22 | CHVD_carObj = (profileNamespace getVariable ["CHVD_carObj",viewDistance]) min CHVD_maxObj;
23 | CHVD_airObj = (profileNamespace getVariable ["CHVD_airObj",viewDistance]) min CHVD_maxObj;
24 |
25 | CHVD_footTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_footTerrain",25]} else {(profileNamespace getVariable ["CHVD_footTerrain",25]) min 48.99 max 3.125};
26 | CHVD_carTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_carTerrain",25]} else {(profileNamespace getVariable ["CHVD_carTerrain",25]) min 48.99 max 3.125};
27 | CHVD_airTerrain = if (CHVD_allowNoGrass) then {profileNamespace getVariable ["CHVD_airTerrain",25]} else {(profileNamespace getVariable ["CHVD_airTerrain",25]) min 48.99 max 3.125};
28 |
29 | //Begin initialization
30 | waitUntil {!isNull player};
31 | waitUntil {!isNull findDisplay 46};
32 | /*
33 | _actionText = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"} else {"View Distance Settings"};
34 | player addAction [_actionText, CHVD_fnc_openDialog, [], -99, false, true];
35 | player addEventHandler ["Respawn", format ["player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]", _actionText]];
36 | */
37 | //Detect when to change setting type
38 | [] spawn {
39 | for "_i" from 0 to 1 step 0 do {
40 | [nil, false] call CHVD_fnc_updateSettings;
41 | _currentVehicle = vehicle player;
42 | waitUntil {_currentVehicle != vehicle player};
43 | };
44 | };
45 | [] spawn {
46 | for "_i" from 0 to 1 step 0 do {
47 | waitUntil {UAVControl (getConnectedUAV player) select 1 != ""};
48 | [nil, true] call CHVD_fnc_updateSettings;
49 | waitUntil {UAVControl (getConnectedUAV player) select 1 == ""};
50 | [nil, false] call CHVD_fnc_updateSettings;
51 | };
52 | };
53 | };
--------------------------------------------------------------------------------
/CHVD/fn_onSliderChange.sqf:
--------------------------------------------------------------------------------
1 | private ["_sliderPos","_updateType"];
2 | _varType1 = [_this, 0, "", [""]] call BIS_fnc_param;
3 | _slider1 = ctrlIDC ([_this, 1, 0, [0, controlNull]] call BIS_fnc_param);
4 | _sliderPos = [_this, 2, 0, [0]] call BIS_fnc_param;
5 | _text1 = [_this, 3, 0, [0, controlNull]] call BIS_fnc_param;
6 | _varType2 = [_this, 4, "", [""]] call BIS_fnc_param;
7 | _slider2 = [_this, 5, 0, [0, controlNull]] call BIS_fnc_param;
8 | _text2 = [_this, 6, 0, [0, controlNull]] call BIS_fnc_param;
9 | _syncVar = [_this, 7, "", [""]] call BIS_fnc_param;
10 |
11 | if (count _this < 8) then {
12 | _updateType = 2;
13 | } else {
14 | if (call compile _syncVar) then {
15 | _updateType = 3;
16 | } else {
17 | _updateType = 1;
18 | };
19 | };
20 |
21 | switch (_updateType) do {
22 | case 1: {
23 | sliderSetPosition [_slider1, _sliderPos min CHVD_maxView];
24 | ctrlSetText [_text1, str round (_sliderPos min CHVD_maxView)];
25 | sliderSetRange [_slider2, 0, _sliderPos min CHVD_maxView];
26 |
27 | call compile format ["%1 = %2", _varType1, _sliderPos min CHVD_maxView];
28 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType1];
29 |
30 | if ((call compile _varType2) > _sliderPos) then {
31 | sliderSetPosition [_slider2, _sliderPos min CHVD_maxObj];
32 | ctrlSetText [_text2, str round (_sliderPos min CHVD_maxObj)];
33 |
34 | call compile format ["%1 = %2", _varType2, _sliderPos min CHVD_maxObj];
35 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType2];
36 | };
37 |
38 | [_updateType] call CHVD_fnc_updateSettings;
39 | };
40 | case 2: {
41 | sliderSetPosition [_slider1, _sliderPos min CHVD_maxObj];
42 | ctrlSetText [_text1, str round (_sliderPos min CHVD_maxObj)];
43 |
44 | call compile format ["%1 = %2", _varType1, _sliderPos min CHVD_maxObj];
45 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType1];
46 |
47 | [_updateType] call CHVD_fnc_updateSettings;
48 | };
49 | case 3: {
50 | sliderSetPosition [_slider1, _sliderPos min CHVD_maxView];
51 | ctrlSetText [_text1, str round (_sliderPos min CHVD_maxView)];
52 | sliderSetRange [_slider2, 0, _sliderPos min CHVD_maxView];
53 |
54 | call compile format ["%1 = %2", _varType1, _sliderPos min CHVD_maxView];
55 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType1];
56 |
57 | if ((call compile _varType2) > _sliderPos) then {
58 | sliderSetPosition [_slider2, _sliderPos min CHVD_maxObj];
59 | ctrlSetText [_text2, str round (_sliderPos min CHVD_maxObj)];
60 |
61 | call compile format ["%1 = %2", _varType2, _sliderPos min CHVD_maxObj];
62 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType2];
63 | };
64 |
65 | sliderSetPosition [_slider2, _sliderPos min CHVD_maxObj];
66 | ctrlSetText [_text2, str round (_sliderPos min CHVD_maxObj)];
67 |
68 | call compile format ["%1 = %2", _varType2, _sliderPos min CHVD_maxObj];
69 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType2];
70 |
71 | [_updateType] call CHVD_fnc_updateSettings;
72 | };
73 | };
--------------------------------------------------------------------------------
/EVO/fn_pickSideMission.sqf:
--------------------------------------------------------------------------------
1 | currentSideMission = "none";
2 | currentSideMissionStatus = "ip";
3 | currentSidemissionUnits = [];
4 | publicVariable "currentSidemissionUnits";
5 | publicVariable "currentSideMission";
6 | publicVariable "currentSideMissionStatus";
7 | _mission = ["aaa", "attack"] call BIS_fnc_selectRandom;
8 | switch (_mission) do {
9 | case "aaa": {
10 | _options = [];
11 | {
12 | _vehicle = _x;
13 | if (typeOf _vehicle == EVO_opforAAA && alive _vehicle && canMove _vehicle) then {
14 | _options = _options + [_vehicle];
15 | };
16 | } forEach vehicles;
17 | _vehicle = _options call BIS_fnc_selectRandom;
18 | if (!isNil "_vehicle") then {
19 | aaHuntTarget = _vehicle;
20 | publicVariable "aaHuntTarget";
21 | [] call EVO_fnc_sm_aaHunt;
22 | } else {
23 | [] spawn EVO_fnc_pickSideMission;
24 | };
25 | };
26 | case "basedefend": {
27 | [] call EVO_fnc_sm_baseDef;
28 | };
29 | case "attack": {
30 | attackMilTarget = militaryLocations call BIS_fnc_selectRandom;
31 | [] call EVO_fnc_sm_attackMil;
32 | };
33 | case "defend": {
34 | defendTarget = sideLocations call BIS_fnc_selectRandom;
35 | [] call EVO_fnc_sm_reinforce;
36 | };
37 | case "csar": {
38 | csarLoc = sideLocations call BIS_fnc_selectRandom;
39 | [] call EVO_fnc_sm_csar;
40 | };
41 | };
42 |
43 | /*
44 | //convoy
45 | // 1 in 2 chance
46 | _bool = false;
47 | if (("randomSideMissions" call BIS_fnc_getParamValue) == 1) then {
48 | _bool = [true, false] call BIS_fnc_selectRandom;
49 | } else {
50 | _bool = true;
51 | };
52 | if (_bool) then {
53 | _locationArray = militaryLocations + targetLocations;
54 | _locationArray = _locationArray - ([targetLocations select 0]) - ([targetLocations select 1]) - ([targetLocations select 2]);
55 | convoyStart = _locationArray call BIS_fnc_selectRandom;
56 | _locationArray = nearestLocations [ (position convoyStart), ["NameCity", "NameCityCapital","NameVillage"], 10000];
57 | _locationArray= _locationArray - [(_locationArray select 0)] - [(_locationArray select 1)] - [(_locationArray select 2)] - [(_locationArray select 3)] - [(_locationArray select 4)] - [(_locationArray select 5)] - [(_locationArray select 6)];
58 | convoyEnd = _locationArray call BIS_fnc_selectRandom;
59 | _pos = position convoyStart;
60 | _array = nearestObjects [_pos, ["house"], 500];
61 | _obj = _array select 0;
62 |
63 | _pos2 = position convoyEnd;
64 | _array2 = nearestObjects [_pos2, ["house"], 500];
65 | _obj2 = _array2 select 0;
66 | _descrip = format["We have received intel that an OPFOR convoy with supplies will be departing %1, heading to %2. Ambush them and destroy any supply or support vehicles", text convoyStart, text convoyEnd];
67 | _img = getText(configFile >> "CfgTaskTypes" >> "Destroy" >> "icon");
68 | availableSideMissions = availableSideMissions + [
69 | [getPos _obj, EVO_fnc_sm_convoy, "Ambush Convoy Start", _descrip,"",_img,1,[]]
70 | ];
71 | availableSideMissions = availableSideMissions + [
72 | [getPos _obj2, EVO_fnc_sm_convoy, "Ambush Convoy End", _descrip,"",_img,1,[]]
73 | ];
74 | };
75 | */
76 |
77 |
--------------------------------------------------------------------------------
/EVO/fn_support_cas.sqf:
--------------------------------------------------------------------------------
1 | private ["_caller","_pos","_is3D","_ID","_grpSide","_planeClass","_pilot","_score","_dis","_newCasStrike","_center","_cas","_loop","_plane","_supportAsset","_source","_scoreToAdd","_player"];
2 |
3 | _caller = _this select 0;
4 | _pos = _this select 1;
5 | _target = _this select 2;
6 | _is3D = _this select 3;
7 | _ID = _this select 4;
8 | _grpSide = side _caller;
9 | _planeClass = "B_Plane_CAS_01_dynamicLoadout_F";
10 | _pilot = pilot_west;
11 | _score = _score - 7;
12 | [player, -7] call bis_fnc_addScore;
13 | ["PointsRemoved",["CAS support initiated.", 7]] call BIS_fnc_showNotification;
14 | _dis = _pos distance _pilot;
15 | [_caller, format["%2, this is %1, requesting immediate fixed wing CAS support, over.", groupID (group _caller), groupID (group _pilot)]] call EVO_fnc_globalSideChat;
16 | sleep 3.5;
17 | [_pilot, format["%1, this is %2, send grid coordinates, over.", groupID (group _caller), groupID (group _pilot)]] call EVO_fnc_globalSideChat;
18 | sleep 3.5;
19 | openMap true;
20 | sleep 3;
21 | ["supportMapClickEH", "onMapSingleClick", {
22 | supportMapClick = _pos;
23 | supportClicked = true;
24 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
25 | }] call BIS_fnc_addStackedEventHandler;
26 | ["deployed",["DESIGNATE TARGET", "Left click on your target."]] call BIS_fnc_showNotification;
27 | waitUntil {supportClicked || !(visiblemap)};
28 | _pos = supportMapClick;
29 | if (!visiblemap) exitWith {
30 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
31 | [_caller, format["%1, this is %2, scratch that last request, out.", groupID (group _pilot), groupID (group _caller)]] call EVO_fnc_globalSideChat;
32 | _pilot setVariable ["EVO_support_busy", false, true];
33 | sleep 3.5;
34 | [_pilot, format["Copy that %2, out.", groupID (group _pilot), groupID (group _caller)]] call EVO_fnc_globalSideChat;
35 | sleep 3.5;
36 | _newCasStrike = [_caller, "fixedCasStrike"] call BIS_fnc_addCommMenuItem;
37 | [player, 7] call bis_fnc_addScore;
38 | ["PointsAdded",["CAS support canceled.", 7]] call BIS_fnc_showNotification;
39 | };
40 | openMap false;
41 | [_caller, format["Grid %3, over.", groupID (group _caller), groupID (group _pilot), mapGridPosition _pos]] call EVO_fnc_globalSideChat;
42 | sleep 3.5;
43 |
44 | if ( _dis > 1000) then {
45 |
46 | [_pilot, format["Grid %3 confirmed, en route, over.", groupID (group _caller), groupID (group _pilot), mapGridPosition _pos]] call EVO_fnc_globalSideChat;
47 | sleep 3.5;
48 | _logic = "Logic" createVehicleLocal _pos;
49 | _logic setDir (random 360);
50 | _logic setVariable ["vehicle", _planeClass];
51 | _logic setVariable ["type", 2];
52 | [_logic,nil,true] call BIS_fnc_moduleCAS;
53 | deleteVehicle _logic;
54 | _loop = true;
55 |
56 | } else {
57 | [_pilot, format["Grid %3 is too close to friendly forces, request denied, out.", groupID (group _caller), groupID (group _pilot), mapGridPosition _pos]] call EVO_fnc_globalSideChat;
58 | sleep 5;
59 | _newCasStrike = [_caller, "fixedCasStrike"] call BIS_fnc_addCommMenuItem;
60 | [player, 7] call bis_fnc_addScore;
61 | ["PointsAdded",["CAS support canceled.", 7]] call BIS_fnc_showNotification;
62 | };
63 | supportMapClick = [0,0,0];
64 | supportClicked = false;
65 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_FrmChnge.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 | Changes group formation dependent on surroundings and behaviour
6 |
7 | Parameter(s):
8 | 0: OBJECT - Unit whose group to change formation
9 |
10 | Returns:
11 | BOOL
12 | */
13 |
14 | private ["_unit", "_nearestCity", "_locationPos", "_nearestVillage", "_locationPos2", "_nearestHill", "_locationPos4", "_nearestLocal", "_locationPos3"];
15 |
16 | //Pull the unit
17 | _unit = _this;
18 |
19 | //Grab the group of the unit
20 | _group = group _unit;
21 |
22 | //Vehicular groups in "SAFE" behaviour will move in convoys
23 | if (!isNull objectParent _unit && {behaviour _unit == "SAFE"}) exitWith
24 | {
25 | _group setFormation "FILE";
26 | //Set the units variable so they dont try changing formations too frequently.
27 | _VCOM_CHANGEDFORMATION = true;
28 | _VCOM_CHANGEDFORMATION
29 | };
30 |
31 | //Grab the nearest "City" from the unit
32 | _nearestCity = nearestLocation [getPosASL _unit, "nameCity"];
33 |
34 | //Lets grab the location position
35 | _locationPos = locationPosition _nearestCity;
36 |
37 | //If the unit is less than 500 meters from the location exit with the following code
38 | if ((_locationPos distance _unit) < 500) exitWith
39 | {
40 |
41 | //Check if the unit is in a vehicle or not
42 | if (!isNull objectParent _unit) then
43 | {
44 | _group setFormation "COLUMN";
45 | }
46 | else
47 | {
48 | _group setFormation "STAG COLUMN";
49 | };
50 |
51 | //Set the units variable so they dont try changing formations too frequently.
52 | _VCOM_CHANGEDFORMATION = true;
53 | _VCOM_CHANGEDFORMATION
54 |
55 | };
56 |
57 | //The rest of the commands follow the same logic. Commenting where necessary.
58 | _nearestVillage = nearestLocation [getPosASL _unit, "NameVillage"];
59 | _locationPos2 = locationPosition _nearestVillage;
60 |
61 | if ((_locationPos2 distance _unit) < 500) exitWith
62 | {
63 | if ((vehicle _unit) != _unit) then
64 | {
65 | _group setFormation "COLUMN";
66 | }
67 | else
68 | {
69 | _group setFormation "STAG COLUMN";
70 | };
71 |
72 | _VCOM_CHANGEDFORMATION = true;
73 | _VCOM_CHANGEDFORMATION
74 |
75 | };
76 |
77 |
78 | _nearestHill = nearestLocation [getPosASL _unit, "Hill"];
79 | _locationPos4 = locationPosition _nearestHill;
80 |
81 | if ((_locationPos4 distance _unit) < 500) exitWith
82 | {
83 | if ((vehicle _unit) != _unit) then
84 | {
85 | _group setFormation "LINE";
86 | }
87 | else
88 | {
89 | _group setFormation "LINE";
90 | };
91 |
92 | _VCOM_CHANGEDFORMATION = true;
93 | _VCOM_CHANGEDFORMATION
94 |
95 | };
96 |
97 |
98 | _nearestLocal = nearestLocation [getPosASL _unit, "NameLocal"];
99 | _locationPos3 = locationPosition _nearestLocal;
100 |
101 | if ((_locationPos3 distance _unit) < 300) exitWith
102 | {
103 | if ((vehicle _unit) != _unit) then
104 | {
105 | _group setFormation "COLUMN";
106 | }
107 | else
108 | {
109 | _group setFormation "COLUMN";
110 | };
111 |
112 | _VCOM_CHANGEDFORMATION = true;
113 | _VCOM_CHANGEDFORMATION
114 | };
115 |
116 |
117 | //Execute this code only when all the above were NOT true. Return to wedge formation
118 | _group setFormation "WEDGE";
119 |
120 | _VCOM_CHANGEDFORMATION = true;
121 |
122 | _VCOM_CHANGEDFORMATION
123 |
--------------------------------------------------------------------------------
/EVO/fn_calculateDelay.sqf:
--------------------------------------------------------------------------------
1 | private ["_type","_delay"];
2 |
3 | //////////////////////////////////////
4 | //Calculate Delay of Reinforcements
5 | //////////////////////////////////////
6 | _type = _this select 0;
7 | if (isNil "_type") exitWith {};
8 | _delay = 0;
9 | switch (_type) do {
10 | case "CAS": {
11 | switch (EVO_difficulty) do {
12 | case 1: {
13 | //////////////////////////////////////
14 | //EASY
15 | //////////////////////////////////////
16 | _delay = 600 + (floor(random(100)));
17 | };
18 | case 2: {
19 | //////////////////////////////////////
20 | //NORMAL
21 | //////////////////////////////////////
22 | _delay = 600 + (floor(random(50)));
23 | _delay = _delay - (floor(random(50)));
24 | };
25 | case 3: {
26 | //////////////////////////////////////
27 | //HARD
28 | //////////////////////////////////////
29 | _delay = 600 + (floor(random(30)));
30 | _delay = _delay - (floor(random(50)));
31 | };
32 | case 4: {
33 | //////////////////////////////////////
34 | //ALTIS ON FIRE
35 | //////////////////////////////////////
36 | _delay = 600 - (floor(random(100)));
37 | };
38 | };
39 | };
40 | case "Infantry": {
41 | switch (EVO_difficulty) do {
42 | case 1: {
43 | //////////////////////////////////////
44 | //EASY
45 | //////////////////////////////////////
46 | _delay = 45 + (floor(random(30)));
47 | };
48 | case 2: {
49 | //////////////////////////////////////
50 | //NORMAL
51 | //////////////////////////////////////
52 | _delay = 45 + (floor(random(30)));
53 | _delay = _delay - (floor(random(30)));
54 | };
55 | case 3: {
56 | //////////////////////////////////////
57 | //HARD
58 | //////////////////////////////////////
59 | _delay = 45 + (floor(random(30)));
60 | _delay = _delay - (floor(random(50)));
61 | };
62 | case 4: {
63 | //////////////////////////////////////
64 | //ALTIS ON FIRE
65 | //////////////////////////////////////
66 | _delay = 60 - (floor(random(60)));
67 | };
68 | };
69 | };
70 | case "Armor": {
71 | switch (EVO_difficulty) do {
72 | case 1: {
73 | //////////////////////////////////////
74 | //EASY
75 | //////////////////////////////////////
76 | _delay = 60 + (floor(random(30)));
77 | };
78 | case 2: {
79 | //////////////////////////////////////
80 | //NORMAL
81 | //////////////////////////////////////
82 | _delay = 60 + (floor(random(30)));
83 | _delay = _delay - (floor(random(30)));
84 | };
85 | case 3: {
86 | //////////////////////////////////////
87 | //HARD
88 | //////////////////////////////////////
89 | _delay = 60 + (floor(random(30)));
90 | _delay = _delay - (floor(random(50)));
91 | };
92 | case 4: {
93 | //////////////////////////////////////
94 | //ALTIS ON FIRE
95 | //////////////////////////////////////
96 | _delay = 60 - (floor(random(60)));
97 | };
98 | };
99 | };
100 | };
101 |
102 |
103 | _delay;
--------------------------------------------------------------------------------
/EVO/fn_respawnRepair.sqf:
--------------------------------------------------------------------------------
1 | _veh = _this select 0;
2 | clearWeaponCargoGlobal _veh;
3 | clearMagazineCargoGlobal _veh;
4 | clearBackpackCargoGlobal _veh;
5 | clearItemCargoGlobal _veh;
6 | _veh AddEventHandler ["Killed", {
7 | handle = _this spawn {
8 | _vehicle = _this select 0;
9 | _killer = _this select 1;
10 | _mhq = false;
11 | _classname = typeOf _vehicle;
12 | _dir = getDir _vehicle;
13 | _pos = getPosASL _vehicle;
14 | _veh = _vehicle;
15 | _vehPos = getPos _veh;
16 | _posDriverExit = _veh selectionPosition ("pos driver");
17 | _posCommanderExit = _veh selectionPosition ("pos codriver");
18 | _posCargoExit = _veh selectionPosition ("pos driver");
19 | _posDriver = (driver _veh) worldToModel _vehPos;
20 | _posCommander = (commander _veh) worldToModel _vehPos;
21 | _posCargo = ((crew _veh ) select 0) worldToModel _vehPos;
22 | _driverExitOffset = (_posDriverExit select 0) - (_posDriver select 0);
23 | {
24 | if !(alive _x) then {
25 | _deadPos = _x worldToModel _vehPos;
26 | if ((_deadPos select 0) > 0) then {
27 | _deadPos set [0, (_deadPos select 0) + (abs _driverExitOffset)];
28 | } else {
29 | _deadPos set [0, (_deadPos select 0) + (_driverExitOffset)];
30 | };
31 | _deadExitPos = _x modelToWorld _deadPos;
32 | _deadExitPos set [1, (getPos _x) select 1];
33 | _x setPos _deadExitPos;
34 | };
35 | } forEach (crew _veh);
36 | sleep 120;
37 | deleteVehicle _vehicle;
38 | _newVehicle = _classname createVehicle _pos;
39 | _newVehicle setDir _dir;
40 | _newVehicle setDamage 0.8;
41 | _newVehicle setFuel 0;
42 | _newVehicle setVehicleAmmo 0;
43 | _newVehicle setPosASL _pos;
44 | waitUntil {!isNil "_newVehicle"};
45 | handle = [_newVehicle] spawn {
46 | _newVehicle = _this select 0;
47 | clearWeaponCargoGlobal _newVehicle;
48 | clearMagazineCargoGlobal _newVehicle;
49 | clearBackpackCargoGlobal _newVehicle;
50 | clearItemCargoGlobal _newVehicle;
51 | _displayName = getText(configFile >> "CfgVehicles" >> (typeOf _newVehicle) >> "displayName");
52 | _markerName = format ["damaged_%1_%2", _displayName, markerCounter];
53 | _vehMarker = createMarker [_markerName, position _newVehicle ];
54 | _markerName setMarkerShape "ICON";
55 | _markerName setMarkerType "b_maint";
56 | _markerName setMarkerColor "ColorWEST";
57 | _markerName setMarkerPos (GetPos _newVehicle);
58 | _markerName setMarkerText format ["Wrecked %1", _displayName];
59 | markerCounter = markerCounter + 1;
60 | waitUntil {canMove _newVehicle || !alive _newVehicle};
61 | deleteMarker _markerName;
62 | _null = [_newVehicle] spawn EVO_fnc_respawnRepair;
63 | };
64 | };
65 | }];
66 | while {alive _veh} do {
67 | if (!canMove _veh) then {
68 | _displayName = getText(configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayName");
69 | _markerName = format ["immobil_%1", markerCounter];
70 | _vehMarker = createMarker [_markerName, position _veh ];
71 | _markerName setMarkerShape "ICON";
72 | _markerName setMarkerType "b_maint";
73 | _markerName setMarkerColor "ColorWEST";
74 | _markerName setMarkerPos (GetPos _veh);
75 | _markerName setMarkerText format ["Immobilized %1", _displayName];
76 | markerCounter = markerCounter + 1;
77 | waitUntil {canMove _veh || !alive _veh};
78 | deleteMarker _markerName;
79 | };
80 | sleep 15;
81 | };
82 |
83 |
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_SatchelPlant.sqf:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Author: Genesis
4 |
5 | Description:
6 | Script used to make AI attach explosives to buildings and bring them down if players garrison them.
7 |
8 | Parameter(s):
9 | 0: OBJECT - Unit to plant satchel
10 | 1: ARRAY - satchel array
11 |
12 | Returns:
13 | NOTHING
14 | */
15 |
16 | params ["_unit","_satchelArray"];
17 |
18 | private _satchelObj = _satchelArray select 0;
19 | private _satchelMag = _satchelArray select 1;
20 |
21 | //Let's see if we can place a scripted version of the item.
22 | private _testName = _satchelObj + "_scripted";
23 | private _testMine = _testName createVehiclelocal [0,0,0];
24 | if !(isNull _testMine) then
25 | {
26 | _satchelObj = _testName;
27 | };
28 |
29 |
30 |
31 | private _point = _unit call VCM_fnc_ClstEmy;
32 | if (_point isEqualTo [] || {isNil "_point"}) exitWith {};
33 |
34 | if ((_unit distance _point) < 200) then
35 | {
36 |
37 | private _vehicle = vehicle _point;
38 |
39 | if (_point isEqualTo _vehicle) then
40 | {
41 |
42 | private _nBuilding = (nearestObjects [_point, ["House", "Building"], 50]) select 0;
43 | if (isNil "_nBuilding") exitWith {};
44 | if ((_nBuilding distance _point) > 40) exitWith {};
45 | [_unit,_nBuilding,(group _unit),_satchelObj,_satchelMag] spawn
46 | {
47 | params ["_unit","_nBuilding","_Group","_satchelObj","_satchelMag"];
48 | _unit disableAI "TARGET";
49 | _unit disableAI "AUTOTARGET";
50 | _unit disableAI "CHECKVISIBLE";
51 | _unit disableAI "COVER";
52 | _unit disableAI "AUTOCOMBAT";
53 | doStop _unit; _unit doMove (getPos _nBuilding);
54 |
55 | private _truth = true;
56 | while {_truth} do
57 | {
58 | if ((_unit distance _nBuilding) <= 9) then {_truth = false;};
59 | sleep 0.25;
60 | };
61 |
62 | _unit removeMagazine _satchelMag;
63 | private _mine = _satchelObj createVehicle (getposATL _unit);
64 | _mine setDir ([_mine, _nBuilding] call BIS_fnc_dirTo);
65 | [_unit,"AinvPknlMstpSnonWnonDnon_Putdown_AmovPknlMstpSnonWnonDnon"] remoteExec ["Vcm_PMN",0];
66 | _unit action ["SetTimer", _unit, _mine];
67 |
68 | private _plantPosition = getpos _mine;
69 | private _notSafe = true;
70 | private _unitSide = (side _unit);
71 | _unit doMove (getpos (leader _Group));
72 | _unit enableAI "TARGET";
73 | _unit enableAI "AUTOTARGET";
74 | _unit enableAI "CHECKVISIBLE";
75 | _unit enableAI "COVER";
76 | _unit enableAI "AUTOCOMBAT";
77 |
78 | while {_notSafe} do
79 | {
80 | private _array1 = [];
81 | {
82 | _array1 pushback _x;
83 | } foreach (allUnits select {(side _x) isEqualTo _unitSide && (alive _x)});
84 | _closestFriendly = [_array1,_plantPosition,true,"Satch1"] call VCM_fnc_ClstObj;
85 | if !(isNil "_closestFriendly") then
86 | {
87 | if (_closestFriendly distance2D _plantPosition > 10) then {_notSafe = false;};
88 | }
89 | else
90 | {
91 | _notSafe = false;
92 | };
93 | sleep 5;
94 | };
95 | _mine setdamage 1;
96 | sleep 3;
97 | _list = _plantPosition nearObjects ["#crater",5];
98 | if (_list isEqualTo []) then
99 | {
100 | deleteVehicle _mine;
101 | private _mine2 = "SatchelCharge_Remote_Ammo" createVehicle _plantPosition;
102 | _mine2 setdamage 1;
103 | };
104 |
105 | };
106 | };
107 | };
--------------------------------------------------------------------------------
/EVO/fn_sm_aaHunt.sqf:
--------------------------------------------------------------------------------
1 | [{
2 | currentSideMission = "aaHunt";
3 | currentSideMissionStatus = "ip";
4 | currentSideMissionsUnits = [];
5 | publicVariable "currentSideMissionsUnits";
6 | publicVariable "currentSideMissionStatus";
7 | publicVariable "currentSideMission";
8 | if (isServer) then {
9 | //server
10 | _vehicle = aaHuntTarget;
11 | currentSideMissionMarker = format ["%1", (markerCounter + 100)];
12 | publicVariable "currentSideMissionMarker";
13 | _aaMarker = createMarker [currentSideMissionMarker, position _vehicle ];
14 | currentTargetMarkerName setMarkerShape "ELLIPSE";
15 | currentTargetMarkerName setMarkerBrush "Border";
16 | currentSideMissionMarker setMarkerSize [200, 200];
17 | currentSideMissionMarker setMarkerColor "ColorEAST";
18 | currentSideMissionMarker setMarkerPos (GetPos _vehicle);
19 | markerCounter = markerCounter + 1;
20 | for "_i" from 1 to (["Infantry", "Side"] call EVO_fnc_calculateOPFOR) do {
21 | _spawnPos = [getPos _vehicle, 10, 300, 10, 0, 2, 0] call BIS_fnc_findSafePos;
22 | _grp = [_spawnPos, EAST, (EVO_opforInfantry call BIS_fnc_selectRandom)] call EVO_fnc_spawnGroup;
23 | [_grp, getPos _vehicle, 100] call CBA_fnc_taskDefend;
24 | {
25 | currentSideMissionsUnits pushBack _x;
26 | } forEach units _grp;
27 | };
28 | _tskDisplayName = format ["Destroy AAA Battery"];
29 | aaHuntTask = format ["aaHuntTask%1", floor(random(1000))];
30 | [WEST, [aaHuntTask], [_tskDisplayName, _tskDisplayName, ""], (getMarkerPos currentSideMissionMarker), 1, 2, true] call BIS_fnc_taskCreate;
31 | handle = [] spawn {
32 | waitUntil {!alive aaHuntTarget};
33 | sleep (random 15);
34 | currentSideMissionStatus = "success";
35 | publicVariable "currentSideMissionStatus";
36 | [aaHuntTask, "Succeeded", false] call bis_fnc_taskSetState;
37 | _count = {alive _x} count currentSideMissionsUnits;
38 | if (_count > 0) then {
39 | {
40 | if ([true, false] call bis_fnc_selectRandom) then {
41 | [_x] spawn EVO_fnc_surrender;
42 | } else {
43 | [_x] spawn {
44 | _unit = _this select 0;
45 | _loop = true;
46 | while {_loop} do {
47 | _players = [_unit, 1000] call EVO_fnc_playersNearby;
48 | if (!_players || !alive _unit) then {
49 | _loop = false;
50 | };
51 | };
52 | deleteVehicle _unit;
53 | };
54 | };
55 | } forEach currentSideMissionsUnits;
56 | };
57 | currentSideMission = "none";
58 | publicVariable "currentSideMission";
59 | handle = [] spawn EVO_fnc_pickSideMission;
60 | deleteMarker currentSideMissionMarker;
61 | };
62 | };
63 | if (!isDedicated) then {
64 | //client
65 | ["TaskAssigned",["","Destroy AAA Battery"]] call BIS_fnc_showNotification;
66 | CROSSROADS sideChat "All units be advised, forward scouts report an AAA battery and have marked it on the map at HQ. Friendly air assets need that battery destroyed!";
67 | handle = [] spawn {
68 | waitUntil {currentSideMissionStatus != "ip"};
69 | if (player distance aaHuntTarget < 1000) then {
70 | playsound "goodjob";
71 | [player, 10] call bis_fnc_addScore;
72 | ["PointsAdded",["BLUFOR completed a sidemission.", 10]] call BIS_fnc_showNotification;
73 | };
74 | sleep (random 15);
75 | CROSSROADS sideChat "Forward scouts report the AAA battery was destroyed. Outstanding job men!";
76 | ["TaskSucceeded",["","AAA Battery Destroyed"]] call BIS_fnc_showNotification;
77 | currentSideMission = "none";
78 | publicVariable "currentSideMission";
79 | };
80 | };
81 | },"BIS_fnc_spawn"] call BIS_fnc_MP;
--------------------------------------------------------------------------------
/Vcom/Functions/VCM_Functions/fn_MinePlant.sqf:
--------------------------------------------------------------------------------
1 | /*
2 | Author: Genesis
3 |
4 | Description:
5 | Plants a mine
6 |
7 | Parameter(s):
8 | 0: OBJECT - Unit to plant a mine
9 | 1: ARRAY - ???
10 |
11 | Returns:
12 | NOTHING
13 | */
14 |
15 | params ["_unit", "_mineArray"];
16 |
17 | if (VCM_MINECHANCE < (round (random 100)) || {isPlayer _unit}) exitWith {};
18 |
19 | private _mineType = _mineArray select 0;
20 |
21 | //Let's see if we can place a scripted version of the item.
22 | private _testName = _mineType + "_scripted";
23 | private _testMine = _testName createVehiclelocal [0,0,0];
24 | if !(isNull _testMine) then
25 | {
26 | _mineType = _testName;
27 | };
28 |
29 | private _magazineName = _mineArray select 1;
30 |
31 | if (_mineArray isEqualTo []) exitWith {};
32 |
33 | _unit removeMagazine _magazineName;
34 |
35 | //systemchat format ["I %1",_unit];
36 | private _nearestEnemy = _unit call VCM_fnc_ClstEmy;
37 | if (_nearestEnemy isEqualTo [] || {isNil "_nearestEnemy"}) exitWith {};
38 |
39 | private _mine = "";
40 |
41 | if (_nearestEnemy distance2D _unit < 100) then
42 | {
43 | //_mine = createMine [_mineType,getposATL _unit, [], 2];
44 | private _mPos = _unit modeltoworld [0,1,0.05];
45 | _mine = _mineType createVehicle _mPos;
46 | _mine setDir ([_mine, _nearestEnemy] call BIS_fnc_dirTo);
47 | _mine setpos _mPos;
48 | _mine setposATL (getposATL _mine);
49 | [_unit,"AinvPknlMstpSnonWnonDnon_Putdown_AmovPknlMstpSnonWnonDnon"] remoteExec ["Vcm_PMN",0];
50 | }
51 | else
52 | {
53 | _nearRoads = _unit nearRoads 50;
54 | if (count _nearRoads > 0) then
55 | {
56 | private _closestRoad = [_nearRoads,_unit,true,"2"] call VCM_fnc_ClstObj;
57 | doStop _unit;
58 | _unit doMove (getpos _closestRoad);
59 | waitUntil {!(alive _unit) || _unit distance2D _closestRoad < 7};
60 | private _mPos = _unit modeltoworld [0,1,0.05];
61 | _mine = _mineType createVehicle _mPos;
62 | _mine setDir ([_mine, _nearestEnemy] call BIS_fnc_dirTo);
63 | _mine setpos _mPos;
64 | _mine setposATL (getposATL _mine);
65 | //_mine = createMine [_mineType,getposATL _closestRoad, [], 3];
66 | [_unit,"AinvPknlMstpSnonWnonDnon_Putdown_AmovPknlMstpSnonWnonDnon"] remoteExec ["Vcm_PMN",0];
67 | }
68 | else
69 | {
70 | //_mine = createMine [_mineType,getposATL _unit, [], 3];
71 | private _mPos = _unit modeltoworld [0,1,0.05];
72 | _mine = _mineType createVehicle _mPos;
73 | _mine setDir ([_mine, _nearestEnemy] call BIS_fnc_dirTo);
74 | _mine setpos _mPos;
75 | _mine setposATL (getposATL _mine);
76 | [_unit,"AinvPknlMstpSnonWnonDnon_Putdown_AmovPknlMstpSnonWnonDnon"] remoteExec ["Vcm_PMN",0];
77 | };
78 | };
79 |
80 | _unitSide = (side _unit);
81 |
82 |
83 | if (_mine isEqualTo "") exitWith {};
84 |
85 | VCOM_mineArray pushBack [_Mine,_unitSide];
86 | [_Mine, false] remoteExecCall ["enableSimulationGlobal",2];
87 |
88 | /*
89 | [_mine,_unitSide] spawn
90 | {
91 | params ["_Mine","_unitSide"];
92 |
93 |
94 |
95 | private _NotSafe = true;
96 | [_Mine, false] remoteExecCall ["enableSimulationGlobal",2];
97 | waitUntil
98 | {
99 | private _Array1 = (allUnits select {!(side _x isEqualTo _unitSide)});
100 | private _ClosestEnemy = [0,0,0];
101 | _ClosestEnemy = [_Array1,_Mine,true,"2"] call VCM_fnc_ClstObj;
102 | if (_ClosestEnemy distance _Mine < 2.5) then {_NotSafe = false;};
103 | sleep 0.1;
104 | (!(alive _mine) || {!(_NotSafe)})
105 | };
106 | [_Mine, true] remoteExecCall ["enableSimulationGlobal",2];
107 | sleep 0.25;
108 | _Mine setdamage 1;
109 | };
--------------------------------------------------------------------------------
/CHVD/fn_onEBinput.sqf:
--------------------------------------------------------------------------------
1 | private ["_textValue","_updateType"];
2 | _varType1 = [_this, 0, "", [""]] call BIS_fnc_param;
3 | _slider1 = [_this, 1, controlNull, [0, controlNull]] call BIS_fnc_param;
4 | _text1 = [_this, 2, controlNull, [0, controlNull]] call BIS_fnc_param;
5 | _varType2 = [_this, 3, "", [""]] call BIS_fnc_param;
6 | _slider2 = [_this, 4, controlNull, [0, controlNull]] call BIS_fnc_param;
7 | _text2 = [_this, 5, controlNull, [0, controlNull]] call BIS_fnc_param;
8 | _syncVar = [_this, 6, "", [""]] call BIS_fnc_param;
9 |
10 | if (count _this < 7) then {
11 | _updateType = 2;
12 | } else {
13 | if (call compile _syncVar) then {
14 | _updateType = 3;
15 | } else {
16 | _updateType = 1;
17 | };
18 | };
19 |
20 | switch (_updateType) do {
21 | case 1: {
22 | _textValue = [ctrlText _text1, "0123456789"] call BIS_fnc_filterString;
23 | _textValue = if (_textValue == "") then {0} else {call compile _textValue min 12000 max 0};
24 |
25 | sliderSetPosition [_slider1, _textValue min CHVD_maxView];
26 | //ctrlSetText [_text1, str round (_textValue min CHVD_maxView)];
27 | sliderSetRange [_slider2, 0, _textValue min CHVD_maxView];
28 |
29 | call compile format ["%1 = %2", _varType1, _textValue min CHVD_maxView];
30 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType1];
31 |
32 | if ((call compile _varType2) > _textValue) then {
33 | sliderSetPosition [_slider2, _textValue min CHVD_maxObj];
34 | ctrlSetText [_text2, str round (_textValue min CHVD_maxObj)];
35 |
36 | call compile format ["%1 = %2", _varType2, _textValue min CHVD_maxObj];
37 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType2];
38 | };
39 |
40 | [_updateType] call CHVD_fnc_updateSettings;
41 | };
42 | case 2: {
43 | _textValue = [ctrlText _text1, "0123456789"] call BIS_fnc_filterString;
44 | _textValue = if (_textValue == "") then {0} else {call compile _textValue min 12000 max 0};
45 |
46 | sliderSetPosition [_slider1, _textValue min CHVD_maxObj];
47 | //ctrlSetText [_text1, str round (_textValue min CHVD_maxObj)];
48 |
49 | call compile format ["%1 = %2", _varType1, _textValue min CHVD_maxObj];
50 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType1];
51 |
52 | [_updateType] call CHVD_fnc_updateSettings;
53 | };
54 | case 3: {
55 | _textValue = [ctrlText _text1, "0123456789"] call BIS_fnc_filterString;
56 | _textValue = if (_textValue == "") then {0} else {call compile _textValue min 12000 max 0};
57 |
58 | sliderSetPosition [_slider1, _textValue min CHVD_maxView];
59 | //ctrlSetText [_text1, str round (_textValue min CHVD_maxView)];
60 | sliderSetRange [_slider2, 0, _textValue min CHVD_maxView];
61 |
62 | call compile format ["%1 = %2", _varType1, _textValue min CHVD_maxView];
63 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType1];
64 |
65 | if ((call compile _varType2) > _textValue) then {
66 | sliderSetPosition [_slider2, _textValue min CHVD_maxObj];
67 | ctrlSetText [_text2, str round (_textValue min CHVD_maxObj)];
68 |
69 | call compile format ["%1 = %2", _varType2, _textValue min CHVD_maxObj];
70 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType2];
71 | };
72 |
73 | sliderSetPosition [_slider2, _textValue min CHVD_maxObj];
74 | ctrlSetText [_text2, str round (_textValue min CHVD_maxObj)];
75 |
76 | call compile format ["%1 = %2", _varType2, _textValue min CHVD_maxObj];
77 | call compile format ["profileNamespace setVariable ['%1',%1]", _varType2];
78 |
79 | [_updateType] call CHVD_fnc_updateSettings;
80 | };
81 | };
--------------------------------------------------------------------------------
/EVO/fn_buildAmmoCrate.sqf:
--------------------------------------------------------------------------------
1 | _crate = _this select 0;
2 | _EVOrank = _this select 1;
3 |
4 | switch (_EVOrank) do {
5 | case "PRIVATE": {
6 | availableWeapons = availableWeapons + rank1weapons;
7 | availableMagazines = availableWeapons call EVO_fnc_buildMagazineArray;
8 | availableItems = availableItems + rank1items;
9 |
10 | };
11 | case "CORPORAL": {
12 | availableWeapons = availableWeapons + rank1weapons + rank2weapons;
13 | availableItems = availableItems + rank1items + rank2items;
14 | availableMagazines = availableWeapons call EVO_fnc_buildMagazineArray;
15 |
16 | };
17 | case "SERGEANT": {
18 | availableWeapons = availableWeapons + rank1weapons + rank2weapons + rank3weapons;
19 | availableItems = availableItems + rank1items + rank2items + rank3items;
20 | availableMagazines = availableWeapons call EVO_fnc_buildMagazineArray;
21 | };
22 | case "LIEUTENANT": {
23 | availableWeapons = availableWeapons + rank1weapons + rank2weapons + rank3weapons + rank4weapons;
24 | availableItems = availableItems + rank1items + rank2items + rank3items + rank4items;
25 | availableMagazines = availableWeapons call EVO_fnc_buildMagazineArray;
26 | };
27 | case "CAPTAIN": {
28 | availableWeapons = availableWeapons + rank1weapons + rank2weapons + rank3weapons + rank4weapons + rank5weapons;
29 | availableItems = availableItems + rank1items + rank2items + rank3items + rank4items + rank5items;
30 | availableMagazines = availableWeapons call EVO_fnc_buildMagazineArray;
31 | };
32 | case "MAJOR": {
33 | availableWeapons = availableWeapons + rank1weapons + rank2weapons + rank3weapons + rank4weapons + rank5weapons + rank6weapons;
34 | availableItems = availableItems + rank1items + rank2items + rank3items + rank4items + rank5items + rank6items;
35 | availableMagazines = availableWeapons call EVO_fnc_buildMagazineArray;
36 | };
37 | case "COLONEL": {
38 | availableWeapons = availableWeapons + rank1weapons + rank2weapons + rank3weapons + rank4weapons + rank5weapons + rank6weapons + rank7weapons;
39 | availableItems = availableItems + rank1items + rank2items + rank3items + rank4items + rank5items + rank6items;
40 | availableMagazines = availableWeapons call EVO_fnc_buildMagazineArray;
41 | };
42 | default {
43 | availableWeapons = availableWeapons + rank1weapons;
44 | availableMagazines = availableWeapons call EVO_fnc_buildMagazineArray;
45 | availableItems = availableItems + rank1items;
46 | };
47 | };
48 |
49 |
50 | [_crate, ([_crate] call BIS_fnc_getVirtualWeaponCargo) , false] call BIS_fnc_removeVirtualWeaponCargo;
51 | [_crate, ([_crate] call BIS_fnc_getVirtualMagazineCargo) , false] call BIS_fnc_removeVirtualMagazineCargo;
52 | [_crate, ([_crate] call BIS_fnc_getVirtualBackpackCargo) , false] call BIS_fnc_removeVirtualBackpackCargo;
53 | [_crate, ([_crate] call BIS_fnc_getVirtualItemCargo) , false] call BIS_fnc_removeVirtualItemCargo;
54 |
55 | {
56 | _crate addMagazineCargo [_x, 100];
57 | } forEach availableMagazines;
58 |
59 | {
60 | _crate addWeaponCargo [_x, 5];
61 | } forEach availableWeapons;
62 |
63 | availableItems = availableItems + availableHeadgear + availableGoggles + availableUniforms + availableVests;
64 |
65 | [_crate, availableWeapons, false, true] call BIS_fnc_addVirtualWeaponCargo;
66 | [_crate, availableBackpacks, false, true] call BIS_fnc_addVirtualBackpackCargo;
67 | [_crate, availableItems, false, true] call BIS_fnc_addVirtualItemCargo;
68 | [_crate, availableMagazines, false, true] call BIS_fnc_addVirtualMagazineCargo;
69 |
--------------------------------------------------------------------------------
/EVO/fn_pinit.sqf:
--------------------------------------------------------------------------------
1 | private ["_score","_player","_respawnPos","_ret","_vehicle","_displayName","_txt","_hitID","_handleHealID","_string","_currentLoadout"];
2 |
3 | //////////////////////////////////////
4 | //Setup Player Actions
5 | //////////////////////////////////////
6 | player addaction ["View Distance Settings", CHVD_fnc_openDialog, nil,1,false,true,"","(player distance spawnBuilding) < 10"];
7 | //player addaction ["Select Side Mission","[] spawn EVO_fnc_osm;",nil,1,false,true,"","(player distance spawnBuilding) < 10 && currentSideMission == 'none'"];
8 | player addaction ["Recruit Infantry","bon_recruit_units\open_dialog.sqf",nil,1,false,true,"","(player distance spawnBuilding) < 10 && ((leader group player) == player)"];
9 | player addaction ["HALO Drop", EVO_fnc_paraInsert, nil,1,false,true,"","(player distance spawnBuilding) < 10"];
10 | player addaction ["Group Management","disableserialization; ([] call BIS_fnc_displayMission) createDisplay 'RscDisplayDynamicGroups'",nil,1,false,true,"","(player distance spawnBuilding) < 10"];
11 | player addaction ["Use FARP", EVO_fnc_rearm,nil,1,false,true,"","(player distance (nearestObject [player, 'USMC_WarfareBBarracks']) < 20 && !(vehicle player isKindOf 'Man'))"];
12 | player addaction ["Service Vehicle", EVO_fnc_rearm,nil,1,false,true,"","((player distance hqbox) < 600) && !(vehicle player isKindOf 'Man')"];
13 | player addaction ["Use MASH", "player setDamage 0",nil,1,false,true,"","(player distance (nearestObject [player, 'USMC_WarfareBFieldhHospital']) < 20 && (vehicle player isKindOf 'Man'))"];
14 | player setUnitLoadout loadout;
15 | player enableFatigue false;
16 | group player setVariable ["Vcm_Disable",true]; //This command will disable Vcom AI on a group entirely.
17 | _nil = [] spawn EVO_fnc_rank;
18 | _nil = [] spawn EVO_fnc_supportManager;
19 |
20 | //////////////////////////////////////
21 | //Add MASH/FARP to Player
22 | //////////////////////////////////////
23 | if (typeOf player == "B_medic_F") then {
24 | player addaction ["Build MASH","[] spawn EVO_fnc_deployMplayer",nil,1,false,true,"","player distance spawnBuilding > 800 && isTouchingGround player && speed player < 1 && vehicle player == player && animationState player != 'Acts_carFixingWheel' && (player distance (nearestObject [player, 'USMC_WarfareBFieldhHospital']) > 50)"];
25 | [["Gamemode","MASH"], 15, "", 35, "", true, true, true, true] call BIS_fnc_advHint;
26 | };
27 | if (typeOf player == "B_soldier_repair_F") then {
28 | player addaction ["Build FARP","[] spawn EVO_fnc_deployEplayer",nil,1,false,true,"","player distance spawnBuilding > 800 && isTouchingGround player && speed player < 1 && vehicle player == player && animationState player != 'Acts_carFixingWheel' && (player distance (nearestObject [player, 'USMC_WarfareBBarracks']) > 50)"];
29 | [["Gamemode","FARP"], 15, "", 35, "", true, true, true, true] call BIS_fnc_advHint;
30 | };
31 |
32 | //////////////////////////////////////
33 | //Player Rank/Vehicle Loop
34 | //////////////////////////////////////
35 | player addEventHandler ["GetInMan", {
36 | params ["_unit", "_role", "_vehicle", "_turret"];
37 | handle = [player] call EVO_fnc_vehicleCheck;
38 | }];
39 |
40 | //////////////////////////////////////
41 | //Add Handle Score to Server
42 | //////////////////////////////////////
43 | player addEventHandler ["HandleScore", {
44 | params ["_unit", "_object", "_score"];
45 | [] remoteExecCall ["EVO_fnc_rank", _unit];
46 | [] remoteExecCall ["EVO_fnc_supportManager", _unit];
47 | true
48 | }];
49 |
50 |
--------------------------------------------------------------------------------
/bon_recruit_units/unit_lifecycle.fsm:
--------------------------------------------------------------------------------
1 | /*%FSM*/
2 | /*%FSM*/
3 | /*
4 | item0[] = {"init",0,250,-190.484970,-249.414719,-151.321075,-222.826096,0.000000,"init"};
5 | item1[] = {"alive_AI__player",2,250,-50.501659,-162.876266,39.498356,-112.876259,0.000000,"alive AI," \n "player exists"};
6 | item2[] = {"_",8,218,-18.394661,-244.481613,14.749162,-223.244141,0.000000,""};
7 | item3[] = {"AI_dead___dismis",4,218,83.946503,-122.073662,155.217407,-70.066902,1.000000,"AI dead /" \n "dismissed"};
8 | item4[] = {"no_player__AI_de",4,218,79.933113,-200.334457,153.879608,-153.010040,0.000000,"no player;" \n "AI dead"};
9 | item5[] = {"exit",1,4346,213.043457,-142.809418,246.187393,-113.545189,0.000000,"exit"};
10 | link0[] = {0,2};
11 | link1[] = {1,3};
12 | link2[] = {1,4};
13 | link3[] = {2,1};
14 | link4[] = {3,5};
15 | link5[] = {4,5};
16 | globals[] = {0.000000,0,0,0,0,640,480,1,8,6316128,1,-300.000000,300.000000,300.000000,-300.000000,897,592,1};
17 | window[] = {0,-1,-1,-1,-1,762,25,1285,25,1,915};
18 | *//*%FSM*/
19 | class FSM
20 | {
21 | fsmName = "unit_lifecycle";
22 | class States
23 | {
24 | /*%FSM*/
25 | class init
26 | {
27 | name = "init";
28 | init = /*%FSM*/"_unit = _this select 0;"/*%FSM*/;
29 | precondition = /*%FSM*/""/*%FSM*/;
30 | class Links
31 | {
32 | /*%FSM*/
33 | class _
34 | {
35 | priority = 0.000000;
36 | to="alive_AI__player";
37 | precondition = /*%FSM*/""/*%FSM*/;
38 | condition=/*%FSM*/""/*%FSM*/;
39 | action=/*%FSM*/""/*%FSM*/;
40 | };
41 | /*%FSM*/
42 | };
43 | };
44 | /*%FSM*/
45 | /*%FSM*/
46 | class alive_AI__player
47 | {
48 | name = "alive_AI__player";
49 | init = /*%FSM*/""/*%FSM*/;
50 | precondition = /*%FSM*/""/*%FSM*/;
51 | class Links
52 | {
53 | /*%FSM*/
54 | class AI_dead___dismis
55 | {
56 | priority = 1.000000;
57 | to="exit";
58 | precondition = /*%FSM*/""/*%FSM*/;
59 | condition=/*%FSM*/"not alive _unit"/*%FSM*/;
60 | action=/*%FSM*/""/*%FSM*/;
61 | };
62 | /*%FSM*/
63 | /*%FSM*/
64 | class no_player__AI_de
65 | {
66 | priority = 0.000000;
67 | to="exit";
68 | precondition = /*%FSM*/""/*%FSM*/;
69 | condition=/*%FSM*/"{isPlayer _x} count (units group _unit) == 0"/*%FSM*/;
70 | action=/*%FSM*/""/*%FSM*/;
71 | };
72 | /*%FSM*/
73 | };
74 | };
75 | /*%FSM*/
76 | /*%FSM*/
77 | class exit
78 | {
79 | name = "exit";
80 | init = /*%FSM*/"if(not isNull _unit) then {" \n
81 | " _unit spawn {" \n
82 | " _this setDamage 1;" \n
83 | " sleep 120;" \n
84 | " hideBody _this;" \n
85 | " sleep 5;" \n
86 | " deleteVehicle _this;" \n
87 | " };" \n
88 | "};"/*%FSM*/;
89 | precondition = /*%FSM*/""/*%FSM*/;
90 | class Links
91 | {
92 | };
93 | };
94 | /*%FSM*/
95 | };
96 | initState="init";
97 | finalStates[] =
98 | {
99 | "exit",
100 | };
101 | };
102 | /*%FSM*/
--------------------------------------------------------------------------------
/Vcom/cfgFunctions.hpp:
--------------------------------------------------------------------------------
1 | class VCOM
2 | {
3 | tag = "VCM";
4 |
5 | class FSM
6 | {
7 | file = "Vcom\FSMS";
8 |
9 | // group spawn VCM_fnc_SQUADBEH
10 | class SQUADBEH
11 | {
12 | ext = ".fsm";
13 | };
14 | };
15 |
16 | class Functions
17 | {
18 | file = "Vcom\Functions\VCM_Functions";
19 |
20 | // [unitToRearm, rearmLocation] spawn VCM_fnc_ActRearm
21 | class ActRearm {};
22 |
23 | // [unit, source, damage, instigator] call VCM_fnc_AIHIT;
24 | class AIHIT {};
25 |
26 | // [group] call VCM_fnc_ArmStatics;
27 | class ArmStatics {};
28 |
29 | // [callGroup, enemyGroup] call VCM_fnc_ArtyCall;
30 | class ArtyCall {};
31 |
32 | // group call VCM_fnc_ArtyManage;
33 | class ArtyManage {};
34 |
35 | // [entity, unit] call VCM_fnc_BoxNrst;
36 | class BoxNrst {};
37 |
38 | // unit call VCM_fnc_CheckArty;
39 | class CheckArty {};
40 |
41 | // [string] call VCM_fnc_Classname;
42 | class Classname {};
43 |
44 | // [group, enemy] call VCM_fnc_ClearBuilding;
45 | class ClearBuilding {};
46 |
47 | // unit call VCM_fnc_ClstEmy;
48 | class ClstEmy {};
49 |
50 | // [list, object, order, script] call VCM_fnc_ClstObj;
51 | class ClstObj {};
52 |
53 | // [unit, killer] call VCM_fnc_ClstWarn;
54 | class ClstWarn {};
55 |
56 | // [group, searchDistance] call VCM_fnc_EmptyStatic;
57 | class EmptyStatic {};
58 |
59 | // unit call VCM_fnc_EnemyArray;
60 | class EnemyArray {};
61 |
62 | // [groupLeader, moveDistance] call VCM_fnc_FindCover;
63 | class FindCover {};
64 |
65 | // [groupLeader] spawn VCM_fnc_FlankMove;
66 | class FlankMove {};
67 |
68 | // [groupLeader, moveDistance] call VCM_fnc_ForceMove;
69 | class ForceMove {};
70 |
71 | // unit call VCM_fnc_FriendlyArray;
72 | class FriendlyArray {};
73 |
74 | // unit call VCM_fnc_FrmChnge;
75 | class FrmChnge {};
76 |
77 | // group spawn VCM_fnc_Garrison;
78 | class Garrison {};
79 |
80 | // group call VCM_fnc_GarrisonLight;
81 | class GarrisonLight {};
82 |
83 | // unit call VCM_fnc_HasMine;
84 | class HasMine {};
85 |
86 | // unit call VCM_fnc_HealSelf;
87 | class HealSelf {};
88 |
89 | // [unit, weapon, muzzle, mode, ammo, magazine, bullet, gunner] call VCM_fnc_HearingAids;
90 | class HearingAids {};
91 |
92 | // [object, searchRadius, precision, sortingOrder] call VCM_fnc_Heights;
93 | class Heights {};
94 |
95 | // [] call VCM_fnc_IRCHECK;
96 | class IRCHECK {};
97 |
98 | // group call VCM_fnc_KitChk;
99 | class KitChk {};
100 |
101 | // [array, unitToReveal, revealAmount] call VCM_fnc_KnowAbout;
102 | class KnowAbout {};
103 |
104 | // group call VCM_fnc_MedicalHandler
105 | class MedicalHandler {};
106 |
107 | //[medic, injuredUnit] spawn VCM_fnc_MedicHeal;
108 | class MedicHeal {};
109 |
110 | // [] spawn VCM_fnc_MineMonitor;
111 | class MineMonitor {};
112 |
113 | // [unit, mineArray] spawn VCM_fnc_MinePlant;
114 | class MinePlant {};
115 |
116 | // [gunner, backpackClassname, staticWeapon] call VCM_fnc_PackStatic;
117 | class PackStatic {};
118 |
119 | // group call VCM_fnc_RearmSelf;
120 | class RearmSelf {};
121 |
122 | // group call VCM_fnc_RMedics;
123 | class RMedics {};
124 |
125 | // group call VCM_fnc_RStatics;
126 | class RStatics {};
127 |
128 | // [unit, satchelArray] spawn VCM_fnc_SatchelPlant;
129 | class SatchelPlant {};
130 |
131 | // group call VCM_fnc_SquadExc;
132 | class SquadExc {};
133 |
134 | // group call VCM_fnc_WyptChk;
135 | class WyptChk {};
136 |
137 | //group call VCM_fnc_VehicleCommandeer;
138 | class vehiclecommandeer {};
139 |
140 | //group call VCM_fnc_VehicleCheck;
141 | class VehicleCheck {};
142 |
143 | //group call VCM_fnc_VehicleMove;
144 | class VehicleMove {};
145 |
146 | //group call VCM_fnc_IsTransport;
147 | class IsTransport {};
148 |
149 | //[_pos,_dist,_params] call VCM_fnc_isFlatEmpty;
150 | class isFlatEmpty {};
151 |
152 | //[] call VCM_fnc_CBASettings;
153 | class CBASettings {};
154 | };
155 |
156 | };
--------------------------------------------------------------------------------
/EVO/fn_support_arty.sqf:
--------------------------------------------------------------------------------
1 | _caller = _this select 0;
2 | _pos = _this select 1;
3 | _target = _this select 2;
4 | _is3D = _this select 3;
5 | _ID = _this select 4;
6 |
7 | _grpSide = side _caller;
8 | _arty = _caller;
9 | _arty = arty_west;
10 | _busy = false;
11 | _busy = _arty getVariable ["EVO_support_busy", false];
12 | [player, -6] call bis_fnc_addScore;
13 | ["PointsRemoved",["Artillery support initiated.", 6]] call BIS_fnc_showNotification;
14 | if(!_busy) then {
15 | _arty setVariable ["EVO_support_busy", true, true];
16 | [_caller, format["%1, this is %2, adjust fire, over.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
17 | sleep 3.5;
18 | [_arty, format["%2 this is %1, adjust fire, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
19 | sleep 3.5;
20 | openMap true;
21 | sleep 3;
22 | ["supportMapClickEH", "onMapSingleClick", {
23 | supportMapClick = _pos;
24 | supportClicked = true;
25 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
26 | }] call BIS_fnc_addStackedEventHandler;
27 | ["deployed",["DESIGNATE TARGET", "Left click on your target."]] call BIS_fnc_showNotification;
28 | waitUntil {supportClicked || !(visiblemap)};
29 | _pos = supportMapClick;
30 | if (!visiblemap) exitWith {
31 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
32 | [_caller, format["%1, this is %2, scratch that last request, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
33 | _arty setVariable ["EVO_support_busy", false, true];
34 | sleep 3.5;
35 | [_arty, format["Copy that %2, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
36 | sleep 3.5;
37 | _newartyStrike = [_caller, "artyStrike"] call BIS_fnc_addCommMenuItem;
38 | [player, 6] call bis_fnc_addScore;
39 | ["PointsAdded",["Artillery support canceled.", 6]] call BIS_fnc_showNotification;
40 | };
41 | openMap false;
42 | [_caller, format["Grid %1, over.", mapGridPosition _pos]] call EVO_fnc_globalSideChat;
43 | sleep 3;
44 | _isInRange = _pos inRangeOfArtillery [[_arty], currentMagazine _arty];
45 | if (_isInRange) then {
46 | _arty setVariable ["EVO_playerRequester", player, true];
47 | [_arty, format["Grid %1, out.", mapGridPosition _pos]] call EVO_fnc_globalSideChat;
48 | sleep 3;
49 | [_caller, "Fire for effect, over."] call EVO_fnc_globalSideChat;
50 | sleep 3;
51 | [_arty, "Fire for effect, out."] call EVO_fnc_globalSideChat;
52 | sleep 1.5;
53 | [_arty, "Firing for effect, three rounds, out."] call EVO_fnc_globalSideChat;
54 | sleep 3.5;
55 | [_arty, "Shot, over."] call EVO_fnc_globalSideChat;
56 | //fire!
57 | _eta = 0;
58 | [[_arty, _pos, 6],"EVO_fnc_doArtyFire", (owner _arty), false, false] spawn BIS_fnc_MP;
59 | _eta = floor(_arty getArtilleryETA [_pos, currentMagazine _arty]);
60 | [_caller, "Shot, out."] call EVO_fnc_globalSideChat;
61 | sleep 3.5;
62 | _arty setVariable ["EVO_support_busy", false, true];
63 | [_arty, format["Splash in %1 seconds, over.", _eta]] call EVO_fnc_globalSideChat;
64 | sleep (_eta + 10);
65 | [_caller, "Splash, over."] call EVO_fnc_globalSideChat;
66 | sleep 3.5;
67 | [_arty, "Splash, out."] call EVO_fnc_globalSideChat;
68 | } else {
69 | [_arty, format["%2 this is %1, specified map grid is out of range, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
70 | _arty setVariable ["EVO_support_busy", false, true];
71 | _newartyStrike = [_caller, "artyStrike"] call BIS_fnc_addCommMenuItem;
72 | [player, 6] call bis_fnc_addScore;
73 | };
74 |
75 | } else {
76 | [_caller, format["%1, this is %2, adjust fire, over.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
77 | sleep 3.5;
78 | [_arty, format["%2 this is %1, we are already servicing a request, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
79 | _newartyStrike = [_caller, "artyStrike"] call BIS_fnc_addCommMenuItem;
80 | [player, 6] call bis_fnc_addScore;
81 | ["PointsAdded",["Artillery support canceled.", 6]] call BIS_fnc_showNotification;
82 | };
83 | supportMapClick = [0,0,0];
84 | supportClicked = false;
85 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
--------------------------------------------------------------------------------
/bon_recruit_units/recruit.sqf:
--------------------------------------------------------------------------------
1 | // by Bon_Inf*
2 |
3 | if(not local player) exitWith{};
4 | _count = 0;
5 | {
6 | if (!isPlayer _x) then {
7 | _count = _count + 1;
8 | };
9 | } forEach units group player;
10 | _count = _count + count bon_recruit_queue;
11 | //_precount = count units group player + count bon_recruit_queue;
12 | //if (_precount >= bon_max_units_allowed) exitWith {hint "You've reached the max allowed group size."};
13 | if (_count >= bon_max_units_allowed) exitWith {hint "You've reached the maximum allowed group size for your rank."};
14 |
15 |
16 | #include "dialog\definitions.sqf"
17 | disableSerialization;
18 |
19 |
20 | _update_queue = {
21 | _display = findDisplay BON_RECRUITING_DIALOG;
22 | _queuelist = _display displayCtrl BON_RECRUITING_QUEUE;
23 | _queuelist ctrlSetText format["Units queued: %1",count bon_recruit_queue];
24 | };
25 |
26 |
27 | _display = findDisplay BON_RECRUITING_DIALOG;
28 | _listbox = _display displayCtrl BON_RECRUITING_UNITLIST;
29 | _sel = lbCurSel _listbox; if(_sel < 0) exitWith{};
30 |
31 | _unittype = bon_recruit_recruitableunits select _sel;
32 | _typename = lbtext [BON_RECRUITING_UNITLIST,_sel];
33 |
34 | _queuepos = 0;
35 | _queuecount = count bon_recruit_queue;
36 | if(_queuecount > 0) then {
37 | _queuepos = (bon_recruit_queue select (_queuecount - 1)) + 1;
38 | hint parseText format["%1 added to queue.",_typename];
39 | };
40 | bon_recruit_queue = bon_recruit_queue + [_queuepos];
41 |
42 | [] call _update_queue;
43 |
44 |
45 | WaitUntil{_queuepos == bon_recruit_queue select 0};
46 | sleep (1.5 * (_queuepos min 1));
47 | hint parseText format["Processing your %1.",_typename];
48 |
49 | sleep 8.5;
50 |
51 |
52 |
53 |
54 | /********************* UNIT CREATION ********************/
55 | _unit = objNull;
56 |
57 | if (player distance SpawnBuilding < 500) then {
58 | //_spawnPos = [getPos player, 10, 10, 10, 0, 2, 0] call BIS_fnc_findSafePos;
59 | _spawnPos = getPos SpawnBuilding;
60 | _unit = group player createUnit [_unittype, _spawnPos, [], 0, "FORM"];
61 | _unit addEventHandler ["GetInMan", {
62 | params ["_unit", "_role", "_vehicle", "_turret"];
63 | handle = [_unit] call EVO_fnc_vehicleCheck;
64 | }];
65 | } else {
66 | _spawnPos = [((getPos player) select 0), ((getPos player) select 1), (((getPos player) select 2) + 200)];
67 | _unit = group player createUnit [_unittype, [_spawnPos select 0, _spawnPos select 1, 200], [], 0, "FORM"];
68 | _unit allowdamage false;
69 | waitUntil {(position _unit select 2) <= 75};
70 | _chute = createVehicle ["Steerable_Parachute_F", position _unit, [], (random 10), 'FLY'];
71 | _chute setPos (getPos _unit);
72 | _unit assignAsDriver _chute;
73 | _unit moveIndriver _chute;
74 | _unit DoMove (getPos leader group _unit);
75 | _unit allowdamage true;
76 | _unit addEventHandler ["GetInMan", {
77 | params ["_unit", "_role", "_vehicle", "_turret"];
78 | handle = [_unit] call EVO_fnc_vehicleCheck;
79 | }];
80 | [_unit] spawn {
81 | _unit = _this select 0;
82 | (vehicle _unit) allowDamage false;// Set parachute invincible to prevent exploding if it hits buildings
83 | waitUntil {isTouchingGround _unit || (position _unit select 2) < 1 };
84 | _unit allowDamage false;
85 | _unit action ["EJECT", vehicle _unit];
86 | _unit setvelocity [0,0,0];
87 | sleep 1;// Para Units sometimes get damaged on landing. Wait to prevent this.
88 | _unit allowDamage true;
89 | };
90 | };
91 |
92 | _unit setRank "PRIVATE";
93 | _unit = _this select 0;
94 | _unit addEventHandler ["HandleScore", {
95 | _ai = _this select 0;
96 | _source = _this select 1;
97 | _scoreToAdd = _this select 2;
98 | _player = leader group _ai;
99 | [_player, _scoreToAdd] call bis_fnc_addScore;
100 | }];
101 | [_unit] execVM (BON_RECRUIT_PATH+"init_newunit.sqf");
102 | /*******************************************************/
103 |
104 |
105 |
106 |
107 | //hint parseText format["Your %1 %2 has arrived.",_typename,name _unit];
108 | _msg = format["Your %1 %2 has arrived.",_typename,name _unit];
109 | ["deployed",["REINFORCEMENTS", _msg]] call BIS_fnc_showNotification;
110 | bon_recruit_queue = bon_recruit_queue - [_queuepos];
111 |
112 | [] call _update_queue;
113 |
--------------------------------------------------------------------------------
/EVO/fn_support_rocket.sqf:
--------------------------------------------------------------------------------
1 | private ["_caller","_pos","_is3D","_ID","_grpSide","_arty","_busy","_score","_newartyStrike","_isInRange","_eta"];
2 |
3 | _caller = _this select 0;
4 | _pos = _this select 1;
5 | _target = _this select 2;
6 | _is3D = _this select 3;
7 | _ID = _this select 4;
8 | _grpSide = side _caller;
9 | _arty = _caller;
10 |
11 |
12 | _arty = rocket_west;
13 | _busy = false;
14 | _busy = _arty getVariable ["EVO_support_busy", false];
15 | [player, -6] call bis_fnc_addScore;
16 | ["PointsRemoved",["Rocket support initiated.", 6]] call BIS_fnc_showNotification;
17 | if(!_busy || isNil "_busy") then {
18 |
19 | _arty setVariable ["EVO_support_busy", true, true];
20 | [_caller, format["%1, this is %2, adjust fire, over.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
21 | sleep 3.5;
22 | [_arty, format["%2 this is %1, adjust fire, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
23 | sleep 3.5;
24 | openMap true;
25 | sleep 3;
26 | ["supportMapClickEH", "onMapSingleClick", {
27 | supportMapClick = _pos;
28 | supportClicked = true;
29 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
30 | }] call BIS_fnc_addStackedEventHandler;
31 | ["deployed",["DESIGNATE TARGET", "Left click on your target."]] call BIS_fnc_showNotification;
32 | waitUntil {supportClicked || !(visiblemap)};
33 | _pos = supportMapClick;
34 | if (!visiblemap) exitWith {
35 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
36 | [_caller, format["%1, this is %2, scratch that last request, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
37 | _arty setVariable ["EVO_support_busy", false, true];
38 | sleep 3.5;
39 | [_arty, format["Copy that %2, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
40 | sleep 3.5;
41 | _newartyStrike = [_caller, "rocketStrike"] call BIS_fnc_addCommMenuItem;
42 | [player, 6] call bis_fnc_addScore;
43 | ["PointsAdded",["Rocket support canceled.", 6]] call BIS_fnc_showNotification;
44 | };
45 | [_caller, format["Grid %1, over.", mapGridPosition _pos]] call EVO_fnc_globalSideChat;
46 | sleep 3;
47 |
48 | _isInRange = _pos inRangeOfArtillery [[_arty], currentMagazine _arty];
49 | if (_isInRange) then {
50 | _arty setVariable ["EVO_playerRequester", player, true];
51 | [_arty, format["Grid %1, out.", mapGridPosition _pos]] call EVO_fnc_globalSideChat;
52 | sleep 3;
53 | [_caller, "Fire for effect, over."] call EVO_fnc_globalSideChat;
54 | sleep 3;
55 | [_arty, "Fire for effect, out."] call EVO_fnc_globalSideChat;
56 | sleep 1.5;
57 | [_arty, "Firing for effect, three rounds, out."] call EVO_fnc_globalSideChat;
58 | sleep 3.5;
59 | [_arty, "Shot, over."] call EVO_fnc_globalSideChat;
60 | //fire!
61 | _eta = 0;
62 | [[_arty, _pos, 6],"EVO_fnc_doArtyFire", (owner _arty), false, false] spawn BIS_fnc_MP;
63 | _eta = floor(_arty getArtilleryETA [_pos, currentMagazine _arty]);
64 | [_caller, "Shot, out."] call EVO_fnc_globalSideChat;
65 | sleep 3.5;
66 | _arty setVariable ["EVO_support_busy", false, true];
67 | [_arty, format["Splash in %1 seconds, over.", _eta]] call EVO_fnc_globalSideChat;
68 | sleep (_eta + 10);
69 | [_caller, "Splash, over."] call EVO_fnc_globalSideChat;
70 | sleep 3.5;
71 | [_arty, "Splash, out."] call EVO_fnc_globalSideChat;
72 | } else {
73 | [_arty, format["%2 this is %1, specified map grid is out of range, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
74 | _newartyStrike = [_caller, "rocketStrike"] call BIS_fnc_addCommMenuItem;
75 | _arty setVariable ["EVO_support_busy", false, true];
76 | [player, 6] call bis_fnc_addScore;
77 | };
78 |
79 | } else {
80 | [_caller, format["%1, this is %2, adjust fire, over.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
81 | sleep 3.5;
82 | [_arty, format["%2 this is %1, we are already servicing a request, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
83 | _newartyStrike = [_caller, "rocketStrike"] call BIS_fnc_addCommMenuItem;
84 | [player, 6] call bis_fnc_addScore;
85 | ["PointsAdded",["Rocket support canceled.", 6]] call BIS_fnc_showNotification;
86 |
87 | };
88 | supportMapClick = [0,0,0];
89 | supportClicked = false;
90 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
91 |
--------------------------------------------------------------------------------
/EVO/fn_support_mortar.sqf:
--------------------------------------------------------------------------------
1 | private ["_caller","_pos","_is3D","_ID","_grpSide","_mortar","_busy","_score","_newMortarStrike","_isInRange","_eta","_arty"];
2 |
3 | _caller = _this select 0;
4 | _pos = _this select 1;
5 | _target = _this select 2;
6 | _is3D = _this select 3;
7 | _ID = _this select 4;
8 | _grpSide = side _caller;
9 | _mortar = _caller;
10 | _mortar = mortar_west;
11 | _busy = false;
12 | _busy = _mortar getVariable ["EVO_support_busy", false];
13 | [player, -5] call bis_fnc_addScore;
14 | ["PointsRemoved",["Mortar support initiated.", 5]] call BIS_fnc_showNotification;
15 | if(!_busy || isNil "_busy") then {
16 | [_caller, format["%1, this is %2, adjust fire, over.", groupID (group _mortar), groupID (group _caller)]] call EVO_fnc_globalSideChat;
17 | sleep 3.5;
18 | [_mortar, format["%2 this is %1, adjust fire, out.", groupID (group _mortar), groupID (group _caller)]] call EVO_fnc_globalSideChat;
19 | sleep 3.5;
20 | openMap true;
21 | sleep 3;
22 | ["supportMapClickEH", "onMapSingleClick", {
23 | supportMapClick = _pos;
24 | supportClicked = true;
25 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
26 | }] call BIS_fnc_addStackedEventHandler;
27 | ["deployed",["DESIGNATE TARGET", "Left click on your target."]] call BIS_fnc_showNotification;
28 | waitUntil {supportClicked || !(visiblemap)};
29 | _pos = supportMapClick;
30 | if (!visiblemap) exitWith {
31 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
32 | [_caller, format["%1, this is %2, scratch that last request, out.", groupID (group _mortar), groupID (group _caller)]] call EVO_fnc_globalSideChat;
33 | _mortar setVariable ["EVO_support_busy", false, true];
34 | sleep 3.5;
35 | [_mortar, format["Copy that %2, out.", groupID (group _mortar), groupID (group _caller)]] call EVO_fnc_globalSideChat;
36 | sleep 3.5;
37 | _newMortarStrike = [_caller, "mortarStrike"] call BIS_fnc_addCommMenuItem;
38 | [player, 5] call bis_fnc_addScore;
39 | ["PointAdded",["Mortar support canceled.", 5]] call BIS_fnc_showNotification;
40 | };
41 | openMap false;
42 | [_caller, format["Grid %1, over.", mapGridPosition _pos]] call EVO_fnc_globalSideChat;
43 | sleep 3;
44 |
45 | _isInRange = _pos inRangeOfArtillery [[_mortar], currentMagazine _mortar];
46 | if (_isInRange) then {
47 | _mortar setVariable ["EVO_playerRequester", player, true];
48 | [_mortar, format["Grid %1, out.", mapGridPosition _pos]] call EVO_fnc_globalSideChat;
49 | sleep 3;
50 | [_caller, "Fire for effect, over."] call EVO_fnc_globalSideChat;
51 | sleep 3;
52 | [_mortar, "Fire for effect, out."] call EVO_fnc_globalSideChat;
53 | sleep 1.5;
54 | [_mortar, "Firing for effect, five rounds, out."] call EVO_fnc_globalSideChat;
55 | sleep 3.5;
56 | [_mortar, "Shot, over."] call EVO_fnc_globalSideChat;
57 | //fire!
58 | _eta = 0;
59 | [[_mortar, _pos, 6],"EVO_fnc_doArtyFire", (owner _mortar), false, false] spawn BIS_fnc_MP;
60 | _eta = floor(_mortar getArtilleryETA [_pos, currentMagazine _mortar]);
61 | [_caller, "Shot, out."] call EVO_fnc_globalSideChat;
62 | sleep 3.5;
63 | _mortar setVariable ["EVO_support_busy", false, true];
64 | [_mortar, format["Splash in %1 seconds, over.", _eta]] call EVO_fnc_globalSideChat;
65 | sleep (_eta + 10);
66 | [_caller, "Splash, over."] call EVO_fnc_globalSideChat;
67 | sleep 3.5;
68 | [_mortar, "Splash, out."] call EVO_fnc_globalSideChat;
69 | } else {
70 | [_mortar, format["%2 this is %1, specified map grid is out of range, out.", groupID (group _mortar), groupID (group _caller)]] call EVO_fnc_globalSideChat;
71 | _newMortarStrike = [_caller, "mortarStrike"] call BIS_fnc_addCommMenuItem;
72 | _mortar setVariable ["EVO_support_busy", false, true];
73 | [player, 5] call bis_fnc_addScore;
74 | };
75 |
76 | } else {
77 | [_caller, format["%1, this is %2, adjust fire, over.", groupID (group _mortar), groupID (group _caller)]] call KOL_fnc_globalSideChat;
78 | sleep 3.5;
79 | [_mortar, format["%2 this is %1, we are already servicing a request, out.", groupID (group _arty), groupID (group _caller)]] call EVO_fnc_globalSideChat;
80 | _newMortarStrike = [_caller, "mortarStrike"] call BIS_fnc_addCommMenuItem;
81 | [player, 5] call bis_fnc_addScore;
82 | ["PointAdded",["Mortar support canceled.", 5]] call BIS_fnc_showNotification;
83 |
84 | };
85 | supportMapClick = [0,0,0];
86 | supportClicked = false;
87 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
--------------------------------------------------------------------------------
/EVO/fn_support_resupply.sqf:
--------------------------------------------------------------------------------
1 | private ["_caller","_pos","_is3D","_ID","_grpSide","_grp","_score","_spawnPos","_pos2","_vehicle","_retArray2","_heli","_heliCrew","_heliGrp","_heliDriver","_newResupply","_chute"];
2 |
3 | _caller = _this select 0;
4 | _caller playMoveNow "Acts_listeningToRadio_Loop";
5 | _pos = _this select 1;
6 | _target = _this select 2;
7 | _is3D = _this select 3;
8 | _ID = _this select 4;
9 | _grpSide = side _caller;
10 | _grp = group _caller;
11 | [_caller, -5] call bis_fnc_addScore;
12 | ["PointsRemoved",["Resupply request initiated.", 5]] call BIS_fnc_showNotification;
13 |
14 | _spawnPos = [getPos spawnBuilding, 150, 500, 10, 0, 2, 0] call BIS_fnc_findSafePos;
15 | _vehicle = createVehicle ["CargoNet_01_box_F", _spawnPos, [], 0, "NONE"];
16 | _spawnPos = [getPos spawnBuilding, 150, 500, 10, 0, 2, 0] call BIS_fnc_findSafePos;
17 | _retArray2 = [_spawnPos, 180, "B_Heli_Transport_03_F", WEST] call EVO_fnc_spawnvehicle;
18 | _heli = _retArray2 select 0;
19 | _heliCrew = _retArray2 select 1;
20 | _heliGrp = _retArray2 select 2;
21 | _heliDriver = driver _heli;
22 |
23 | [_caller, format["%2, this is %1, requesting a supply drop, over.", groupID (group _caller), groupID _heliGrp]] call EVO_fnc_globalSideChat;
24 | sleep 3;
25 | [(leader _heliGrp), format["%1, this is %2, copy your last. Send target grid, over.", groupID (group _caller), groupID _heliGrp]] call EVO_fnc_globalSideChat;
26 | sleep 3;
27 | openMap true;
28 | sleep 3;
29 | ["supportMapClickEH", "onMapSingleClick", {
30 | supportMapClick = _pos;
31 | supportClicked = true;
32 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
33 | }] call BIS_fnc_addStackedEventHandler;
34 | ["deployed",["DESIGNATE TARGET", "Left click on your target."]] call BIS_fnc_showNotification;
35 | waitUntil {supportClicked || !(visiblemap)};
36 | _pos = supportMapClick;
37 | if (!visiblemap) exitWith {
38 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
39 | [_caller, format["%1, this is %2, scratch that last request, out.", groupID (group _heliGrp), groupID (group _caller)]] call EVO_fnc_globalSideChat;
40 | sleep 3.5;
41 | [_heliGrp, format["Copy that %2, out.", groupID (group _heliGrp), groupID (group _caller)]] call EVO_fnc_globalSideChat;
42 | sleep 3.5;
43 | _newResupply = [_caller, "resupply"] call BIS_fnc_addCommMenuItem;
44 | [player, 5] call bis_fnc_addScore;
45 | ["PointsAdded",["Ammo drop canceled.", 5]] call BIS_fnc_showNotification;
46 | };
47 | openMap false;
48 | [_caller, format["Grid %1, over.", mapGridPosition _pos]] call EVO_fnc_globalSideChat;
49 | sleep 3;
50 | [(leader _heliGrp), format["Copy that %1, dispatching to requested coordinates, out.", groupID (group _caller), groupID _heliGrp]] call EVO_fnc_globalSideChat;
51 | sleep 3;
52 |
53 | _heli setSlingLoad _vehicle;
54 |
55 | _heliDriver disableAI "FSM";
56 | _heliDriver disableAI "TARGET";
57 | _heliDriver disableAI "AUTOTARGET";
58 | _heliGrp setBehaviour "AWARE";
59 | _heliGrp setCombatMode "RED";
60 | _heliGrp setSpeedMode "NORMAL";
61 | _heliDriver doMove _pos;
62 | _heli flyInHeight 50;
63 | _heli lock 3;
64 | _heli allowDamage false;
65 | _vehicle allowDamage false;
66 | supportMapClick = [0,0,0];
67 | supportClicked = false;
68 | ["supportMapClickEH", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
69 | waitUntil {([_heli, _pos] call BIS_fnc_distance2D < 10)};
70 | {
71 | ropeCut [ _x, 5];
72 | } forEach ropes _heli;
73 | _chute = createVehicle ["B_Parachute_02_F", [100, 100, 200], [], 0, 'FLY'];
74 | _chute setPos [position _heli select 0, position _heli select 1, (position _heli select 2) - 50];
75 | _vehicle attachTo [_chute, [0, 0, -1.3]];
76 | _heli allowDamage true;
77 | _vehicle allowDamage true;
78 | [(leader _grp), format["Be advised, supply drop complete, out."]] call EVO_fnc_globalSideChat;
79 | _heliDriver doMove _spawnPos;
80 |
81 | waitUntil {position _vehicle select 2 < 0.5 || isNull _chute};
82 | detach _vehicle;
83 | _vehicle setPos [position _vehicle select 0, position _vehicle select 1, 0];
84 | [[_vehicle, _caller getVariable ["EVO_rank", "PRIVATE"]],{
85 | if (!isDedicated) then {
86 | [(_this select 0), _this select 1] call EVO_fnc_buildAmmoCrate;
87 | };
88 | },"BIS_fnc_spawn",true,true] call BIS_fnc_MP;
89 | _heli flyInHeight 50;
90 | waitUntil {([_heli, _pos] call BIS_fnc_distance2D < 200)};
91 | {
92 | deleteVehicle _x;
93 | } forEach _heliCrew;
94 | deleteVehicle _heli;
95 | deleteGroup _heliGrp;
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------