mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 18:03:30 +00:00
Compare commits
36 Commits
main
...
wings_of_l
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6c5ad7c28 | ||
|
|
b2be0808f7 | ||
|
|
9181723f49 | ||
|
|
7629c87216 | ||
|
|
150941532d | ||
|
|
33d7821552 | ||
|
|
5862404049 | ||
|
|
e40dfe76dd | ||
|
|
6fe2a9d520 | ||
|
|
4b449ca5aa | ||
|
|
aa91d71971 | ||
|
|
e2cd512b9b | ||
|
|
1e99c8a579 | ||
|
|
febbf415c2 | ||
|
|
fc7ff214bf | ||
|
|
d136fa070a | ||
|
|
b88d94b8c6 | ||
|
|
e4deab1db0 | ||
|
|
1c76a8bd76 | ||
|
|
3f629afc49 | ||
|
|
64596a97d1 | ||
|
|
8007b6ada6 | ||
|
|
8c955c421e | ||
|
|
0ea9cab94d | ||
|
|
e84ad95b06 | ||
|
|
fff6716e24 | ||
|
|
9ff0cdce3b | ||
|
|
8024c6c4b2 | ||
|
|
7718c156ec | ||
|
|
26ede4fc48 | ||
|
|
e42216498c | ||
|
|
fa1dec8b52 | ||
|
|
65055c5922 | ||
|
|
34c77ae055 | ||
|
|
69917d1351 | ||
|
|
78fa2608c3 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -3,6 +3,7 @@
|
||||
*.paa filter=lfs diff=lfs merge=lfs -text
|
||||
*.p3d filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.dll filter=lfs diff=lfs merge=lfs -text
|
||||
*.apk filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
@@ -36,6 +36,7 @@ url = "https://github.com/valmojr/armatak"
|
||||
preset = "Hemtt"
|
||||
|
||||
[hemtt.launch.default]
|
||||
mission = "hearts_and_minds.kunduz_valley"
|
||||
workshop = [
|
||||
"450814997", # CBA_A3
|
||||
"463939057", # ACE
|
||||
@@ -43,13 +44,13 @@ workshop = [
|
||||
"2522638637", # ACE Extended Arsenal
|
||||
"333310405", # Enhanced Movement
|
||||
"2034363662", # Enhanced Movement Rework
|
||||
"2941986336", # Hatchet Interaction Framework - Stable Version
|
||||
"1745501605", # Hatchet H-60 pack - Stable Version
|
||||
"843577117", # RHSUSAF
|
||||
"843425103", # RHSAFRF
|
||||
"843632231", # RHSSAF
|
||||
"843593391", # RHSGREF
|
||||
"1673456286", # 3CB Factions
|
||||
"2585568796", # Taliban Forces 2021
|
||||
"3030830594", # Western Dusk
|
||||
"623475643", # 3den Enhanced
|
||||
"2257686620", # Blastcore Murr Edition
|
||||
"583496184", # CUP Terrains - Core
|
||||
@@ -58,8 +59,12 @@ workshop = [
|
||||
"1808238502", # LAMBS_Suppression
|
||||
"3425368881", # M4A1_URGI
|
||||
"2268351256", # Tier One Weapons
|
||||
"3073216844", # Tier One Weapons - All NVG Compatible
|
||||
"2560276469", # Restrict Markers
|
||||
"3493557838" # Ballad of the Green Berets
|
||||
"3015795970", # Weapon Sight No Zoom Overhaul
|
||||
"2397360831", # USAF Mod - Main
|
||||
"2397376046", # USAF Mod - Utility
|
||||
"1779063631" # Zeus Enhanced
|
||||
]
|
||||
|
||||
parameters = [
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
ARMATAK is a server side Arma 3 addons for streaming unit positions to TAK Clients in sessions on real locations maps. It can be runned both as a clientside mod or a serverside mod, when runned serverside, it will create a TCP Socket connection between Arma 3 and the TAK Server, sending the game session information into it. When used clientside, Arma 3 will host a websocket server that you can connect to your phone and mock the phone's location to the player's in game location.
|
||||
|
||||
## Operation Wings of Liberty
|
||||
|
||||
By default, this repo contains a forked Hearts and Minds mission (6-12 COOP) themed as Ranger Recon Detachment to showcase the mod, it was developed and heavily tested on a OG TAK Server running in CloudRF TAK Server container, other TAK Server may be functional, but not tested.
|
||||
|
||||
## Get in Touch
|
||||
|
||||
[Join the Discord Server for ARMATAK!](https://discord.gg/svK64PCycU)
|
||||
|
||||
@@ -25,7 +25,7 @@ player setVariable [QGVAR(eudConnected), true];
|
||||
if (player getVariable [QGVAR(eudConnected), false]) then {
|
||||
"armatak" callExtension ["udp_socket:send_gps_cot", [player call FUNC(extractClientPosition)]];
|
||||
};
|
||||
}, 0.5, []] call CBA_fnc_addPerFrameHandler;
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
deleteVehicle _logic;
|
||||
closeDialog 1;
|
||||
|
||||
@@ -29,7 +29,7 @@ if (isServer) exitWith {
|
||||
|
||||
_role = [_role] call BIS_fnc_filterString;
|
||||
_name = [_name] call BIS_fnc_filterString;
|
||||
|
||||
|
||||
_stream_path = _name + "_" + _role + "_" + _uuid_short;
|
||||
|
||||
armatak_mediamtx_video_stream_instance_address = GETMVAR(instance_address,false);
|
||||
@@ -64,6 +64,7 @@ if (isServer) exitWith {
|
||||
GETVAR((this select 0),GVAR(isStreaming),false)
|
||||
}
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
|
||||
[
|
||||
"Man",
|
||||
1,
|
||||
|
||||
14
hearts_and_minds.kunduz_valley/.editorconfig
Normal file
14
hearts_and_minds.kunduz_valley/.editorconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
738
hearts_and_minds.kunduz_valley/core/def/mission.sqf
Normal file
738
hearts_and_minds.kunduz_valley/core/def/mission.sqf
Normal file
@@ -0,0 +1,738 @@
|
||||
|
||||
btc_version = [
|
||||
1,
|
||||
25,
|
||||
1
|
||||
];
|
||||
diag_log format (["=BTC= HEARTS AND MINDS VERSION %1.%2.%3"] + btc_version);
|
||||
|
||||
//Param
|
||||
//<< Time options >>
|
||||
btc_p_time = "btc_p_time" call BIS_fnc_getParamValue;
|
||||
btc_p_acctime = "btc_p_acctime" call BIS_fnc_getParamValue;
|
||||
btc_db_load = ("btc_p_load" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_auto_db = "btc_p_auto_db" call BIS_fnc_getParamValue isEqualTo 1;
|
||||
btc_p_db_autoRestartTime = "btc_p_db_autoRestartTime" call BIS_fnc_getParamValue;
|
||||
btc_p_db_autoRestartHour = [
|
||||
"btc_p_db_autoRestartHour1" call BIS_fnc_getParamValue,
|
||||
"btc_p_db_autoRestartHour2" call BIS_fnc_getParamValue
|
||||
];
|
||||
btc_p_db_autoRestartType = "btc_p_db_autoRestartType" call BIS_fnc_getParamValue;
|
||||
btc_p_slot_isShare = "btc_p_slot_isShare" call BIS_fnc_getParamValue isEqualTo 1;
|
||||
btc_p_change_time = ("btc_p_change_time" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_change_weather = ("btc_p_change_weather" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
|
||||
//<< Respawn options >>
|
||||
btc_p_respawn_location = "btc_p_respawn_location" call BIS_fnc_getParamValue;
|
||||
btc_p_respawn_fromOutsideBase = "btc_p_respawn_fromOutsideBase" call BIS_fnc_getParamValue;
|
||||
btc_p_respawn_fromOutsideTimeout = "btc_p_respawn_fromOutsideTimeout" call BIS_fnc_getParamValue;
|
||||
btc_p_rallypointTimer = "btc_p_rallypointTimer" call BIS_fnc_getParamValue;
|
||||
btc_p_respawn_arsenal = ("btc_p_respawn_arsenal" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_respawn_ticketsAtStart = "btc_p_respawn_ticketsAtStart" call BIS_fnc_getParamValue;
|
||||
btc_p_respawn_ticketsLost = 1 - ("btc_p_respawn_ticketsLost" call BIS_fnc_getParamValue);
|
||||
btc_p_respawn_ticketsShare = ("btc_p_respawn_ticketsShare" call BIS_fnc_getParamValue) isEqualTo 0;
|
||||
btc_p_respawn_ticketsFromPrisoners = "btc_p_respawn_ticketsFromPrisoners" call BIS_fnc_getParamValue;
|
||||
btc_p_body_timeBeforeShowMarker = ("btc_p_body_timeBeforeShowMarker" call BIS_fnc_getParamValue) * 60;
|
||||
|
||||
//<< Faction options >>
|
||||
private _p_en = "btc_p_en" call BIS_fnc_getParamValue;
|
||||
private _p_en_AA = ("btc_p_AA" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
private _p_en_tank = ("btc_p_tank" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
private _p_civ = "btc_p_civ" call BIS_fnc_getParamValue;
|
||||
private _p_civ_veh = "btc_p_civ_veh" call BIS_fnc_getParamValue;
|
||||
|
||||
//<< IED options >>
|
||||
btc_p_ied = ("btc_p_ied" call BIS_fnc_getParamValue)/2;
|
||||
private _p_ied_spot = "btc_p_ied_spot" call BIS_fnc_getParamValue;
|
||||
btc_p_ied_placement = "btc_p_ied_placement" call BIS_fnc_getParamValue;
|
||||
btc_p_ied_drone = ("btc_p_ied_drone" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_ied_power = "btc_p_ied_power" call BIS_fnc_getParamValue;
|
||||
|
||||
//<< Hideout/Cache options >>
|
||||
btc_hideout_n = "btc_p_hideout_n" call BIS_fnc_getParamValue;
|
||||
btc_info_cache_def = "btc_p_cache_info_def" call BIS_fnc_getParamValue;
|
||||
btc_info_cache_ratio = "btc_p_cache_info_ratio" call BIS_fnc_getParamValue;
|
||||
btc_info_intel_chance = "btc_p_info_chance" call BIS_fnc_getParamValue;
|
||||
btc_p_info_houseDensity = "btc_p_info_houseDensity" call BIS_fnc_getParamValue;
|
||||
|
||||
//<< Skill options >>
|
||||
btc_p_set_skill = ("btc_p_set_skill" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_AI_skill = [
|
||||
("btc_p_set_skill_general" call BIS_fnc_getParamValue)/10,//general
|
||||
("btc_p_set_skill_aimingAccuracy" call BIS_fnc_getParamValue)/10,//aimingAccuracy
|
||||
("btc_p_set_skill_aimingShake" call BIS_fnc_getParamValue)/10,//aimingShake
|
||||
("btc_p_set_skill_aimingSpeed" call BIS_fnc_getParamValue)/10,//aimingSpeed
|
||||
("btc_p_set_skill_endurance" call BIS_fnc_getParamValue)/10,//endurance
|
||||
("btc_p_set_skill_spotDistance" call BIS_fnc_getParamValue)/10,//spotDistance
|
||||
("btc_p_set_skill_spotTime" call BIS_fnc_getParamValue)/10,//spotTime
|
||||
("btc_p_set_skill_courage" call BIS_fnc_getParamValue)/10,//courage
|
||||
("btc_p_set_skill_reloadSpeed" call BIS_fnc_getParamValue)/10,//reloadSpeed
|
||||
("btc_p_set_skill_commanding" call BIS_fnc_getParamValue)/10//commanding
|
||||
];
|
||||
|
||||
//<< Spawn options >>
|
||||
btc_p_density_of_occupiedCity = ("btc_p_density_of_occupiedCity" call BIS_fnc_getParamValue)/100;
|
||||
btc_p_mil_group_ratio = ("btc_p_mil_group_ratio" call BIS_fnc_getParamValue)/100;
|
||||
btc_p_mil_wp_houseDensity = ("btc_p_wp_houseDensity" call BIS_fnc_getParamValue)/100;
|
||||
btc_p_mil_static_group_ratio = ("btc_p_mil_static_group_ratio" call BIS_fnc_getParamValue)/100;
|
||||
btc_p_civ_group_ratio = ("btc_p_civ_group_ratio" call BIS_fnc_getParamValue)/100;
|
||||
btc_p_animals_group_ratio = ("btc_p_animals_group_ratio" call BIS_fnc_getParamValue)/100;
|
||||
btc_p_veh_armed_ho = ("btc_p_veh_armed_ho" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_veh_armed_spawn_more = ("btc_p_veh_armed_spawn_more" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_patrol_max = "btc_p_patrol_max" call BIS_fnc_getParamValue;
|
||||
btc_p_civ_max_veh = "btc_p_civ_max_veh" call BIS_fnc_getParamValue;
|
||||
|
||||
//<< Gameplay options >>
|
||||
btc_p_sea = ("btc_p_sea" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_chem_sides = ("btc_p_chem_sides" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_chem_cache_probability = ("btc_p_chem_cache_probability" call BIS_fnc_getParamValue)/100;
|
||||
btc_p_spect = ("btc_p_spect" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_side_mission_cycle = "btc_p_side_mission_cycle" call BIS_fnc_getParamValue;
|
||||
|
||||
//<< Arsenal options >>
|
||||
btc_p_arsenal_Type = "btc_p_arsenal_Type" call BIS_fnc_getParamValue;
|
||||
btc_p_arsenal_Restrict = "btc_p_arsenal_Restrict" call BIS_fnc_getParamValue;
|
||||
btc_p_garage = ("btc_p_garage" call BIS_fnc_getParamValue) isEqualTo 1;
|
||||
btc_p_autoloadout = "btc_p_autoloadout" call BIS_fnc_getParamValue;
|
||||
|
||||
//<< Other options >>
|
||||
btc_global_reputation = "btc_p_rep" call BIS_fnc_getParamValue;
|
||||
btc_p_rep_notify = "btc_p_rep_notify" call BIS_fnc_getParamValue;
|
||||
btc_city_radiusOffset = ("btc_p_city_radiusOffset" call BIS_fnc_getParamValue) * 100;
|
||||
btc_p_trigger = if (("btc_p_trigger" call BIS_fnc_getParamValue) isEqualTo 1) then {
|
||||
"this && (false in (thisList apply {_x isKindOf 'Plane'})) && (false in (thisList apply {(_x isKindOf 'Helicopter') && (speed _x > 190)}))"
|
||||
} else {
|
||||
"this"
|
||||
};
|
||||
private _p_city_free_trigger = "btc_p_city_free_trigger" call BIS_fnc_getParamValue;
|
||||
btc_p_flag = "btc_p_flag" call BIS_fnc_getParamValue;
|
||||
btc_p_debug = "btc_p_debug" call BIS_fnc_getParamValue;
|
||||
|
||||
switch (btc_p_debug) do {
|
||||
case 0 : {
|
||||
btc_debug_log = false;
|
||||
btc_debug = false;
|
||||
};
|
||||
case 1 : {
|
||||
btc_debug_log = true;
|
||||
btc_debug = true;
|
||||
btc_debug_graph = false;
|
||||
btc_debug_frames = 0;
|
||||
};
|
||||
case 2 : {
|
||||
btc_debug_log = true;
|
||||
btc_debug = false;
|
||||
};
|
||||
};
|
||||
|
||||
if (!isMultiplayer) then {
|
||||
btc_debug_log = true;
|
||||
btc_debug = true;
|
||||
btc_debug_graph = false;
|
||||
btc_debug_frames = 0;
|
||||
};
|
||||
|
||||
private _cfgVehicles = configFile >> "CfgVehicles";
|
||||
private _allClassVehicles = ("true" configClasses _cfgVehicles) apply {configName _x};
|
||||
private _allClassSorted = _allClassVehicles select {getNumber (_cfgVehicles >> _x >> "scope") isEqualTo 2};
|
||||
|
||||
if (isServer) then {
|
||||
btc_final_phase = false;
|
||||
btc_delay_time = 0;
|
||||
|
||||
//City
|
||||
btc_city_blacklist = [];//NAME FROM CFG
|
||||
btc_p_city_free_trigger_condition = if (_p_city_free_trigger isEqualTo 0) then {
|
||||
"thisList isEqualTo []"
|
||||
} else {
|
||||
format ["[thisList, %1] call btc_city_fnc_trigger_free_condition", _p_city_free_trigger]
|
||||
};
|
||||
|
||||
//Civ
|
||||
btc_civ_veh_active = [];
|
||||
|
||||
//Database
|
||||
btc_db_serverCommandPassword = "btc_password"; //Define the same password in server.cfg like this: serverCommandPassword = "btc_password";
|
||||
btc_db_warningTimeAutoRestart = 5;
|
||||
|
||||
//Hideout
|
||||
btc_hideout_cityID = []; // List of city ID visible in debug mode for custom hideout location
|
||||
btc_hideouts = []; publicVariable "btc_hideouts";
|
||||
btc_hideouts_radius = 800;
|
||||
if (btc_hideout_n isEqualTo 99) then {
|
||||
btc_hideout_n = round random 10;
|
||||
};
|
||||
btc_hideout_safezone = 4000;
|
||||
btc_hideout_range = 3500;
|
||||
btc_hideout_cap_time = 1800;
|
||||
btc_hideout_minRange = btc_hideout_range;
|
||||
|
||||
//IED
|
||||
btc_ied_suic_time = 900;
|
||||
btc_ied_suic_spawned = - btc_ied_suic_time;
|
||||
btc_ied_offset = [0, -0.03, -0.07] select _p_ied_spot;
|
||||
btc_ied_list = [];
|
||||
btc_ied_range = 10;
|
||||
btc_ied_power = ["Bo_GBU12_LGB_MI10", "R_MRAAWS_HE_F"] select btc_p_ied_power;
|
||||
|
||||
//FOB
|
||||
btc_fobs = [[], [], []];
|
||||
btc_fob_rallypointTimer = 60 * btc_p_rallypointTimer;
|
||||
btc_body_deadPlayers = [];
|
||||
|
||||
//Patrol
|
||||
btc_patrol_active = [];
|
||||
btc_patrol_area = 2500;
|
||||
|
||||
//Rep
|
||||
btc_rep_militia_call_time = 600;
|
||||
btc_rep_militia_called = - btc_rep_militia_call_time;
|
||||
btc_rep_delayed = [0, []];
|
||||
|
||||
//Chem
|
||||
btc_chem_decontaminate = [];
|
||||
btc_chem_contaminated = []; publicVariable "btc_chem_contaminated"; //Preserve reference
|
||||
|
||||
//Spect
|
||||
btc_spect_emp = []; publicVariable "btc_spect_emp"; //Preserve reference
|
||||
|
||||
//Cache
|
||||
btc_cache_type = [
|
||||
_allClassSorted select {
|
||||
_x isKindOf "ReammoBox_F" &&
|
||||
{getText(_cfgVehicles >> _x >> "model") isEqualTo "\A3\weapons_F\AmmoBoxes\AmmoBox_F"}
|
||||
},
|
||||
["Land_PlasticCase_01_small_black_CBRN_F", "Land_PlasticCase_01_small_olive_CBRN_F", "Land_PlasticCase_01_small_CBRN_F"]
|
||||
];
|
||||
private _weapons_usefull = "true" configClasses (configFile >> "CfgWeapons") select {
|
||||
getNumber (_x >> 'type') isEqualTo 1 &&
|
||||
{getArray (_x >> 'magazines') isNotEqualTo []} &&
|
||||
{getNumber (_x >> 'scope') isEqualTo 2}
|
||||
};
|
||||
btc_cache_weapons_type = _weapons_usefull apply {(toLower getText (_x >> "model")) select [1]};
|
||||
|
||||
//Hideout classname
|
||||
btc_type_campfire = ["MetalBarrel_burning_F"] + (_allClassSorted select {_x isKindOf "Land_Campfire_F"});
|
||||
btc_type_Scrapyard = _allClassSorted select {
|
||||
_x isKindOf "Scrapyard_base_F" &&
|
||||
{!("scrap" in toLower _x)}
|
||||
};
|
||||
btc_type_bigbox = ["Box_FIA_Ammo_F", "Box_East_AmmoVeh_F", "CargoNet_01_box_F", "O_CargoNet_01_ammo_F"] + btc_type_Scrapyard;
|
||||
btc_type_seat = ["Land_WoodenLog_F", "Land_CampingChair_V2_F", "Land_CampingChair_V1_folded_F", "Land_CampingChair_V1_F"];
|
||||
btc_type_sleepingbag = _allClassSorted select {_x isKindOf "Land_Sleeping_bag_F"};
|
||||
btc_type_sleepingbag_folded = _allClassSorted select {_x isKindOf "Land_Sleeping_bag_folded_F"};
|
||||
btc_type_tent = ["Land_TentA_F", "Land_TentDome_F"] + (_allClassSorted select {
|
||||
_x isKindOf "Land_TentSolar_01_base_F" &&
|
||||
{!(_x isKindOf "Land_TentSolar_01_folded_base_F")}
|
||||
});
|
||||
btc_type_camonet = ["Land_IRMaskingCover_02_F"] + (_allClassSorted select {_x isKindOf "Shelter_base_F"});
|
||||
btc_type_satelliteAntenna = _allClassSorted select {_x isKindOf "Land_SatelliteAntenna_01_F"};
|
||||
|
||||
//Side
|
||||
btc_side_ID = 0;
|
||||
btc_side_list = ["supply", "mines", "vehicle", "get_city", "tower", "civtreatment", "checkpoint", "convoy", "rescue", "capture_officer", "hostage", "hack", "kill", "EMP", "removeRubbish", "massacre"]; // On ground (Side "convoy" and "capture_officer" are not design for map with different islands. Start and end city can be on different islands.)
|
||||
if (btc_p_sea) then {btc_side_list append ["civtreatment_boat", "underwater_generator"]}; // On sea
|
||||
if (btc_p_chem_sides) then {btc_side_list append ["chemicalLeak", "pandemic"]};
|
||||
btc_side_list_use = [];
|
||||
btc_type_tower = ["Land_Communication_F", "Land_TTowerBig_1_F", "Land_TTowerBig_2_F"];
|
||||
btc_type_barrel = ["Land_GarbageBarrel_01_F", "Land_BarrelSand_grey_F", "MetalBarrel_burning_F", "Land_BarrelWater_F", "Land_MetalBarrel_F", "Land_MetalBarrel_empty_F"];
|
||||
btc_type_canister = ["Land_CanisterPlastic_F"];
|
||||
btc_type_pallet = ["Land_Pallets_stack_F", "Land_Pallets_F", "Land_Pallet_F"];
|
||||
btc_type_box = ["Box_East_Wps_F", "Box_East_WpsSpecial_F", "Box_East_Ammo_F"] + (btc_cache_type select 0);
|
||||
btc_type_generator = _allClassSorted select {_x isKindOf "Land_Device_assembled_F"};
|
||||
btc_type_storagebladder = _allClassSorted select {_x isKindOf "StorageBladder_base_F"};
|
||||
btc_type_mines = ["APERSMine", "APERSBoundingMine", "APERSTripMine"];
|
||||
btc_type_power = ["Land_PowerGenerator_F", "Land_PortableGenerator_01_F"] + (_allClassSorted select {_x isKindOf "Machine_base_F"});
|
||||
btc_type_cord = ["Land_ExtensionCord_F"];
|
||||
btc_type_cones = ["Land_RoadCone_01_F", "RoadCone_F", "RoadCone_L_F"];
|
||||
btc_type_fences = ["Land_PlasticNetFence_01_long_F", "Land_PlasticNetFence_01_long_d_F", "RoadBarrier_F", "TapeSign_F"];
|
||||
btc_type_barrier = ["Land_CncBarrier_stripes_F", "Land_CncBarrier_F"];
|
||||
btc_type_portable_light = _allClassSorted select {_x isKindOf "Land_PortableLight_single_F"};
|
||||
btc_type_portableLamp = _allClassSorted select {
|
||||
_x isKindOf "Land_PortableLight_02_base_F" ||
|
||||
{_x isKindOf "TentLamp_01_standing_base_F"}
|
||||
};
|
||||
btc_type_tentLamp = _allClassSorted select {_x isKindOf "TentLamp_01_base_F"};
|
||||
btc_type_first_aid_kits = ["Land_FirstAidKit_01_open_F", "Land_FirstAidKit_01_closed_F"];
|
||||
btc_type_body_bags = _allClassSorted select {
|
||||
_x isKindOf "Land_Bodybag_01_base_F" ||
|
||||
{_x isKindOf "Land_Bodybag_01_empty_base_F"} ||
|
||||
{_x isKindOf "Land_Bodybag_01_folded_base_F"}
|
||||
};
|
||||
btc_type_signs = _allClassSorted select {_x isKindOf "Land_Sign_Mines_F"};
|
||||
btc_type_bloods = _allClassSorted select {_x isKindOf "Blood_01_Base_F"};
|
||||
btc_type_medicals = _allClassSorted select {_x isKindOf "MedicalGarbage_01_Base_F"};
|
||||
btc_type_table = _allClassSorted select {_x isKindOf "Land_CampingTable_F"};
|
||||
btc_type_garbage = ["Land_Garbage_line_F","Land_Garbage_square3_F","Land_Garbage_square5_F"];
|
||||
btc_type_foodSack = _allClassSorted select {_x isKindOf "Land_FoodSack_01_empty_base_F"};
|
||||
btc_type_PaperBox = _allClassSorted select {
|
||||
_x isKindOf "Land_PaperBox_01_small_ransacked_base_F" ||
|
||||
{_x isKindOf "Land_PaperBox_01_small_open_base_F"} ||
|
||||
{_x isKindOf "Land_PaperBox_01_small_destroyed_base_F"}
|
||||
};
|
||||
btc_type_EmergencyBlanket = _allClassSorted select {_x isKindOf "Land_EmergencyBlanket_01_base_F"};
|
||||
btc_type_Sponsor = _allClassSorted select {
|
||||
_x isKindOf "SignAd_Sponsor_F" &&
|
||||
{"idap" in toLower _x}
|
||||
};
|
||||
btc_type_PlasticCase = _allClassSorted select {_x isKindOf "PlasticCase_01_base_F"};
|
||||
btc_type_MedicalTent = _allClassSorted select {_x isKindOf "Land_MedicalTent_01_base_F"};
|
||||
btc_type_cargo_ruins = _allClassSorted select {
|
||||
_x isKindOf "Ruins_F" &&
|
||||
{
|
||||
"cargo40" in toLower _x ||
|
||||
"cargo20" in toLower _x
|
||||
}
|
||||
};
|
||||
btc_type_spill = ["Oil_Spill_F", "Land_DirtPatch_01_6x8_F"] + (_allClassSorted select {
|
||||
_x isKindOf "Land_DirtPatch_02_base_F" ||
|
||||
{_x isKindOf "WaterSpill_01_Base_F"}
|
||||
});
|
||||
btc_type_tarp = _allClassSorted select {_x isKindOf "Tarp_01_base_F"};
|
||||
btc_type_SCBA = _allClassSorted select {_x isKindOf "SCBACylinder_01_base_F"};
|
||||
btc_type_brush = _allClassSorted select {_x isKindOf "Brush_01_base_F"};
|
||||
btc_type_broom = _allClassSorted select {_x isKindOf "Broom_01_base_F"};
|
||||
btc_type_sponge = _allClassSorted select {_x isKindOf "Sponge_01_base_F"};
|
||||
btc_type_connectorTentClosed = _allClassSorted select {_x isKindOf "Land_ConnectorTent_01_closed_base_F"};
|
||||
btc_type_crossTent = _allClassSorted select {_x isKindOf "Land_ConnectorTent_01_cross_base_F"};
|
||||
btc_type_connectorTent = (_allClassSorted select {_x isKindOf "Land_ConnectorTent_01_base_F"}) - btc_type_connectorTentClosed - btc_type_crossTent;
|
||||
btc_type_cargoEMP = _allClassSorted select {_x isKindOf "Cargo_EMP_base_F"};
|
||||
btc_type_antenna = _allClassSorted select {_x isKindOf "OmniDirectionalAntenna_01_base_F"};
|
||||
btc_type_solarPanel = _allClassSorted select {_x isKindOf "Land_SolarPanel_04_base_F"};
|
||||
btc_type_sports = (_allClassSorted select {_x isKindOf "SportItems_base_F"}) select {"ball" in _x};
|
||||
btc_type_bottles = (_allClassSorted select {_x isKindOf "Items_base_F"}) select {"Bottle" in _x and (not ("stack" in _x))};
|
||||
|
||||
// The two arrays below are prefixes of buildings and their multiplier.
|
||||
// They will multiply the values of btc_rep_malus_building_destroyed and btc_rep_malus_building_damaged,
|
||||
// if a building is not present here it will be multiplied by 1.0.
|
||||
// Use 0.0 to disable reputation hit on a specific's building destruction.
|
||||
// You can modify this for any other terrain, clearing the table will also make all buildings just have a 1.0 multiplier.
|
||||
// If there's a hit in btc_buildings_multiplier, btc_buildings_categories_multipliers will NOT be run
|
||||
btc_buildings_multipliers = [
|
||||
// Specific buildings that need to have a custom modifier.
|
||||
["Land_BellTower", 0.2 ], ["Land_WIP", 1.5], ["Land_u_Addon_01", 0.2],
|
||||
["Land_Airport_Tower", 10.0], ["Land_Mil_ControlTower", 10.0],
|
||||
["Land_TentHangar", 7.0], ["Land_i_Shed_Ind", 1.5], ["Land_u_Shed_Ind", 1.5],
|
||||
["Land_TTowerBig", 6.0], ["Land_TTowerSmall", 4.5], ["Land_cmp_Tower", 4.0]
|
||||
];
|
||||
|
||||
// The multipliers are applied on top of each other, so "Chapel" and "Small" will both multiply the malus value
|
||||
btc_buildings_categories_multipliers = [
|
||||
["Shed", 0.75], ["Slum", 0.8], ["Small", 0.8], ["Big", 1.5], ["Villa", 2.0], ["Main", 3.0], ["Tower", 2.0],
|
||||
["HouseBlock", 2.0], ["Panelak", 2.0], ["Tenement", 7.0],
|
||||
["Barn", 1.5], ["School", 3.0], ["Office", 2.0], ["Shop", 1.5], ["Store", 1.5], ["Hospital", 12.0],
|
||||
["Castle", 2.5], ["Chapel", 3.0], ["Minaret", 3.0], ["Mosque", 4.0], ["Church", 4.0], ["Kostel", 4.0],
|
||||
["Lighthouse", 4.0],
|
||||
["Airport", 4.0], ["Hangar", 1.75], ["ControlTower", 2.25], ["Terminal", 3.0],
|
||||
["Hopper", 2.0], ["Tank", 4.0], ["Factory", 2.0], ["Transformer", 1.1],
|
||||
["FuelStation", 5.0],
|
||||
["Barracks", 1.75],
|
||||
["spp", 3.0], ["Powerstation", 3.0],
|
||||
["Pump", 2.5]
|
||||
];
|
||||
btc_buildings_changed = [];
|
||||
|
||||
//TAGS
|
||||
btc_type_tags = ["Land_Graffiti_01_F", "Land_Graffiti_02_F", "Land_Graffiti_03_F", "Land_Graffiti_04_F", "Land_Graffiti_05_F"];
|
||||
btc_type_tags_sentences = [
|
||||
"STR_BTC_HAM_TAG_GO",
|
||||
"STR_BTC_HAM_TAG_LN",
|
||||
"STR_BTC_HAM_TAG_WWKY",
|
||||
"STR_BTC_HAM_TAG_BA",
|
||||
"STR_BTC_HAM_TAG_GH",
|
||||
"STR_BTC_HAM_TAG_IE",
|
||||
"STR_BTC_HAM_TAG_DWY",
|
||||
"STR_BTC_HAM_TAG_WHY",
|
||||
"STR_BTC_HAM_TAG_YGD"
|
||||
];
|
||||
btc_tags_player = [];
|
||||
btc_tags_server = [];
|
||||
|
||||
//Flowers
|
||||
btc_type_flowers = _allClassSorted select {_x isKindOf "FlowerBouquet_base_F"};
|
||||
|
||||
//IED
|
||||
private _ieds = ["Land_GarbageContainer_closed_F", "Land_GarbageContainer_open_F", "Land_Portable_generator_F", "Land_WoodenBox_F", "Land_BarrelTrash_grey_F", "Land_Sacks_heap_F", "Land_Wreck_Skodovka_F", "Land_WheelieBin_01_F", "Land_GarbageBin_03_F"] + btc_type_pallet + btc_type_barrel + (_allClassSorted select {
|
||||
_x isKindOf "GasTank_base_F" ||
|
||||
{_x isKindOf "Garbage_base_F"} ||
|
||||
{_x isKindOf "Stall_base_F"} ||
|
||||
{_x isKindOf "Market_base_F"} ||
|
||||
(_x isKindOf "Constructions_base_F" &&
|
||||
{
|
||||
"bricks" in toLower _x
|
||||
}) ||
|
||||
(_x isKindOf "Wreck_base_F" &&
|
||||
{
|
||||
"car" in toLower _x ||
|
||||
"offroad" in toLower _x
|
||||
})
|
||||
});
|
||||
btc_type_ieds = _ieds - ["Land_Garbage_line_F","Land_Garbage_square3_F","Land_Garbage_square5_F", "Land_MarketShelter_F", "Land_ClothShelter_01_F", "Land_ClothShelter_02_F"];
|
||||
btc_model_ieds = btc_type_ieds apply {(toLower getText(_cfgVehicles >> _x >> "model")) select [1]};
|
||||
btc_type_blacklist = btc_type_tags + btc_type_flowers + ["UserTexture1m_F"]; publicVariable "btc_type_blacklist";
|
||||
|
||||
btc_groundWeaponHolder = [];
|
||||
|
||||
//Respawn
|
||||
btc_respawn_tickets = createHashMap;
|
||||
|
||||
btc_slots_serialized = createHashMap;
|
||||
|
||||
//Delay
|
||||
btc_delay_agent = 0.1;
|
||||
btc_delay_unit = 0.2;
|
||||
btc_delay_vehicle = 0.3;
|
||||
btc_delay_exec = 0.1;
|
||||
|
||||
//Explosives
|
||||
btc_explosives = [];
|
||||
btc_explosives_objectSide = createVehicle ["CBA_NamespaceDummy", [-1000, -1000, 0], [], 0, "NONE"];
|
||||
};
|
||||
|
||||
//Civ
|
||||
// Get all faction from mod there are currently running
|
||||
//copyToClipboard str (["CIV"] call btc_fnc_get_class);
|
||||
private _allfaction = ["CIV_F","DEFAULT","CIV_IDAP_F","UK3CB_ADC_C","UK3CB_CHC_C","UK3CB_MEC_C","UK3CB_TKC_C"]; //All factions
|
||||
_p_civ = _allfaction select _p_civ; //Select faction selected from mission parameter
|
||||
_p_civ_veh = _allfaction select _p_civ_veh; //Select faction selected from mission parameter
|
||||
private _allclasse = [[_p_civ]] call btc_civ_fnc_class; //Create classes from factions, you can combine factions from the SAME side : [[_p_civ, "btc_ac","LOP_TAK_CIV"]] call btc_civ_fnc_class.
|
||||
|
||||
//Save class name to global variable
|
||||
btc_civ_type_units = _allclasse select 0;
|
||||
_allclasse = [[_p_civ_veh]] call btc_civ_fnc_class;
|
||||
btc_civ_type_veh = _allclasse select 2;
|
||||
btc_civ_type_boats = _allclasse select 1;
|
||||
|
||||
btc_w_civs = [
|
||||
["srifle_DMR_06_hunter_F", "sgun_HunterShotgun_01_F", "srifle_DMR_06_hunter_khs_F", "sgun_HunterShotgun_01_Sawedoff_F", "Hgun_PDW2000_F", "arifle_AKM_F", "arifle_AKS_F"],
|
||||
["hgun_Pistol_heavy_02_F", "hgun_Rook40_F", "hgun_Pistol_01_F"]
|
||||
];
|
||||
btc_g_civs = ["HandGrenade", "MiniGrenade", "ACE_M84", "ACE_M84"];
|
||||
|
||||
// ANIMALS
|
||||
btc_animals_type = ["Hen_random_F", "Cock_random_F", "Fin_random_F", "Alsatian_Random_F", "Goat_random_F", "Sheep_random_F"];
|
||||
|
||||
//FOB
|
||||
btc_fob_mat = "Land_Cargo20_blue_F";
|
||||
btc_fob_structure = "Land_Cargo_HQ_V1_F";
|
||||
btc_fob_flag = "Flag_NATO_F";
|
||||
btc_fob_id = 0;
|
||||
btc_fob_minDistance = 1500;
|
||||
btc_fob_timeout = 1 * 60;
|
||||
|
||||
//IED
|
||||
btc_type_ieds_ace = ["IEDLandBig_F", "IEDLandSmall_F"];
|
||||
btc_ied_deleteOn = -1;
|
||||
|
||||
//Int
|
||||
btc_int_ordersRadius = 25;
|
||||
btc_int_search_intel_time = 4;
|
||||
btc_int_sirenRadius = 35;
|
||||
btc_int_beaconRadius = 15;
|
||||
btc_int_hornRadius = 20;
|
||||
btc_int_hornDelay = time;
|
||||
|
||||
//Info
|
||||
btc_info_intel_type = [80, 95];//cache - hd - both
|
||||
btc_info_hideout_radius = 4000;
|
||||
btc_info_intels = ["Land_Camera_01_F", "Land_HandyCam_F", "Land_File1_F", "Land_FilePhotos_F", "Land_File2_F", "Land_File_research_F", "Land_MobilePhone_old_F", "Land_PortableLongRangeRadio_F", "Land_Laptop_02_unfolded_F"];
|
||||
private _mapsIntel = switch (worldName) do {
|
||||
case "Altis": {["Land_Map_altis_F", "Land_Map_unfolded_Altis_F"]};
|
||||
case "Stratis": {["Land_Map_stratis_F", "Land_Map_unfolded_F"]};
|
||||
case "Tanoa": {["Land_Map_Tanoa_F", "Land_Map_unfolded_Tanoa_F"]};
|
||||
case "Malden": {["Land_Map_Malden_F", "Land_Map_unfolded_Malden_F"]};
|
||||
case "Enoch": {["Land_Map_Enoch_F", "Land_Map_unfolded_Enoch_F"]};
|
||||
default {["Land_Map_blank_F"]};
|
||||
};
|
||||
btc_info_intels append _mapsIntel;
|
||||
|
||||
//Supplies
|
||||
btc_supplies_cargo = "Land_Cargo20_IDAP_F";
|
||||
btc_supplies_mat = [
|
||||
_allClassSorted select {_x isKindOf "Land_FoodSack_01_cargo_base_F"},
|
||||
_allClassSorted select {_x isKindOf "Land_WaterBottle_01_stack_F"}
|
||||
];
|
||||
|
||||
//Hazmat
|
||||
btc_type_hazmat = ["HazmatBag_01_F", "Land_MetalBarrel_F"] + (_allClassSorted select {
|
||||
_x isKindOf "Land_GarbageBarrel_02_base_F" ||
|
||||
{_x isKindOf "Land_FoodContainer_01_F"} ||
|
||||
{_x isKindOf "Land_CanisterFuel_F"} ||
|
||||
{_x isKindOf "CBRNContainer_01_base_F"} ||
|
||||
{_x isKindOf "PlasticCase_01_base_F"}
|
||||
});
|
||||
|
||||
//Containers
|
||||
btc_containers_mat = ["Land_Cargo20_military_green_F", "Land_Cargo40_military_green_F"];
|
||||
|
||||
//Player
|
||||
btc_player_side = west;
|
||||
btc_respawn_marker = "respawn_west";
|
||||
btc_player_type = ["SoldierWB", "SoldierEB", "SoldierGB"] select ([west, east, independent] find btc_player_side);
|
||||
|
||||
//Log
|
||||
btc_construction_array =
|
||||
[
|
||||
[
|
||||
"Fortifications",
|
||||
"Static",
|
||||
"Ammobox",
|
||||
"Containers",
|
||||
"Supplies",
|
||||
"FOB",
|
||||
"Decontamination",
|
||||
"Vehicle Logistic"
|
||||
],
|
||||
[
|
||||
[
|
||||
//"Fortifications"
|
||||
"Land_BagBunker_Small_F",
|
||||
"Land_BagFence_Corner_F",
|
||||
"Land_BagFence_End_F",
|
||||
"Land_BagFence_Long_F",
|
||||
"Land_BagFence_Round_F",
|
||||
"Land_BagFence_Short_F",
|
||||
"Land_HBarrier_1_F",
|
||||
"Land_HBarrier_3_F",
|
||||
"Land_HBarrier_5_F",
|
||||
"Land_HBarrierBig_F",
|
||||
"Land_Razorwire_F",
|
||||
"Land_CncBarrier_F",
|
||||
"Land_CncBarrierMedium_F",
|
||||
"Land_CncBarrierMedium4_F",
|
||||
"Land_CncWall1_F",
|
||||
"Land_CncWall4_F",
|
||||
"Land_Mil_ConcreteWall_F",
|
||||
"Land_Mil_WallBig_4m_F",
|
||||
"Land_Mil_WallBig_Corner_F",
|
||||
"Land_PortableLight_double_F",
|
||||
"Land_Pod_Heli_Transport_04_medevac_black_F"
|
||||
],
|
||||
[
|
||||
//"Static"
|
||||
] + (_allClassSorted select {(
|
||||
_x isKindOf "GMG_TriPod" ||
|
||||
{_x isKindOf "StaticMortar"} ||
|
||||
{_x isKindOf "HMG_01_base_F"} ||
|
||||
{_x isKindOf "AA_01_base_F"} ||
|
||||
{_x isKindOf "AT_01_base_F"}) && {
|
||||
getNumber (_cfgVehicles >> _x >> "side") isEqualTo ([east, west, independent, civilian] find btc_player_side)
|
||||
}
|
||||
}),
|
||||
[
|
||||
//"Ammobox"
|
||||
"Land_WoodenBox_F"
|
||||
|
||||
] + (_allClassSorted select {
|
||||
_x isKindOf "ReammoBox_F" &&
|
||||
{!(_x isKindOf "Slingload_01_Base_F")} &&
|
||||
{!(_x isKindOf "Pod_Heli_Transport_04_base_F")}
|
||||
}),
|
||||
[
|
||||
//"Containers"
|
||||
|
||||
] + btc_containers_mat,
|
||||
[
|
||||
//"Supplies"
|
||||
btc_supplies_cargo
|
||||
],
|
||||
[
|
||||
//"FOB"
|
||||
btc_fob_mat
|
||||
],
|
||||
[
|
||||
//"Decontamination"
|
||||
"DeconShower_01_F"
|
||||
],
|
||||
[
|
||||
//"Vehicle logistic"
|
||||
"ACE_Wheel",
|
||||
"ACE_Track",
|
||||
"B_Slingload_01_Ammo_F",
|
||||
"B_Slingload_01_Fuel_F"
|
||||
] + (_allClassSorted select {_x isKindOf "FlexibleTank_base_F"})
|
||||
]
|
||||
];
|
||||
|
||||
(btc_construction_array select 1) params [
|
||||
"_cFortifications", "_cStatics", "_cAmmobox",
|
||||
"_cContainers", "_cSupplies", "_cFOB",
|
||||
"_cDecontamination", "_cVehicle_logistic"
|
||||
];
|
||||
btc_log_def_loadable = flatten (btc_construction_array select 1) + flatten btc_supplies_mat + btc_type_hazmat;
|
||||
btc_log_def_can_load = _cContainers;
|
||||
btc_log_def_placeable = (_cFortifications + _cContainers + _cSupplies + _cFOB + _cDecontamination + _cVehicle_logistic + flatten btc_supplies_mat + btc_type_hazmat) select {
|
||||
getNumber(_cfgVehicles >> _x >> "ace_dragging_canCarry") isEqualTo 0
|
||||
};
|
||||
btc_tow_vehicleTowing = objNull;
|
||||
btc_log_placing_max_h = 12;
|
||||
btc_log_placing = false;
|
||||
btc_log_obj_created = [];
|
||||
|
||||
btc_log_fnc_get_nottowable = {
|
||||
params ["_tower"];
|
||||
|
||||
switch (true) do {
|
||||
case (_tower isKindOf "Tank") : {
|
||||
["Plane", "Helicopter"]; //The tower is a tank so it can't tow: plane and helicopter
|
||||
};
|
||||
case (_tower isKindOf "Truck_F") : {
|
||||
["Plane", "Helicopter"];
|
||||
};
|
||||
case (_tower isKindOf "Truck") : {
|
||||
["Plane", "Helicopter"];
|
||||
};
|
||||
case (_tower isKindOf "Ship") : {
|
||||
[];
|
||||
};
|
||||
case (_tower isKindOf "Car") : {
|
||||
["Truck", "Truck_F", "Tank", "Plane", "Helicopter"]; //The tower is a car so it can't tow: truck, tank, plane and helicopter
|
||||
};
|
||||
default {
|
||||
["Car", "Truck", "Truck_F", "Tank", "Plane", "Helicopter", "Ship"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Lift
|
||||
btc_lift_fnc_getLiftable = {
|
||||
params ["_chopper"];
|
||||
|
||||
private _array = [];
|
||||
switch (typeOf _chopper) do {
|
||||
case "B_SDV_01_F" : {
|
||||
_array = ["Motorcycle", "ReammoBox", "ReammoBox_F", "StaticWeapon", "Car", "Truck", "Wheeled_APC_F", "Tracked_APC", "APC_Tracked_01_base_F", "APC_Tracked_02_base_F", "Air", "Ship", "Tank"] + ((btc_construction_array select 1) select 3) + ((btc_construction_array select 1) select 4) + ((btc_construction_array select 1) select 5);
|
||||
};
|
||||
default {
|
||||
private _MaxCargoMass = getNumber (configOf _chopper >> "slingLoadMaxCargoMass");
|
||||
switch (true) do {
|
||||
case (_MaxCargoMass <= 510) : {
|
||||
_array = ["Motorcycle", "ReammoBox", "ReammoBox_F", "Quadbike_01_base_F", "Strategic"];
|
||||
};
|
||||
case (_MaxCargoMass <= 2100) : {
|
||||
_array = ["Motorcycle", "ReammoBox", "ReammoBox_F", "StaticWeapon", "Car"];
|
||||
};
|
||||
case (_MaxCargoMass <= 4100) : {
|
||||
_array = ["Motorcycle", "ReammoBox", "ReammoBox_F", "StaticWeapon", "Car", "Truck_F", "Truck", "Wheeled_APC_F", "Air", "Ship"] + ((btc_construction_array select 1) select 3) + ((btc_construction_array select 1) select 4) + ((btc_construction_array select 1) select 5);
|
||||
};
|
||||
case (_MaxCargoMass <= 14000) : {
|
||||
_array = ["Motorcycle", "ReammoBox", "ReammoBox_F", "StaticWeapon", "Car", "Truck_F", "Truck", "Wheeled_APC_F", "Tracked_APC", "APC_Tracked_01_base_F", "APC_Tracked_02_base_F", "Air", "Ship", "Tank"] + ((btc_construction_array select 1) select 3) + ((btc_construction_array select 1) select 4) + ((btc_construction_array select 1) select 5);
|
||||
};
|
||||
default {
|
||||
_array = ["Motorcycle", "ReammoBox", "ReammoBox_F", "StaticWeapon", "Car", "Truck_F", "Truck", "Wheeled_APC_F", "Tracked_APC", "APC_Tracked_01_base_F", "APC_Tracked_02_base_F", "Air", "Ship", "Tank"] + ((btc_construction_array select 1) select 3) + ((btc_construction_array select 1) select 4) + ((btc_construction_array select 1) select 5);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
_array
|
||||
};
|
||||
|
||||
btc_ropes_deployed = false;
|
||||
btc_lift_min_h = 7;
|
||||
btc_lift_max_h = 12;
|
||||
btc_lift_radius = 3;
|
||||
btc_lift_HUD_x = 0.874;
|
||||
btc_lift_HUD_y = 0.848;
|
||||
|
||||
//Mil
|
||||
btc_hq = objNull;
|
||||
// Get all faction from mod there are currently running
|
||||
//copyToClipboard str (["EN"] call btc_fnc_get_class);
|
||||
private _allfaction = ["IND_F","OPF_F","OPF_G_F","IND_G_F","BLU_G_F","IND_E_F","IND_L_F","BLU_F","IND_C_F","USAF","OPF_R_F","OPF_T_F","BLU_CTRG_F","OPF_GEN_F","BLU_GEN_F","BLU_T_F","O_TALIBAN","BLU_W_F","RHS_FACTION_VMF","RHS_FACTION_MSV","RHS_FACTION_RVA","RHS_FACTION_TV","RHS_FACTION_VDV","RHS_FACTION_VPVO","RHS_FACTION_VV","RHS_FACTION_VVS_C","RHS_FACTION_VVS","RHSSAF_FACTION_ARMY","RHSSAF_FACTION_ARMY_OPFOR","RHSSAF_FACTION_AIRFORCE_OPFOR","RHSSAF_FACTION_AIRFORCE","RHSSAF_FACTION_UN","RHS_FACTION_USARMY_D","RHS_FACTION_USARMY_WD","RHS_FACTION_USN","RHS_FACTION_SOCOM","RHS_FACTION_USAF","RHS_FACTION_USMC_D","RHS_FACTION_USMC_WD","RHSGREF_FACTION_UN","RHSGREF_FACTION_NATIONALIST","RHSGREF_FACTION_TLA","RHSGREF_FACTION_TLA_G","RHSGREF_FACTION_CDF_GROUND","RHSGREF_FACTION_CDF_GROUND_B","UK3CB_AAF_O","UK3CB_AAF_I","UK3CB_AAF_B","UK3CB_ANA_B","UK3CB_ANP_B","UK3CB_ADA_O","UK3CB_ADA_I","UK3CB_ADA_B","UK3CB_ADR_O","UK3CB_ADR_I","UK3CB_ADR_B","UK3CB_ADG_O","UK3CB_ADG_I","UK3CB_ADG_B","UK3CB_ADC_O","UK3CB_ADC_I","UK3CB_ADC_B","UK3CB_ADE_O","UK3CB_ADE_I","UK3CB_ADM_O","UK3CB_ADM_I","UK3CB_ADM_B","UK3CB_ADP_O","UK3CB_ADP_I","UK3CB_ADP_B","UK3CB_APD_O","UK3CB_APD_I","UK3CB_APD_B","UK3CB_ARD_O","UK3CB_ARD_I","UK3CB_ARD_B","UK3CB_CHD_O","UK3CB_CHD_W_O","UK3CB_CHD_B","UK3CB_CHD_W_B","UK3CB_CHD_I","UK3CB_CHD_W_I","UK3CB_CHC_O","UK3CB_CHC_I","UK3CB_CHC_B","UK3CB_CCM_O","UK3CB_CCM_B","UK3CB_CCM_I","UK3CB_CPD_O","UK3CB_CPD_I","UK3CB_CPD_B","UK3CB_CW_US_B_EARLY","UK3CB_CW_US_B_LATE","UK3CB_CW_SOV_O_EARLY","UK3CB_CW_SOV_O_LATE","UK3CB_CSAT_A_O","UK3CB_CSAT_W_O","UK3CB_CSAT_M_O","UK3CB_CSAT_B_O","UK3CB_CSAT_N_O","UK3CB_CSAT_F_O","UK3CB_CSAT_G_O","UK3CB_CSAT_U_O","UK3CB_CSAT_S_O","UK3CB_FIA_O","UK3CB_FIA_I","UK3CB_FIA_B","UK3CB_GAF_O","UK3CB_GAF_I","UK3CB_GAF_B","UK3CB_ION_O_DESERT","UK3CB_ION_I_DESERT","UK3CB_ION_B_DESERT","UK3CB_ION_O_URBAN","UK3CB_ION_I_URBAN","UK3CB_ION_B_URBAN","UK3CB_ION_O_WINTER","UK3CB_ION_I_WINTER","UK3CB_ION_B_WINTER","UK3CB_ION_O_WOODLAND","UK3CB_ION_I_WOODLAND","UK3CB_ION_B_WOODLAND","UK3CB_KRG_O","UK3CB_KRG_I","UK3CB_KRG_B","UK3CB_KDF_O","UK3CB_KDF_I","UK3CB_KDF_B","UK3CB_LDF_O","UK3CB_LDF_I","UK3CB_LDF_B","UK3CB_LFR_O","UK3CB_LFR_I","UK3CB_LFR_B","UK3CB_LSM_O","UK3CB_LSM_I","UK3CB_LSM_B","UK3CB_LNM_O","UK3CB_LNM_I","UK3CB_LNM_B","UK3CB_MDF_O","UK3CB_MDF_I","UK3CB_MDF_B","UK3CB_MEC_O","UK3CB_MEC_I","UK3CB_MEC_B","UK3CB_MEE_O","UK3CB_MEE_I","UK3CB_MEI_O","UK3CB_MEI_I","UK3CB_MEI_B","UK3CB_NAP_O","UK3CB_NAP_I","UK3CB_NAP_B","UK3CB_NFA_O","UK3CB_NFA_I","UK3CB_NFA_B","UK3CB_NPD_O","UK3CB_NPD_I","UK3CB_NPD_B","UK3CB_TKC_O","UK3CB_TKC_I","UK3CB_TKC_B","UK3CB_TKM_O","UK3CB_TKA_O","UK3CB_TKA_I","UK3CB_TKA_B","UK3CB_TKP_O","UK3CB_TKP_I","UK3CB_TKP_B","UK3CB_TKM_B","UK3CB_TKM_I","UK3CB_UN_I","UK3CB_UN_B","RHSGREF_FACTION_CDF_AIR","RHSGREF_FACTION_CDF_AIR_B","RHSGREF_FACTION_CDF_NG","RHSGREF_FACTION_CDF_NG_B","RHSGREF_FACTION_CHDKZ","RHSGREF_FACTION_CHDKZ_G","RHSGREF_FACTION_HIDF"]; //All factions
|
||||
_p_en = _allfaction select _p_en; //Select faction selected from mission parameter
|
||||
_allclasse = [[_p_en], _p_en_AA, _p_en_tank] call btc_mil_fnc_class; //Create classes from factions, you can combine factions like that: [[_p_en , "IND_F"], _p_en_AA, _p_en_tank] call btc_mil_fnc_class;
|
||||
|
||||
//Save class name to global variable
|
||||
btc_enemy_side = _allclasse select 0;
|
||||
btc_type_units = _allclasse select 1;
|
||||
btc_type_divers = _allclasse select 2;
|
||||
btc_type_crewmen = _allclasse select 3;
|
||||
btc_type_boats = _allclasse select 4;
|
||||
btc_type_motorized = _allclasse select 5;
|
||||
btc_type_motorized_armed = _allclasse select 6;
|
||||
btc_type_mg = _allclasse select 7;
|
||||
btc_type_gl = _allclasse select 8;
|
||||
|
||||
//Sometimes you need to remove units: - ["Blabla","moreBlabla"];
|
||||
//Sometimes you need to add units: + ["Blabla","moreBlabla"];
|
||||
switch (_p_en) do {
|
||||
/*case "Myfactionexemple" : {
|
||||
btc_type_units = btc_type_units - ["Blabla","moreBlabla"];
|
||||
btc_type_divers = btc_type_divers + ["Blabla","moreBlabla"];
|
||||
btc_type_crewmen = "Blabla";
|
||||
btc_type_boats = btc_type_boats;
|
||||
btc_type_motorized = btc_type_motorized;
|
||||
btc_type_mg = btc_type_mg;
|
||||
btc_type_gl = btc_type_gl;
|
||||
};*/
|
||||
case "OPF_G_F" : {
|
||||
btc_type_motorized = btc_type_motorized + ["I_Truck_02_transport_F", "I_Truck_02_covered_F"];
|
||||
btc_type_motorized_armed = btc_type_motorized_armed + ["I_Heli_light_03_F"];
|
||||
};
|
||||
case "IND_C_F" : {
|
||||
btc_type_motorized = btc_type_motorized + ["I_G_Offroad_01_repair_F", "I_G_Offroad_01_F", "I_G_Quadbike_01_F", "I_G_Van_01_fuel_F", "I_Truck_02_transport_F", "I_Truck_02_covered_F"];
|
||||
btc_type_motorized_armed = btc_type_motorized_armed + ["I_Heli_light_03_F", "I_G_Offroad_01_F"];
|
||||
btc_type_units = btc_type_units - ["I_C_Soldier_Camo_F"];
|
||||
};
|
||||
};
|
||||
|
||||
//Chem
|
||||
btc_chem_range = 3;
|
||||
|
||||
//Spect
|
||||
btc_spect_range = 1000;
|
||||
btc_spect_updateOn = -1;
|
||||
|
||||
//Rep
|
||||
btc_rep_bonus_cache = 100;
|
||||
btc_rep_bonus_civ_hh = 3;
|
||||
btc_rep_bonus_disarm = 15;
|
||||
btc_rep_bonus_hideout = 200;
|
||||
btc_rep_bonus_mil_killed = 0.25;
|
||||
btc_rep_bonus_IEDCleanUp = 10;
|
||||
btc_rep_bonus_removeTag = 3;
|
||||
btc_rep_bonus_removeTagLetter = 0.5;
|
||||
btc_rep_bonus_foodGive = 0.5;
|
||||
btc_rep_bonus_grave = 5;
|
||||
|
||||
btc_rep_malus_civ_hd = - 2;
|
||||
btc_rep_malus_animal_hd = - 1;
|
||||
btc_rep_malus_civ_killed = - 10;
|
||||
btc_rep_malus_animal_killed = - 5;
|
||||
btc_rep_malus_civ_suppressed = - 4;
|
||||
btc_rep_malus_player_respawn = - 10;
|
||||
btc_rep_malus_veh_killed = - 25;
|
||||
btc_rep_malus_building_damaged = - 2.5;
|
||||
btc_rep_malus_building_destroyed = - 5;
|
||||
btc_rep_malus_foodRemove = - btc_rep_bonus_foodGive;
|
||||
btc_rep_malus_breakDoor = - 2;
|
||||
btc_rep_malus_wheelChange = - 7;
|
||||
btc_rep_malus_mil_killed = - 10;
|
||||
|
||||
btc_rep_level_veryLow = 0;
|
||||
btc_rep_level_low = 200;
|
||||
btc_rep_level_normal = 500;
|
||||
btc_rep_level_high = 750;
|
||||
|
||||
btc_rep_food = "ACE_Banana";
|
||||
|
||||
//Headless
|
||||
btc_units_owners = [];
|
||||
|
||||
//Door
|
||||
btc_door_breaking_time = 60;
|
||||
|
||||
//Flag
|
||||
btc_flag_textures = [
|
||||
"\A3\Data_F\Flags\flag_red_CO.paa",
|
||||
"\A3\Data_F\Flags\flag_green_CO.paa",
|
||||
"\A3\Data_F\Flags\flag_blue_CO.paa",
|
||||
"z\ace\addons\flags\data\Flag_yellow_co.paa",
|
||||
"\A3\Data_F\Flags\flag_NATO_CO.paa"
|
||||
];
|
||||
|
||||
//Respawn
|
||||
btc_body_bagTicketPlayer = 1;
|
||||
btc_body_prisonerTicket = 1;
|
||||
|
||||
btc_startDate = [2035, 6, 24, 12, 15];
|
||||
506
hearts_and_minds.kunduz_valley/core/def/param.hpp
Normal file
506
hearts_and_minds.kunduz_valley/core/def/param.hpp
Normal file
File diff suppressed because one or more lines are too long
59
hearts_and_minds.kunduz_valley/core/doc.sqf
Normal file
59
hearts_and_minds.kunduz_valley/core/doc.sqf
Normal file
@@ -0,0 +1,59 @@
|
||||
private _mainCategory = localize "str_3den_display3den_menubar_helpdoc_text";
|
||||
player createDiarySubject [_mainCategory, _mainCategory, "\A3\ui_f\data\igui\cfg\simpleTasks\types\documents_ca.paa"];
|
||||
|
||||
//Headless and Data base
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_DOC_HEADLESS_TITLE", localize "STR_BTC_HAM_DOC_HEADLESS_TEXT"]];
|
||||
|
||||
//Door locked
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_DOC_DOOR_TITLE", localize "STR_BTC_HAM_DOC_DOOR_TEXT"]];
|
||||
|
||||
//Chemical warfare
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_DOC_CHEMICALWARFARE_TITLE", localize "STR_BTC_HAM_DOC_CHEMICALWARFARE_TEXT"]];
|
||||
|
||||
//Spectrum devices
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_DOC_SPECTRUMDEVICES_TITLE", localize "STR_BTC_HAM_DOC_SPECTRUMDEVICES_TEXT"]];
|
||||
|
||||
//Vehicles
|
||||
player createDiaryRecord [_mainCategory, [localize "str_a3_cfghints_command_vehicles1", localize "STR_BTC_HAM_DOC_VEHICLES_TEXT"]];
|
||||
|
||||
//Side Mission
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_DOC_SIDEMISSION_TITLE", localize "STR_BTC_HAM_DOC_SIDEMISSION_TEXT"]];
|
||||
|
||||
//Respawn tickets
|
||||
player createDiaryRecord [_mainCategory, [localize "str_a3_cfgvehicles_modulerespawntickets_f", localize "STR_BTC_HAM_DOC_RESPAWN_TEXT"]];
|
||||
|
||||
//Respawn position
|
||||
player createDiaryRecord [_mainCategory, [localize "str_a3_cfgvehicles_modulerespawnposition_f_0", localize "STR_BTC_HAM_DOC_FOB_TEXT"]];
|
||||
|
||||
//Sling loading
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_A3_SlingLoad1", localize "STR_BTC_HAM_DOC_SLING_TEXT"]];
|
||||
|
||||
//Logistic point
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_MSQM_MRK_LOGPOINT", localize "STR_BTC_HAM_DOC_LOGISTICP_TEXT"]];
|
||||
|
||||
//Logistic
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_ACTION_LOC_MAIN", localize "STR_BTC_HAM_DOC_LOGISTIC_TEXT"]];
|
||||
|
||||
//Hideout
|
||||
player createDiaryRecord [_mainCategory, [localize "str_a3_campaign_b_m03_marker02", localize "STR_BTC_HAM_DOC_HIDEOUT_TEXT"]];
|
||||
|
||||
//IED
|
||||
player createDiaryRecord [_mainCategory, ["IED", localize "STR_BTC_HAM_DOC_IED_TEXT"]];
|
||||
|
||||
//Intel
|
||||
player createDiaryRecord [_mainCategory, [localize "str_a3_mdl_category_intel", localize "STR_BTC_HAM_DOC_INTEL_TEXT"]];
|
||||
|
||||
//Reputation
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_DOC_REPUTATION_TITLE", localize "STR_BTC_HAM_DOC_REPUTATION_TEXT"]];
|
||||
|
||||
//Orders
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_ACTION_ORDERS_MAIN", localize "STR_BTC_HAM_DOC_ORDERS_TEXT"]];
|
||||
|
||||
//Traffic
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_BTC_HAM_DOC_TRAFFIC_TITLE", localize "STR_BTC_HAM_DOC_TRAFFIC_TEXT"]];
|
||||
|
||||
//Version
|
||||
player createDiaryRecord [_mainCategory, [localize "STR_A3_FM_Welcome4",
|
||||
format (["<img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\download_ca.paa' width='20' height='20'/> Version %1.%2.%3 <img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\download_ca.paa' width='20' height='20'/> <br/><br/> <img image='\a3\missions_f_orange\Data\Img\orange_overview_ca.paa' width='355' height='200'/>"] + btc_version)
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,63 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_arsenal_fnc_ammoUsage
|
||||
|
||||
Description:
|
||||
Select weapons if:
|
||||
- is a type of item
|
||||
- and has a ammo usage allowed
|
||||
|
||||
Parameters:
|
||||
_weapons - Array of weapons. [Array]
|
||||
_itemType_ammo_usageAllowed - Weapons allowed filter: array of item type ("AssaultRifle", "MissileLauncher"...), allowed ammo usage ("128 + 512": ammo against vehicles and armored vehicles). [Array]
|
||||
|
||||
Returns:
|
||||
Array of selected weapons
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_weapons_selected = [["launch_RPG7_F"], ["MissileLauncher", "256"]] call btc_arsenal_fnc_ammoUsage;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_weapons", ["launch_RPG7_F"], [[]]],
|
||||
["_itemType_ammo_usageAllowed", ["MissileLauncher", "256"], [[]]]
|
||||
];
|
||||
_itemType_ammo_usageAllowed params [["_itemType", "MissileLauncher", [""]], ["_ammo_usageAllowed", "", [""]]];
|
||||
|
||||
private _cfgWeapons = configFile >> "CfgWeapons";
|
||||
private _cfgMagazines = configFile >> "CfgMagazines";
|
||||
private _cfgAmmo = configFile >> "CfgAmmo";
|
||||
|
||||
_weapons select {
|
||||
private _weapon = _x;
|
||||
private _isAllowed = true;
|
||||
if (_ammo_usageAllowed isNotEqualTo "") then {
|
||||
private _magazines = getArray (_cfgWeapons >> _weapon >> "magazines");
|
||||
private _aiAmmoUsage_magazines = _magazines apply {
|
||||
private _ammo = getText (_cfgMagazines >> _x >> "ammo");
|
||||
|
||||
private _aiAmmoUsage = getText (_cfgAmmo >> _ammo >> "aiAmmoUsageFlags");
|
||||
if (_aiAmmoUsage isEqualTo "") then {
|
||||
_aiAmmoUsage = str getNumber (_cfgAmmo >> _ammo >> "aiAmmoUsageFlags");
|
||||
};
|
||||
|
||||
_aiAmmoUsage;
|
||||
};
|
||||
|
||||
if (btc_debug_log) then {
|
||||
if ("" in _aiAmmoUsage_magazines) then {
|
||||
[format ["Weapons: %1 AiAmmoUsage Magazines: %2", _weapon, _aiAmmoUsage_magazines], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
};
|
||||
|
||||
_isAllowed = _ammo_usageAllowed in _aiAmmoUsage_magazines;
|
||||
};
|
||||
|
||||
(_itemType in (_weapon call BIS_fnc_itemType)) && {_isAllowed}
|
||||
};
|
||||
69
hearts_and_minds.kunduz_valley/core/fnc/arsenal/data.sqf
Normal file
69
hearts_and_minds.kunduz_valley/core/fnc/arsenal/data.sqf
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_arsenal_fnc_data
|
||||
|
||||
Description:
|
||||
Add virtual weapons to an object (e.g., ammo box) with restriction. Virtual items can be selected in the BIS/ACE3 Arsenal.
|
||||
|
||||
Parameters:
|
||||
_box - Object to which items will be added. [Object]
|
||||
_arsenalType - _arsenalType < 3 add BIS Arsenal, _arsenalType > 0 add ACE3 Arsenal. [Number]
|
||||
_arsenalRestrict - 1 to add to Arsenal _arsenalData, other to restrict Arsenal with _arsenalData. [Number]
|
||||
_arsenalData - Array of weapons, magazines and items. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[btc_gear_object, btc_p_arsenal_Type, btc_p_arsenal_Restrict, btc_custom_arsenal] call btc_arsenal_fnc_data;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
1kuemmel1
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_box", objNull, [objNull]],
|
||||
["_arsenalType", 0, [0]],
|
||||
["_arsenalRestrict", 0, [0]],
|
||||
["_arsenalData", [], [[]]]
|
||||
];
|
||||
_arsenalData params [["_weapons", [], [[]]], ["_magazines", [], [[]]], ["_items", [], [[]]], ["_backpacks", [], [[]]]];
|
||||
|
||||
//BIS Arsenal
|
||||
if (_arsenalType < 3) then {
|
||||
if (_arsenalRestrict isEqualTo 1) then {
|
||||
//add
|
||||
[_box, _weapons, false, false] call BIS_fnc_addVirtualWeaponCargo;
|
||||
[_box, _magazines, false, false] call BIS_fnc_addVirtualMagazineCargo;
|
||||
[_box, _items, false, false] call BIS_fnc_addVirtualItemCargo;
|
||||
[_box, _backpacks, false, false] call BIS_fnc_addVirtualBackpackCargo;
|
||||
};
|
||||
|
||||
// DO NOT WORK FOR BIS ARSENAL
|
||||
if (_arsenalRestrict in [2, 3]) then {
|
||||
//remove
|
||||
[_box, _weapons, false] call BIS_fnc_removeVirtualWeaponCargo;
|
||||
[_box, _magazines, false] call BIS_fnc_removeVirtualMagazineCargo;
|
||||
[_box, _items, false] call BIS_fnc_removeVirtualItemCargo;
|
||||
[_box, _backpacks, false] call BIS_fnc_removeVirtualBackpackCargo;
|
||||
};
|
||||
};
|
||||
|
||||
//ACE Arsenal
|
||||
if (_arsenalType > 0) then {
|
||||
//add
|
||||
if (_arsenalRestrict isEqualTo 1) then {
|
||||
private _aceAdd = [];
|
||||
{_aceAdd append _x;} forEach [_weapons, _magazines, _items, _backpacks];
|
||||
[_box, _aceAdd] call ace_arsenal_fnc_addVirtualItems;
|
||||
};
|
||||
|
||||
//remove
|
||||
if (_arsenalRestrict in [2, 3]) then {
|
||||
private _aceRemove = [];
|
||||
{_aceRemove append _x;} forEach [_weapons, _magazines, _items, _backpacks];
|
||||
[_box, _aceRemove] call ace_arsenal_fnc_removeVirtualItems;
|
||||
};
|
||||
};
|
||||
61
hearts_and_minds.kunduz_valley/core/fnc/arsenal/garage.sqf
Normal file
61
hearts_and_minds.kunduz_valley/core/fnc/arsenal/garage.sqf
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_arsenal_fnc_garage
|
||||
|
||||
Description:
|
||||
Open virtual Arsenal garage on object position.
|
||||
|
||||
Parameters:
|
||||
_current_garage - Object where the vehicle from garage will spawn. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[btc_create_object_point] spawn btc_arsenal_fnc_garage;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_current_garage", objNull, [objNull]]
|
||||
];
|
||||
|
||||
if ([_current_garage] call btc_fnc_checkArea) exitWith {};
|
||||
|
||||
disableSerialization;
|
||||
uiNamespace setVariable ["current_garage", _current_garage];
|
||||
private _fullVersion = missionNamespace getVariable ["BIS_fnc_arsenal_fullGarage", false];
|
||||
if !(isNull (uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull])) exitwith {
|
||||
"Garage Viewer is already running" call bis_fnc_logFormat;
|
||||
};
|
||||
private _veh = createVehicle ["Land_HelipadEmpty_F", getPos _current_garage, [], 0, "CAN_COLLIDE"];
|
||||
_veh setPosASL getPosASL _current_garage;
|
||||
uiNamespace setVariable ["garage_pad", _veh];
|
||||
missionNamespace setVariable ["BIS_fnc_arsenal_fullGarage", [true, 0, false, [false]] call BIS_fnc_param];
|
||||
with missionNamespace do {BIS_fnc_garage_center = _veh};
|
||||
|
||||
with uiNamespace do {
|
||||
private _displayMission = [] call (uiNamespace getVariable "bis_fnc_displayMission");
|
||||
if !(isNull findDisplay 312) then {_displayMission = findDisplay 312;};
|
||||
_displayMission createDisplay "RscDisplayGarage";
|
||||
uiNamespace setVariable ["running_garage", true];
|
||||
waitUntil {sleep 0.25; isNull (uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull])};
|
||||
private _logistic_point = uiNamespace getVariable "current_garage";
|
||||
private _pad = uiNamespace getVariable "garage_pad";
|
||||
deleteVehicle _pad;
|
||||
private _veh_list = _logistic_point nearEntities 5;
|
||||
{
|
||||
private _type = typeOf _x;
|
||||
private _pos = getPosASL _x;
|
||||
private _dir = getDir _current_garage;
|
||||
private _customization = [_x] call BIS_fnc_getVehicleCustomization;
|
||||
|
||||
_x call CBA_fnc_deleteEntity;
|
||||
[_type, _pos, _dir, _customization] remoteExecCall ["btc_log_fnc_createVehicle", 2];
|
||||
[_type] remoteExecCall ["btc_veh_fnc_init", -2];
|
||||
} forEach _veh_list;
|
||||
};
|
||||
228
hearts_and_minds.kunduz_valley/core/fnc/arsenal/loadout.sqf
Normal file
228
hearts_and_minds.kunduz_valley/core/fnc/arsenal/loadout.sqf
Normal file
@@ -0,0 +1,228 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_arsenal_fnc_loadout
|
||||
|
||||
Description:
|
||||
Generate a loadout from an array of defined loadout depending on trait, medical level, color and hour of the day.
|
||||
|
||||
Parameters:
|
||||
_type - Type of loadout: 0 - Rifleman, 1 - Medic, 2 - Repair, 3 - Engineer, 4 - Anti-Tank, 5 - Anti Air, 6 - Sniper, 7 - Machine gunner, 8 - CBRN, 9 - Drone hacker. [Number]
|
||||
_color - Color of skin loadout: 0 - Desert, 1 - Tropic, 2 - Black, 3 - Forest. [Number]
|
||||
_isDay - Select night (false) or day (true) loadout. [Boolean]
|
||||
_medicalParameters - Select the correct medical stuff depends on ACE3 medical parameters. [Array]
|
||||
_arsenal_loadout - Array of defined loadout. [Array]
|
||||
|
||||
Returns:
|
||||
Loadout array.
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_rifleman_loadout = [0] call btc_arsenal_fnc_loadout;
|
||||
(end)
|
||||
(begin example)
|
||||
[] spawn {
|
||||
{
|
||||
private _i = _x;
|
||||
{
|
||||
private _j = _x;
|
||||
{
|
||||
player setUnitLoadout ([_i, _j, _x] call btc_arsenal_fnc_loadout);
|
||||
sleep 1;
|
||||
} forEach [false,true];
|
||||
} forEach [0,1,2,3];
|
||||
} forEach [0,1,2,3,4,5,6,7,8,9];
|
||||
};
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_type", 0, [0]],
|
||||
["_color", -1, [0]],
|
||||
["_isDay", 0, [0, false]],
|
||||
["_medicalParameters", [ace_medical_treatment_advancedBandages, ace_medical_treatment_locationEpinephrine, ace_medical_treatment_locationSurgicalKit, ace_medical_treatment_locationPAK, ace_medical_fractures], [[]]],
|
||||
["_arsenal_loadout", btc_arsenal_loadout, [[]]]
|
||||
];
|
||||
|
||||
if (_color < 0) then {
|
||||
_color = if (sunOrMoon isEqualTo 0) then {
|
||||
2
|
||||
} else {
|
||||
switch (true) do {
|
||||
case (worldName in ["Tanoa", "lingor3"]): {
|
||||
1
|
||||
};
|
||||
case (worldName in ["chernarus", "Enoch", "sara", "vt7", "cup_chernarus_A3", "chernarus_summer"]): {
|
||||
3
|
||||
};
|
||||
default {
|
||||
0
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
(_arsenal_loadout apply {_x select _color}) params ["_uniform", "_uniformCBRN", "_uniformSniper", "_vest", "_helmet", "_hood", "_hoodCBRN", "_laserdesignator", "_night_vision", "_weapon", "_weapon_sniper", "_weapon_machineGunner", "_bipod", "_pistol", "_launcher_AT", "_launcher_AA", "_backpack", "_backpack_big", "_backpackCBRN", "_radio"];
|
||||
|
||||
if (_isDay isEqualType 0) then {
|
||||
(date call BIS_fnc_sunriseSunsetTime) params ["_sunrise", "_sunset"];
|
||||
_isDay = (_sunrise < dayTime) && (_sunset > dayTime + 1);
|
||||
};
|
||||
|
||||
_medicalParameters params ["_advancedBandages", "_epi", "_surgicalKit", "_PAK", "_fractures"];
|
||||
|
||||
//Item inside Uniform
|
||||
private _cfgPatches = configFile >> "CfgPatches";
|
||||
private _cargo_uniform = [["acc_flashlight", 1], ["ACE_EarPlugs", 1], ["ACE_CableTie",5], ["optic_ACO_grn_smg", 1], ["ACE_MapTools", 1], ["ACE_RangeTable_82mm", 1]];
|
||||
|
||||
//Tweak uniform medical item depends on medical parameters
|
||||
private _medical = [["ACE_fieldDressing", 3], ["ACE_tourniquet", 4], ["ACE_morphine", 3]];
|
||||
_medical pushBack (if (_advancedBandages > 0) then {
|
||||
["ACE_packingBandage", 4]
|
||||
} else {
|
||||
["ACE_fieldDressing", 4]
|
||||
});
|
||||
_medical pushBack (if (_epi < 4) then {
|
||||
["ACE_epinephrine", 3]
|
||||
} else {
|
||||
["ACE_morphine", 3]
|
||||
});
|
||||
if (_fractures > 0) then {
|
||||
_medical pushBack ["ACE_splint", 1];
|
||||
};
|
||||
_cargo_uniform append _medical;
|
||||
|
||||
private _uniform = switch (_type) do {
|
||||
case 6: {
|
||||
_uniformSniper
|
||||
};
|
||||
case 8: {
|
||||
_uniformCBRN
|
||||
};
|
||||
default {
|
||||
_uniform
|
||||
};
|
||||
};
|
||||
|
||||
private _hood = switch (_type) do {
|
||||
case 8: {
|
||||
_hoodCBRN
|
||||
};
|
||||
default {
|
||||
_hood
|
||||
};
|
||||
};
|
||||
|
||||
//Choose appropriate weapon/optics depends on _type
|
||||
private _array = switch (_type) do {
|
||||
case 6: {
|
||||
[_weapon_sniper, ["ACE_optic_Hamr_2D", "ACE_optic_LRPS_2D"]];
|
||||
};
|
||||
case 7: {
|
||||
[_weapon_machineGunner];
|
||||
};
|
||||
default {
|
||||
[_weapon];
|
||||
};
|
||||
};
|
||||
_array params ["_weapon", ["_optics", ["ACE_optic_Hamr_2D", "ACE_optic_Arco_2D"], [[]]]];
|
||||
private _bipod_item = ["", _bipod] select (_type in [6, 7]);
|
||||
|
||||
//Generate magazines and boulets count
|
||||
private _cfgWeapons = configFile >> "CfgWeapons";
|
||||
private _cfgMagazines = configFile >> "CfgMagazines";
|
||||
private _launcher = ["", _launcher_AT] select (_type isEqualTo 4);
|
||||
private _launcher = [_launcher, _launcher_AA] select (_type isEqualTo 5);
|
||||
([_weapon, _pistol, _launcher] apply {getArray (_cfgWeapons >> _x >> "magazines")}) params ["_weaponMagazines", "_pistolMagazines", "_launcherMagazines"];
|
||||
([_weaponMagazines, _pistolMagazines, _launcherMagazines] apply {_x select 0}) params ["_weaponMagazine", "_pistolMagazine", ["_launcherMagazine", ""]];
|
||||
([_weaponMagazine, _pistolMagazine, _launcherMagazine] apply {getNumber (_cfgMagazines >> _x >> "count")}) params ["_weaponCount", "_pistolCount", "_launcherCount"];
|
||||
|
||||
//Backpack content
|
||||
//Tweak backpack medical item depends on medical parameters
|
||||
private _backpackMedical = [["ACE_fieldDressing", 10], ["ACE_morphine", 12], ["ACE_bloodIV", 2], ["ACE_bloodIV_250", 2], ["ACE_bloodIV_500", 1]];
|
||||
_backpackMedical append (if (_advancedBandages > 0) then {
|
||||
[["ACE_packingBandage", 15], ["ACE_elasticBandage", 10], ["ACE_quikclot", 10]]
|
||||
} else {
|
||||
[["ACE_fieldDressing", 10]]
|
||||
});
|
||||
_backpackMedical pushBack (if (_epi < 4) then {
|
||||
["ACE_epinephrine", 12]
|
||||
} else {
|
||||
["ACE_morphine", 2]
|
||||
});
|
||||
if (_surgicalKit < 4) then {
|
||||
_backpackMedical pushBack ["ACE_surgicalKit", 1];
|
||||
};
|
||||
if (_PAK < 4) then {
|
||||
_backpackMedical pushBack ["ACE_personalAidKit", 1];
|
||||
};
|
||||
if (_fractures > 0) then {
|
||||
_backpackMedical pushBack ["ACE_splint", 3];
|
||||
};
|
||||
|
||||
private _cargos = [
|
||||
[],
|
||||
[_backpack, [["SmokeShellGreen", 3, 1], ["SmokeShellPurple", 1, 1]] + _backpackMedical],
|
||||
[_backpack, [["ToolKit", 1], ["ACE_EntrenchingTool", 1], ["ACE_wirecutter", 1]]],
|
||||
[_backpack, [["ACE_DefusalKit", 1], ["ACE_Clacker", 2], ["ACE_SpraypaintRed", 1], ["DemoCharge_Remote_Mag", 2, 1], [["ACE_VMM3", "", "", "", [], [], ""], 1], ["ACE_EntrenchingTool", 1]]],
|
||||
[_backpack, [[_launcherMagazines param [1, _launcherMagazine], 1, _launcherCount], [_launcherMagazine, 1, _launcherCount]]],
|
||||
[_backpack_big, [[_launcherMagazine, 2, _launcherCount]]],
|
||||
[_backpack, [["ACE_Sandbag_empty", 1], ["ACE_Kestrel4500", 1], ["ACE_ATragMX", 1], ["ACE_RangeCard", 1], ["ACE_EntrenchingTool", 1]]],
|
||||
[],
|
||||
[_backpackCBRN, [["G_Respirator_white_F", 5]]],
|
||||
[_backpack, [["muzzle_antenna_02_f", 1], ["muzzle_antenna_01_f", 1], [["hgun_esd_01_F", "", "", "", [], [], ""], 1]]]
|
||||
];
|
||||
private _binocular_array = [_laserdesignator, "", "", "", ["Laserbatteries", 1], [], ""];
|
||||
private _launcher_array = [[_launcher, "", "", "", [_launcherMagazine, _launcherCount], [], ""], []] select (_launcher isEqualTo "");
|
||||
private _radio_item = [
|
||||
["ItemRadio", ""] select (isClass(_cfgPatches >> "acre_main")),
|
||||
_radio
|
||||
] select (isClass (_cfgPatches >> "task_force_radio"));
|
||||
|
||||
private _loadout = if (_isDay) then {
|
||||
[
|
||||
[_weapon, "", "", _optics select _isDay, [_weaponMagazine, _weaponCount], [], _bipod_item],
|
||||
_launcher_array,
|
||||
[_pistol, "", "", "", [_pistolMagazine, _pistolCount], [], ""],
|
||||
[_uniform, _cargo_uniform],
|
||||
[_vest, [
|
||||
["SmokeShellGreen", 2, 1],
|
||||
[_weaponMagazine, 7, _weaponCount],
|
||||
["SmokeShellPurple", 2, 1],
|
||||
["SmokeShellYellow", 1, 1],
|
||||
[_pistolMagazine, 1, _pistolCount],
|
||||
["ACE_M84", 1, 1],
|
||||
["HandGrenade", 3, 1]
|
||||
]],
|
||||
_cargos select _type, _helmet, _hood, _binocular_array,
|
||||
["ItemMap", "B_UavTerminal", _radio_item, "ItemCompass", "ChemicalDetector_01_watch_F", ""]
|
||||
]
|
||||
} else {
|
||||
[
|
||||
[_weapon, "muzzle_snds_65_TI_blk_F", "acc_pointer_IR", _optics select _isDay, [_weaponMagazines param [1, _weaponMagazine], _weaponCount], [], _bipod_item],
|
||||
_launcher_array,
|
||||
[_pistol, "", "", "", [_pistolMagazine, _pistolCount], [], ""],
|
||||
[_uniform, _cargo_uniform],
|
||||
[_vest, [
|
||||
["SmokeShellGreen", 1, 1],
|
||||
["B_IR_Grenade", 2, 1],
|
||||
[_weaponMagazines param [1, _weaponMagazine], 7, _weaponCount],
|
||||
["Chemlight_green", 1, 1],
|
||||
["Chemlight_blue", 1, 1],
|
||||
["ACE_HandFlare_Green", 1, 1],
|
||||
["HandGrenade", 3, 1],
|
||||
["ACE_M84", 1, 1]
|
||||
]],
|
||||
_cargos select _type, _helmet, _hood, _binocular_array,
|
||||
["ItemMap", "B_UavTerminal", _radio_item, "ItemCompass", "ChemicalDetector_01_watch_F", _night_vision]
|
||||
]
|
||||
};
|
||||
|
||||
if (isClass(_cfgPatches >> "acre_main")) then {
|
||||
(_loadout select 4 select 1) pushBack [_radio, 1];
|
||||
};
|
||||
|
||||
_loadout
|
||||
59
hearts_and_minds.kunduz_valley/core/fnc/arsenal/trait.sqf
Normal file
59
hearts_and_minds.kunduz_valley/core/fnc/arsenal/trait.sqf
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_arsenal_fnc_trait
|
||||
|
||||
Description:
|
||||
Get trait from an object (e.g. Player) and return the corresponding trait and weapons allowed filter (https://community.bistudio.com/wiki/CfgAmmo_Config_Reference#aiAmmoUsageFlags).
|
||||
|
||||
Parameters:
|
||||
_player - Object use to determine the trait and the weapons allowed filter accordingly to the trait. [Object]
|
||||
|
||||
Returns:
|
||||
_type_ammoUsageAllowed = trait and array of weapons allowed filter: array of item type ("AssaultRifle", "MissileLauncher"...), allowed ammo usage ("128 + 512": ammo against vehicles and armored vehicles).
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_type_ammoUsageAllowed = [player] call btc_arsenal_fnc_trait;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_player", objNull, [objNull]]
|
||||
];
|
||||
|
||||
switch (true) do {
|
||||
case (_player getUnitTrait "medic"): {
|
||||
[1, [["AssaultRifle"]]]
|
||||
};
|
||||
case (_player getVariable ["ace_isEngineer", 0] in [1, 2]): {
|
||||
[2, [["AssaultRifle"]]]
|
||||
};
|
||||
case (_player getUnitTrait "explosiveSpecialist"): {
|
||||
[3, [["AssaultRifle"]]]
|
||||
};
|
||||
case ([typeOf _player, ["MissileLauncher", "128 + 512"]] call btc_mil_fnc_ammoUsage): {
|
||||
[4, [["AssaultRifle"], ["RocketLauncher"], ["MissileLauncher", "128 + 512"]]]
|
||||
};
|
||||
case ([typeOf _player, ["MissileLauncher", "256"]] call btc_mil_fnc_ammoUsage): {
|
||||
[5, [["AssaultRifle"], ["MissileLauncher", "256"]]]
|
||||
};
|
||||
case ([typeOf _player, ["SniperRifle"]] call btc_mil_fnc_ammoUsage): {
|
||||
[6, [["SniperRifle"]]]
|
||||
};
|
||||
case ([typeOf _player, ["MachineGun"]] call btc_mil_fnc_ammoUsage): {
|
||||
[7, [["MachineGun"]]]
|
||||
};
|
||||
case ("cbrn" in toLower uniform _player): {
|
||||
[8, [["AssaultRifle"]]]
|
||||
};
|
||||
case (_player getUnitTrait "UAVHacker"): {
|
||||
[9, [["AssaultRifle"]]]
|
||||
};
|
||||
default {
|
||||
[0, [["AssaultRifle"], ["RocketLauncher"]]]
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_arsenal_fnc_weaponsFilter
|
||||
|
||||
Description:
|
||||
Filter weapons allowed with the weapons allowed filter: array of item type ("AssaultRifle", "MissileLauncher"...), allowed ammo usage ("128 + 512": ammo against vehicles and armored vehicles).
|
||||
|
||||
Parameters:
|
||||
_itemType_ammo_usageAllowed - Array of weapons allowed filter. [Array]
|
||||
_custom_arsenal - Array of weapons, magazines and items. [Array]
|
||||
_arsenalRestrict - 1 to add allowed weapons to Arsenal _custom_arsenal, other to restrict. [Number]
|
||||
_type_units - Array of enemies type. Use to remove enemies weapons from the allowed weapons. [Array]
|
||||
|
||||
Returns:
|
||||
_allowedWeapons - Array of allowed weapons [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_allowedWeapons = [[["AssaultRifle", ""], ["RocketLauncher", ""]]] call btc_arsenal_fnc_weaponsFilter;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_itemType_ammo_usageAllowed", [["AssaultRifle", ""], ["RocketLauncher", ""]], [[]]],
|
||||
["_custom_arsenal", btc_custom_arsenal, [[]]],
|
||||
["_arsenalRestrict", btc_p_arsenal_Restrict, [0]],
|
||||
["_type_units", btc_type_units, [[]]]
|
||||
];
|
||||
|
||||
private _weapons = ("true" configClasses (configFile >> "CfgWeapons") select {
|
||||
getNumber (_x >> "scope") isEqualTo 2 &&
|
||||
{getNumber (_x >> "type") in [1, 4]}
|
||||
}) apply {configName _x};
|
||||
|
||||
private _allowedWeapons = [];
|
||||
{
|
||||
_allowedWeapons append ([_weapons, _x] call btc_arsenal_fnc_ammoUsage);
|
||||
} forEach _itemType_ammo_usageAllowed;
|
||||
|
||||
private _cfgVehicles = configFile >> "CfgVehicles";
|
||||
private _enemyWeapons = [];
|
||||
{
|
||||
_enemyWeapons append getArray (_cfgVehicles >> _x >> "weapons");
|
||||
} forEach _type_units;
|
||||
_allowedWeapons = _allowedWeapons - _enemyWeapons;
|
||||
|
||||
if (_arsenalRestrict isEqualTo 1) then {
|
||||
(_custom_arsenal select 0) append _allowedWeapons;
|
||||
} else {
|
||||
(_custom_arsenal select 0) append (_weapons - _allowedWeapons);
|
||||
};
|
||||
|
||||
_allowedWeapons
|
||||
37
hearts_and_minds.kunduz_valley/core/fnc/body/bagRecover.sqf
Normal file
37
hearts_and_minds.kunduz_valley/core/fnc/body/bagRecover.sqf
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_body_fnc_bagRecover
|
||||
|
||||
Description:
|
||||
Add respawn tickets when a body bag is provided.
|
||||
|
||||
Parameters:
|
||||
_logistic - Logistic pad. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
{_x addCuratorEditableObjects [btc_body_deadPlayers, false];} forEach allCurators;
|
||||
[btc_create_object_point] call btc_body_fnc_bagRecover;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_logistic", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _array = nearestObjects [_logistic, ["ACE_bodyBagObject", "CAManBase"], 10];
|
||||
_array = _array select {
|
||||
_x isKindOf "CAManBase" ||
|
||||
_x isKindOf "ACE_bodyBagObject"
|
||||
};
|
||||
if (_array isEqualTo []) exitWith {
|
||||
localize "STR_BTC_HAM_O_BODYBAG_NO" call CBA_fnc_notify;
|
||||
};
|
||||
|
||||
[_array select 0, player] remoteExecCall ["btc_body_fnc_bagRecover_s", 2];
|
||||
@@ -0,0 +1,91 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_body_fnc_bagRecover_s
|
||||
|
||||
Description:
|
||||
Add respawn tickets when a body bag or an alive enemy is provided.
|
||||
|
||||
Parameters:
|
||||
_bodyBag - Body bag or alive enemy. [Object]
|
||||
_player - Player interacting. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[cursorObject, player] remoteExecCall ["btc_body_fnc_bagRecover_s", 2];
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_bodyBag", objNull, [objNull]],
|
||||
["_player", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _ticket = 0;
|
||||
private _UID = _bodyBag getVariable ["btc_UID", ""];
|
||||
private _players = [];
|
||||
if (_UID isEqualTo "") then {
|
||||
if (
|
||||
alive _bodyBag &&
|
||||
_bodyBag isKindOf "CAManBase" &&
|
||||
side group _bodyBag isEqualTo btc_enemy_side
|
||||
) then {
|
||||
_ticket = btc_body_prisonerTicket;
|
||||
|
||||
switch (btc_p_respawn_ticketsFromPrisoners) do {
|
||||
case 1 : {
|
||||
_players = allPlayers select {side group _x isEqualTo btc_player_side};
|
||||
};
|
||||
case 2 : {
|
||||
_players = [_player];
|
||||
};
|
||||
case 3 : {
|
||||
_players = allPlayers select {side group _x isEqualTo btc_player_side};
|
||||
private _index = _players findIf {[_x] call BIS_fnc_respawnTickets isEqualTo 0};
|
||||
if (_index isEqualTo -1) then {
|
||||
_players = [];
|
||||
} else {
|
||||
_players = [_players select _index];
|
||||
};
|
||||
};
|
||||
case 4 : {
|
||||
_players = allPlayers select {side group _x isEqualTo btc_player_side};
|
||||
private _tickets = _players apply {[[_x] call BIS_fnc_respawnTickets, _x]};
|
||||
_tickets sort true;
|
||||
_players = [_tickets select 0 select 1];
|
||||
};
|
||||
default {};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_ticket = btc_body_bagTicketPlayer;
|
||||
};
|
||||
|
||||
if (_ticket isEqualTo 0) exitWith {
|
||||
[23] remoteExecCall ["btc_fnc_show_hint", remoteExecutedOwner];
|
||||
};
|
||||
if (_UID isEqualTo "" && _players isEqualTo []) exitWith {
|
||||
[25] remoteExecCall ["btc_fnc_show_hint", remoteExecutedOwner];
|
||||
};
|
||||
[22] remoteExecCall ["btc_fnc_show_hint", remoteExecutedOwner];
|
||||
|
||||
if (btc_p_respawn_ticketsShare) then {
|
||||
[btc_player_side, _ticket, btc_player_side] call btc_respawn_fnc_addTicket;
|
||||
} else {
|
||||
if (_UID isEqualTo "") then {
|
||||
{
|
||||
[_x, _ticket, getPlayerUID _x] call btc_respawn_fnc_addTicket;
|
||||
} forEach _players;
|
||||
} else {
|
||||
private _player = _UID call BIS_fnc_getUnitByUID;
|
||||
[_player, _ticket, _UID] call btc_respawn_fnc_addTicket;
|
||||
};
|
||||
};
|
||||
|
||||
deleteMarker (_bodyBag getVariable ["btc_body_deadMarker", ""]);
|
||||
_bodyBag call CBA_fnc_deleteEntity;
|
||||
60
hearts_and_minds.kunduz_valley/core/fnc/body/create.sqf
Normal file
60
hearts_and_minds.kunduz_valley/core/fnc/body/create.sqf
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_body_fnc_create
|
||||
|
||||
Description:
|
||||
Create dead bodies from a serialized array of bodies.
|
||||
|
||||
Parameters:
|
||||
_serializedBodies - Serialized bodies. [Array]
|
||||
|
||||
Returns:
|
||||
_bodies - Bodies. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_body_fnc_create;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_serializedBodies", [], [[]]]
|
||||
];
|
||||
|
||||
private _group = createGroup btc_player_side;
|
||||
_bodies = _serializedBodies apply {
|
||||
_x params ["_type", "_pos", "_dir", "_loadout", "_dogtag", "_isContaminated",
|
||||
["_flagTexture", "", [""]]
|
||||
];
|
||||
private _body = _group createUnit [_type, ASLToAGL _pos, [], 0, "CAN_COLLIDE"];
|
||||
_body setUnitLoadout _loadout;
|
||||
[_body, _dogtag] call btc_body_fnc_dogtagSet;
|
||||
|
||||
if (_isContaminated) then {
|
||||
if ((btc_chem_contaminated pushBackUnique _body) > -1) then {
|
||||
publicVariable "btc_chem_contaminated";
|
||||
};
|
||||
};
|
||||
_body setDamage 1;
|
||||
_body setVariable ["btc_dont_delete", true];
|
||||
_body forceFlagTexture _flagTexture;
|
||||
|
||||
[{
|
||||
params ["_body", "_dir", "_pos"];
|
||||
_body setDir _dir;
|
||||
_body setPosASL _pos;
|
||||
}, [_body, _dir, _pos], 3] call CBA_fnc_waitAndExecute;
|
||||
|
||||
if (btc_p_body_timeBeforeShowMarker >= 0) then {
|
||||
_body call btc_body_fnc_createMarker;
|
||||
};
|
||||
|
||||
_body
|
||||
};
|
||||
deleteGroup _group;
|
||||
|
||||
_bodies
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_body_fnc_createMarker
|
||||
|
||||
Description:
|
||||
Create a KIA marker on dead body.
|
||||
|
||||
Parameters:
|
||||
_deadBody - Dead body. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[cursorObject] call btc_body_fnc_createMarker;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_unit", objNull, [objNull]]
|
||||
];
|
||||
|
||||
if (isNull _unit) exitwith {};
|
||||
|
||||
private _marker = createMarker [
|
||||
format ["btc_body_dead_%1", {"btc_body_dead" in _x} count allMapMarkers],
|
||||
_unit
|
||||
];
|
||||
_marker setMarkerType "KIA";
|
||||
_marker setMarkerSize [0.5, 0.5];
|
||||
_marker setMarkerAlpha 0.5;
|
||||
_unit setVariable ["btc_body_deadMarker", _marker];
|
||||
31
hearts_and_minds.kunduz_valley/core/fnc/body/dogtagGet.sqf
Normal file
31
hearts_and_minds.kunduz_valley/core/fnc/body/dogtagGet.sqf
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_body_fnc_dogtagGet
|
||||
|
||||
Description:
|
||||
Get ACE dogtag data and player UID.
|
||||
|
||||
Parameters:
|
||||
_deadBody - Dead body or body bag. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[cursorObject] call btc_body_fnc_dogtagGet;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_unit", objNull, [objNull]]
|
||||
];
|
||||
|
||||
[
|
||||
_unit call ace_dogtags_fnc_getDogtagData,
|
||||
!isNull (_unit getVariable ["ace_dogtags_dogtagTaken", objNull]),
|
||||
_unit getVariable ["btc_UID", ""]
|
||||
]
|
||||
40
hearts_and_minds.kunduz_valley/core/fnc/body/dogtagSet.sqf
Normal file
40
hearts_and_minds.kunduz_valley/core/fnc/body/dogtagSet.sqf
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_body_fnc_dogtagSet
|
||||
|
||||
Description:
|
||||
Set ACE dogtag data.
|
||||
|
||||
Parameters:
|
||||
_deadBody - Dead body or body bag. [Object]
|
||||
_dogtagDataTaken - Dogtag data and if it has been taken. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[cursorObject] call btc_body_fnc_dogtagSet;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_deadBody", objNull, [objNull]],
|
||||
["_dogtagDataTaken", [], [[]]]
|
||||
];
|
||||
_dogtagDataTaken params [
|
||||
["_dogtagData", [], [[]]],
|
||||
["_dogtagTaken", false, [false]],
|
||||
["_UID", "", [""]]
|
||||
];
|
||||
|
||||
if (_dogtagData isNotEqualTo []) then {
|
||||
_deadBody setVariable ["ace_dogtags_dogtagData", _dogtagData, true];
|
||||
if (_dogtagTaken) then {
|
||||
_deadBody setVariable ["ace_dogtags_dogtagTaken", _deadBody, true];
|
||||
};
|
||||
_deadBody setVariable ["btc_UID", _UID];
|
||||
};
|
||||
38
hearts_and_minds.kunduz_valley/core/fnc/body/get.sqf
Normal file
38
hearts_and_minds.kunduz_valley/core/fnc/body/get.sqf
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_body_fnc_get
|
||||
|
||||
Description:
|
||||
Serialize dead bodies.
|
||||
|
||||
Parameters:
|
||||
_bodies - Bodies. [Array]
|
||||
|
||||
Returns:
|
||||
_serializedBodies - Serialized bodies. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[btc_body_deadPlayers] call btc_body_fnc_get;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_bodies", [], [[]]]
|
||||
];
|
||||
|
||||
private _serializedBodies = (_bodies - [objNull]) apply {[
|
||||
typeOf _x,
|
||||
getPosASL _x,
|
||||
getDir _x,
|
||||
getUnitLoadout _x,
|
||||
_x call btc_body_fnc_dogtagGet,
|
||||
_x in btc_chem_contaminated,
|
||||
getForcedFlagTexture _x
|
||||
]};
|
||||
|
||||
_serializedBodies
|
||||
29
hearts_and_minds.kunduz_valley/core/fnc/body/setBodyBag.sqf
Normal file
29
hearts_and_minds.kunduz_valley/core/fnc/body/setBodyBag.sqf
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_body_fnc_setBodyBag
|
||||
|
||||
Description:
|
||||
Set bodybag variable from a patient.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_body_fnc_setBodyBag;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params ["_patient", "_bodyBag"];
|
||||
|
||||
if (_patient getVariable ["btc_UID", ""] isEqualTo "") exitWith {};
|
||||
|
||||
deleteMarker (_patient getVariable ["btc_body_deadMarker", ""]);
|
||||
_bodyBag setVariable ["btc_UID", _patient getVariable ["btc_UID", ""]];
|
||||
|
||||
[_bodyBag] call btc_log_fnc_init;
|
||||
80
hearts_and_minds.kunduz_valley/core/fnc/cache/create.sqf
vendored
Normal file
80
hearts_and_minds.kunduz_valley/core/fnc/cache/create.sqf
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_cache_fnc_create
|
||||
|
||||
Description:
|
||||
Create a cache at btc_cache_pos position.
|
||||
|
||||
Parameters:
|
||||
_cache_pos - Position of the cache. [Array]
|
||||
_p_chem - Allow chemical cache. [Boolean]
|
||||
_probabilityChemical - Probability to create a chemical cache. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call {
|
||||
for [{_i=1},{_i<=360},{_i=_i+10}] do {
|
||||
[(allPlayers#0) getpos [10, _i], true, 0.7] call btc_cache_fnc_create;
|
||||
};
|
||||
};
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_cache_pos", btc_cache_pos, [[]]],
|
||||
["_p_chem", btc_p_chem_cache_probability > 0, [true]],
|
||||
["_probabilityChemical", btc_p_chem_cache_probability, [0]]
|
||||
];
|
||||
|
||||
private _isChem = false;
|
||||
if (_p_chem) then {
|
||||
_isChem = random 1 < _probabilityChemical;
|
||||
};
|
||||
private _cacheType = selectRandom (btc_cache_type select 0);
|
||||
btc_cache_obj = _cacheType createVehicle _cache_pos;
|
||||
btc_cache_obj setPosATL _cache_pos;
|
||||
btc_cache_obj setDir random 360;
|
||||
|
||||
clearWeaponCargoGlobal btc_cache_obj;
|
||||
clearItemCargoGlobal btc_cache_obj;
|
||||
clearMagazineCargoGlobal btc_cache_obj;
|
||||
clearBackpackCargoGlobal btc_cache_obj;
|
||||
|
||||
[btc_cache_obj, "HandleDamage", btc_cache_fnc_hd] remoteExecCall ["CBA_fnc_addBISEventHandler", 0, true];
|
||||
|
||||
if (_isChem) then {
|
||||
btc_chem_contaminated pushBack btc_cache_obj;
|
||||
publicVariable "btc_chem_contaminated";
|
||||
private _holder = createSimpleObject [selectRandom (btc_cache_type select 1), _cache_pos];
|
||||
[btc_cache_obj, _holder, "TOP", 0.1] call btc_cache_fnc_create_attachto;
|
||||
_holder setVectorDirAndUp [[0, 1, 0], [0, 0, 1]];
|
||||
} else {
|
||||
private _pos_type_array = ["TOP", "FRONT", "CORNER_L", "CORNER_R"];
|
||||
|
||||
for "_i" from 1 to (1 + round random 3) do {
|
||||
private _holder = createSimpleObject [selectRandom btc_cache_weapons_type, _cache_pos];
|
||||
|
||||
private _pos_type = selectRandom _pos_type_array;
|
||||
_pos_type_array = _pos_type_array - [_pos_type];
|
||||
[btc_cache_obj, _holder, _pos_type] call btc_cache_fnc_create_attachto;
|
||||
_holder hideSelection ["zasleh", true];
|
||||
};
|
||||
};
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["ID %1 POS %2", btc_cache_n, _cache_pos], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
if (btc_debug) then {
|
||||
[format ["in %1", _cache_pos], __FILE__, [btc_debug, false]] call btc_debug_fnc_message;
|
||||
private _marker = createMarker [format ["%1", _cache_pos], _cache_pos];
|
||||
_marker setMarkerType "mil_unknown";
|
||||
_marker setMarkerText format ["Cache %1", btc_cache_n];
|
||||
_marker setMarkerSize [0.8, 0.8];
|
||||
};
|
||||
72
hearts_and_minds.kunduz_valley/core/fnc/cache/create_attachto.sqf
vendored
Normal file
72
hearts_and_minds.kunduz_valley/core/fnc/cache/create_attachto.sqf
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_cache_fnc_create_attachto
|
||||
|
||||
Description:
|
||||
Attach holder to an object at the desired position.
|
||||
|
||||
Parameters:
|
||||
_object - Object where holders are attached. [Object]
|
||||
_holder - Object attached to _object [Object]
|
||||
_pos_type - Position ("TOP", "FRONT", "CORNER_L", "CORNER_R") where holder will be attached to object. [String]
|
||||
_offSet - Add verticale offset. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[btc_cache_obj, "groundWeaponHolder" createVehicle btc_cache_obj, "TOP"] call btc_cache_fnc_create_attachto;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_object", objNull, [objNull]],
|
||||
["_holder", objNull, [objNull]],
|
||||
["_pos_type", "", [""]],
|
||||
["_offSet", 0, [0]]
|
||||
];
|
||||
|
||||
private _bbr = (boundingBoxReal _object) params ["_p1", "_p2"];
|
||||
private _height_box = abs ((_p2 select 2) - (_p1 select 2));
|
||||
private _maxWidth_box = abs ((_p2 select 0) - (_p1 select 0));
|
||||
private _corner_box = abs ((_p2 select 2) - (_p1 select 2));
|
||||
|
||||
private _bbr = (boundingBoxReal _object) params ["_p1", "_p2"];
|
||||
private _height_weapon = abs ((_p2 select 2) - (_p1 select 2));
|
||||
|
||||
private _y = 0;
|
||||
private _p = 0;
|
||||
private _r = 0;
|
||||
|
||||
switch (_pos_type) do {
|
||||
case "FRONT": {
|
||||
_holder attachTo [_object, [- _maxWidth_box/6, 0, _height_weapon/2 - 0.15]];
|
||||
_y = 90;
|
||||
_p = -10;
|
||||
_r = 90;
|
||||
};
|
||||
case "CORNER_L": {
|
||||
_holder attachTo [_object, [- _maxWidth_box/6.5, _corner_box/2, _height_weapon/2 - 0.15]];
|
||||
_y = -70;
|
||||
_p = 10;
|
||||
_r = 90;
|
||||
};
|
||||
case "CORNER_R": {
|
||||
_holder attachTo [_object, [- _maxWidth_box/6.5, -_corner_box/2, _height_weapon/2 - 0.15]];
|
||||
_y = -110;
|
||||
_p = 10;
|
||||
_r = 90;
|
||||
};
|
||||
default { // TOP
|
||||
_holder attachTo [_object, [0, 0, _height_box/2 + 0.02 + _offSet]];
|
||||
_y = random 180;
|
||||
_p = 90;
|
||||
_r = 0;
|
||||
};
|
||||
};
|
||||
|
||||
_holder setVectorDirAndUp [[ sin _y * cos _p, cos _y * cos _p, sin _p], [[ sin _r, -sin _p, cos _r * cos _p], -_y] call BIS_fnc_rotateVector2D];
|
||||
45
hearts_and_minds.kunduz_valley/core/fnc/cache/find_pos.sqf
vendored
Normal file
45
hearts_and_minds.kunduz_valley/core/fnc/cache/find_pos.sqf
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_cache_fnc_find_pos
|
||||
|
||||
Description:
|
||||
Find a house in a city and spawn in it an ammo cache.
|
||||
|
||||
Parameters:
|
||||
_city_all - Array of cities where the ammo cache can be spawn. [Array]
|
||||
|
||||
Returns:
|
||||
- Position of the cache. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_cache_fnc_find_pos;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_city_all", values btc_city_all, [[]]]
|
||||
];
|
||||
|
||||
private _useful = _city_all select {_x getVariable ["occupied", false] && {!(_x getVariable ["type", ""] in ["NameLocal", "Hill", "NameMarine"])}};
|
||||
|
||||
if (_useful isEqualTo []) then {_useful = _city_all;};
|
||||
|
||||
private _city = selectRandom _useful;
|
||||
|
||||
if (_city getVariable ["type", ""] in ["NameLocal", "Hill", "NameMarine"]) exitWith {
|
||||
[] call btc_cache_fnc_find_pos;
|
||||
};
|
||||
|
||||
private _cachingRadius = _city getVariable ["cachingRadius", 200];
|
||||
private _houses = ([getPos _city, _cachingRadius/2] call btc_fnc_getHouses) select 0;
|
||||
|
||||
if (_houses isEqualTo []) then {
|
||||
[] call btc_cache_fnc_find_pos
|
||||
} else {
|
||||
ASLToATL AGLToASL selectRandom (selectRandom _houses buildingPos -1)
|
||||
}
|
||||
82
hearts_and_minds.kunduz_valley/core/fnc/cache/hd.sqf
vendored
Normal file
82
hearts_and_minds.kunduz_valley/core/fnc/cache/hd.sqf
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_cache_fnc_hd
|
||||
|
||||
Description:
|
||||
Destroy an ammo cache only when an explposive with damage > 0.6 is used.
|
||||
|
||||
Parameters:
|
||||
_cache - Object to destroy. [Object]
|
||||
_part - Not use. [String]
|
||||
_damage - Amount of damage get by the object. [Number]
|
||||
_injurer - Not use. [Object]
|
||||
_ammo - Type of ammo use to make damage. [String]
|
||||
_hitIndex - Hit part index of the hit point, -1 otherwise. [Number]
|
||||
_instigator - Person who pulled the trigger. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_cache_fnc_hd;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_cache", objNull, [objNull]],
|
||||
["_part", "", [""]],
|
||||
["_damage", 0, [0]],
|
||||
["_injurer", objNull, [objNull]],
|
||||
["_ammo", "", [""]],
|
||||
["_hitIndex", 0, [0]],
|
||||
["_instigator", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _explosive = getNumber (configFile >> "cfgAmmo" >> _ammo >> "explosive") > 0;
|
||||
|
||||
if (
|
||||
!(_cache getVariable ["btc_cache_fnc_hd_fired", false]) &&
|
||||
{_explosive} &&
|
||||
{_damage > 0.6}
|
||||
) then {
|
||||
_cache setVariable ["btc_cache_fnc_hd_fired", true];
|
||||
|
||||
if (!isServer) exitWith {
|
||||
_this remoteExecCall ["btc_cache_fnc_hd", 2];
|
||||
};
|
||||
|
||||
//Effects
|
||||
private _pos = getPosATL btc_cache_obj;
|
||||
"Bo_GBU12_LGB_MI10" createVehicle _pos;
|
||||
[{
|
||||
"M_PG_AT" createVehicle _this;
|
||||
[{
|
||||
"M_PG_AT" createVehicle _this;
|
||||
}, _this, random [0.5, 2, 3]] call CBA_fnc_waitAndExecute;
|
||||
}, _pos, random [0.5, 2, 3]] call CBA_fnc_waitAndExecute;
|
||||
[_pos] call btc_deaf_fnc_earringing;
|
||||
[attachedObjects _cache, btc_cache_obj, btc_cache_markers] call CBA_fnc_deleteEntity;
|
||||
|
||||
private _marker = createMarker [format ["btc_cache_%1", btc_cache_n], btc_cache_pos];
|
||||
_marker setMarkerType "hd_destroy";
|
||||
[_marker, "STR_BTC_HAM_O_EH_HDCACHE_MRK", btc_cache_n] remoteExecCall ["btc_fnc_set_markerTextLocal", [0, -2] select isDedicated, _marker]; //Cache %1 destroyed
|
||||
_marker setMarkerSize [1, 1];
|
||||
_marker setMarkerColor "ColorRed";
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["DESTROYED: ID %1 POS %2", btc_cache_n, btc_cache_pos], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
[btc_rep_bonus_cache, _instigator] call btc_rep_fnc_change;
|
||||
|
||||
//Notification
|
||||
[0] remoteExecCall ["btc_fnc_show_hint", 0];
|
||||
|
||||
[btc_cache_n + 1, btc_cache_pictures] call btc_cache_fnc_init;
|
||||
} else {
|
||||
0
|
||||
};
|
||||
38
hearts_and_minds.kunduz_valley/core/fnc/cache/init.sqf
vendored
Normal file
38
hearts_and_minds.kunduz_valley/core/fnc/cache/init.sqf
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_cache_fnc_init
|
||||
|
||||
Description:
|
||||
Initialise the ammo cache system with all necessary variable and start the search of a suitable position for it.
|
||||
|
||||
Parameters:
|
||||
_cache_n - Cache number. [Number]
|
||||
_cache_pictures - Array of building type. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[0, btc_cache_pictures] call btc_cache_fnc_init;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_cache_n", 0, [0]],
|
||||
["_cache_pictures", [[], [], []], [[]]]
|
||||
];
|
||||
|
||||
btc_cache_n = _cache_n;
|
||||
btc_cache_obj = objNull;
|
||||
btc_cache_markers = [];
|
||||
{
|
||||
remoteExecCall ["", _x];
|
||||
} forEach (_cache_pictures select 2);
|
||||
btc_cache_pictures = [[], [], []];
|
||||
btc_cache_info = btc_info_cache_def;
|
||||
btc_cache_pos = [values btc_city_all] call btc_cache_fnc_find_pos;
|
||||
[btc_cache_pos] call btc_cache_fnc_create;
|
||||
37
hearts_and_minds.kunduz_valley/core/fnc/chem/biopsy.sqf
Normal file
37
hearts_and_minds.kunduz_valley/core/fnc/chem/biopsy.sqf
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_chem_fnc_biopsy
|
||||
|
||||
Description:
|
||||
Do a biopsy to determine if the object is contaminated.
|
||||
|
||||
Parameters:
|
||||
_data - Data collected. [Array]
|
||||
_success - Does the biopsy has been correctly done. [Boolean]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[[player, "head", 50], true] call btc_chem_fnc_biopsy;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_data", [], [[]]],
|
||||
["_success", false, [true]]
|
||||
];
|
||||
|
||||
if !(_success) exitWith {_this};
|
||||
|
||||
private _obj = _data select 0;
|
||||
([
|
||||
localize "STR_BTC_HAM_O_CHEM_NOTCONTA",
|
||||
localize "STR_BTC_HAM_O_CHEM_CONTA"
|
||||
] select (_obj in btc_chem_contaminated)) call CBA_fnc_notify;
|
||||
|
||||
_this
|
||||
94
hearts_and_minds.kunduz_valley/core/fnc/chem/checkLoop.sqf
Normal file
94
hearts_and_minds.kunduz_valley/core/fnc/chem/checkLoop.sqf
Normal file
@@ -0,0 +1,94 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_chem_fnc_checkLoop
|
||||
|
||||
Description:
|
||||
Loop over chemical objects, showers and check if player/objects is around. If yes, decontaminate player/objects or set damage to player.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_chem_fnc_checkLoop;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
if !(btc_p_chem_sides || (btc_p_chem_cache_probability > 0)) exitWith {};
|
||||
|
||||
private _bodyParts = ["head","body","hand_l","hand_r","leg_l","leg_r"];
|
||||
|
||||
[{
|
||||
params ["_args", "_id"];
|
||||
_args params ["_contaminated", "_decontaminate", "_range", "_bodyParts", "_cfgGlasses"];
|
||||
|
||||
if (_contaminated isEqualTo []) exitWith {};
|
||||
|
||||
private _allUnitsUAV = [];
|
||||
{
|
||||
_allUnitsUAV append crew _x;
|
||||
} forEach allUnitsUAV;
|
||||
private _units = allUnits - _allUnitsUAV;
|
||||
private _objtToDecontaminate = [];
|
||||
private _unitsContaminated = _contaminated arrayIntersect _units;
|
||||
{
|
||||
(0 boundingBoxReal _x) params ["_p1", "_p2"];
|
||||
private _maxWidth = abs ((_p2 select 0) - (_p1 select 0));
|
||||
private _maxLength = abs ((_p2 select 1) - (_p1 select 1));
|
||||
private _maxHeight = abs ((_p2 select 2) - (_p1 select 2));
|
||||
private _sorted = _contaminated;
|
||||
if (_x isKindOf "DeconShower_01_F") then {
|
||||
_sorted = _unitsContaminated; // Small shower can only decontaminate units
|
||||
};
|
||||
_objtToDecontaminate append (_sorted inAreaArray [ASLToAGL getPosASL _x, _maxWidth/2, _maxLength/2, getDir _x, true, _maxHeight]);
|
||||
} forEach (_decontaminate select {_x animationSourcePhase "valve_source" isEqualTo 1});
|
||||
{
|
||||
if (!(local _x) && {_x in _units}) then {
|
||||
["btc_chem_decontaminated", [_x], _x] call CBA_fnc_targetEvent;
|
||||
};
|
||||
_contaminated deleteAt (_contaminated find _x);
|
||||
{
|
||||
if (!(local _x) && {_x in _units}) then {
|
||||
["btc_chem_decontaminated", [_x], _x] call CBA_fnc_targetEvent;
|
||||
};
|
||||
_contaminated deleteAt (_contaminated find _x);
|
||||
{
|
||||
_contaminated deleteAt (_contaminated find _x);
|
||||
} forEach (_x getVariable ["ace_cargo_loaded", []]);
|
||||
} forEach ((_x getVariable ["ace_cargo_loaded", []]) + crew _x);
|
||||
publicVariable "btc_chem_contaminated";
|
||||
} forEach _objtToDecontaminate;
|
||||
|
||||
if (_contaminated isEqualTo []) exitWith {};
|
||||
|
||||
private _unitContaminate = [];
|
||||
private _tempRange = _range;
|
||||
{
|
||||
if (_x in _units) then {
|
||||
_tempRange = _range / 1.5;
|
||||
};
|
||||
_unitContaminate append (_units inAreaArray [ASLToAGL getPosASL _x, _tempRange, _tempRange, 0, false, 2]);
|
||||
} forEach _contaminated;
|
||||
|
||||
if (_unitContaminate isEqualTo []) exitWith {};
|
||||
|
||||
private _periode = 3 / count _unitContaminate;
|
||||
{
|
||||
private _notAlready = _contaminated pushBackUnique _x > -1;
|
||||
if (_notAlready) then {
|
||||
publicVariable "btc_chem_contaminated";
|
||||
};
|
||||
if (local _x) then {
|
||||
[btc_chem_fnc_damage, [_x, _notAlready, _bodyParts, _cfgGlasses], _forEachIndex * _periode] call CBA_fnc_waitAndExecute;
|
||||
} else {
|
||||
if (_notAlready) then {
|
||||
[_x] remoteExecCall ["btc_chem_fnc_damageLoop", _x];
|
||||
};
|
||||
};
|
||||
} forEach _unitContaminate;
|
||||
}, 3.1, [btc_chem_contaminated, btc_chem_decontaminate, btc_chem_range, _bodyParts, configFile >> "CfgGlasses"]] call CBA_fnc_addPerFrameHandler;
|
||||
95
hearts_and_minds.kunduz_valley/core/fnc/chem/damage.sqf
Normal file
95
hearts_and_minds.kunduz_valley/core/fnc/chem/damage.sqf
Normal file
@@ -0,0 +1,95 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_chem_fnc_damage
|
||||
|
||||
Description:
|
||||
Apply chemical damage.
|
||||
|
||||
Parameters:
|
||||
_unit - Unit to apply the damage. [Object]
|
||||
_firstDamage - If no CBRN protection, true: Always apply damage, false: Damage are applied randomly. [Boolean]
|
||||
_bodyParts - List of body part. [Array]
|
||||
_cfgGlasses - Glasses config. [Config]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[cursorObject, true, ["head","body","hand_l","hand_r","leg_l","leg_r"], configFile >> "CfgGlasses"] call btc_chem_fnc_damage;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_unit", objNull, [objNull]],
|
||||
["_firstDamage", true, [true]],
|
||||
["_bodyParts", [], [[]]],
|
||||
["_cfgGlasses", configNull, [configNull]]
|
||||
];
|
||||
|
||||
private _googles = goggles _unit;
|
||||
private _backpack = backpack _unit;
|
||||
private _uniform = toLower uniform _unit;
|
||||
private _protection = 0;
|
||||
|
||||
if (
|
||||
[
|
||||
"G_Respirator_base_F"
|
||||
] findIf {_googles isKindOf [_x, _cfgGlasses]} > -1
|
||||
) then {
|
||||
_protection = _protection + selectRandom [0.15, 0.3]; // Less protection than respirator
|
||||
} else {
|
||||
if (
|
||||
[
|
||||
"G_RegulatorMask_base_F",
|
||||
"G_AirPurifyingRespirator_01_base_F",
|
||||
"GP21_GasmaskPS",
|
||||
"GP5Filter_RaspiratorPS",
|
||||
"GP7_RaspiratorPS",
|
||||
"SE_M17",
|
||||
"Hamster_PS",
|
||||
"SE_S10",
|
||||
"MK502"
|
||||
] findIf {_googles isKindOf [_x, _cfgGlasses]} > -1
|
||||
) then {
|
||||
_protection = _protection + 0.3;
|
||||
};
|
||||
};
|
||||
if (
|
||||
isPlayer _unit &&
|
||||
{_protection isEqualTo 0}
|
||||
) then {
|
||||
if (_unit getVariable ["ace_medical_pain", 0] < 0.9) then {
|
||||
[_unit, 0.01] call ace_medical_fnc_adjustPainLevel;
|
||||
};
|
||||
};
|
||||
if (
|
||||
[
|
||||
"B_SCBA_01_base_F",
|
||||
"B_CombinationUnitRespirator_01_Base_F"
|
||||
] findIf {_backpack isKindOf _x} > -1
|
||||
) then {
|
||||
_protection = _protection + 0.1;
|
||||
};
|
||||
if (_uniform isNotEqualTo "") then {
|
||||
_protection = _protection + 0.4;
|
||||
if (
|
||||
[
|
||||
"cbrn"
|
||||
] findIf {_x in _uniform} > -1
|
||||
) then {
|
||||
_protection = _protection + 0.2;
|
||||
};
|
||||
};
|
||||
|
||||
if (_protection >= 1) exitWith {_this};
|
||||
|
||||
if (_firstDamage || (random 1 > _protection)) then {
|
||||
_this set [1, false];
|
||||
[_unit, random [0.05, 0.05, 0.2], selectRandom _bodyParts, "stab"] call ace_medical_fnc_addDamageToUnit; // ropeburn
|
||||
};
|
||||
|
||||
_this
|
||||
56
hearts_and_minds.kunduz_valley/core/fnc/chem/damageLoop.sqf
Normal file
56
hearts_and_minds.kunduz_valley/core/fnc/chem/damageLoop.sqf
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_chem_fnc_damageLoop
|
||||
|
||||
Description:
|
||||
Apply chemical damage constantly.
|
||||
|
||||
Parameters:
|
||||
_unit - Unit to apply the damage. [Object]
|
||||
_notAlready - false if is already contaminated. [Boolean]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_chem_fnc_damageLoop;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_unit", player, [objNull]],
|
||||
["_notAlready", true, [true]]
|
||||
];
|
||||
|
||||
private _bodyParts = ["head","body","hand_l","hand_r","leg_l","leg_r"];
|
||||
private _handle = [{
|
||||
params ["_args", "_handle"];
|
||||
private _unit = _args select 0;
|
||||
|
||||
if !(alive _unit) exitWith {
|
||||
["btc_chem_decontaminated", [_unit]] call CBA_fnc_localEvent;
|
||||
};
|
||||
_this set [0, _args call btc_chem_fnc_damage];
|
||||
}, 3, [_unit, _notAlready, _bodyParts, configFile >> "CfgGlasses"]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
["btc_chem_decontaminated", {
|
||||
params ["_unitfromCallEvent"];
|
||||
_thisArgs params ["_handle", "_unit"];
|
||||
|
||||
if (_unitfromCallEvent isEqualTo _unit) then {
|
||||
[_thisType, _thisId] call CBA_fnc_removeEventHandler;
|
||||
[_handle] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
if (btc_debug || btc_debug_log) then {
|
||||
[format ["Stop: %1", _handle], __FILE__, [btc_debug, btc_debug_log]] call btc_debug_fnc_message;
|
||||
};
|
||||
};
|
||||
}, [_handle, _unit]] call CBA_fnc_addEventHandlerArgs;
|
||||
|
||||
if (btc_debug || btc_debug_log) then {
|
||||
[format ["Start: %1", _handle], __FILE__, [btc_debug, btc_debug_log]] call btc_debug_fnc_message;
|
||||
};
|
||||
39
hearts_and_minds.kunduz_valley/core/fnc/chem/ehDetector.sqf
Normal file
39
hearts_and_minds.kunduz_valley/core/fnc/chem/ehDetector.sqf
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_chem_fnc_ehDetector
|
||||
|
||||
Description:
|
||||
Trigger the screen update of the chemical detector when it is opened.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_chem_fnc_ehDetector;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
"btc_chem_detector" cutRsc ["RscWeaponChemicalDetector", "PLAIN", 1, false]; //IGUI display on
|
||||
|
||||
[{!isNull (findDisplay 46)}, {
|
||||
(findDisplay 46) displayAddEventHandler ["KeyDown", {
|
||||
params ["_display", "_key"];
|
||||
|
||||
if (
|
||||
(_key in actionKeys "Watch" || _key in actionKeys "WatchToggle") &&
|
||||
{!visibleWatch} &&
|
||||
{"ChemicalDetector_01_watch_F" in (assignedItems player)}
|
||||
) then {
|
||||
private _ui = uiNamespace getVariable "RscWeaponChemicalDetector";
|
||||
private _obj = _ui displayCtrl 101;
|
||||
|
||||
[{visibleWatch}, btc_chem_fnc_updateDetector, [_obj]] call CBA_fnc_waitUntilAndExecute;
|
||||
};
|
||||
}];
|
||||
}] call CBA_fnc_waitUntilAndExecute;
|
||||
@@ -0,0 +1,56 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_chem_fnc_handleShower
|
||||
|
||||
Description:
|
||||
Loop over shower and activate or desactivate them if objects are around.
|
||||
|
||||
Parameters:
|
||||
_minDistance - Minimal distance of shower triggered. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_chem_fnc_handleShower;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
if !(btc_p_chem_sides || (btc_p_chem_cache_probability > 0)) exitWith {};
|
||||
|
||||
params [
|
||||
["_minDistance", 5, [2]]
|
||||
];
|
||||
|
||||
[{
|
||||
params ["_args", "_id"];
|
||||
_args params ["_shower", "_minDistance"];
|
||||
|
||||
if (_shower isEqualTo []) exitWith {};
|
||||
|
||||
_needActivate = _shower select {
|
||||
_x animationSourcePhase "valve_source" isEqualTo 0 &&
|
||||
{(nearestObjects [_x, ["Car_F", "Man", "Strategic", "Constructions_base_F", "Cargo_base_F"], _minDistance]) isNotEqualTo []}
|
||||
};
|
||||
|
||||
_needDesactivate = _shower select {
|
||||
_x animationSourcePhase "valve_source" > 0 &&
|
||||
{(nearestObjects [_x, ["Car_F", "Man", "Strategic", "Constructions_base_F", "Cargo_base_F"], _minDistance]) isEqualTo []}
|
||||
};
|
||||
|
||||
{
|
||||
if (_x isKindOf "DeconShower_01_F") then {
|
||||
[_x, 1.5, 9] remoteExec ["BIN_fnc_deconShowerAnim", 0, _x];
|
||||
} else {
|
||||
[_x, 5.4, 4, 2, true] remoteExec ["btc_chem_fnc_deconShowerAnimLarge", 0, _x];
|
||||
};
|
||||
} forEach _needActivate;
|
||||
{
|
||||
remoteExecCall ["", _x];
|
||||
[_x] remoteExecCall ["BIN_fnc_deconShowerAnimStop", 0];
|
||||
} forEach _needDesactivate;
|
||||
}, 2, [btc_chem_decontaminate, _minDistance]] call CBA_fnc_addPerFrameHandler;
|
||||
43
hearts_and_minds.kunduz_valley/core/fnc/chem/propagate.sqf
Normal file
43
hearts_and_minds.kunduz_valley/core/fnc/chem/propagate.sqf
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_chem_fnc_propagate
|
||||
|
||||
Description:
|
||||
Propagate from the item or vehicle contaminated to the item or vehicle not contaminated.
|
||||
|
||||
Parameters:
|
||||
_item - Item. [Object]
|
||||
_vehicle - Vehicle. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[cursorObject, vehicle player] call btc_chem_fnc_propagate;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_item", objNull, [objNull, ""]],
|
||||
["_vehicle", objNull, [objNull]]
|
||||
];
|
||||
|
||||
if (_item isEqualType "") exitWith {_this};
|
||||
|
||||
if (_item in btc_chem_contaminated) then {
|
||||
if ((btc_chem_contaminated pushBackUnique _vehicle) > -1) then {
|
||||
publicVariable "btc_chem_contaminated";
|
||||
};
|
||||
} else {
|
||||
if (_vehicle in btc_chem_contaminated) then {
|
||||
if ((btc_chem_contaminated pushBackUnique _item) > -1) then {
|
||||
publicVariable "btc_chem_contaminated";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_this
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_chem_fnc_updateDetector
|
||||
|
||||
Description:
|
||||
Refresh chemical level on the chemical detector screen when it is open.
|
||||
|
||||
Parameters:
|
||||
_objt - Screen control. [Control]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
private _ui = uiNamespace getVariable "RscWeaponChemicalDetector";
|
||||
private _obj = _ui displayCtrl 101;
|
||||
[_obj] call btc_chem_fnc_updateDetector;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
[{
|
||||
params ["_arguments", "_idPFH"];
|
||||
_arguments params [
|
||||
["_obj", controlNull, [controlNull]]
|
||||
];
|
||||
|
||||
if !(visibleWatch) exitWith {
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
if (btc_chem_contaminated isEqualTo []) exitWith {
|
||||
_obj ctrlAnimateModel ["Threat_Level_Source", 0, true];
|
||||
};
|
||||
|
||||
private _level = selectMin (btc_chem_contaminated apply {player distance _x});
|
||||
if (_level < btc_chem_range) then {
|
||||
_level = 1;
|
||||
} else {
|
||||
_level = (floor (btc_chem_range / _level * 10)) / 10;
|
||||
};
|
||||
|
||||
_obj ctrlAnimateModel ["Threat_Level_Source", _level, true]; //Displaying a threat level (value between 0.0 and 1.0)
|
||||
}, 0.3, _this] call CBA_fnc_addPerFrameHandler;
|
||||
372
hearts_and_minds.kunduz_valley/core/fnc/city/activate.sqf
Normal file
372
hearts_and_minds.kunduz_valley/core/fnc/city/activate.sqf
Normal file
@@ -0,0 +1,372 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_activate
|
||||
|
||||
Description:
|
||||
Activate the city with the current id passed. This generate IED, random group, populate city with civilian and suicider. It also spawn military patrol and civilian.
|
||||
|
||||
Parameters:
|
||||
_city - City will be activating. [Number]
|
||||
_p_mil_group_ratio - Enemy density. [Number]
|
||||
_p_mil_static_group_ratio - Enemy static density. [Number]
|
||||
_p_civ_group_ratio - Civilian density. [Number]
|
||||
_p_animals_group_ratio - Animal density. [Number]
|
||||
_p_civ_max_veh - Maximum number of civilian patrol. [Number]
|
||||
_p_patrol_max - Maximum number of enemy patrol. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_city_fnc_activate;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_city", objNull, [objNull]],
|
||||
["_p_mil_group_ratio", btc_p_mil_group_ratio, [0]],
|
||||
["_p_mil_static_group_ratio", btc_p_mil_static_group_ratio, [0]],
|
||||
["_p_civ_group_ratio", btc_p_civ_group_ratio, [0]],
|
||||
["_p_animals_group_ratio", btc_p_animals_group_ratio, [0]],
|
||||
["_p_civ_max_veh", btc_p_civ_max_veh, [0]],
|
||||
["_p_patrol_max", btc_p_patrol_max, [0]]
|
||||
];
|
||||
|
||||
if (btc_debug) then {
|
||||
_city setVariable ["serverTime", serverTime];
|
||||
};
|
||||
|
||||
_city enableSimulation false;
|
||||
_city setVariable ["active", true];
|
||||
|
||||
private _data_units = _city getVariable ["data_units", []];
|
||||
private _data_animals = _city getVariable ["data_animals", []];
|
||||
private _type = _city getVariable ["type", ""];
|
||||
private _cachingRadius = _city getVariable ["cachingRadius", 100];
|
||||
private _has_en = _city getVariable ["occupied", false];
|
||||
private _has_ho = _city getVariable ["has_ho", false];
|
||||
private _ieds = _city getVariable ["ieds", []];
|
||||
private _spawningRadius = _cachingRadius/2;
|
||||
|
||||
if (!(_city getVariable ["initialized", false])) then {
|
||||
private _numberOfIED = (switch _type do {
|
||||
case "Hill" : {1};
|
||||
case "VegetationFir" : {1};
|
||||
case "BorderCrossing" : {2};
|
||||
case "NameLocal" : {2.5};
|
||||
case "StrongpointArea" : {3};
|
||||
case "NameVillage" : {3.5};
|
||||
case "NameCity" : {5};
|
||||
case "NameCityCapital" : {6};
|
||||
case "Airport" : {0};
|
||||
case "NameMarine" : {0};
|
||||
default {0};
|
||||
});
|
||||
|
||||
if (_has_en) then {
|
||||
_numberOfIED = _numberOfIED * 1.5;
|
||||
} else {
|
||||
_numberOfIED = _numberOfIED * 0.75;
|
||||
};
|
||||
if (_has_ho) then {
|
||||
_numberOfIED = _numberOfIED * 2;
|
||||
};
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["_numberOfIED %1 - p %2", _numberOfIED, _numberOfIED * btc_p_ied], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
_numberOfIED = _numberOfIED * btc_p_ied / 2;
|
||||
if (_numberOfIED > 0) then {
|
||||
[[_city, _spawningRadius, _numberOfIED + (random _numberOfIED)], btc_ied_fnc_initArea] call btc_delay_fnc_exec;
|
||||
};
|
||||
|
||||
_city setVariable ["initialized", true];
|
||||
};
|
||||
[_city, btc_ied_fnc_check] call btc_delay_fnc_exec;
|
||||
|
||||
private _delay = 0;
|
||||
if (_data_units isNotEqualTo []) then {
|
||||
{
|
||||
_delay = _delay + ([_x, _city, _spawningRadius] call btc_data_fnc_spawn_group);
|
||||
} forEach _data_units;
|
||||
} else {
|
||||
// Maximum number of enemy group
|
||||
private _numberOfGroup = (switch _type do {
|
||||
case "Hill" : {4};
|
||||
case "VegetationFir" : {4};
|
||||
case "BorderCrossing" : {7};
|
||||
case "NameLocal" : {7};
|
||||
case "StrongpointArea" : {8};
|
||||
case "NameVillage" : {8};
|
||||
case "NameCity" : {16};
|
||||
case "NameCityCapital" : {32};
|
||||
case "Airport" : {32};
|
||||
case "NameMarine" : {4};
|
||||
default {0};
|
||||
});
|
||||
|
||||
if (_has_en) then {
|
||||
private _finalNumberOfGroup = _p_mil_group_ratio * _numberOfGroup;
|
||||
private _numberOfHouseGroup = _finalNumberOfGroup * btc_p_mil_wp_houseDensity;
|
||||
for "_i" from 1 to round _finalNumberOfGroup do {
|
||||
[
|
||||
_city,
|
||||
[_spawningRadius, _spawningRadius/2] select (_i <= _numberOfHouseGroup),
|
||||
2 + round random 2,
|
||||
[["PATROL", "SENTRY"] selectRandomWeighted [0.7, 0.3], "HOUSE"] select (_i <= _numberOfHouseGroup)
|
||||
] call btc_mil_fnc_create_group;
|
||||
};
|
||||
};
|
||||
|
||||
if !(_type in ["Hill", "NameMarine"]) then {
|
||||
([_city, _spawningRadius/2] call btc_city_fnc_getHouses) params ["_housesEntrerable", "_housesNotEntrerable"];
|
||||
|
||||
if (_has_en) then {
|
||||
private _numberOfStatic = (switch _type do {
|
||||
case "VegetationFir" : {3};
|
||||
case "BorderCrossing" : {6};
|
||||
case "NameLocal" : {3};
|
||||
case "StrongpointArea" : {6};
|
||||
case "NameVillage" : {6};
|
||||
case "NameCity" : {12};
|
||||
case "NameCityCapital" : {15};
|
||||
case "Airport" : {6};
|
||||
default {0};
|
||||
});
|
||||
[_housesEntrerable+_housesNotEntrerable, round (_p_mil_static_group_ratio * _numberOfStatic), _city] call btc_mil_fnc_create_staticOnRoof;
|
||||
};
|
||||
|
||||
// Spawn civilians
|
||||
private _numberOfCivi = (switch _type do {
|
||||
case "VegetationFir" : {2};
|
||||
case "BorderCrossing" : {0};
|
||||
case "NameLocal" : {6};
|
||||
case "StrongpointArea" : {0};
|
||||
case "NameVillage" : {12};
|
||||
case "NameCity" : {20};
|
||||
case "NameCityCapital" : {38};
|
||||
case "Airport" : {12};
|
||||
default {4};
|
||||
});
|
||||
[+_housesEntrerable, round (_p_civ_group_ratio * _numberOfCivi), _city] call btc_civ_fnc_populate;
|
||||
};
|
||||
};
|
||||
if (btc_p_animals_group_ratio > 0) then {
|
||||
if (_data_animals isNotEqualTo []) then {
|
||||
{
|
||||
(_x + [nil, _city]) call btc_delay_fnc_createAgent;
|
||||
} forEach _data_animals;
|
||||
} else {
|
||||
// Spawn animals
|
||||
private _numberOfAnimalsGroup = (switch _type do {
|
||||
case "Hill" : {3};
|
||||
case "VegetationFir" : {3};
|
||||
case "NameLocal" : {3};
|
||||
case "NameVillage" : {2};
|
||||
case "NameCity" : {1};
|
||||
case "NameCityCapital" : {0};
|
||||
case "Airport" : {0};
|
||||
case "NameMarine" : {0};
|
||||
default {0};
|
||||
});
|
||||
for "_i" from 1 to _numberOfAnimalsGroup do {
|
||||
private _pos = [_city, _spawningRadius/3] call CBA_fnc_randPos;
|
||||
for "_i" from 1 to (round random 3) do {
|
||||
[selectRandom btc_animals_type, [_pos, 6] call CBA_fnc_randPos, nil, _city] call btc_delay_fnc_createAgent;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_city getVariable ["spawn_more", false]) then {
|
||||
_city setVariable ["spawn_more", false];
|
||||
private _finalNumberOfGroup = _p_mil_group_ratio * 5;
|
||||
private _numberOfHouseGroup = _finalNumberOfGroup * btc_p_mil_wp_houseDensity;
|
||||
for "_i" from 1 to round _finalNumberOfGroup do {
|
||||
[
|
||||
_city,
|
||||
[_spawningRadius, _spawningRadius/2] select (_i <= _numberOfHouseGroup),
|
||||
4 + round random 3,
|
||||
["PATROL", "HOUSE"] select (_i <= _numberOfHouseGroup)
|
||||
] call btc_mil_fnc_create_group;
|
||||
};
|
||||
if (btc_p_veh_armed_spawn_more) then {
|
||||
[[_city, _spawningRadius, 1, btc_type_motorized_armed, 1 + round random 2], btc_city_fnc_send] call btc_delay_fnc_exec;
|
||||
};
|
||||
};
|
||||
|
||||
if (
|
||||
(btc_cache_pos isNotEqualTo []) &&
|
||||
{_city inArea [btc_cache_pos, _cachingRadius, _cachingRadius, 0, false]}
|
||||
) then {
|
||||
if (btc_cache_obj getVariable ["btc_cache_unitsSpawned", false]) then {
|
||||
[[btc_cache_pos, 5], {
|
||||
if (count (btc_cache_pos nearEntities ["Man", 50]) > 3) exitWith {};
|
||||
[btc_cache_pos, 8, 3, "HOUSE"] call btc_mil_fnc_create_group;
|
||||
[btc_cache_pos, 50, 4, "SENTRY"] call btc_mil_fnc_create_group;
|
||||
}] call btc_delay_fnc_exec;
|
||||
} else {
|
||||
btc_cache_obj setVariable ["btc_cache_unitsSpawned", true];
|
||||
|
||||
[btc_cache_pos, 8, 3, "HOUSE"] call btc_mil_fnc_create_group;
|
||||
[btc_cache_pos, 50, 4, "SENTRY"] call btc_mil_fnc_create_group;
|
||||
if (btc_p_veh_armed_spawn_more) then {
|
||||
[[_city, _spawningRadius, 1, btc_type_motorized_armed, 1 + round random 3], btc_city_fnc_send] call btc_delay_fnc_exec;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_has_ho && {!(_city getVariable ["ho_units_spawned", false])}) then {
|
||||
_city setVariable ["ho_units_spawned", true];
|
||||
[_city, 20, 10 + round (_p_mil_group_ratio * random 6), "SENTRY"] call btc_mil_fnc_create_group;
|
||||
[_city, 120, 1 + round random 2, "SENTRY"] call btc_mil_fnc_create_group;
|
||||
[_city, 120, 1 + round random 2, "SENTRY"] call btc_mil_fnc_create_group;
|
||||
private _random = random 1;
|
||||
private _pos = getPos _city;
|
||||
switch (true) do {
|
||||
case (_random <= 0.3) : {};
|
||||
case (_random > 0.3 && _random <= 0.75) : {
|
||||
private _statics = btc_type_gl + btc_type_mg;
|
||||
[[(_pos select 0) + 7, (_pos select 1) + 7, 0], _statics, 45, [], _city] call btc_mil_fnc_create_static;
|
||||
};
|
||||
case (_random > 0.75) : {
|
||||
private _statics = btc_type_gl + btc_type_mg;
|
||||
[[(_pos select 0) + 7, (_pos select 1) + 7, 0], _statics, 45, [], _city] call btc_mil_fnc_create_static;
|
||||
[[(_pos select 0) - 7, (_pos select 1) - 7, 0], _statics, 225, [], _city] call btc_mil_fnc_create_static;
|
||||
};
|
||||
};
|
||||
if (btc_p_veh_armed_ho) then {
|
||||
[[_city, _spawningRadius, 1, btc_type_motorized_armed, 2 + round random 3], btc_city_fnc_send] call btc_delay_fnc_exec;
|
||||
};
|
||||
};
|
||||
|
||||
//Suicider
|
||||
if !(_city getVariable ["has_suicider", false]) then {
|
||||
if ((time - btc_ied_suic_spawned) > btc_ied_suic_time && {random (btc_rep_level_high + 250) > btc_global_reputation}) then {
|
||||
btc_ied_suic_spawned = time;
|
||||
_city setVariable ["has_suicider", true];
|
||||
if (selectRandom [false, false, btc_p_ied_drone]) then {
|
||||
[[_city, _spawningRadius, getPosATL _city], btc_ied_fnc_drone_create] call btc_delay_fnc_exec;
|
||||
} else {
|
||||
[[_city, _spawningRadius], btc_ied_fnc_suicider_create] call btc_delay_fnc_exec;
|
||||
};
|
||||
_delay = _delay + btc_delay_unit;
|
||||
};
|
||||
};
|
||||
|
||||
if (_city getVariable ["data_tags", []] isEqualTo []) then {
|
||||
private _tag_number = (switch _type do {
|
||||
case "Hill" : {1};
|
||||
case "BorderCrossing" : {1};
|
||||
case "NameLocal" : {2.5};
|
||||
case "StrongpointArea" : {3};
|
||||
case "NameVillage" : {3.5};
|
||||
case "NameCity" : {5};
|
||||
case "NameCityCapital" : {6};
|
||||
case "Airport" : {6};
|
||||
case "NameMarine" : {0};
|
||||
default {0};
|
||||
});
|
||||
|
||||
if (_has_en) then {
|
||||
_tag_number = _tag_number * 1.5;
|
||||
};
|
||||
if (_has_ho) then {
|
||||
_tag_number = _tag_number * 2;
|
||||
};
|
||||
|
||||
if (_tag_number > 0) then {
|
||||
[[_city, _spawningRadius, _tag_number / 2 + random _tag_number / 2], btc_tag_fnc_initArea] call btc_delay_fnc_exec;
|
||||
};
|
||||
};
|
||||
[_city, btc_tag_fnc_create] call btc_delay_fnc_exec;
|
||||
|
||||
if (
|
||||
!(_type in ["Hill", "NameMarine"]) &&
|
||||
_city getVariable ["btc_city_housesEntrerable", []] isEqualTo []
|
||||
) then {
|
||||
[[_city, _spawningRadius/2], btc_city_fnc_getHouses] call btc_delay_fnc_exec;
|
||||
};
|
||||
|
||||
[_city, btc_door_fnc_lock] call btc_delay_fnc_exec;
|
||||
|
||||
if (btc_p_info_houseDensity > 0) then {
|
||||
[_city, btc_info_fnc_createIntels] call btc_delay_fnc_exec;
|
||||
};
|
||||
|
||||
private _civKilled = _city getVariable ["btc_rep_civKilled", []];
|
||||
if (_civKilled isNotEqualTo []) then {
|
||||
[[_city, _civKilled], btc_civ_fnc_createFlower] call btc_delay_fnc_exec;
|
||||
};
|
||||
|
||||
private _grave = _city getVariable ["btc_rep_graves", []];
|
||||
if (_grave isNotEqualTo []) then {
|
||||
[[_city, _grave], btc_civ_fnc_createGrave] call btc_delay_fnc_exec;
|
||||
};
|
||||
|
||||
[{
|
||||
params ["_has_en", "_city", "_cachingRadius"];
|
||||
|
||||
if (_has_en) then {
|
||||
private _trigger = createTrigger ["EmptyDetector", _city, false];
|
||||
_trigger setTriggerArea [_cachingRadius, _cachingRadius, 0, false];
|
||||
_trigger setTriggerActivation [str btc_enemy_side, "PRESENT", false];
|
||||
_trigger setTriggerStatements [btc_p_city_free_trigger_condition, "[thisTrigger, thisList] call btc_city_fnc_setClear", ""];
|
||||
_trigger setTriggerInterval 2;
|
||||
_trigger setVariable ["playerTrigger", _city];
|
||||
_city setVariable ["enTrigger", _trigger];
|
||||
};
|
||||
|
||||
_city enableSimulation true;
|
||||
}, [_has_en, _city, _cachingRadius], _delay] call btc_delay_fnc_waitAndExecute;
|
||||
|
||||
//Patrol
|
||||
btc_patrol_active = btc_patrol_active - [grpNull];
|
||||
private _numberOfPatrol = count btc_patrol_active;
|
||||
if (_numberOfPatrol < _p_patrol_max) then {
|
||||
private _min = [0, 1] select _has_en;
|
||||
private _addMilPatrol = (_min + random 1) min (_p_patrol_max - _numberOfPatrol);
|
||||
for "_i" from 1 to round _addMilPatrol do {
|
||||
private _group = createGroup btc_enemy_side;
|
||||
btc_patrol_active pushBack _group;
|
||||
_group setVariable ["no_cache", true];
|
||||
_group setVariable ["acex_headless_blacklist", true];
|
||||
[[_group, 1 + round random 1, _city, _cachingRadius + btc_patrol_area], btc_mil_fnc_create_patrol] call btc_delay_fnc_exec;
|
||||
};
|
||||
};
|
||||
//Traffic
|
||||
btc_civ_veh_active = btc_civ_veh_active - [grpNull];
|
||||
private _numberOfCivVeh = count btc_civ_veh_active;
|
||||
if (_numberOfCivVeh < _p_civ_max_veh) then {
|
||||
private _addCivVeh = (random 2) min (_p_civ_max_veh - _numberOfCivVeh);
|
||||
for "_i" from 1 to round _addCivVeh do {
|
||||
private _group = createGroup civilian;
|
||||
btc_civ_veh_active pushBack _group;
|
||||
_group setVariable ["no_cache", true];
|
||||
_group setVariable ["acex_headless_blacklist", true];
|
||||
[[_group, _city, _cachingRadius + btc_patrol_area], btc_civ_fnc_create_patrol] call btc_delay_fnc_exec;
|
||||
};
|
||||
};
|
||||
|
||||
// https://feedback.bistudio.com/T162941
|
||||
private _HCs = entities "HeadlessClient_F";
|
||||
if (_HCs isNotEqualTo []) then {
|
||||
private _triggerZSize = (triggerArea _city) select 4;
|
||||
if (_triggerZSize isNotEqualTo -1) then {
|
||||
private _cityPos = getPosASL _city;
|
||||
private _HCPos = _cityPos vectorAdd [0, 0, -(_triggerZSize + 50)];
|
||||
{
|
||||
_x setPosASL _HCPos;
|
||||
} forEach _HCs;
|
||||
};
|
||||
};
|
||||
|
||||
if (btc_debug || btc_debug_log) then {
|
||||
private _id = _city getVariable "id";
|
||||
[format ["%1 - %2ms", _id, (serverTime - (_city getVariable ["serverTime", serverTime])) * 1000] , __FILE__, [btc_debug, btc_debug_log, true]] call btc_debug_fnc_message;
|
||||
};
|
||||
56
hearts_and_minds.kunduz_valley/core/fnc/city/cleanUp.sqf
Normal file
56
hearts_and_minds.kunduz_valley/core/fnc/city/cleanUp.sqf
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_cleanUp
|
||||
|
||||
Description:
|
||||
Delete all ground weapon holder (in range of 500 m), dead bodies (in range of 500 m) and empty group.
|
||||
|
||||
Parameters:
|
||||
_playableUnits - Players connected. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_city_fnc_cleanUp;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_playableUnits", playableUnits, [[]]]
|
||||
];
|
||||
|
||||
btc_groundWeaponHolder = btc_groundWeaponHolder - [objNull];
|
||||
private _toRemove = ((btc_groundWeaponHolder + (entities "WeaponHolderSimulated")) select {!(_x getVariable ["no_cache", false])}) select {
|
||||
private _obj = _x;
|
||||
|
||||
_playableUnits inAreaArray [getPosWorld _obj, 500, 500] isEqualTo []
|
||||
};
|
||||
|
||||
_toRemove append (allDead select {
|
||||
private _dead = _x;
|
||||
|
||||
(_playableUnits inAreaArray [getPosWorld _dead, 500, 500]) isEqualTo [] && !(_dead getVariable ["btc_dont_delete", false])
|
||||
});
|
||||
|
||||
_toRemove call CBA_fnc_deleteEntity;
|
||||
|
||||
if (btc_delay_time < 0.001) then { // Don't remove group during units creation.
|
||||
(allGroups select {
|
||||
units _x isEqualTo [] &&
|
||||
!(
|
||||
_x in btc_patrol_active ||
|
||||
_x in btc_civ_veh_active
|
||||
)
|
||||
}) call CBA_fnc_deleteEntity;
|
||||
};
|
||||
|
||||
while {objNull in btc_chem_contaminated} do {
|
||||
btc_chem_contaminated deleteAt (
|
||||
btc_chem_contaminated find objNull
|
||||
)
|
||||
};
|
||||
63
hearts_and_minds.kunduz_valley/core/fnc/city/create.sqf
Normal file
63
hearts_and_minds.kunduz_valley/core/fnc/city/create.sqf
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_create
|
||||
|
||||
Description:
|
||||
Create a city at the desired position with all necessary variable and the trigger to detect player presence.
|
||||
|
||||
Parameters:
|
||||
_position - The position where the city will be created. [Array]
|
||||
_type - Type of city. [String]
|
||||
_name - The name of the city. [String]
|
||||
_cachingRadius - The city radius. [Number]
|
||||
_has_en - If the city is occupied by enemies. [Boolean]
|
||||
_id - ID of the city in the cfgworlds. [Number]
|
||||
|
||||
Returns:
|
||||
_city - City created [Object]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_city = [[0, 0, 0], "NameCityCapital", "BTC Capital", 500, true] call btc_city_fnc_create;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_position", [0, 0, 0], [[]]],
|
||||
["_type", "", [""]],
|
||||
["_name", "", [""]],
|
||||
["_cachingRadius", 0, [0]],
|
||||
["_has_en", false, [false]],
|
||||
["_id", (0 min (selectMin keys btc_city_all)) - 1, [0]]
|
||||
];
|
||||
|
||||
private _city = createTrigger ["EmptyDetector", [_position select 0, _position select 1, getTerrainHeightASL _position], false];
|
||||
|
||||
btc_city_all set [_id, _city];
|
||||
_city setVariable ["id", _id];
|
||||
|
||||
_city setVariable ["initialized", false];
|
||||
_city setVariable ["name", _name];
|
||||
_city setVariable ["cachingRadius", _cachingRadius];
|
||||
_city setVariable ["active", false];
|
||||
_city setVariable ["type", _type];
|
||||
_city setVariable ["spawn_more", false];
|
||||
_city setVariable ["data_units", []];
|
||||
_city setVariable ["data_animals", []];
|
||||
_city setVariable ["occupied", _has_en];
|
||||
|
||||
if (btc_p_sea) then {
|
||||
_city setVariable ["hasbeach", ((selectBestPlaces [_position, 0.8 * _cachingRadius, "sea", 10, 1]) select 0 select 1) isEqualTo 1];
|
||||
};
|
||||
|
||||
[{
|
||||
(_this select 0) findEmptyPositionReady (_this select 1)
|
||||
}, {}, [_position, [0, _cachingRadius]], 5 * 60] call CBA_fnc_waitUntilAndExecute;
|
||||
|
||||
[_city, _cachingRadius] call btc_city_fnc_setPlayerTrigger;
|
||||
|
||||
_city
|
||||
117
hearts_and_minds.kunduz_valley/core/fnc/city/de_activate.sqf
Normal file
117
hearts_and_minds.kunduz_valley/core/fnc/city/de_activate.sqf
Normal file
@@ -0,0 +1,117 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_de_activate
|
||||
|
||||
Description:
|
||||
Desactivate the city by storing all groups present inside and clean up dead bodies.
|
||||
|
||||
Parameters:
|
||||
_city - City to desactivate. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_city_fnc_de_activate;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_city", objNull, [objNull]]
|
||||
];
|
||||
|
||||
if !(_city getVariable ["active", false]) exitWith {};
|
||||
|
||||
if (btc_debug) then {
|
||||
private _id = _city getVariable "id";
|
||||
[str _id, __FILE__, [btc_debug, btc_debug_log, true]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
//Save all and delete
|
||||
private _cachingRadius = _city getVariable ["cachingRadius", 0];
|
||||
private _has_en = _city getVariable ["occupied", false];
|
||||
|
||||
if (_has_en) then {
|
||||
private _trigger = _city getVariable ["enTrigger", objNull];
|
||||
deleteVehicle _trigger;
|
||||
};
|
||||
|
||||
private _pos_city = getPosWorld _city;
|
||||
private _data_units = [];
|
||||
private _has_suicider = false;
|
||||
{
|
||||
if (
|
||||
(leader _x) inArea [_pos_city, _cachingRadius, _cachingRadius, 0, false] &&
|
||||
{side _x != btc_player_side} &&
|
||||
{!(_x getVariable ["no_cache", false])} &&
|
||||
{_x getVariable ["btc_city", _city] in [_city, objNull]}
|
||||
) then {
|
||||
private _data_group = _x call btc_data_fnc_get_group;
|
||||
_data_units pushBack _data_group;
|
||||
|
||||
if ((_data_group select 0) in [5, 7]) then {_has_suicider = true;};
|
||||
};
|
||||
} forEach allGroups;
|
||||
|
||||
private _data_animals = [];
|
||||
{
|
||||
private _agent = agent _x;
|
||||
if (
|
||||
_agent inArea [_pos_city, _cachingRadius, _cachingRadius, 0, false] &&
|
||||
{alive _agent} &&
|
||||
{!(_x getVariable ["no_cache", false])} &&
|
||||
{_x getVariable ["btc_city", _city] in [_city, objNull]}
|
||||
) then {
|
||||
_data_animals pushBack [
|
||||
typeOf _agent,
|
||||
getPosATL _agent
|
||||
];
|
||||
_agent call CBA_fnc_deleteEntity;
|
||||
};
|
||||
} forEach agents;
|
||||
|
||||
private _data_tags = [];
|
||||
{
|
||||
if (_x getVariable ["btc_city", _city] isEqualTo _city) then {
|
||||
private _pos = getPos _x;
|
||||
_pos set [2, 0];
|
||||
_data_tags pushBack [
|
||||
_pos,
|
||||
[vectorDir _x, vectorUp _x],
|
||||
_x getVariable "btc_texture",
|
||||
typeOf _x
|
||||
];
|
||||
_x call CBA_fnc_deleteEntity;
|
||||
};
|
||||
} forEach (btc_tags_server inAreaArray [_pos_city, _cachingRadius, _cachingRadius]);
|
||||
btc_tags_server = btc_tags_server - [objNull];
|
||||
|
||||
{
|
||||
[_x] call btc_tag_fnc_vehicle;
|
||||
} forEach (btc_vehicles inAreaArray [_pos_city, _cachingRadius, _cachingRadius]);
|
||||
|
||||
(_city getVariable ["btc_city_intels", []]) call CBA_fnc_deleteEntity;
|
||||
|
||||
(_city getVariable ["btc_civ_flowers", []]) call CBA_fnc_deleteEntity;
|
||||
|
||||
(_city getVariable ["btc_civ_graves", []]) call CBA_fnc_deleteEntity;
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["count data_units = %1", count _data_units], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
[format ["count data_animals = %1", count _data_animals], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
[format ["count data_tags = %1", count _data_tags], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
_city setVariable ["has_suicider", _has_suicider];
|
||||
_city setVariable ["data_units", _data_units];
|
||||
_city setVariable ["data_animals", _data_animals];
|
||||
_city setVariable ["data_tags", _data_tags];
|
||||
_city setVariable ["active", false];
|
||||
|
||||
[] call btc_mil_fnc_check_cap;
|
||||
|
||||
[] call btc_city_fnc_cleanUp;
|
||||
37
hearts_and_minds.kunduz_valley/core/fnc/city/getHouses.sqf
Normal file
37
hearts_and_minds.kunduz_valley/core/fnc/city/getHouses.sqf
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_getHouses
|
||||
|
||||
Description:
|
||||
Get random open houses around a position.
|
||||
|
||||
Parameters:
|
||||
_city - City to search for houses. [Object]
|
||||
_radius - Radius of search. [Number]
|
||||
|
||||
Returns:
|
||||
_houses - Random useful open houses. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[player] call btc_city_fnc_getHouses;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_city", objNull, [objNull]],
|
||||
["_radius", 100, [0]]
|
||||
];
|
||||
|
||||
([_city, _radius] call btc_fnc_getHouses) params ["_housesEntrerable", "_housesNotEntrerable"];
|
||||
|
||||
_housesEntrerable = _housesEntrerable call BIS_fnc_arrayShuffle;
|
||||
_housesNotEntrerable = _housesNotEntrerable call BIS_fnc_arrayShuffle;
|
||||
_city setVariable ["btc_city_housesEntrerable", _housesEntrerable];
|
||||
_city setVariable ["btc_city_housesNotEntrerable", _housesNotEntrerable];
|
||||
|
||||
[_housesEntrerable, _housesNotEntrerable]
|
||||
86
hearts_and_minds.kunduz_valley/core/fnc/city/init.sqf
Normal file
86
hearts_and_minds.kunduz_valley/core/fnc/city/init.sqf
Normal file
@@ -0,0 +1,86 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_init
|
||||
|
||||
Description:
|
||||
Create cities all over the map and store those properties.
|
||||
|
||||
Parameters:
|
||||
_density_of_occupiedCity - Density of occupied city. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_city_fnc_init;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_density_of_occupiedCity", btc_p_density_of_occupiedCity, [0]]
|
||||
];
|
||||
|
||||
private _locations = configfile >> "cfgworlds" >> worldname >> "names";
|
||||
|
||||
private _citiesType = ["NameVillage", "NameCity", "NameCityCapital", "NameLocal", "Hill", "Airport", "StrongpointArea", "BorderCrossing", "VegetationFir"];
|
||||
if (btc_p_sea) then {_citiesType pushBack "NameMarine";};
|
||||
|
||||
btc_city_all = createHashMap;
|
||||
for "_id" from 0 to (count _locations - 1) do {
|
||||
private _current = _locations select _id;
|
||||
|
||||
private _type = getText (_current >> "type");
|
||||
|
||||
if (_type in _citiesType) then {
|
||||
private _position = getArray (_current >> "position");
|
||||
if (
|
||||
surfaceIsWater _position &&
|
||||
{_type isNotEqualTo "NameMarine"} &&
|
||||
{getTerrainHeightASL _position < - 1}
|
||||
) then {
|
||||
private _church = nearestTerrainObjects [_position, ["CHURCH"], 470];
|
||||
if (_church isEqualTo []) then {
|
||||
private _area = 50;
|
||||
for "_i" from 0 to 3 do {
|
||||
private _new_position = [_position, 0, _area, 0.5, 0, -1, 0] call BIS_fnc_findSafePos;
|
||||
if (count _new_position isEqualTo 2) exitWith {
|
||||
_position = _new_position;
|
||||
};
|
||||
_area = _area * 2;
|
||||
};
|
||||
} else {
|
||||
_position = getPos (_church select 0);
|
||||
};
|
||||
};
|
||||
private _name = getText(_current >> "name");
|
||||
private _cachingRadius = getNumber(_current >> "RadiusA") + getNumber(_current >> "RadiusB");
|
||||
_cachingRadius = (_cachingRadius max 160) min 800;
|
||||
|
||||
if (btc_city_blacklist find _name >= 0) exitWith {};
|
||||
|
||||
|
||||
//if you want a safe area
|
||||
if ((getMarkerPos "btc_base") inArea [_position, 1000, 1000, 0, false]) exitWith {};
|
||||
|
||||
|
||||
[_position, _type, _name, _cachingRadius, false, _id] call btc_city_fnc_create;
|
||||
};
|
||||
};
|
||||
|
||||
private _cities = values btc_city_all;
|
||||
[_cities, true] call CBA_fnc_shuffle;
|
||||
private _numberOfCity = round ((count _cities) * _density_of_occupiedCity);
|
||||
{
|
||||
_x setVariable ["occupied", true];
|
||||
if (btc_debug) then {
|
||||
(format ["loc_%1", _x getVariable "id"]) setMarkerColor "colorRed";
|
||||
};
|
||||
} forEach (_cities select [0, _numberOfCity]);
|
||||
|
||||
if !(isNil "btc_custom_loc") then {
|
||||
{_x call btc_city_fnc_create;} forEach btc_custom_loc;
|
||||
};
|
||||
44
hearts_and_minds.kunduz_valley/core/fnc/city/send.sqf
Normal file
44
hearts_and_minds.kunduz_valley/core/fnc/city/send.sqf
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_send
|
||||
|
||||
Description:
|
||||
Send a group of units to a location then call btc_data_fnc_add_group. If player is around, initiate patrol around the destination, ifnot save in database and delete units.
|
||||
|
||||
Parameters:
|
||||
_dest - Destination. [Array, Object]
|
||||
_spawningRadius - Random area for destination. [Number]
|
||||
_typeOf_patrol - Infantry or motorized. [String]
|
||||
_veh_types - Vehicle types for motorized. [String]
|
||||
_sendMultipleGroup - Number of group to send. [Number]
|
||||
|
||||
Returns:
|
||||
_group - Created group. [Group]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[allPlayers#0, getPos (allPlayers#0)] call btc_city_fnc_send
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_dest", [0, 0, 0], [[], objNull]],
|
||||
["_spawningRadius", 0, [0]],
|
||||
["_typeOf_patrol", 0, [0]],
|
||||
["_veh_types", [], [[]]],
|
||||
["_sendMultipleGroup", 1, [1]]
|
||||
];
|
||||
|
||||
private _closest = [
|
||||
_dest,
|
||||
values btc_city_all select {!(_x getVariable ["active", false])},
|
||||
false
|
||||
] call btc_fnc_find_closecity;
|
||||
|
||||
for "_i" from 1 to _sendMultipleGroup do {
|
||||
[_closest, [_dest, _spawningRadius / 2] call CBA_fnc_randPos, _typeOf_patrol, selectRandom _veh_types] call btc_mil_fnc_send;
|
||||
};
|
||||
53
hearts_and_minds.kunduz_valley/core/fnc/city/setClear.sqf
Normal file
53
hearts_and_minds.kunduz_valley/core/fnc/city/setClear.sqf
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_setClear
|
||||
|
||||
Description:
|
||||
Define a city with the corresponding ID as clear (no more occupied).
|
||||
|
||||
Parameters:
|
||||
_trigger - Enemy trigger with no more enemy. [Number]
|
||||
_remainEnemyUnits - Remaining enemy units assigned to the city. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_city_fnc_setClear;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_trigger", objNull, [objNull]],
|
||||
["_remainEnemyUnits", [], [[]]]
|
||||
];
|
||||
|
||||
private _city = _trigger getVariable "playerTrigger";
|
||||
_city setVariable ["occupied", false];
|
||||
|
||||
if (_remainEnemyUnits isNotEqualTo []) then {
|
||||
{
|
||||
if (unitIsUAV _x) then {
|
||||
_x setDamage 1;
|
||||
} else {
|
||||
[_x, true] call ace_captives_fnc_setSurrendered;
|
||||
};
|
||||
} forEach _remainEnemyUnits;
|
||||
};
|
||||
|
||||
if (_city getVariable ["marker", ""] != "") then {
|
||||
(_city getVariable ["marker", ""]) setMarkerColor "ColorGreen";
|
||||
};
|
||||
|
||||
if (btc_final_phase) then {
|
||||
btc_city_remaining = btc_city_remaining - [_city];
|
||||
};
|
||||
|
||||
if (btc_debug) then {
|
||||
private _id = _city getVariable "id";
|
||||
(format ["loc_%1", _id]) setMarkerColor "ColorGreen";
|
||||
};
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_setPlayerTrigger
|
||||
|
||||
Description:
|
||||
Set trigger properties to detect player presence.
|
||||
|
||||
Parameters:
|
||||
_trigger - City. [Object]
|
||||
_cachingRadius - Radius of the location. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[_trigger, _cachingRadius] call btc_city_fnc_setPlayerTrigger;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_trigger", objNull, [objNull]],
|
||||
["_cachingRadius", 0, [0]]
|
||||
];
|
||||
|
||||
_trigger setTriggerArea [_cachingRadius + btc_city_radiusOffset, _cachingRadius + btc_city_radiusOffset, 0, false, 800];
|
||||
_trigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];
|
||||
_trigger setTriggerStatements [btc_p_trigger, "thisTrigger call btc_city_fnc_activate", "thisTrigger call btc_city_fnc_de_activate"];
|
||||
|
||||
if (btc_debug) then {
|
||||
private _id = _trigger getVariable "id";
|
||||
private _has_en = _trigger getVariable "occupied";
|
||||
private _name = _trigger getVariable "name";
|
||||
private _type = _trigger getVariable "type";
|
||||
|
||||
private _marker = createMarker [format ["loc_%1", _id], _trigger];
|
||||
_marker setMarkerShape "ELLIPSE";
|
||||
_marker setMarkerBrush "SolidBorder";
|
||||
_marker setMarkerSize [_cachingRadius + btc_city_radiusOffset, _cachingRadius + btc_city_radiusOffset];
|
||||
_marker setMarkerAlpha 0.3;
|
||||
_marker setMarkerColor (["colorGreen", "colorRed"] select _has_en);
|
||||
_trigger setVariable ["marker", _marker];
|
||||
|
||||
private _marke = createMarker [format ["locn_%1", _id], _trigger];
|
||||
_marke setMarkerType "Contact_dot1";
|
||||
private _spaces = "";
|
||||
for "_i" from 0 to count _name -1 do {
|
||||
_spaces = _spaces + " ";
|
||||
};
|
||||
_marke setMarkerText format [_spaces + "%1 ID %2 - %3", _type, _id, _trigger getVariable ["hasbeach", "empty"]];
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_city_fnc_trigger_free_condition
|
||||
|
||||
Description:
|
||||
Check if a city should be free.
|
||||
|
||||
Parameters:
|
||||
_remainEnemyUnits - Remaining enemy units assigned to the city, passed by the trigger. [Array]
|
||||
_p_city_free_trigger - Minimum number of units to consider a city free. [Number]
|
||||
|
||||
Returns:
|
||||
_return - If the city should be free. [Boolean]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[allUnits inAreaArray [getPos player, 100, 100], 2] call btc_city_fnc_trigger_free_condition;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
GoldJohnKing
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_remainEnemyUnits", [], [[]]],
|
||||
["_p_city_free_trigger", 0, [0]]
|
||||
];
|
||||
|
||||
if (count _remainEnemyUnits > _p_city_free_trigger) exitWith {false};
|
||||
_remainEnemyUnits findIf {
|
||||
private _veh = vehicle _x;
|
||||
!(
|
||||
_veh isKindOf "Man" ||
|
||||
{unitIsUAV _veh}
|
||||
)
|
||||
} isEqualTo -1
|
||||
52
hearts_and_minds.kunduz_valley/core/fnc/civ/addWP.sqf
Normal file
52
hearts_and_minds.kunduz_valley/core/fnc/civ/addWP.sqf
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_addWP
|
||||
|
||||
Description:
|
||||
Add waypoints to a group. The group will patrol inside a first house, then 4 waypoints outside are added and finally the group will patrol again in an other house.
|
||||
|
||||
Parameters:
|
||||
_group - Group where waypoints will be added. [Group]
|
||||
_pos - Position to search house and position to patrol. [Array]
|
||||
_radius - Radius number to search around the position. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[_group] call btc_civ_fnc_addWP;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_group", grpNull, [grpNull]],
|
||||
["_pos", getPos leader param [0], [[]]],
|
||||
["_radius", 50, [0]]
|
||||
];
|
||||
|
||||
[_group] call CBA_fnc_clearWaypoints;
|
||||
[_group, _pos, -1, "MOVE", "SAFE", "NO CHANGE", "LIMITED"] call CBA_fnc_addWaypoint;
|
||||
|
||||
private _houses = ([_pos, _radius] call btc_fnc_getHouses) select 0;
|
||||
if (_houses isNotEqualTo []) then {
|
||||
private _house = selectRandom _houses;
|
||||
[_group, _house] call btc_fnc_house_addWP_loop;
|
||||
_houses = _houses - [_house];
|
||||
};
|
||||
|
||||
for "_i" from 1 to 4 do {
|
||||
private _wp_pos = [_pos, _radius] call btc_fnc_randomize_pos;
|
||||
[_group, _wp_pos, -1, "MOVE"] call CBA_fnc_addWaypoint;
|
||||
};
|
||||
|
||||
if (_houses isNotEqualTo []) then {
|
||||
private _house = selectRandom _houses;
|
||||
[_group, _house] call btc_fnc_house_addWP_loop;
|
||||
_houses = _houses - [_house];
|
||||
};
|
||||
|
||||
[_group, _pos, -1, "CYCLE"] call CBA_fnc_addWaypoint;
|
||||
45
hearts_and_minds.kunduz_valley/core/fnc/civ/add_grenade.sqf
Normal file
45
hearts_and_minds.kunduz_valley/core/fnc/civ/add_grenade.sqf
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_add_grenade
|
||||
|
||||
Description:
|
||||
Add grenade to a unit.
|
||||
|
||||
Parameters:
|
||||
_unit - Unit where a grenade will be added. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[_unit] call btc_civ_fnc_add_grenade;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_unit", objNull, [objNull]]
|
||||
];
|
||||
|
||||
_unit addMagazines [selectRandom btc_g_civs, 1];
|
||||
|
||||
_unit addEventHandler ["Fired", {
|
||||
params ["_unit", "_weapon"];
|
||||
|
||||
if (_weapon isEqualTo "Throw") then {
|
||||
_unit removeEventHandler ["Fired", _thisEventHandler];
|
||||
|
||||
private _group = createGroup [civilian, true];
|
||||
_group setVariable ["btc_city", group _unit getVariable ["btc_city", objNull]];
|
||||
[_unit] joinSilent _group;
|
||||
|
||||
[{
|
||||
params ["_unit"];
|
||||
|
||||
[group _unit] call btc_civ_fnc_addWP;
|
||||
}, [_unit], 20] call CBA_fnc_waitAndExecute;
|
||||
};
|
||||
}];
|
||||
49
hearts_and_minds.kunduz_valley/core/fnc/civ/add_leaflets.sqf
Normal file
49
hearts_and_minds.kunduz_valley/core/fnc/civ/add_leaflets.sqf
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_add_leaflets
|
||||
|
||||
Description:
|
||||
Add leaflets to drone which have parents classe: UAV_06_base_F and UAV_01_base_F.
|
||||
|
||||
Parameters:
|
||||
_player - Not used. [Object]
|
||||
_uav - Drone where leaflets will be added. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[_player, _uav] call btc_civ_fnc_add_leaflets;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_player", objNull, [objNull]],
|
||||
["_uav", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _isUAV6 = _uav isKindOf "UAV_06_base_F";
|
||||
|
||||
if !(_isUAV6 || _uav isKindOf "UAV_01_base_F") exitWith {};
|
||||
|
||||
private _turret = [0, -1] select (_isUAV6);
|
||||
|
||||
_uav addMagazine "1Rnd_Leaflets_West_F";
|
||||
if !("Bomb_Leaflets" in (_uav weaponsTurret [_turret])) then {
|
||||
_uav addWeapon "Bomb_Leaflets";
|
||||
};
|
||||
_uav selectWeaponTurret ["Bomb_Leaflets", [_turret]];
|
||||
if (needReload _uav isEqualTo 1) then {reload _uav};
|
||||
|
||||
if ((_uav getVariable ["btc_leaflets_eh_added" , -1]) isEqualTo -1) then {
|
||||
private _id_f = _uav addEventHandler ["Fired", btc_civ_fnc_leaflets];
|
||||
_uav setVariable ["btc_leaflets_eh_added", _id_f];
|
||||
|
||||
if (btc_debug) then {
|
||||
[format ["EventHandler ID: %1", _id_f], __FILE__, [btc_debug, false]] call btc_debug_fnc_message;
|
||||
};
|
||||
};
|
||||
31
hearts_and_minds.kunduz_valley/core/fnc/civ/add_weapons.sqf
Normal file
31
hearts_and_minds.kunduz_valley/core/fnc/civ/add_weapons.sqf
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_add_weapons
|
||||
|
||||
Description:
|
||||
Add weapon to a unit.
|
||||
|
||||
Parameters:
|
||||
_unit - Unit where a weapon will be added. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[_unit] call btc_civ_fnc_add_weapons;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_unit", objNull, [objNull]],
|
||||
["_weapon", "", [""]],
|
||||
["_magazine", "", [""]]
|
||||
];
|
||||
|
||||
(uniformContainer _unit) addMagazineCargo [_magazine, 5];
|
||||
_unit addWeapon _weapon;
|
||||
_unit selectWeapon _weapon;
|
||||
82
hearts_and_minds.kunduz_valley/core/fnc/civ/class.sqf
Normal file
82
hearts_and_minds.kunduz_valley/core/fnc/civ/class.sqf
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_class
|
||||
|
||||
Description:
|
||||
Return civilian classe names sorted by units, boats and vehicules based on faction name.
|
||||
|
||||
Parameters:
|
||||
_factions - Faction name used to get civilian classe name sorted. [Array]
|
||||
|
||||
Returns:
|
||||
_civilian_classe_names - Array of units, boats and vehicules classe names. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_civilian_classe_names = ["CIV_F"] call btc_civ_fnc_class;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_factions", [], [[]]]
|
||||
];
|
||||
|
||||
private _type_units = [];
|
||||
private _type_boats = [];
|
||||
private _type_veh = [];
|
||||
|
||||
//Get all vehicles
|
||||
private _cfgVehicles = configFile >> "CfgVehicles";
|
||||
private _allClass = ("(configName _x) isKindOf 'AllVehicles'" configClasses _cfgVehicles) apply {configName _x};
|
||||
_allClass = _allClass select {getNumber(_cfgVehicles >> _x >> "scope") isEqualTo 2};
|
||||
|
||||
//Check if faction existe
|
||||
private _cfgFactionClasses = configFile >> "CfgFactionClasses";
|
||||
_factions = _factions apply {
|
||||
if !(isClass(_cfgFactionClasses >> _x)) then {
|
||||
"CIV_F"
|
||||
} else {
|
||||
_x
|
||||
};
|
||||
};
|
||||
|
||||
{
|
||||
private _faction = _x;
|
||||
|
||||
//Get all vehicles of the _faction selected
|
||||
private _allClass_f = _allClass select {(toUpper getText(_cfgVehicles >> _x >> "faction")) isEqualTo _faction};
|
||||
|
||||
//Units
|
||||
_type_units append (_allClass_f select {_x isKindOf "Man"});
|
||||
|
||||
//Vehicles
|
||||
_type_boats append (_allClass_f select {_x isKindOf "Ship"});
|
||||
|
||||
_type_veh append (_allClass_f select {(_x isKindOf "Car") || (_x isKindOf "Truck") || (_x isKindOf "Truck_F")});
|
||||
|
||||
} forEach _factions;
|
||||
|
||||
//Handle if no class name is found
|
||||
if (_type_units isEqualTo []) then {
|
||||
_type_units = ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_polo_1_F","C_man_polo_1_F_afro","C_man_polo_1_F_euro","C_man_polo_1_F_asia","C_man_polo_2_F","C_man_polo_2_F_afro","C_man_polo_2_F_euro","C_man_polo_2_F_asia","C_man_polo_3_F","C_man_polo_3_F_afro","C_man_polo_3_F_euro","C_man_polo_3_F_asia","C_man_polo_4_F","C_man_polo_4_F_afro","C_man_polo_4_F_euro","C_man_polo_4_F_asia","C_man_polo_5_F","C_man_polo_5_F_afro","C_man_polo_5_F_euro","C_man_polo_5_F_asia","C_man_polo_6_F","C_man_polo_6_F_afro","C_man_polo_6_F_euro","C_man_polo_6_F_asia","C_man_p_fugitive_F","C_man_p_fugitive_F_afro","C_man_p_fugitive_F_euro","C_man_p_fugitive_F_asia","C_man_p_beggar_F","C_man_p_beggar_F_afro","C_man_p_beggar_F_euro","C_man_p_beggar_F_asia","C_man_w_worker_F","C_man_hunter_1_F","C_Orestes","C_Nikos","C_Man_casual_4_F","C_Man_casual_5_F","C_Man_casual_6_F","C_Man_sport_1_F","C_Man_sport_2_F","C_Man_sport_3_F","C_Man_casual_1_F","C_Man_casual_2_F","C_Man_casual_3_F"]
|
||||
};
|
||||
if (_type_boats isEqualTo []) then {
|
||||
_type_boats = ["C_Rubberboat","C_Boat_Civil_01_F","C_Boat_Civil_01_rescue_F","C_Boat_Civil_01_police_F","C_Boat_Transport_02_F","C_Scooter_Transport_01_F"];
|
||||
};
|
||||
if (_type_veh isEqualTo []) then {
|
||||
_type_veh = ["C_Hatchback_01_F","C_SUV_01_F","C_Offroad_01_F","C_Van_01_transport_F","C_Van_01_box_F","C_Truck_02_transport_F","C_Truck_02_covered_F","C_Offroad_02_unarmed_F"]
|
||||
};
|
||||
|
||||
//Final filter unwanted units type
|
||||
_type_units = _type_units select {
|
||||
getText (_cfgVehicles >> _x >> "role") isNotEqualTo "Crewman" &&
|
||||
(_x find "_unarmed_") isEqualTo -1 &&
|
||||
getText (_cfgVehicles >> _x >> "vehicleClass") isNotEqualTo "MenVR"
|
||||
};
|
||||
_type_veh = _type_veh select {(getNumber (_cfgVehicles >> _x >> "isUav") isNotEqualTo 1) && !(_x isKindOf "Kart_01_Base_F")};
|
||||
|
||||
[_type_units, _type_boats, _type_veh]
|
||||
39
hearts_and_minds.kunduz_valley/core/fnc/civ/createFlower.sqf
Normal file
39
hearts_and_minds.kunduz_valley/core/fnc/civ/createFlower.sqf
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_createFlower
|
||||
|
||||
Description:
|
||||
Add flower bouquets next to killed civilians.
|
||||
|
||||
Parameters:
|
||||
_city - City. [Object]
|
||||
_civKilled - Array of previous killed civilians. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[btc_city_all get 0, [[getPosASL player, getDir player]]] call btc_civ_fnc_createFlower;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_city", objNull, [objNull]],
|
||||
["_civKilled", [], [[]]]
|
||||
];
|
||||
|
||||
_city setVariable [
|
||||
"btc_civ_flowers",
|
||||
_civKilled apply {
|
||||
_x params ["_posASL", "_dir"];
|
||||
|
||||
private _flowers = createSimpleObject [selectRandom btc_type_flowers, _posASL];
|
||||
_flowers setDir _dir;
|
||||
|
||||
_flowers
|
||||
}
|
||||
];
|
||||
50
hearts_and_minds.kunduz_valley/core/fnc/civ/createGrave.sqf
Normal file
50
hearts_and_minds.kunduz_valley/core/fnc/civ/createGrave.sqf
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_createGrave
|
||||
|
||||
Description:
|
||||
Create graves and add flower bouquets next to them.
|
||||
|
||||
Parameters:
|
||||
_city - City. [Object]
|
||||
_graves - Array of grave around city. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[btc_city_all get 1, [[getPosASL player, getDir player, "ACE_Grave"]]] call btc_civ_fnc_createGrave;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_city", objNull, [objNull]],
|
||||
["_graves", [], [[]]]
|
||||
];
|
||||
|
||||
_city setVariable [
|
||||
"btc_civ_graves",
|
||||
_graves apply {
|
||||
_x params ["_posASL", "_dir", "_graveType"];
|
||||
|
||||
private _grave = createVehicle [_graveType, [0, 0, 0], [], 0, "NONE"];
|
||||
_grave setPosASL _posASL;
|
||||
_grave setDir _dir;
|
||||
_grave setVectorUp surfaceNormal _posASL;
|
||||
|
||||
_flowers = [];
|
||||
for "_i" from 0 to (1 + round random 2) do {
|
||||
_flowers pushBack createSimpleObject [
|
||||
selectRandom btc_type_flowers,
|
||||
[[_posASL vectorAdd [0, 0, 0.2], 0.2, 0.8, _dir, true]] call CBA_fnc_randPosArea
|
||||
];
|
||||
(_flowers select _i) setDir random 360;
|
||||
};
|
||||
|
||||
[_flowers, _grave]
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_create_patrol
|
||||
|
||||
Description:
|
||||
Create a civilian patrol around a city in a defined area.
|
||||
|
||||
Parameters:
|
||||
_group - Group of the traffic. [Group]
|
||||
_active_city - City where the patrol will be done around. [Object]
|
||||
_area - Area to search a start and an end city for the patrol [Number]
|
||||
|
||||
Returns:
|
||||
_isCreated - return true if the patrol is created. [Boolean]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_isCreated = [createGroup civilian, _active_city] call btc_civ_fnc_create_patrol;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_group", grpNull, [grpNull]],
|
||||
["_active_city", objNull, [objNull]],
|
||||
["_area", btc_patrol_area, [0]]
|
||||
];
|
||||
|
||||
if (isNil "btc_civilian_id") then {btc_civilian_id = -1;};
|
||||
|
||||
//Find a city
|
||||
private _cities = values btc_city_all inAreaArray [getPosWorld _active_city, _area, _area];
|
||||
private _usefuls = _cities select {!(_x getVariable ["active", false])};
|
||||
if (_usefuls isEqualTo []) exitWith {
|
||||
_group call CBA_fnc_deleteEntity;
|
||||
false
|
||||
};
|
||||
|
||||
private _start_city = selectRandom _usefuls;
|
||||
private _pos = getPos _start_city;
|
||||
|
||||
private _pos_isWater = false;
|
||||
private _veh_type = "";
|
||||
private _safe_pos = [];
|
||||
private _roads = _pos nearRoads 200;
|
||||
_roads = _roads select {isOnRoad _x};
|
||||
if (_roads isEqualTo []) then {
|
||||
_safe_pos = [_pos, 0, 500, 13, [0,1] select btc_p_sea, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;
|
||||
_safe_pos = [_safe_pos select 0, _safe_pos select 1, 0];
|
||||
_pos_isWater = (surfaceIsWater _safe_pos) && {getTerrainHeightASL _safe_pos < -2};
|
||||
if (_pos_isWater) then {
|
||||
_veh_type = selectRandom btc_civ_type_boats;
|
||||
} else {
|
||||
_veh_type = selectRandom btc_civ_type_veh;
|
||||
};
|
||||
} else {
|
||||
_safe_pos = getPos (selectRandom _roads);
|
||||
_veh_type = selectRandom btc_civ_type_veh;
|
||||
};
|
||||
|
||||
_group setVariable ["btc_patrol_id", btc_civilian_id, btc_debug];
|
||||
btc_civilian_id = btc_civilian_id - 1;
|
||||
|
||||
private _delay = [_group, _veh_type, [selectRandom btc_civ_type_units], _safe_pos] call btc_delay_fnc_createVehicle;
|
||||
|
||||
[{
|
||||
_this call btc_patrol_fnc_init;
|
||||
(_this select 0) setVariable ["acex_headless_blacklist", false];
|
||||
}, [_group, [_start_city, _active_city], _area, _pos_isWater], _delay] call btc_delay_fnc_waitAndExecute;
|
||||
|
||||
true
|
||||
50
hearts_and_minds.kunduz_valley/core/fnc/civ/evacuate.sqf
Normal file
50
hearts_and_minds.kunduz_valley/core/fnc/civ/evacuate.sqf
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_evacuate
|
||||
|
||||
Description:
|
||||
Evacuate civlians around a position in an area of 200 to a safe position.
|
||||
|
||||
Parameters:
|
||||
_position - Position to search for cilivians in a area of 200. [Array]
|
||||
_position_evac - Safe position where civilians will move to. [Array]
|
||||
|
||||
Returns:
|
||||
_civilians - Civlians found. [Array]
|
||||
Examples:
|
||||
(begin example)
|
||||
_civilians = [getPos player] call btc_civ_fnc_evacuate;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_position", [], [[]]],
|
||||
["_position_evac", [], [[]]]
|
||||
];
|
||||
|
||||
private _civilians = (units civilian) inAreaArray [_position, 200, 200];
|
||||
|
||||
if (_position_evac isEqualTo []) then {
|
||||
private _safe = (nearestTerrainObjects [_position, ["CHURCH", "CHAPEL"], 400]);
|
||||
if (_safe isEqualTo []) then {
|
||||
_position_evac = [_position, 0, 500, 30, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;
|
||||
_position_evac set [2, 0];
|
||||
} else {
|
||||
private _safe_building = _safe select 0;
|
||||
if ((_safe_building buildingPos -1) isEqualTo []) then {
|
||||
_position_evac = _safe_building getPos [((boundingBox _safe_building) select 1 select 0) + 10, getDir _safe_building];
|
||||
} else {
|
||||
_position_evac = getPos _safe_building;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
{
|
||||
[group _x, _position_evac, 20] call btc_civ_fnc_addWP;
|
||||
} forEach _civilians;
|
||||
|
||||
_civilians
|
||||
56
hearts_and_minds.kunduz_valley/core/fnc/civ/get_grenade.sqf
Normal file
56
hearts_and_minds.kunduz_valley/core/fnc/civ/get_grenade.sqf
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_get_grenade
|
||||
|
||||
Description:
|
||||
Search for civilians at a position in a range to add grenade to their inventory.
|
||||
|
||||
Parameters:
|
||||
_pos - Position to search for civilians. [Array]
|
||||
_range - Range to find civilians around the position. [Number]
|
||||
_units - Pass directly units to add greande. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[[0, 0, 0], 200] call btc_civ_fnc_get_grenade;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_pos", [0, 0, 0], [[]]],
|
||||
["_range", 300, [0]],
|
||||
["_units", [], [[]]]
|
||||
];
|
||||
|
||||
if (_units isEqualTo []) then {
|
||||
_units = _pos nearEntities [btc_civ_type_units, _range];
|
||||
};
|
||||
|
||||
_units = _units select {
|
||||
side group _x isEqualTo civilian &&
|
||||
{!(lifeState _x in ["INCAPACITATED", "DEAD"])}
|
||||
};
|
||||
|
||||
if (_units isEqualTo []) exitWith {};
|
||||
|
||||
{
|
||||
if (btc_debug_log) then {
|
||||
[format ["%1 - %2", _x, side _x], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
[_x] call btc_civ_fnc_add_grenade;
|
||||
|
||||
private _group = createGroup [btc_enemy_side, true];
|
||||
_group setVariable ["btc_city", group _x getVariable ["btc_city", objNull]];
|
||||
[_x] joinSilent _group;
|
||||
|
||||
[_group] call CBA_fnc_clearWaypoints;
|
||||
_group setVariable ["getWeapons", true];
|
||||
[_group, _pos, -1, "GUARD", "AWARE", "RED", nil, nil, nil, nil, 10] call CBA_fnc_addWaypoint;
|
||||
} forEach [selectRandom _units];
|
||||
63
hearts_and_minds.kunduz_valley/core/fnc/civ/get_weapons.sqf
Normal file
63
hearts_and_minds.kunduz_valley/core/fnc/civ/get_weapons.sqf
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_get_weapons
|
||||
|
||||
Description:
|
||||
Search for civilians at a position in a range to add weapons to their inventory.
|
||||
|
||||
Parameters:
|
||||
_pos - Position to search for civilians. [Array]
|
||||
_range - Range to find civilians around the position. [Number]
|
||||
_units - Pass directly units to add weapons. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[getPos player, 200] call btc_civ_fnc_get_weapons;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_pos", [0, 0, 0], [[]]],
|
||||
["_range", 300, [0]],
|
||||
["_units", [], [[]]]
|
||||
];
|
||||
|
||||
if (_units isEqualTo []) then {
|
||||
_units = _pos nearEntities [btc_civ_type_units, _range];
|
||||
_units = _units select {
|
||||
side group _x isEqualTo civilian &&
|
||||
{!(lifeState _x in ["INCAPACITATED", "DEAD"])}
|
||||
};
|
||||
};
|
||||
|
||||
{
|
||||
if (btc_debug_log) then {
|
||||
[format ["%1 - %2", _x, side _x], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
private _unit = _x;
|
||||
|
||||
[_unit, "", 2] call ace_common_fnc_doAnimation;
|
||||
|
||||
private _playableUnits = playableUnits inAreaArray [getPosWorld _unit, 50, 50];
|
||||
private _hgun = _playableUnits findIf {[_x, _unit] call btc_fnc_check_los} != -1;
|
||||
|
||||
private _weapon = selectRandom ([btc_w_civs select 0, btc_w_civs select 1] select _hgun);
|
||||
private _magazine = (getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines")) select 0;
|
||||
|
||||
[_unit, _weapon, _magazine] remoteExecCall ["btc_civ_fnc_add_weapons", _unit];
|
||||
|
||||
private _group = createGroup [btc_enemy_side, true];
|
||||
_group setVariable ["btc_city", group _unit getVariable ["btc_city", objNull]];
|
||||
[_unit] joinSilent _group;
|
||||
|
||||
[_group] call CBA_fnc_clearWaypoints;
|
||||
_group setVariable ["getWeapons", true];
|
||||
[_group, getPos _unit, -1, "GUARD", "AWARE", "RED", nil, nil, nil, nil, 10] call CBA_fnc_addWaypoint;
|
||||
} forEach _units;
|
||||
35
hearts_and_minds.kunduz_valley/core/fnc/civ/leaflets.sqf
Normal file
35
hearts_and_minds.kunduz_valley/core/fnc/civ/leaflets.sqf
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_leaflets
|
||||
|
||||
Description:
|
||||
Evacuate civilian when player drop leaflets.
|
||||
|
||||
Parameters:
|
||||
_uav - UAV use by player. [Object]
|
||||
_weapon - Type of weapon use by player inside UAV. [String]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [player, "Bomb_Leaflets"] call btc_civ_fnc_leaflets;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_uav", objNull, [objNull]],
|
||||
["_weapon", "", [""]]
|
||||
];
|
||||
|
||||
if (btc_debug) then {
|
||||
[format ["%1 fired with %2", typeOf _uav, _weapon], __FILE__, [btc_debug, false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
if (_weapon isEqualTo "Bomb_Leaflets") then {
|
||||
[getPos _uav] remoteExecCall ["btc_civ_fnc_evacuate", 2];
|
||||
};
|
||||
43
hearts_and_minds.kunduz_valley/core/fnc/civ/populate.sqf
Normal file
43
hearts_and_minds.kunduz_valley/core/fnc/civ/populate.sqf
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_civ_fnc_populate
|
||||
|
||||
Description:
|
||||
Populate a city in an area with a defined number of civilians.
|
||||
|
||||
Parameters:
|
||||
_houses - Houses to populate around a city. [Number]
|
||||
_n - Number of civilians to generate. [Number]
|
||||
_city - City where the civilian is created. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[_city, 200, 3] call btc_civ_fnc_populate;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_houses", [], [[]]],
|
||||
["_n", 0, [0]],
|
||||
["_city", objNull, [objNull]]
|
||||
];
|
||||
|
||||
if (_houses isEqualTo []) exitWith {};
|
||||
|
||||
for "_i" from 1 to _n do {
|
||||
if (_houses isEqualTo []) exitWith {};
|
||||
|
||||
private _pos = (_houses deleteAt 0) buildingPos 0;
|
||||
|
||||
private _group = createGroup civilian;
|
||||
_group setVariable ["btc_city", _city];
|
||||
_group setVariable ["btc_data_inhouse", [_pos]];
|
||||
[[_group, _pos], btc_civ_fnc_addWP] call btc_delay_fnc_exec;
|
||||
[_group, selectRandom btc_civ_type_units, _pos] call btc_delay_fnc_createUnit;
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_changeWeather
|
||||
|
||||
Description:
|
||||
Change weather: stop rain, stop fog and make sunny weather.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
|
||||
Author:
|
||||
Ice
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
5 setRain 0;
|
||||
5 setFog 0;
|
||||
5 setOvercast 0;
|
||||
10 setRainbow 1;
|
||||
37
hearts_and_minds.kunduz_valley/core/fnc/common/checkArea.sqf
Normal file
37
hearts_and_minds.kunduz_valley/core/fnc/common/checkArea.sqf
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_checkArea
|
||||
|
||||
Description:
|
||||
Check if the area is clear.
|
||||
|
||||
Parameters:
|
||||
_create_obj - Object to check around. [Object]
|
||||
_distance - Distance around the object. [Number]
|
||||
|
||||
Returns:
|
||||
_isNotClear - Is not clear. [Boolean]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_isNotClear = [btc_log_create_obj] call btc_fnc_checkArea;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_create_obj", objNull, [objNull]],
|
||||
["_distance", 5, [0]]
|
||||
];
|
||||
|
||||
if (
|
||||
count (nearestObjects [_create_obj, ["LandVehicle", "CAManBase", "Strategic", "ThingX"], _distance]) > 0
|
||||
) exitWith {
|
||||
(localize "STR_BTC_HAM_LOG_BASICS_CLEARAREA") call CBA_fnc_notify;
|
||||
true
|
||||
};
|
||||
|
||||
false
|
||||
43
hearts_and_minds.kunduz_valley/core/fnc/common/check_los.sqf
Normal file
43
hearts_and_minds.kunduz_valley/core/fnc/common/check_los.sqf
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_check_los
|
||||
|
||||
Description:
|
||||
Check the line of sight (LOS) between a unit and a target.
|
||||
|
||||
Parameters:
|
||||
_unit - Unit for checking. [Object]
|
||||
_target - Target to check. [Object]
|
||||
|
||||
Returns:
|
||||
_can_see - Tell if the unit can see or not the target. [Boolean]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_can_see = [player, cursorObject] call btc_fnc_check_los;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_unit", objNull, [objNull]],
|
||||
["_target", objNull, [objNull]]
|
||||
];
|
||||
|
||||
(eyeDirection _unit) params ["_point1", "_point2"];
|
||||
private _atan = _point1 atan2 _point2;
|
||||
private _dirTo = _target getDir _unit;
|
||||
private _ang = abs (_dirTo - _atan);
|
||||
private _can_see = (_ang > 120) && (_ang < 240);
|
||||
|
||||
if (_can_see) then {
|
||||
private _eyeu = eyePos _unit;
|
||||
private _eyet = eyePos _target;
|
||||
private _terr = terrainIntersectASL [_eyeu, _eyet];
|
||||
private _int = lineIntersects [_eyeu, _eyet];
|
||||
private _can_see = !(_int || _terr);
|
||||
};
|
||||
_can_see
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_create_composition
|
||||
|
||||
Description:
|
||||
Create a composition based on an array containing line for each object of a composition. An objects is describe by: [type of object, direction, real position].
|
||||
|
||||
Parameters:
|
||||
_pos - Position where the composition will be created. [Array]
|
||||
_setDir - Set the direction of composition spawn. [Number]
|
||||
_array - Array of each objects in the composition. [Array]
|
||||
|
||||
Returns:
|
||||
_composition_objects - Objects created from the _array. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_composition_objects = [getPos player, 45, [["Land_Money_F",359.991,[0.833984,-2.00586,1]],["Land_Photoframe_01_F",98.7052,[-0.333984,-2.35547,1]],["Land_BriefingRoomDesk_01_F",0.00013937,[0.285156,-2.2207,0]]]] call btc_fnc_create_composition;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_pos", [0, 0, 0], [[]]],
|
||||
["_setDir", 0, [0]],
|
||||
["_array", [], [[]]]
|
||||
];
|
||||
_pos params ["_pos_x", "_pos_y", ["_pos_z", 0]];
|
||||
|
||||
_array apply {
|
||||
_x params ["_type", "_dir", "_rel_pos"];
|
||||
_rel_pos params ["_rel_x", "_rel_y", ["_rel_z", 0]];
|
||||
|
||||
//// Determine position function of setdir \\\\
|
||||
private _final = [_pos_x + _rel_x*cos(_setDir) - _rel_y*sin(- _setDir), _pos_y + _rel_y*cos(_setDir) + _rel_x*sin(- _setDir)];
|
||||
_final pushBack (_pos_z + _rel_z + getTerrainHeightASL _final);
|
||||
private _obj = createVehicle [_type, ASLToATL _final, [], 0, "CAN_COLLIDE"];
|
||||
//// Determine direction function of setdir \\\\
|
||||
_obj setDir (_dir + _setDir);
|
||||
|
||||
_obj setVectorUp surfaceNormal position _obj;
|
||||
_obj setPosASL _final;
|
||||
_obj;
|
||||
};
|
||||
35
hearts_and_minds.kunduz_valley/core/fnc/common/delete.sqf
Normal file
35
hearts_and_minds.kunduz_valley/core/fnc/common/delete.sqf
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_delete
|
||||
|
||||
Description:
|
||||
Delete markers and the JIP remoteExec associated. Delete objects when player is far from them.
|
||||
|
||||
Parameters:
|
||||
_markers - Array of marker to delete. [Array]
|
||||
_objects - Array of objects and or groups to delete. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[["mymarker"], [objNull, grpNull]] call btc_fnc_delete;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_markers", [], [[""]]],
|
||||
["_objects", [], [[]]]
|
||||
];
|
||||
|
||||
{
|
||||
deleteMarker _x;
|
||||
//remove JIP remoteExec
|
||||
remoteExecCall ["", _x];
|
||||
} forEach _markers;
|
||||
|
||||
[_objects] call btc_fnc_deleteEntities;
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_deleteEntities
|
||||
|
||||
Description:
|
||||
This delete objects or groups when they are far away from a player.
|
||||
|
||||
Parameters:
|
||||
_entities - Entities deleted when _playableUnits are far. [Array]
|
||||
_playableUnits - Objects needed to be far before entities are deleted. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [_entities] call btc_fnc_deleteEntities;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
[{
|
||||
params [
|
||||
["_entities", [], [[]]],
|
||||
["_playableUnits", playableUnits, [[]]]
|
||||
];
|
||||
|
||||
private _entity = _entities deleteAt 0;
|
||||
private _entity_obj = if (_entity isEqualType grpNull) then {
|
||||
leader _entity
|
||||
} else {
|
||||
_entity
|
||||
};
|
||||
|
||||
if (_playableUnits inAreaArray [getPosWorld _entity_obj, 1000, 1000] isEqualTo []) then {
|
||||
_entity call CBA_fnc_deleteEntity;
|
||||
} else {
|
||||
_entities pushBack _entity;
|
||||
};
|
||||
|
||||
if (_entities isNotEqualTo []) exitWith {
|
||||
_this call btc_fnc_deleteEntities;
|
||||
};
|
||||
}, _this, 1] call CBA_fnc_waitAndExecute;
|
||||
231
hearts_and_minds.kunduz_valley/core/fnc/common/dlg.hpp
Normal file
231
hearts_and_minds.kunduz_valley/core/fnc/common/dlg.hpp
Normal file
@@ -0,0 +1,231 @@
|
||||
class btc_dlg_RscText {
|
||||
x = 0;
|
||||
y = 0;
|
||||
h = 0.037;
|
||||
w = 0.3;
|
||||
type = 0;
|
||||
style = 0;
|
||||
shadow = 1;
|
||||
colorShadow[] = {0, 0, 0, 0.5};
|
||||
font = "PuristaMedium";
|
||||
SizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
text = "";
|
||||
colorText[] = {1, 1, 1, 1.0};
|
||||
colorBackground[] = {0, 0, 0, 0};
|
||||
linespacing = 1;
|
||||
};
|
||||
|
||||
class btc_dlg_shortcutButton {
|
||||
idc = -1;
|
||||
style = 0;
|
||||
default = 0;
|
||||
shadow = 1;
|
||||
w = 0.183825;
|
||||
h = "( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";
|
||||
color[] = {1, 1, 1, 1.0};
|
||||
color2[] = {0.95, 0.95, 0.95, 1};
|
||||
colorDisabled[] = {1, 1, 1, 0.25};
|
||||
colorFocused[] = {0.95, 0.95, 0.95, 1};//{1, 1, 1, 1.0};
|
||||
colorBackgroundFocused[] = {0.95, 0.95, 0.95, 1};//{"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1};
|
||||
colorBackground[] = {0.95, 0.95, 0.95, 1};//{"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1};
|
||||
colorBackground2[] = {1, 1, 1, 1};
|
||||
animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa";
|
||||
animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa";
|
||||
animTextureDisabled = "\A3\ui_f\data\GUI\scCommon\RscShortcutButton\normal_ca.paa";
|
||||
animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\over_ca.paa";
|
||||
animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\focus_ca.paa";
|
||||
animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\down_ca.paa";
|
||||
textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)";
|
||||
periodFocus = 1.2;
|
||||
periodOver = 0.8;
|
||||
|
||||
class HitZone {
|
||||
left = 0.0;
|
||||
top = 0.0;
|
||||
right = 0.0;
|
||||
bottom = 0.0;
|
||||
};
|
||||
|
||||
class ShortcutPos {
|
||||
left = 0;
|
||||
top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
|
||||
w = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";
|
||||
h = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
};
|
||||
|
||||
class TextPos {
|
||||
left = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";
|
||||
top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
|
||||
right = 0.005;
|
||||
bottom = 0.0;
|
||||
};
|
||||
period = 0.4;
|
||||
font = "PuristaMedium";
|
||||
size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
text = "";
|
||||
soundEnter[] = {"\A3\ui_f\data\sound\onover", 0.09, 1};
|
||||
soundPush[] = {"\A3\ui_f\data\sound\new1", 0.0, 0};
|
||||
soundClick[] = {"\A3\ui_f\data\sound\onclick", 0.07, 1};
|
||||
soundEscape[] = {"\A3\ui_f\data\sound\onescape", 0.09, 1};
|
||||
action = "";
|
||||
|
||||
class Attributes {
|
||||
font = "PuristaMedium";
|
||||
color = "#E5E5E5";
|
||||
align = "left";
|
||||
shadow = "true";
|
||||
};
|
||||
|
||||
class AttributesImage {
|
||||
font = "PuristaMedium";
|
||||
color = "#E5E5E5";
|
||||
align = "left";
|
||||
};
|
||||
};
|
||||
class btc_dlg_button : btc_dlg_shortcutButton {
|
||||
idc = -1;
|
||||
type = 16;
|
||||
style = "0x02 + 0xC0";
|
||||
default = 0;
|
||||
shadow = 0;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0.15;//0.095589;
|
||||
h = 0.039216;
|
||||
animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTextureOver = "#(argb,8,8,3)color(1,1,1,0.5)";
|
||||
animTextureFocused = "#(argb,8,8,3)color(0,0,0,1)";//"#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTexturePressed = "#(argb,8,8,3)color(0,0,0,1)";//"#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTextureDefault = "#(argb,8,8,3)color(0,0,0,1)";//"#(argb,8,8,3)color(1,1,1,1)";
|
||||
colorBackground[] = {0, 0, 0, 0.8};
|
||||
colorBackground2[] = {1, 1, 1, 0.5};
|
||||
color[] = {1, 1, 1, 1};
|
||||
color2[] = {1, 1, 1, 1};
|
||||
colorText[] = {1, 1, 1, 1};
|
||||
colorDisabled[] = {1, 1, 1, 0.25};
|
||||
period = 1.2;
|
||||
periodFocus = 1.2;
|
||||
periodOver = 1.2;
|
||||
size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
|
||||
class TextPos {
|
||||
left = "0.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
|
||||
right = 0.005;
|
||||
bottom = 0.0;
|
||||
};
|
||||
|
||||
class Attributes {
|
||||
font = "PuristaLight";
|
||||
color = "#E5E5E5";
|
||||
align = "left";
|
||||
shadow = "false";
|
||||
};
|
||||
|
||||
class ShortcutPos {
|
||||
left = "(6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005";
|
||||
top = 0.005;
|
||||
w = 0.0225;
|
||||
h = 0.03;
|
||||
};
|
||||
};
|
||||
class btc_dlg_RscListBox {
|
||||
type = 5;
|
||||
style = "0x10";
|
||||
idc=-1;
|
||||
font = "puristaMedium";
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)";//"(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.75)";
|
||||
rowHeight=0.025;
|
||||
lineSpacing = 1;
|
||||
idcRight = -1;
|
||||
idcLeft = -1;
|
||||
drawSideArrows = 1;
|
||||
columns[] = {0.937500,0.968750,1.000000,0.7};
|
||||
colorText[] = {1,1,1,0.7};
|
||||
colorDisabled[] = {1, 1, 1, 0.6};
|
||||
colorScrollBar[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",0.85};
|
||||
colorSelect[] = {0.937500,0.968750,1.000000,0.7};
|
||||
colorSelect2[] = {0.937500,0.968750,1.000000,0.7};
|
||||
colorSelectBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",0.85};
|
||||
colorSelectBackground2[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",0.85};
|
||||
colorBackground[] = {1,1,1,0.05};
|
||||
maxHistoryDelay = 1.0;
|
||||
soundSelect[] = {"",0.1,1};
|
||||
period = 1;
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
shadow = 0;
|
||||
|
||||
class listScrollBar
|
||||
{
|
||||
color[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",0.85};
|
||||
colorActive[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",0.85};
|
||||
colorDisabled[] = {1, 1, 1, 1};
|
||||
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
|
||||
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
|
||||
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
|
||||
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
|
||||
soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1};
|
||||
shadow = 1;
|
||||
width = 0.2;
|
||||
};
|
||||
};
|
||||
class btc_dlg_comboBox {
|
||||
style = 16;
|
||||
type = 4;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0.12;
|
||||
h = 0.035;
|
||||
shadow = 0;
|
||||
colorSelect[] = {0,0,0,1};
|
||||
colorText[] = {0.95,0.95,0.95,1};
|
||||
colorBackground[] = {0,0,0,1};
|
||||
colorSelectBackground[] = {1,1,1,0.7};
|
||||
colorScrollBar[] = {1,0,0,1};
|
||||
arrowEmpty = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_ca.paa";
|
||||
arrowFull = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_active_ca.paa";
|
||||
wholeHeight = 0.45;
|
||||
color[] = {1,1,1,1};
|
||||
colorActive[] = {1,0,0,1};
|
||||
colorDisabled[] = {1,1,1,0.25};
|
||||
font = "PuristaMedium";
|
||||
sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
class ComboScrollBar
|
||||
{
|
||||
color[] = {1,1,1,0.6};
|
||||
colorActive[] = {1,1,1,1};
|
||||
colorDisabled[] = {1,1,1,0.3};
|
||||
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
|
||||
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
|
||||
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
|
||||
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
|
||||
};
|
||||
soundSelect[] = { "", 0, 1 };
|
||||
soundExpand[] = { "", 0, 1 };
|
||||
soundCollapse[] = { "", 0, 1 };
|
||||
maxHistoryDelay = 0;
|
||||
};
|
||||
class btc_dlg_RscEdit {
|
||||
type = 2;
|
||||
style = 16;
|
||||
font = "PuristaMedium";
|
||||
shadow = 2;
|
||||
sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
autocomplete = "";
|
||||
htmlControl = true;
|
||||
lineSpacing = 1;
|
||||
colorBackground[] = {0, 0, 0, 0.65};
|
||||
colorText[] = {0.95, 0.95, 0.95, 1};
|
||||
colorDisabled[] = {1, 1, 1, 0.25};
|
||||
colorFocused[] = {1, 1, 1, 1.0};
|
||||
colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1};
|
||||
colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1};
|
||||
canModify = 1;
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_end_mission
|
||||
|
||||
Description:
|
||||
Message shown when the mission end.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_fnc_end_mission;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
hint localize "STR_BTC_HAM_O_COMMON_ENDMISSION";
|
||||
|
||||
while {true} do {
|
||||
hintSilent localize "STR_BTC_HAM_O_COMMON_ENDMISSION";
|
||||
sleep 1;
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_final_phase
|
||||
|
||||
Description:
|
||||
Start the final mission process by waiting until all cities are free, then trigger the mission end.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_fnc_final_phase;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
["btc_dty", "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
[["btc_sze", "btc_m"], 2] call btc_task_fnc_create;
|
||||
|
||||
btc_final_phase = true;
|
||||
|
||||
btc_city_remaining = [];
|
||||
{
|
||||
if (_y getVariable ["type", ""] != "NameMarine") then {
|
||||
if (_y getVariable ["marker", ""] != "") then {
|
||||
deleteMarker (_y getVariable ["marker", ""]);
|
||||
};
|
||||
private _cachingRadius = _y getVariable ["cachingRadius", 500];
|
||||
|
||||
private _marker = createMarker [format ["city_%1", position _y], position _y];
|
||||
_marker setMarkerShape "ELLIPSE";
|
||||
_marker setMarkerBrush "SolidBorder";
|
||||
_marker setMarkerSize [_cachingRadius, _cachingRadius];
|
||||
_marker setMarkerAlpha 0.3;
|
||||
if (_y getVariable ["occupied", false]) then {
|
||||
_marker setMarkerColor "colorRed";
|
||||
btc_city_remaining pushBack _y;
|
||||
} else {
|
||||
_marker setMarkerColor "colorGreen";
|
||||
_marker setMarkerAlpha 0;
|
||||
};
|
||||
_y setVariable ["marker", _marker];
|
||||
};
|
||||
} forEach btc_city_all;
|
||||
|
||||
waitUntil {sleep 15; (btc_city_remaining isEqualTo [])};
|
||||
|
||||
["btc_m", "SUCCEEDED"] call btc_task_fnc_setState;
|
||||
|
||||
//END
|
||||
[] remoteExec ["btc_fnc_end_mission", 0, true];
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_find_closecity
|
||||
|
||||
Description:
|
||||
Find closer city in an array of cities from an initial city.
|
||||
|
||||
Parameters:
|
||||
_obj - City used to find the closer city. [Object]
|
||||
_array - Array of city. [Array]
|
||||
_isOccupied - Activate not occupied city filter. [Boolean]
|
||||
|
||||
Returns:
|
||||
_closer_city - Closer city from the array of city. [Object]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_closer_city = [player, values btc_city_all] call btc_fnc_find_closecity;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_obj", objNull, [objNull, []]],
|
||||
["_array", [], [[]]],
|
||||
["_isOccupied", true, [true]]
|
||||
];
|
||||
|
||||
private _city_all_distance = [];
|
||||
if (_isOccupied) then {
|
||||
_city_all_distance = _array select {!(_x getVariable ["occupied", false])};
|
||||
} else {
|
||||
_city_all_distance = _array;
|
||||
};
|
||||
if (_city_all_distance isEqualTo []) exitWith {objNull};
|
||||
|
||||
_city_all_distance = _city_all_distance apply {[_x distance _obj, _x]};
|
||||
_city_all_distance sort true;
|
||||
_city_all_distance select 0 select 1;
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_findposoutsiderock
|
||||
|
||||
Description:
|
||||
Found position outside rock.
|
||||
|
||||
Parameters:
|
||||
_rpos - Position to check. [Array]
|
||||
|
||||
Returns:
|
||||
_rpos - New position outside rock.
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_rpos = [getPos player] call btc_fnc_findposoutsiderock;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_rpos", [0, 0, 0], [[]]]
|
||||
];
|
||||
_rpos params ["_x", "_y"];
|
||||
|
||||
private _objects = lineIntersectsObjs [[_x, _y, (getTerrainHeightASL _rpos) + 1], [_x, _y, (getTerrainHeightASL _rpos) + 100], objNull, objNull, false, 16];
|
||||
|
||||
if (_objects isEqualTo []) exitWith {_rpos};
|
||||
|
||||
private _object = _objects select 0;
|
||||
if (_object in nearestTerrainObjects [_object, ["HIDE", "ROCK", "ROCKS"], 1]) then {
|
||||
private _roads = _rpos nearRoads 100;
|
||||
if (_roads isEqualTo []) then {
|
||||
_rpos = [_rpos, 5, 50, 10, false] call btc_fnc_findsafepos;
|
||||
} else {
|
||||
_rpos = getPos (_roads select 0);
|
||||
};
|
||||
};
|
||||
|
||||
if (btc_debug_log) then {
|
||||
_objects = lineIntersectsObjs [[_x, _y, (getTerrainHeightASL _rpos) + 1], [_x, _y, (getTerrainHeightASL _rpos) + 100], objNull, objNull, false, 16];
|
||||
if (_objects isNotEqualTo []) then {
|
||||
_object = _objects select 0;
|
||||
if (_object in nearestTerrainObjects [_object, ["HIDE", "ROCK", "ROCKS"], 1]) then {
|
||||
[format ["POS %1 Still inside rock", _rpos], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
if (btc_debug) then {
|
||||
["Still inside rock", __FILE__, [btc_debug, false]] call btc_debug_fnc_message;
|
||||
private _marker = createMarker [format ["btc_inrock_%1", _rpos], _rpos];
|
||||
_marker setMarkerType "mil_unknown";
|
||||
_marker setMarkerText "In rock";
|
||||
_marker setMarkerSize [0.5, 0.5];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_rpos
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_findsafepos
|
||||
|
||||
Description:
|
||||
Find safe position.
|
||||
|
||||
Parameters:
|
||||
_check_pos - Center position. [Array]
|
||||
_mindist - Minimum distance from the center position. [Number]
|
||||
_random_area - Maximum distance from the center position. [Number]
|
||||
_objdist - Minimum distance from the resulting position to the center of nearest object. Specifying quite large distance here will slow the function and might often fail to find suitable position. Recommended value: 0 - 10. [Number]
|
||||
_allow_water - Allow water position. [Boolean]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [getPos player] call btc_fnc_findsafepos;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_check_pos", [0, 0, 0], [[]]],
|
||||
["_mindist", 0, [0]],
|
||||
["_random_area", 100, [0]],
|
||||
["_objdist", 0, [0]],
|
||||
["_allow_water", false, [false, 0]]
|
||||
];
|
||||
|
||||
private _return_pos = [];
|
||||
for "_i" from 0 to 4 do {
|
||||
_return_pos = [_check_pos, _mindist, _random_area, _objdist, [0, 1] select _allow_water, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;
|
||||
if (count _return_pos isEqualTo 2) exitWith {
|
||||
_return_pos = [_return_pos select 0, _return_pos select 1, 0];
|
||||
};
|
||||
|
||||
_random_area = _random_area * 1.5;
|
||||
};
|
||||
_return_pos
|
||||
54
hearts_and_minds.kunduz_valley/core/fnc/common/getHouses.sqf
Normal file
54
hearts_and_minds.kunduz_valley/core/fnc/common/getHouses.sqf
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_getHouses
|
||||
|
||||
Description:
|
||||
Get enterable and not enterable houses around a position.
|
||||
|
||||
Parameters:
|
||||
_pos - Position to search for houses. [Array]
|
||||
_radius - Radius of search. [Number]
|
||||
|
||||
Returns:
|
||||
_enterable - Useful open houses. [Array]
|
||||
_notEnterable - Useful not open houses. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_useful = [getPos player] call btc_fnc_getHouses;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_pos", [0, 0, 0], [[], objNull]],
|
||||
["_radius", 100, [0]]
|
||||
];
|
||||
|
||||
private _enterable = [];
|
||||
private _notEnterable = [];
|
||||
{
|
||||
if (damage _x isNotEqualTo 0) then {continue;};
|
||||
if ((_x buildingPos -1) isEqualTo []) then {
|
||||
if (
|
||||
_x isKindOf "Lamps_base_F" ||
|
||||
{_x isKindOf "PowerLines_Small_base_F"} ||
|
||||
{_x isKindOf "PowerLines_Wires_base_F"} ||
|
||||
{_x isKindOf "Wall"} ||
|
||||
{_x isKindOf "Camping_base_F"} ||
|
||||
{_x isKindOf "Land_Campfire_F"} ||
|
||||
{_x isKindOf "Land_MetalBarrel_empty_F"} ||
|
||||
{_x isKindOf "FlagCarrierCore"} ||
|
||||
{_x isKindOf "Scrapyard_base_F"} ||
|
||||
{_x isKindOf "Shelter_base_F"}
|
||||
) then {continue;};
|
||||
_notEnterable pushBack _x;
|
||||
} else {
|
||||
_enterable pushBack _x;
|
||||
};
|
||||
} forEach (nearestObjects [_pos, ["Building"], _radius]);
|
||||
|
||||
[_enterable, _notEnterable]
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_get_cardinal
|
||||
|
||||
Description:
|
||||
Get cardinal.
|
||||
|
||||
Parameters:
|
||||
_n - Degree. [Number]
|
||||
|
||||
Returns:
|
||||
_card - Cardinal. [String]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [100] call btc_fnc_get_cardinal;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_n", 0, [0]]
|
||||
];
|
||||
|
||||
private _card = "";
|
||||
switch (true) do {
|
||||
case (_n > 345 || _n <= 15) : {_card = "N";};
|
||||
case (_n > 15 && _n <= 75) : {_card = "NE";};
|
||||
case (_n > 75 && _n <= 105) : {_card = "E";};
|
||||
case (_n > 105 && _n <= 165) : {_card = "SE";};
|
||||
case (_n > 165 && _n <= 195) : {_card = "S";};
|
||||
case (_n > 195 && _n <= 255) : {_card = "SW";};
|
||||
case (_n > 255 && _n <= 285) : {_card = "W";};
|
||||
case (_n > 285 && _n <= 345) : {_card = "NW";};
|
||||
};
|
||||
|
||||
_card
|
||||
105
hearts_and_minds.kunduz_valley/core/fnc/common/get_class.sqf
Normal file
105
hearts_and_minds.kunduz_valley/core/fnc/common/get_class.sqf
Normal file
@@ -0,0 +1,105 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_get_class
|
||||
|
||||
Description:
|
||||
Get enemy or civilian factions.
|
||||
|
||||
Parameters:
|
||||
_get_civ_faction - Search for factions of civilian or enemies. [String]
|
||||
|
||||
Returns:
|
||||
_array_of_factions - Array with authos names, text entry for mission parameters, corresponding number for each faction, faction name array. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
copyToClipboard str (["CIV"] call btc_fnc_get_class);
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_get_civ_faction", "EN", [""]]
|
||||
];
|
||||
|
||||
private _faction_list = if (_get_civ_faction isEqualTo "CIV") then {[3]} else {[0, 1, 2]};
|
||||
|
||||
//Get all vehicles/Units
|
||||
private _cfgVehicles = configFile >> "CfgVehicles";
|
||||
private _allvehicles = ("(configName _x) isKindOf 'AllVehicles'" configClasses (_cfgVehicles)) apply {configName _x};
|
||||
_allvehicles = _allvehicles select {getNumber (_cfgVehicles >> _x >> "scope") isEqualTo 2};
|
||||
private _cfgFactionClasses = configFile >> "CfgFactionClasses";
|
||||
private _allfaction = [];
|
||||
private _allside = [];
|
||||
private _allauthor = [];
|
||||
private _alldlc = [];
|
||||
|
||||
// Get factions and store it if new faction are found
|
||||
{
|
||||
// Get faction of the vehicle and store it if is a new faction
|
||||
private _index = _allfaction pushBackUnique toUpper getText(_cfgVehicles >> _x >> "faction");
|
||||
|
||||
//If new get the side and author name and dlc name
|
||||
if (_index > -1) then {
|
||||
_allside pushBack getNumber(_cfgVehicles >> _x >> "side");
|
||||
_allauthor pushBack getText(_cfgVehicles >> _x >> "author");
|
||||
private _dlc = getText(_cfgVehicles >> _x >> "dlc");
|
||||
if (_dlc isEqualTo "") then {
|
||||
if ((_allauthor select _index) isEqualTo "Bohemia Interactive") then {
|
||||
//If is BI check if it is really BI, some mod don't change the author
|
||||
private _mod_folder = getText(_cfgFactionClasses >> _allfaction select _index >> "icon") select [if ((getText(_cfgFactionClasses >> _allfaction select _index >> "icon") select [0, 1]) isEqualTo "\") then {1} else {0}];
|
||||
private _mod = _mod_folder select [0, _mod_folder find "\"];
|
||||
if (_mod isNotEqualTo "a3") then {
|
||||
_dlc = (_allfaction select _index) select [0, (_allfaction select _index) find "_"];
|
||||
};
|
||||
} else {
|
||||
_dlc = (_allfaction select _index) select [0, (_allfaction select _index) find "_"];
|
||||
};
|
||||
};
|
||||
if (count _dlc isEqualTo 1) then {
|
||||
_dlc = "";
|
||||
};
|
||||
_alldlc pushBack _dlc;
|
||||
};
|
||||
} forEach _allvehicles;
|
||||
|
||||
//Create an array of all information get
|
||||
private _all = [];
|
||||
{
|
||||
if ( //Select faction depending on side CIV or Enemy
|
||||
(_allside select _foreachindex) in _faction_list &&
|
||||
(getNumber (_cfgFactionClasses >> _alldlc select _foreachindex >> "side") in [0, 1, 2, 3])
|
||||
) then {
|
||||
|
||||
//Return the text usefull in param.hpp
|
||||
private _factionInfo = format [
|
||||
"%1: %2 (Side: %3)",
|
||||
_allauthor select _foreachindex,
|
||||
getText (_cfgFactionClasses >> _x >> "displayName"),
|
||||
[East, West, Independent, Civilian] select (_allside select _foreachindex)
|
||||
];
|
||||
|
||||
if ((_alldlc select _foreachindex) isNotEqualTo "") then {
|
||||
_factionInfo = format [
|
||||
"%1 %2",
|
||||
_alldlc select _foreachindex,
|
||||
_factionInfo
|
||||
];
|
||||
};
|
||||
|
||||
_all pushBack [_factionInfo, _alldlc select _foreachindex, _x, _allside select _foreachindex, _allauthor select _foreachindex];
|
||||
};
|
||||
} forEach _allfaction;
|
||||
_all sort true;
|
||||
|
||||
_alldlc = _all apply {_x select 1};
|
||||
private _values = [];
|
||||
for "_i" from 0 to (count _all) - 1 do {
|
||||
_values pushBack _i;
|
||||
};
|
||||
_texts = _values apply {format ["%1 - %2", _x, (_all select _x) select 0]};
|
||||
|
||||
[_alldlc arrayIntersect _alldlc, _texts, _all apply {_x select 2}, _values]
|
||||
@@ -0,0 +1,48 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_get_composition
|
||||
|
||||
Description:
|
||||
Get a composition of objects around a position.
|
||||
|
||||
Parameters:
|
||||
_position - Position ASL to get a composition. [Array]
|
||||
_radius - Radius of the composition. [Number]
|
||||
|
||||
Returns:
|
||||
_composition - Array of the corresponding composition. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
copyToClipboard str ([getPosASL player] call btc_fnc_get_composition);
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_position", [0, 0, 0], [[]]],
|
||||
["_radius", 100, [0]]
|
||||
];
|
||||
|
||||
private _objs = (nearestObjects [_position, ["All"], _radius]) select {!(isObjectHidden _x) && !(_x isKindOf "Man")};
|
||||
|
||||
_position params ["_center_xx", "_center_yy", "_center_zz"];
|
||||
|
||||
_objs apply {
|
||||
private _objPos = getPosASL _x;
|
||||
_objPos params ["_xx", "_yy", "_zz"];
|
||||
private _relative_pos = [
|
||||
_xx - _center_xx,
|
||||
_yy - _center_yy,
|
||||
_zz - _center_zz
|
||||
];
|
||||
|
||||
[
|
||||
typeOf _x,
|
||||
getDir _x,
|
||||
_relative_pos
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_house_addWP
|
||||
|
||||
Description:
|
||||
Add waypoints to group to patrol inside an house.
|
||||
|
||||
Parameters:
|
||||
_group - Group to add waypoints. [Group]
|
||||
_house - House use to patrol. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[group player, (([getPos player] call btc_fnc_getHouses) select 0) select 0] call btc_fnc_house_addWP;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_group", grpNull, [grpNull]],
|
||||
["_house", objNull, [objNull]]
|
||||
];
|
||||
|
||||
[_group] call CBA_fnc_clearWaypoints;
|
||||
private _allpositions = [_group, _house] call btc_fnc_house_addWP_loop;
|
||||
|
||||
private _wp = [_group, [_allpositions select 0, 0.2] call CBA_fnc_randPos, -1, "CYCLE", "UNCHANGED", "NO CHANGE", "UNCHANGED", "NO CHANGE", "", [15, 20, 30]] call CBA_fnc_addWaypoint;
|
||||
_wp waypointAttachObject _house;
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_house_addWP_loop
|
||||
|
||||
Description:
|
||||
Add waypoints to group to patrol inside an house.
|
||||
|
||||
Parameters:
|
||||
_group - Group to add waypoints. [Group]
|
||||
_house - House use to patrol. [Object]
|
||||
|
||||
Returns:
|
||||
_allpositions - All position available. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_allpositions = [group player, (([getPos player] call btc_fnc_getHouses) select 0) select 0] call btc_fnc_house_addWP_loop;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_group", grpNull, [grpNull]],
|
||||
["_house", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _allpositions = (_house buildingPos -1) call BIS_fnc_arrayShuffle;
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["count all pos %1 in %2 ", count _allpositions, _house], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
{
|
||||
private _wp = [_group, [_x, 0.2] call CBA_fnc_randPos, -1, "MOVE", "UNCHANGED", "NO CHANGE", "UNCHANGED", "NO CHANGE", "", [15, 20, 30]] call CBA_fnc_addWaypoint;
|
||||
_wp waypointAttachObject _house;
|
||||
_wp setWaypointHousePosition _forEachIndex;
|
||||
} forEach _allpositions;
|
||||
|
||||
_allpositions
|
||||
26
hearts_and_minds.kunduz_valley/core/fnc/common/moveOut.sqf
Normal file
26
hearts_and_minds.kunduz_valley/core/fnc/common/moveOut.sqf
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_moveOut
|
||||
|
||||
Description:
|
||||
Move out crew of a vehicle each frame to avoid dead body colliding.
|
||||
|
||||
Parameters:
|
||||
_crew - Crew array. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
crew cursorObject call btc_fnc_moveOut;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
if (_this isEqualTo []) exitWith {};
|
||||
|
||||
moveOut (_this deleteAt 0);
|
||||
[btc_fnc_moveOut, _this] call CBA_fnc_execNextFrame;
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_randomize_pos
|
||||
|
||||
Description:
|
||||
Randomize position.
|
||||
|
||||
Parameters:
|
||||
_pos - Starting position. [Array]
|
||||
_random_area - Area of radomization. [Number]
|
||||
_allowwater - Allow water position. [Boolean]
|
||||
|
||||
Returns:
|
||||
_return_pos - New position. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_return_pos = [getPos player] call btc_fnc_randomize_pos;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_pos", [0, 0, 0], [[]]],
|
||||
["_random_area", 300, [0]],
|
||||
["_allowwater", false, [true]]
|
||||
];
|
||||
|
||||
private _return_pos = _pos;
|
||||
|
||||
_check_pos = [_pos, _random_area] call CBA_fnc_randPos;
|
||||
|
||||
if ((surfaceIsWater _check_pos) && !(_allowwater)) then {
|
||||
_return_pos = [_check_pos, 0, _random_area, 13, false] call btc_fnc_findsafepos;
|
||||
} else {
|
||||
_return_pos = _check_pos;
|
||||
};
|
||||
_return_pos
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_road_direction
|
||||
|
||||
Description:
|
||||
Found road direction.
|
||||
|
||||
Parameters:
|
||||
_road - Road to find the direction. [Object]
|
||||
|
||||
Returns:
|
||||
_direction - Direction of the road. [Number]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_direction = [(nearRoads player) select 0] call btc_fnc_road_direction;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_road", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _info = getRoadInfo _road;
|
||||
(_info select 6) getDir (_info select 7)
|
||||
66
hearts_and_minds.kunduz_valley/core/fnc/common/roof.sqf
Normal file
66
hearts_and_minds.kunduz_valley/core/fnc/common/roof.sqf
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_roof
|
||||
|
||||
Description:
|
||||
Get roof.
|
||||
|
||||
Parameters:
|
||||
_house - House to find the roof. [Group]
|
||||
|
||||
Returns:
|
||||
_spawnPos - Roof position. [Array]
|
||||
_surfaceNormal - Surface normal. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [(([position player, 30] call btc_fnc_getHouses) select 0) select 0] call btc_fnc_roof;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_house", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _positions = _house buildingPos -1;
|
||||
private "_ASL";
|
||||
if (_positions isEqualTo []) then {
|
||||
private _bbr = (0 boundingBoxReal _house);
|
||||
private _p1 = _bbr select 0;
|
||||
private _p2 = _bbr select 1;
|
||||
private _maxHeight = abs ((_p2 select 2) - (_p1 select 2));
|
||||
_ASL = (getPosASL _house) vectorAdd [0, 0, _maxHeight];
|
||||
} else {
|
||||
{
|
||||
reverse _x
|
||||
} forEach _positions;
|
||||
_positions sort false;
|
||||
private _higherPos = _positions select 0;
|
||||
reverse _higherPos;
|
||||
_ASL = AGLToASL _higherPos;
|
||||
};
|
||||
|
||||
private _surface = lineIntersectsSurfaces [_ASL vectorAdd [0, 0, 10], _ASL];
|
||||
|
||||
private _spawnPos = _ASL;
|
||||
private _surfaceNormal = [0, 0, 1];
|
||||
if (_surface isEqualTo []) then { // Try to find again the roof with house position
|
||||
_surface = lineIntersectsSurfaces [_ASL vectorAdd [0, 0, 10], getPosASL _house];
|
||||
};
|
||||
|
||||
if (_surface isNotEqualTo []) then {
|
||||
private _intersect = _surface select 0;
|
||||
if (
|
||||
_house in _intersect &&
|
||||
{(_spawnPos select 2) + 0.5 < (_intersect select 0 select 2)}
|
||||
) then {
|
||||
_spawnPos = (_intersect select 0) vectorAdd [0, 0, 0.2];
|
||||
_surfaceNormal = _intersect select 1;
|
||||
};
|
||||
};
|
||||
|
||||
[_spawnPos, _surfaceNormal]
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_set_damage
|
||||
|
||||
Description:
|
||||
Set ACE damage.
|
||||
|
||||
Parameters:
|
||||
_unit - Unit taking damage. [Object]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[player] call btc_fnc_set_damage;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_unit", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _selection = [
|
||||
"head",
|
||||
"body",
|
||||
"hand_l",
|
||||
"hand_r",
|
||||
"leg_l",
|
||||
"leg_r"
|
||||
];
|
||||
private _type = [
|
||||
"bullet",
|
||||
"grenade"/*,
|
||||
"explosive",
|
||||
"shell"*/
|
||||
];
|
||||
|
||||
_unit setVariable ["ace_medical_ai_lastFired", 9999999]; //Disable AI to self healing
|
||||
|
||||
for "_i" from 0 to (1 + floor random 2) do {
|
||||
[_unit, 0.4, selectRandom _selection, selectRandom _type] call ace_medical_fnc_addDamageToUnit;
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
if (_unit call ace_medical_status_fnc_isInStableCondition) exitWith {[_unit] call btc_fnc_set_damage;};
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_set_markerTextLocal
|
||||
|
||||
Description:
|
||||
Add local text to a marker.
|
||||
|
||||
Parameters:
|
||||
_marker - Marker to add text locally [String]
|
||||
_text - Text to add locally. [String]
|
||||
_arg - Argument for custom text. [String, Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_fnc_set_markerTextLocal;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
1kuemmel1
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_marker", "", [""]],
|
||||
["_text", "", [""]],
|
||||
["_arg", "", ["", 0]]
|
||||
];
|
||||
|
||||
_text = if (isLocalized _text) then {localize _text};
|
||||
|
||||
_marker setMarkerTextLocal format [_text, _arg];
|
||||
@@ -0,0 +1,86 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_showSubtitle
|
||||
|
||||
Description:
|
||||
Show text as a subtitle.
|
||||
|
||||
Parameters:
|
||||
_from - Name of the person speaking [String]
|
||||
_text - Contents of the subtitle [String]
|
||||
_lineBreak - Add a line break [Boolean]
|
||||
_colorFrom - HEX color for speaker (#RGB or #ARGB) [String]
|
||||
_colorText - HEX color for content (#RGB or #ARGB) [String]
|
||||
_fontText - Font (https://community.bistudio.com/wiki/FXY_File_Format#Available_Fonts) [String]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
["Some Guy","How do yo do?"] call btc_fnc_showSubtitle;
|
||||
["Darth Vader","Come to the dark side. We have cookies!", false, "#ed2939"] call btc_fnc_showSubtitle;
|
||||
["Luke Skywalker","Whhhhhhyyyyyyyy", true, "#1768d3", nil, "PuristaBold"] call btc_fnc_showSubtitle;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Thomas Ryan
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
#define WAIT 10
|
||||
#define POS_W (0.4 * safeZoneW)
|
||||
#define POS_H (safeZoneH)
|
||||
#define POS_X (0.5 - POS_W / 2)
|
||||
#define POS_Y (safeZoneY + (6/8) * safeZoneH)
|
||||
#define POS_Y_CAM (safeZoneY + (31/32) * safeZoneH)
|
||||
|
||||
disableSerialization;
|
||||
// Create display and control
|
||||
"btc_fnc_showSubtitle" cutRsc ["RscDynamicText", "PLAIN"];
|
||||
[{private _display = uiNamespace getVariable "BIS_dynamicText"; !(isNull _display)}, {
|
||||
|
||||
params [
|
||||
["_from", "", [""]],
|
||||
["_text", "", [""]],
|
||||
["_lineBreak", false, [false]],
|
||||
["_colorFrom", "#d4cd00", [""]], //default color: gold
|
||||
["_colorText", "#FFFFFF", [""]], //default color: white
|
||||
["_fontText", "RobotoCondensedBold", [""]]
|
||||
];
|
||||
|
||||
private _display = uiNamespace getVariable "BIS_dynamicText";
|
||||
private _ctrl = _display ctrlCreate ["RscStructuredText",-1];
|
||||
uiNamespace setVariable ["BIS_dynamicText", displayNull];
|
||||
|
||||
_ctrl ctrlSetBackgroundColor (["Subtitles","Background"] call bis_fnc_displayColorGet);
|
||||
//_ctrl ctrlSetBackgroundColor [0, 0, 0, 0.5]; //optional? - for better readability
|
||||
_ctrl ctrlSetTextColor (["Subtitles", "Text"] call bis_fnc_displayColorGet);
|
||||
_ctrl ctrlSetPosition [POS_X, POS_Y, POS_W, POS_H];
|
||||
_ctrl ctrlCommit 0;
|
||||
|
||||
// Show subtitle
|
||||
_ctrl ctrlSetStructuredText parseText format [
|
||||
if (_from isEqualTo "") then {
|
||||
"<t align='center' shadow='1' color='%5' size='%3' font=%6>%2</t>"
|
||||
} else {
|
||||
if (_lineBreak) then {
|
||||
"<t align='center' shadow='1' color='%4' size='%3' font=%6>%1: <br /></t><t align='center' color='%5' shadow='1' size='%3' font=%6>%2</t>"
|
||||
} else {
|
||||
"<t align='center' shadow='1' color='%4' size='%3' font=%6>%1: </t><t align='center' color='%5' shadow='1' size='%3' font=%6>%2</t>"
|
||||
};
|
||||
},
|
||||
toUpper _from, _text, (safezoneH * 0.65) max 1, _colorFrom, _colorText, _fontText
|
||||
];
|
||||
|
||||
private _textHeight = ctrlTextHeight _ctrl;
|
||||
_ctrl ctrlSetPosition [POS_X, POS_Y - _textHeight, POS_W, _textHeight];
|
||||
_ctrl ctrlcommit 0;
|
||||
|
||||
[{
|
||||
params ["_ctrl"];
|
||||
|
||||
// Hide subtitle
|
||||
_ctrl ctrlSetFade 1;
|
||||
_ctrl ctrlCommit 0.5;
|
||||
}, [_ctrl], WAIT] call CBA_fnc_waitAndExecute;
|
||||
}, _this] call CBA_fnc_waitUntilAndExecute;
|
||||
132
hearts_and_minds.kunduz_valley/core/fnc/common/show_hint.sqf
Normal file
132
hearts_and_minds.kunduz_valley/core/fnc/common/show_hint.sqf
Normal file
@@ -0,0 +1,132 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_show_hint
|
||||
|
||||
Description:
|
||||
Show CBA_fnc_notify.
|
||||
|
||||
Parameters:
|
||||
_type - Type of CBA_fnc_notify to show. [Number]
|
||||
_custom - Argument for custom text. [String, Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[0] call btc_fnc_show_hint;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
if (isDedicated) exitWith {};
|
||||
|
||||
params [
|
||||
["_type", 0, [0]],
|
||||
["_custom", 0, [0, "", []]]
|
||||
];
|
||||
|
||||
private _text = switch (_type) do {
|
||||
case 0 : {
|
||||
localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_0";
|
||||
};
|
||||
case 1 : {
|
||||
[
|
||||
[localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_1"],
|
||||
[localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_MU"],
|
||||
['\A3\ui_f\data\map\markers\handdrawn\unknown_CA.paa', 0.8, [1, 0, 0]]
|
||||
];
|
||||
};
|
||||
case 2 : {
|
||||
format [localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_2", _custom];
|
||||
};
|
||||
case 3 : {
|
||||
localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_3";
|
||||
};
|
||||
case 5 : {
|
||||
[
|
||||
[localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_5"],
|
||||
[localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_MU"],
|
||||
['\A3\ui_f\data\map\markers\handdrawn\warning_CA.paa', 0.8, [1, 0, 0]]
|
||||
];
|
||||
};
|
||||
case 7 : {
|
||||
format [localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_7", _custom];
|
||||
};
|
||||
case 8 : {
|
||||
localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_8";
|
||||
};
|
||||
case 9 : {
|
||||
localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_9";
|
||||
};
|
||||
case 10 : {
|
||||
localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_10";
|
||||
};
|
||||
case 12 : {
|
||||
localize "STR_BTC_HAM_SIDE_CONVOY_STARTCHAT";
|
||||
};
|
||||
case 14 : {
|
||||
[
|
||||
[localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_14"],
|
||||
[getText (configfile >> "CfgVehicles" >> _custom >> "editorPreview"), 8]
|
||||
];
|
||||
};
|
||||
case 15 : {
|
||||
[
|
||||
[localize "STR_BTC_HAM_O_COMMON_SHOWHINTS_15"],
|
||||
[getText (configfile >> "CfgVehicles" >> _custom >> "editorPreview"), 8]
|
||||
];
|
||||
};
|
||||
case 16 : {
|
||||
[
|
||||
[localize "STR_BTC_HAM_LOG_RWRECK_ISHELO"],
|
||||
["\A3\ui_f\data\igui\cfg\simpleTasks\types\repair_ca.paa"]
|
||||
];
|
||||
};
|
||||
case 17 : {
|
||||
[
|
||||
[localize "STR_BTC_HAM_LOG_LPDELETE"],
|
||||
["\z\ace\addons\arsenal\data\iconClearContainer.paa"]
|
||||
];
|
||||
};
|
||||
case 18 : {
|
||||
localize "STR_BTC_HAM_O_FOB_DISMANTLE_H_PROC";
|
||||
};
|
||||
case 19 : {
|
||||
[
|
||||
format [localize "STR_BTC_HAM_O_COMMON_REBOOT", _custom], 1.5, [1, 0, 0]
|
||||
];
|
||||
};
|
||||
case 20 : {
|
||||
_custom params ["_color", "_player"];
|
||||
[
|
||||
[[name _player], [" "]] select (isNull _player),
|
||||
["\A3\Data_F_Orange\Logos\arma3_orange_picture_ca.paa", 4, _color],
|
||||
[" "]
|
||||
];
|
||||
};
|
||||
case 21 : {
|
||||
_custom params ["_color", "_player"];
|
||||
[
|
||||
[[name _player], [" "]] select (isNull _player || (side group _player isNotEqualTo btc_player_side)),
|
||||
["\a3\Ui_f\data\GUI\Cfg\Debriefing\endDefault_ca.paa", 4, _color],
|
||||
[" "]
|
||||
];
|
||||
};
|
||||
case 22 : {
|
||||
localize "STR_BTC_HAM_O_COMMON_TICKETADD";
|
||||
};
|
||||
case 23 : {
|
||||
localize "STR_BTC_HAM_O_COMMON_NOBODYBAG";
|
||||
};
|
||||
case 24 : {
|
||||
format [localize "STR_BTC_HAM_O_COMMON_TICKETSLEFT", _custom];
|
||||
};
|
||||
case 25 : {
|
||||
localize "STR_BTC_HAM_O_COMMON_NOPLAYERFTICKET";
|
||||
};
|
||||
};
|
||||
|
||||
_text call CBA_fnc_notify;
|
||||
57
hearts_and_minds.kunduz_valley/core/fnc/common/typeOf.sqf
Normal file
57
hearts_and_minds.kunduz_valley/core/fnc/common/typeOf.sqf
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_typeOf
|
||||
|
||||
Description:
|
||||
Get the classe name of an object. Very usefull for terrain objects.
|
||||
|
||||
Parameters:
|
||||
_object - Object to get the typeOf. [Object]
|
||||
|
||||
Returns:
|
||||
_calssenameArray - Array of classename. [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
a = nearestTerrainObjects [player, [], 3, false];
|
||||
[[a select 0]] call btc_fnc_typeOf;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
PabstMirror
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_objectArray", [], [[]]]
|
||||
];
|
||||
|
||||
if (isNil "btc_modelNamespace") then {
|
||||
btc_modelNamespace = createHashMap;
|
||||
};
|
||||
|
||||
private _cfgVehicles = configFile >> "cfgVehicles";
|
||||
|
||||
_objectArray apply {
|
||||
private _type = typeOf _x;
|
||||
|
||||
if (_type == "") then {
|
||||
private _model = (getModelInfo _x) select 1;
|
||||
if (_model == "") exitWith {""};
|
||||
_type = btc_modelNamespace get _model;
|
||||
if (isNil "_type") then {
|
||||
private _objects = configProperties [
|
||||
_cfgVehicles,
|
||||
"(isClass _x) && {(((getText (_x >> 'model')) select [1]) == _model) || {(getText (_x >> 'model')) == _model}}",
|
||||
true
|
||||
];
|
||||
if (_objects isEqualTo []) then {
|
||||
_type = "";
|
||||
} else {
|
||||
_type = configName (_objects select 0);
|
||||
};
|
||||
btc_modelNamespace set [_model, _type];
|
||||
};
|
||||
};
|
||||
_type
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_fnc_typeOfPreview
|
||||
|
||||
Description:
|
||||
Return the picture of a class name.
|
||||
|
||||
Parameters:
|
||||
_typeOf - Class name of the object to preview. [String]
|
||||
_width - Width in pixel. [Number]
|
||||
_height - Height in pixel. [Number]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[typeOf player] call btc_fnc_typeOfPreview;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_typeOf", "Land_PowerGenerator_F", [""]],
|
||||
["_width", 355, [0]],
|
||||
["_height", 200, [0]]
|
||||
];
|
||||
|
||||
format [
|
||||
"<br/><img image='%1' width='%2' height='%3'/>",
|
||||
getText (configfile >> "CfgVehicles" >> _typeOf >> "editorPreview"),
|
||||
_width,
|
||||
_height
|
||||
];
|
||||
444
hearts_and_minds.kunduz_valley/core/fnc/compile.sqf
Normal file
444
hearts_and_minds.kunduz_valley/core/fnc/compile.sqf
Normal file
@@ -0,0 +1,444 @@
|
||||
/////////////////////SERVER\\\\\\\\\\\\\\\\\\\\\
|
||||
if (isServer) then {
|
||||
//BODY
|
||||
btc_body_fnc_bagRecover_s = compileScript ["core\fnc\body\bagRecover_s.sqf"];
|
||||
btc_body_fnc_createMarker = compileScript ["core\fnc\body\createMarker.sqf"];
|
||||
btc_body_fnc_dogtagGet = compileScript ["core\fnc\body\dogtagGet.sqf"];
|
||||
btc_body_fnc_dogtagSet = compileScript ["core\fnc\body\dogtagSet.sqf"];
|
||||
btc_body_fnc_setBodyBag = compileScript ["core\fnc\body\setBodyBag.sqf"];
|
||||
btc_body_fnc_create = compileScript ["core\fnc\body\create.sqf"];
|
||||
btc_body_fnc_get = compileScript ["core\fnc\body\get.sqf"];
|
||||
|
||||
//CACHE
|
||||
btc_cache_fnc_find_pos = compileScript ["core\fnc\cache\find_pos.sqf"];
|
||||
btc_cache_fnc_create = compileScript ["core\fnc\cache\create.sqf"];
|
||||
btc_cache_fnc_create_attachto = compileScript ["core\fnc\cache\create_attachto.sqf"];
|
||||
btc_cache_fnc_init = compileScript ["core\fnc\cache\init.sqf"];
|
||||
|
||||
//COMMON
|
||||
btc_fnc_check_los = compileScript ["core\fnc\common\check_los.sqf"];
|
||||
btc_fnc_create_composition = compileScript ["core\fnc\common\create_composition.sqf"];
|
||||
btc_fnc_house_addWP = compileScript ["core\fnc\common\house_addWP.sqf"];
|
||||
btc_fnc_set_damage = compileScript ["core\fnc\common\set_damage.sqf"];
|
||||
btc_fnc_road_direction = compileScript ["core\fnc\common\road_direction.sqf"];
|
||||
btc_fnc_findsafepos = compileScript ["core\fnc\common\findsafepos.sqf"];
|
||||
btc_fnc_find_closecity = compileScript ["core\fnc\common\find_closecity.sqf"];
|
||||
btc_fnc_delete = compileScript ["core\fnc\common\delete.sqf"];
|
||||
btc_fnc_deleteEntities = compileScript ["core\fnc\common\deleteEntities.sqf"];
|
||||
btc_fnc_final_phase = compileScript ["core\fnc\common\final_phase.sqf"];
|
||||
btc_fnc_findPosOutsideRock = compileScript ["core\fnc\common\findposoutsiderock.sqf"];
|
||||
btc_fnc_typeOf = compileScript ["core\fnc\common\typeOf.sqf"];
|
||||
btc_fnc_roof = compileScript ["core\fnc\common\roof.sqf"];
|
||||
btc_fnc_moveOut = compileScript ["core\fnc\common\moveOut.sqf"];
|
||||
btc_fnc_changeWeather = compileScript ["core\fnc\common\changeWeather.sqf"];
|
||||
|
||||
//CHEM
|
||||
btc_chem_fnc_checkLoop = compileScript ["core\fnc\chem\checkLoop.sqf"];
|
||||
btc_chem_fnc_propagate = compileScript ["core\fnc\chem\propagate.sqf"];
|
||||
btc_chem_fnc_handleShower = compileScript ["core\fnc\chem\handleShower.sqf"];
|
||||
|
||||
//SPECT
|
||||
btc_spect_fnc_checkLoop = compileScript ["core\fnc\spect\checkLoop.sqf"];
|
||||
btc_spect_fnc_electronicFailure = compileScript ["core\fnc\spect\electronicFailure.sqf"];
|
||||
|
||||
//CITY
|
||||
btc_city_fnc_activate = compileScript ["core\fnc\city\activate.sqf"];
|
||||
btc_city_fnc_create = compileScript ["core\fnc\city\create.sqf"];
|
||||
btc_city_fnc_de_activate = compileScript ["core\fnc\city\de_activate.sqf"];
|
||||
btc_city_fnc_setClear = compileScript ["core\fnc\city\setClear.sqf"];
|
||||
btc_city_fnc_setPlayerTrigger = compileScript ["core\fnc\city\setPlayerTrigger.sqf"];
|
||||
btc_city_fnc_cleanUp = compileScript ["core\fnc\city\cleanUp.sqf"];
|
||||
btc_city_fnc_trigger_free_condition = compileScript ["core\fnc\city\trigger_free_condition.sqf"];
|
||||
btc_city_fnc_getHouses = compileScript ["core\fnc\city\getHouses.sqf"];
|
||||
btc_city_fnc_send = compileScript ["core\fnc\city\send.sqf"];
|
||||
|
||||
//CIV
|
||||
btc_civ_fnc_add_grenade = compileScript ["core\fnc\civ\add_grenade.sqf"];
|
||||
btc_civ_fnc_get_weapons = compileScript ["core\fnc\civ\get_weapons.sqf"];
|
||||
btc_civ_fnc_get_grenade = compileScript ["core\fnc\civ\get_grenade.sqf"];
|
||||
btc_civ_fnc_populate = compileScript ["core\fnc\civ\populate.sqf"];
|
||||
btc_civ_fnc_create_patrol = compileScript ["core\fnc\civ\create_patrol.sqf"];
|
||||
btc_civ_fnc_evacuate = compileScript ["core\fnc\civ\evacuate.sqf"];
|
||||
btc_civ_fnc_createFlower = compileScript ["core\fnc\civ\createFlower.sqf"];
|
||||
btc_civ_fnc_createGrave = compileScript ["core\fnc\civ\createGrave.sqf"];
|
||||
|
||||
//DATA
|
||||
btc_data_fnc_add_group = compileScript ["core\fnc\data\add_group.sqf"];
|
||||
btc_data_fnc_get_group = compileScript ["core\fnc\data\get_group.sqf"];
|
||||
btc_data_fnc_spawn_group = compileScript ["core\fnc\data\spawn_group.sqf"];
|
||||
|
||||
//DB
|
||||
btc_db_fnc_save = compileScript ["core\fnc\db\save.sqf"];
|
||||
btc_db_fnc_delete = compileScript ["core\fnc\db\delete.sqf"];
|
||||
btc_db_fnc_loadObjectStatus = compileScript ["core\fnc\db\loadObjectStatus.sqf"];
|
||||
btc_db_fnc_saveObjectStatus = compileScript ["core\fnc\db\saveObjectStatus.sqf"];
|
||||
btc_db_fnc_loadCargo = compileScript ["core\fnc\db\loadcargo.sqf"];
|
||||
btc_db_fnc_autoRestart = compileScript ["core\fnc\db\autoRestart.sqf"];
|
||||
btc_db_fnc_setTurretMagazines = compileScript ["core\fnc\db\setTurretMagazines.sqf"];
|
||||
btc_db_fnc_autoRestartLoop = compileScript ["core\fnc\db\autoRestartLoop.sqf"];
|
||||
|
||||
//DELAY
|
||||
btc_delay_fnc_createUnit = compileScript ["core\fnc\delay\createUnit.sqf"];
|
||||
btc_delay_fnc_createVehicle = compileScript ["core\fnc\delay\createVehicle.sqf"];
|
||||
btc_delay_fnc_createAgent = compileScript ["core\fnc\delay\createAgent.sqf"];
|
||||
btc_delay_fnc_exec = compileScript ["core\fnc\delay\exec.sqf"];
|
||||
btc_delay_fnc_waitAndExecute = compileScript ["core\fnc\delay\waitAndExecute.sqf"];
|
||||
|
||||
//DOOR
|
||||
btc_door_fnc_lock = compileScript ["core\fnc\door\lock.sqf"];
|
||||
btc_door_fnc_get = compileScript ["core\fnc\door\get.sqf"];
|
||||
|
||||
//EH
|
||||
btc_eh_fnc_server = compileScript ["core\fnc\eh\server.sqf"];
|
||||
btc_eh_fnc_playerConnected = compileScript ["core\fnc\eh\playerConnected.sqf"];
|
||||
|
||||
//IED
|
||||
btc_ied_fnc_boom = compileScript ["core\fnc\ied\boom.sqf"];
|
||||
btc_ied_fnc_check = compileScript ["core\fnc\ied\check.sqf"];
|
||||
btc_ied_fnc_checkLoop = compileScript ["core\fnc\ied\checkLoop.sqf"];
|
||||
btc_ied_fnc_create = compileScript ["core\fnc\ied\create.sqf"];
|
||||
btc_ied_fnc_fired_near = compileScript ["core\fnc\ied\fired_near.sqf"];
|
||||
btc_ied_fnc_initArea = compileScript ["core\fnc\ied\initArea.sqf"];
|
||||
btc_ied_fnc_suicider_active = compileScript ["core\fnc\ied\suicider_active.sqf"];
|
||||
btc_ied_fnc_suicider_activeLoop = compileScript ["core\fnc\ied\suicider_activeLoop.sqf"];
|
||||
btc_ied_fnc_suicider_create = compileScript ["core\fnc\ied\suicider_create.sqf"];
|
||||
btc_ied_fnc_suiciderLoop = compileScript ["core\fnc\ied\suiciderLoop.sqf"];
|
||||
btc_ied_fnc_allahu_akbar = compileScript ["core\fnc\ied\allahu_akbar.sqf"];
|
||||
btc_ied_fnc_drone_active = compileScript ["core\fnc\ied\drone_active.sqf"];
|
||||
btc_ied_fnc_drone_create = compileScript ["core\fnc\ied\drone_create.sqf"];
|
||||
btc_ied_fnc_droneLoop = compileScript ["core\fnc\ied\droneLoop.sqf"];
|
||||
btc_ied_fnc_drone_fire = compileScript ["core\fnc\ied\drone_fire.sqf"];
|
||||
btc_ied_fnc_randomRoadPos = compileScript ["core\fnc\ied\randomRoadPos.sqf"];
|
||||
|
||||
//INFO
|
||||
btc_info_fnc_cache = compileScript ["core\fnc\info\cache.sqf"];
|
||||
btc_info_fnc_give_intel = compileScript ["core\fnc\info\give_intel.sqf"];
|
||||
btc_info_fnc_has_intel = compileScript ["core\fnc\info\has_intel.sqf"];
|
||||
btc_info_fnc_hideout = compileScript ["core\fnc\info\hideout.sqf"];
|
||||
btc_info_fnc_cacheMarker = compileScript ["core\fnc\info\cacheMarker.sqf"];
|
||||
btc_info_fnc_path = compileScript ["core\fnc\info\path.sqf"];
|
||||
btc_info_fnc_createIntels = compileScript ["core\fnc\info\createIntels.sqf"];
|
||||
|
||||
//FOB
|
||||
btc_fob_fnc_create_s = compileScript ["core\fnc\fob\create_s.sqf"];
|
||||
btc_fob_fnc_dismantle_s = compileScript ["core\fnc\fob\dismantle_s.sqf"];
|
||||
btc_fob_fnc_killed = compileScript ["core\fnc\fob\killed.sqf"];
|
||||
btc_fob_fnc_rallypointTimer = compileScript ["core\fnc\fob\rallypointTimer.sqf"];
|
||||
|
||||
//MIL
|
||||
btc_mil_fnc_addWP = compileScript ["core\fnc\mil\addWP.sqf"];
|
||||
btc_mil_fnc_check_cap = compileScript ["core\fnc\mil\check_cap.sqf"];
|
||||
btc_mil_fnc_create_group = compileScript ["core\fnc\mil\create_group.sqf"];
|
||||
btc_mil_fnc_create_static = compileScript ["core\fnc\mil\create_static.sqf"];
|
||||
btc_mil_fnc_create_patrol = compileScript ["core\fnc\mil\create_patrol.sqf"];
|
||||
btc_mil_fnc_send = compileScript ["core\fnc\mil\send.sqf"];
|
||||
btc_mil_fnc_set_skill = compileScript ["core\fnc\mil\set_skill.sqf"];
|
||||
btc_mil_fnc_getStructures = compileScript ["core\fnc\mil\getStructures.sqf"];
|
||||
btc_mil_fnc_getBuilding = compileScript ["core\fnc\mil\getBuilding.sqf"];
|
||||
btc_mil_fnc_createVehicle = compileScript ["core\fnc\mil\createVehicle.sqf"];
|
||||
btc_mil_fnc_createUnits = compileScript ["core\fnc\mil\createUnits.sqf"];
|
||||
btc_mil_fnc_unit_killed = compileScript ["core\fnc\mil\unit_killed.sqf"];
|
||||
btc_mil_fnc_create_staticOnRoof = compileScript ["core\fnc\mil\create_staticOnRoof.sqf"];
|
||||
|
||||
//HIDEOUT
|
||||
btc_hideout_fnc_hd = compileScript ["core\fnc\hideout\hd.sqf"];
|
||||
btc_hideout_fnc_create = compileScript ["core\fnc\hideout\create.sqf"];
|
||||
btc_hideout_fnc_create_composition = compileScript ["core\fnc\hideout\create_composition.sqf"];
|
||||
|
||||
//PATROL
|
||||
btc_patrol_fnc_playersInAreaCityGroup = compileScript ["core\fnc\patrol\playersInAreaCityGroup.sqf"];
|
||||
btc_patrol_fnc_usefulCity = compileScript ["core\fnc\patrol\usefulCity.sqf"];
|
||||
btc_patrol_fnc_WPCheck = compileScript ["core\fnc\patrol\WPCheck.sqf"];
|
||||
btc_patrol_fnc_init = compileScript ["core\fnc\patrol\init.sqf"];
|
||||
btc_patrol_fnc_addWP = compileScript ["core\fnc\patrol\addWP.sqf"];
|
||||
btc_patrol_fnc_eh = compileScript ["core\fnc\patrol\eh.sqf"];
|
||||
btc_patrol_fnc_addEH = compileScript ["core\fnc\patrol\addEH.sqf"];
|
||||
|
||||
//SLOT
|
||||
btc_slot_fnc_serializeState = compileScript ["core\fnc\slot\serializeState.sqf"];
|
||||
btc_slot_fnc_deserializeState_s = compileScript ["core\fnc\slot\deserializeState_s.sqf"];
|
||||
btc_slot_fnc_createKey = compileScript ["core\fnc\slot\createKey.sqf"];
|
||||
|
||||
//REP
|
||||
btc_rep_fnc_call_militia = compileScript ["core\fnc\rep\call_militia.sqf"];
|
||||
btc_rep_fnc_change = compileScript ["core\fnc\rep\change.sqf"];
|
||||
btc_rep_fnc_eh_effects = compileScript ["core\fnc\rep\eh_effects.sqf"];
|
||||
btc_rep_fnc_hh = compileScript ["core\fnc\rep\hh.sqf"];
|
||||
btc_rep_fnc_buildingchanged = compileScript ["core\fnc\rep\buildingchanged.sqf"];
|
||||
btc_rep_fnc_explosives_defuse = compileScript ["core\fnc\rep\explosives_defuse.sqf"];
|
||||
btc_rep_fnc_notify = compileScript ["core\fnc\rep\notify.sqf"];
|
||||
btc_rep_fnc_killed = compileScript ["core\fnc\rep\killed.sqf"];
|
||||
btc_rep_fnc_wheelChange = compileScript ["core\fnc\rep\wheelChange.sqf"];
|
||||
btc_rep_fnc_grave = compileScript ["core\fnc\rep\grave.sqf"];
|
||||
|
||||
//RESPAWN
|
||||
btc_respawn_fnc_addTicket = compileScript ["core\fnc\respawn\addTicket.sqf"];
|
||||
btc_respawn_fnc_playerConnected = compileScript ["core\fnc\respawn\playerConnected.sqf"];
|
||||
btc_respawn_fnc_player = compileScript ["core\fnc\respawn\player.sqf"];
|
||||
|
||||
//SIDE
|
||||
btc_side_fnc_create = compileScript ["core\fnc\side\create.sqf"];
|
||||
btc_side_fnc_get_city = compileScript ["core\fnc\side\get_city.sqf"];
|
||||
btc_side_fnc_mines = compileScript ["core\fnc\side\mines.sqf"];
|
||||
btc_side_fnc_supply = compileScript ["core\fnc\side\supply.sqf"];
|
||||
btc_side_fnc_vehicle = compileScript ["core\fnc\side\vehicle.sqf"];
|
||||
btc_side_fnc_civtreatment = compileScript ["core\fnc\side\civtreatment.sqf"];
|
||||
btc_side_fnc_tower = compileScript ["core\fnc\side\tower.sqf"];
|
||||
btc_side_fnc_checkpoint = compileScript ["core\fnc\side\checkpoint.sqf"];
|
||||
btc_side_fnc_civtreatment_boat = compileScript ["core\fnc\side\civtreatment_boat.sqf"];
|
||||
btc_side_fnc_underwater_generator= compileScript ["core\fnc\side\underwater_generator.sqf"];
|
||||
btc_side_fnc_convoy = compileScript ["core\fnc\side\convoy.sqf"];
|
||||
btc_side_fnc_rescue = compileScript ["core\fnc\side\rescue.sqf"];
|
||||
btc_side_fnc_capture_officer = compileScript ["core\fnc\side\capture_officer.sqf"];
|
||||
btc_side_fnc_hostage = compileScript ["core\fnc\side\hostage.sqf"];
|
||||
btc_side_fnc_hack = compileScript ["core\fnc\side\hack.sqf"];
|
||||
btc_side_fnc_kill = compileScript ["core\fnc\side\kill.sqf"];
|
||||
btc_side_fnc_chemicalLeak = compileScript ["core\fnc\side\chemicalLeak.sqf"];
|
||||
btc_side_fnc_EMP = compileScript ["core\fnc\side\EMP.sqf"];
|
||||
btc_side_fnc_removeRubbish = compileScript ["core\fnc\side\removeRubbish.sqf"];
|
||||
btc_side_fnc_pandemic = compileScript ["core\fnc\side\pandemic.sqf"];
|
||||
btc_side_fnc_massacre = compileScript ["core\fnc\side\massacre.sqf"];
|
||||
|
||||
//TAG
|
||||
btc_tag_fnc_initArea = compileScript ["core\fnc\tag\initArea.sqf"];
|
||||
btc_tag_fnc_eh = compileScript ["core\fnc\tag\eh.sqf"];
|
||||
btc_tag_fnc_create = compileScript ["core\fnc\tag\create.sqf"];
|
||||
btc_tag_fnc_vehicle = compileScript ["core\fnc\tag\vehicle.sqf"];
|
||||
|
||||
//LOG
|
||||
btc_log_fnc_createVehicle = compileScript ["core\fnc\log\createVehicle.sqf"];
|
||||
btc_log_fnc_init = compileScript ["core\fnc\log\init.sqf"];
|
||||
btc_log_fnc_server_delete = compileScript ["core\fnc\log\server_delete.sqf"];
|
||||
btc_log_fnc_create_s = compileScript ["core\fnc\log\create_s.sqf"];
|
||||
btc_log_fnc_server_repair_wreck = compileScript ["core\fnc\log\server_repair_wreck.sqf"];
|
||||
|
||||
//DEAF
|
||||
btc_deaf_fnc_earringing = compileScript ["core\fnc\deaf\earringing.sqf"];
|
||||
|
||||
//TASK
|
||||
btc_task_fnc_create = compileScript ["core\fnc\task\create.sqf"];
|
||||
btc_task_fnc_setState = compileScript ["core\fnc\task\setState.sqf"];
|
||||
|
||||
//TOW
|
||||
btc_tow_fnc_ropeBreak = compileScript ["core\fnc\tow\ropeBreak.sqf"];
|
||||
btc_tow_fnc_ViV = compileScript ["core\fnc\tow\ViV.sqf"];
|
||||
|
||||
//VEH
|
||||
btc_veh_fnc_addRespawn = compileScript ["core\fnc\veh\addRespawn.sqf"];
|
||||
btc_veh_fnc_killed = compileScript ["core\fnc\veh\killed.sqf"];
|
||||
btc_veh_fnc_respawn = compileScript ["core\fnc\veh\respawn.sqf"];
|
||||
btc_veh_fnc_propertiesGet = compileScript ["core\fnc\veh\propertiesGet.sqf"];
|
||||
btc_veh_fnc_propertiesSet = compileScript ["core\fnc\veh\propertiesSet.sqf"];
|
||||
btc_veh_fnc_add = compileScript ["core\fnc\veh\add.sqf"];
|
||||
btc_veh_fnc_inventoryRestore = compileScript ["core\fnc\veh\inventoryRestore.sqf"];
|
||||
};
|
||||
|
||||
/////////////////////CLIENT AND SERVER\\\\\\\\\\\\\\\\\\\\\
|
||||
|
||||
//CACHE
|
||||
btc_cache_fnc_hd = compileScript ["core\fnc\cache\hd.sqf"];
|
||||
|
||||
//COMMON
|
||||
btc_fnc_get_class = compileScript ["core\fnc\common\get_class.sqf"];
|
||||
btc_fnc_randomize_pos = compileScript ["core\fnc\common\randomize_pos.sqf"];
|
||||
btc_fnc_getHouses = compileScript ["core\fnc\common\getHouses.sqf"];
|
||||
btc_fnc_house_addWP_loop = compileScript ["core\fnc\common\house_addWP_loop.sqf"];
|
||||
|
||||
//CHEM
|
||||
btc_chem_fnc_damage = compileScript ["core\fnc\chem\damage.sqf"];
|
||||
btc_chem_fnc_deconShowerAnimLarge = {(_this select 0) setVariable ["BIN_Shower_Stop",false]; _this call BIN_fnc_deconShowerAnimLarge;};
|
||||
btc_chem_fnc_damageLoop = compileScript ["core\fnc\chem\damageLoop.sqf"];
|
||||
|
||||
//DOOR
|
||||
btc_door_fnc_broke = compileScript ["core\fnc\door\broke.sqf"];
|
||||
|
||||
//DEBUG
|
||||
btc_debug_fnc_message = compileScript ["core\fnc\debug\message.sqf"];
|
||||
|
||||
//EH
|
||||
btc_eh_fnc_trackItem = compileScript ["core\fnc\eh\trackItem.sqf"];
|
||||
|
||||
//FLAG
|
||||
btc_flag_fnc_int = compileScript ["core\fnc\flag\int.sqf"];
|
||||
|
||||
//CIV
|
||||
btc_civ_fnc_class = compileScript ["core\fnc\civ\class.sqf"];
|
||||
btc_civ_fnc_addWP = compileScript ["core\fnc\civ\addWP.sqf"];
|
||||
btc_civ_fnc_add_weapons = compileScript ["core\fnc\civ\add_weapons.sqf"];
|
||||
|
||||
//IED
|
||||
btc_ied_fnc_belt = compileScript ["core\fnc\ied\belt.sqf"];
|
||||
|
||||
//INT
|
||||
btc_int_fnc_orders_give = compileScript ["core\fnc\int\orders_give.sqf"];
|
||||
btc_int_fnc_orders_behaviour = compileScript ["core\fnc\int\orders_behaviour.sqf"];
|
||||
btc_int_fnc_ask_var = compileScript ["core\fnc\int\ask_var.sqf"];
|
||||
|
||||
//LOG
|
||||
btc_log_fnc_place_destroy_camera = compileScript ["core\fnc\log\place_destroy_camera.sqf"];
|
||||
btc_log_fnc_inventoryGet = compileScript ["core\fnc\log\inventoryGet.sqf"];
|
||||
btc_log_fnc_inventorySet = compileScript ["core\fnc\log\inventorySet.sqf"];
|
||||
|
||||
//MIL
|
||||
btc_mil_fnc_class = compileScript ["core\fnc\mil\class.sqf"];
|
||||
btc_mil_fnc_ammoUsage = compileScript ["core\fnc\mil\ammoUsage.sqf"];
|
||||
|
||||
//PATROL
|
||||
btc_patrol_fnc_disabled = compileScript ["core\fnc\patrol\disabled.sqf"];
|
||||
|
||||
//REP
|
||||
btc_rep_fnc_hd = compileScript ["core\fnc\rep\hd.sqf"];
|
||||
btc_rep_fnc_suppressed = compileScript ["core\fnc\rep\suppressed.sqf"];
|
||||
btc_rep_fnc_foodRemoved = compileScript ["core\fnc\rep\foodRemoved.sqf"];
|
||||
|
||||
//ARSENAL
|
||||
btc_arsenal_fnc_ammoUsage = compileScript ["core\fnc\arsenal\ammoUsage.sqf"];
|
||||
|
||||
//TOW
|
||||
btc_tow_fnc_int = compileScript ["core\fnc\tow\int.sqf"];
|
||||
|
||||
//VEH
|
||||
btc_veh_fnc_init = compileScript ["core\fnc\veh\init.sqf"];
|
||||
|
||||
/////////////////////CLIENT\\\\\\\\\\\\\\\\\\\\\
|
||||
if (!isDedicated) then {
|
||||
//BODY
|
||||
btc_body_fnc_bagRecover = compileScript ["core\fnc\body\bagRecover.sqf"];
|
||||
|
||||
//COMMON
|
||||
btc_fnc_end_mission = compileScript ["core\fnc\common\end_mission.sqf"];
|
||||
btc_fnc_get_cardinal = compileScript ["core\fnc\common\get_cardinal.sqf"];
|
||||
btc_fnc_show_hint = compileScript ["core\fnc\common\show_hint.sqf"];
|
||||
btc_fnc_set_markerTextLocal = compileScript ["core\fnc\common\set_markerTextLocal.sqf"];
|
||||
btc_fnc_showSubtitle = compileScript ["core\fnc\common\showSubtitle.sqf"];
|
||||
btc_fnc_get_composition = compileScript ["core\fnc\common\get_composition.sqf"];
|
||||
btc_fnc_checkArea = compileScript ["core\fnc\common\checkArea.sqf"];
|
||||
btc_fnc_typeOfPreview = compileScript ["core\fnc\common\typeOfPreview.sqf"];
|
||||
|
||||
//CHEM
|
||||
btc_chem_fnc_biopsy = compileScript ["core\fnc\chem\biopsy.sqf"];
|
||||
btc_chem_fnc_ehDetector = compileScript ["core\fnc\chem\ehDetector.sqf"];
|
||||
btc_chem_fnc_updateDetector = compileScript ["core\fnc\chem\updateDetector.sqf"];
|
||||
|
||||
//DEBUG
|
||||
btc_debug_fnc_marker = compileScript ["core\fnc\debug\marker.sqf"];
|
||||
btc_debug_fnc_units = compileScript ["core\fnc\debug\units.sqf"];
|
||||
btc_debug_fnc_fps = compileScript ["core\fnc\debug\fps.sqf"];
|
||||
btc_debug_fnc_graph = compileScript ["core\fnc\debug\graph.sqf"];
|
||||
|
||||
//CIV
|
||||
btc_civ_fnc_add_leaflets = compileScript ["core\fnc\civ\add_leaflets.sqf"];
|
||||
btc_civ_fnc_leaflets = compileScript ["core\fnc\civ\leaflets.sqf"];
|
||||
|
||||
//DOOR
|
||||
btc_door_fnc_break = compileScript ["core\fnc\door\break.sqf"];
|
||||
|
||||
//IED
|
||||
btc_ied_fnc_effects = compileScript ["core\fnc\ied\effects.sqf"];
|
||||
btc_ied_fnc_effect_smoke = compileScript ["core\fnc\ied\effect_smoke.sqf"];
|
||||
btc_ied_fnc_effect_color_smoke = compileScript ["core\fnc\ied\effect_color_smoke.sqf"];
|
||||
btc_ied_fnc_effect_rocks = compileScript ["core\fnc\ied\effect_rocks.sqf"];
|
||||
btc_ied_fnc_effect_blurEffect = compileScript ["core\fnc\ied\effect_blurEffect.sqf"];
|
||||
btc_ied_fnc_effect_shock_wave = compileScript ["core\fnc\ied\effect_shock_wave.sqf"];
|
||||
btc_ied_fnc_deleteLoop = compileScript ["core\fnc\ied\deleteLoop.sqf"];
|
||||
|
||||
//EH
|
||||
btc_eh_fnc_CuratorObjectPlaced = compileScript ["core\fnc\eh\CuratorObjectPlaced.sqf"];
|
||||
btc_eh_fnc_player = compileScript ["core\fnc\eh\player.sqf"];
|
||||
|
||||
//FLAG
|
||||
btc_flag_fnc_deploy = compileScript ["core\fnc\flag\deploy.sqf"];
|
||||
|
||||
//FOB
|
||||
btc_fob_fnc_create = compileScript ["core\fnc\fob\create.sqf"];
|
||||
btc_fob_fnc_rallypointAssemble = compileScript ["core\fnc\fob\rallypointAssemble.sqf"];
|
||||
btc_fob_fnc_redeploy = compileScript ["core\fnc\fob\redeploy.sqf"];
|
||||
btc_fob_fnc_redeployCheck = compileScript ["core\fnc\fob\redeployCheck.sqf"];
|
||||
btc_fob_fnc_addInteraction = compileScript ["core\fnc\fob\addInteraction.sqf"];
|
||||
|
||||
//INT
|
||||
btc_int_fnc_add_actions = compileScript ["core\fnc\int\add_actions.sqf"];
|
||||
btc_int_fnc_orders = compileScript ["core\fnc\int\orders.sqf"];
|
||||
btc_int_fnc_shortcuts = compileScript ["core\fnc\int\shortcuts.sqf"];
|
||||
btc_int_fnc_terminal = compileScript ["core\fnc\int\terminal.sqf"];
|
||||
btc_int_fnc_foodGive = compileScript ["core\fnc\int\foodGive.sqf"];
|
||||
btc_int_fnc_ordersLoop = compileScript ["core\fnc\int\ordersLoop.sqf"];
|
||||
btc_int_fnc_checkSirenBeacons = compileScript ["core\fnc\int\checkSirenBeacons.sqf"];
|
||||
btc_int_fnc_horn = compileScript ["core\fnc\int\horn.sqf"];
|
||||
|
||||
//INFO
|
||||
btc_info_fnc_ask = compileScript ["core\fnc\info\ask.sqf"];
|
||||
btc_info_fnc_hideout_asked = compileScript ["core\fnc\info\hideout_asked.sqf"];
|
||||
btc_info_fnc_search_for_intel = compileScript ["core\fnc\info\search_for_intel.sqf"];
|
||||
btc_info_fnc_troops = compileScript ["core\fnc\info\troops.sqf"];
|
||||
btc_info_fnc_ask_reputation = compileScript ["core\fnc\info\ask_reputation.sqf"];
|
||||
btc_info_fnc_cachePicture = compileScript ["core\fnc\info\cachePicture.sqf"];
|
||||
|
||||
//LIFT
|
||||
btc_lift_fnc_check = compileScript ["core\fnc\lift\check.sqf"];
|
||||
btc_lift_fnc_deployRopes = compileScript ["core\fnc\lift\deployRopes.sqf"];
|
||||
btc_lift_fnc_destroyRopes = compileScript ["core\fnc\lift\destroyRopes.sqf"];
|
||||
btc_lift_fnc_hook = compileScript ["core\fnc\lift\hook.sqf"];
|
||||
btc_lift_fnc_hookFake = compileScript ["core\fnc\lift\hookFake.sqf"];
|
||||
btc_lift_fnc_hud = compileScript ["core\fnc\lift\hud.sqf"];
|
||||
btc_lift_fnc_hudLoop = compileScript ["core\fnc\lift\hudLoop.sqf"];
|
||||
btc_lift_fnc_shortcuts = compileScript ["core\fnc\lift\shortcuts.sqf"];
|
||||
|
||||
//LOG
|
||||
btc_log_fnc_get_corner_points = compileScript ["core\fnc\log\get_corner_points.sqf"];
|
||||
btc_log_fnc_delete = compileScript ["core\fnc\log\delete.sqf"];
|
||||
btc_log_fnc_create = compileScript ["core\fnc\log\create.sqf"];
|
||||
btc_log_fnc_create_apply = compileScript ["core\fnc\log\create_apply.sqf"];
|
||||
btc_log_fnc_create_load = compileScript ["core\fnc\log\create_load.sqf"];
|
||||
btc_log_fnc_create_change_target = compileScript ["core\fnc\log\create_change_target.sqf"];
|
||||
btc_log_fnc_place_create_camera = compileScript ["core\fnc\log\place_create_camera.sqf"];
|
||||
btc_log_fnc_place = compileScript ["core\fnc\log\place.sqf"];
|
||||
btc_log_fnc_place_key_down = compileScript ["core\fnc\log\place_key_down.sqf"];
|
||||
btc_log_fnc_repair_wreck = compileScript ["core\fnc\log\repair_wreck.sqf"];
|
||||
btc_log_fnc_copy = compileScript ["core\fnc\log\copy.sqf"];
|
||||
btc_log_fnc_paste = compileScript ["core\fnc\log\paste.sqf"];
|
||||
btc_log_fnc_refuelSource = compileScript ["core\fnc\log\refuelSource.sqf"];
|
||||
btc_log_fnc_rearmSource = compileScript ["core\fnc\log\rearmSource.sqf"];
|
||||
btc_log_fnc_inventoryCopy = compileScript ["core\fnc\log\inventoryCopy.sqf"];
|
||||
btc_log_fnc_inventoryPaste = compileScript ["core\fnc\log\inventoryPaste.sqf"];
|
||||
btc_log_fnc_inventoryRestore = compileScript ["core\fnc\log\inventoryRestore.sqf"];
|
||||
|
||||
//REP
|
||||
btc_rep_fnc_treatment = compileScript ["core\fnc\rep\treatment.sqf"];
|
||||
|
||||
//RESPAWN
|
||||
btc_respawn_fnc_screen = compileScript ["core\fnc\respawn\screen.sqf"];
|
||||
btc_respawn_fnc_force = compileScript ["core\fnc\respawn\force.sqf"];
|
||||
btc_respawn_fnc_intro = compileScript ["core\fnc\respawn\intro.sqf"];
|
||||
|
||||
//SPECT
|
||||
btc_spect_fnc_updateDevice = compileScript ["core\fnc\spect\updateDevice.sqf"];
|
||||
btc_spect_fnc_frequencies = compileScript ["core\fnc\spect\frequencies.sqf"];
|
||||
btc_spect_fnc_disableDevice = compileScript ["core\fnc\spect\disableDevice.sqf"];
|
||||
|
||||
//ARSENAL
|
||||
btc_arsenal_fnc_data = compileScript ["core\fnc\arsenal\data.sqf"];
|
||||
btc_arsenal_fnc_garage = compileScript ["core\fnc\arsenal\garage.sqf"];
|
||||
btc_arsenal_fnc_loadout = compileScript ["core\fnc\arsenal\loadout.sqf"];
|
||||
btc_arsenal_fnc_trait = compileScript ["core\fnc\arsenal\trait.sqf"];
|
||||
btc_arsenal_fnc_ammoUsage = compileScript ["core\fnc\arsenal\ammoUsage.sqf"];
|
||||
btc_arsenal_fnc_weaponsFilter = compileScript ["core\fnc\arsenal\weaponsfilter.sqf"];
|
||||
|
||||
//TASK
|
||||
btc_task_fnc_setDescription = compileScript ["core\fnc\task\setDescription.sqf"];
|
||||
btc_task_fnc_abort = compileScript ["core\fnc\task\abort.sqf"];
|
||||
|
||||
//TOW
|
||||
btc_tow_fnc_ropeCreate = compileScript ["core\fnc\tow\ropeCreate.sqf"];
|
||||
btc_tow_fnc_hitch_points = compileScript ["core\fnc\tow\hitch_points.sqf"];
|
||||
btc_tow_fnc_unhook = compileScript ["core\fnc\tow\unhook.sqf"];
|
||||
btc_tow_fnc_check = compileScript ["core\fnc\tow\check.sqf"];
|
||||
|
||||
//SLOT
|
||||
btc_slot_fnc_deserializeState = compileScript ["core\fnc\slot\deserializeState.sqf"];
|
||||
};
|
||||
|
||||
/////////////////////HEADLESS\\\\\\\\\\\\\\\\\\\\\
|
||||
if (!hasInterface && !isDedicated) then {
|
||||
btc_eh_fnc_headless = compileScript ["core\fnc\eh\headless.sqf"];
|
||||
};
|
||||
73
hearts_and_minds.kunduz_valley/core/fnc/data/add_group.sqf
Normal file
73
hearts_and_minds.kunduz_valley/core/fnc/data/add_group.sqf
Normal file
@@ -0,0 +1,73 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_data_fnc_add_group
|
||||
|
||||
Description:
|
||||
If player is around: initiate patrol around the destination,
|
||||
Ifnot: save in database and delete units by calling btc_data_fnc_get_group.
|
||||
|
||||
Parameters:
|
||||
_group - Group of units. [Group]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_data_fnc_add_group;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_group", grpNull, [grpNull]]
|
||||
];
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["%1", _group], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
_group setVariable ["no_cache", nil];
|
||||
[_group] call CBA_fnc_clearWaypoints;
|
||||
|
||||
private _city = [leader _group, values btc_city_all, false] call btc_fnc_find_closecity;
|
||||
_city setVariable ["occupied", true];
|
||||
|
||||
if (_city getVariable ["marker", ""] != "") then {
|
||||
private _marker = _city getVariable ["marker", ""];
|
||||
_marker setMarkerColor "ColorRed";
|
||||
_marker setMarkerAlpha 0.3;
|
||||
};
|
||||
|
||||
private _wp = if (vehicle leader _group isEqualTo leader _group) then {
|
||||
selectRandom ["HOUSE", "PATROL", "SENTRY"];
|
||||
} else {
|
||||
if ((vehicle leader _group) isKindOf "Air") then {
|
||||
"PATROL";
|
||||
} else {
|
||||
selectRandom ["PATROL", "SENTRY"];
|
||||
};
|
||||
};
|
||||
|
||||
[_group, _city, 200, _wp] call btc_mil_fnc_addWP;
|
||||
|
||||
if (_city getVariable ["active", false]) then {
|
||||
_group setVariable ["btc_city", _city];
|
||||
} else {
|
||||
private _data_units = _city getVariable ["data_units", []];
|
||||
private _data_group = _group call btc_data_fnc_get_group;
|
||||
|
||||
_data_units pushBack _data_group;
|
||||
_city setVariable ["data_units", _data_units];
|
||||
if (btc_debug_log) then {
|
||||
[format ["PUSHBACK = %1", _data_group], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
};
|
||||
|
||||
if (btc_final_phase) then {
|
||||
btc_city_remaining pushBack _city;
|
||||
};
|
||||
if (btc_debug_log) then {
|
||||
[format ["END = %1", []], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
84
hearts_and_minds.kunduz_valley/core/fnc/data/get_group.sqf
Normal file
84
hearts_and_minds.kunduz_valley/core/fnc/data/get_group.sqf
Normal file
@@ -0,0 +1,84 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_data_fnc_get_group
|
||||
|
||||
Description:
|
||||
Get groups parameters (position, waypoints, behaviour ...), save them and delete.
|
||||
|
||||
Parameters:
|
||||
_group - Group of units. [Group]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_data_fnc_get_group;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_group", grpNull, [grpNull]]
|
||||
];
|
||||
|
||||
private _units = (units _group) select {alive _x};
|
||||
if (_units isEqualTo []) exitWith {nil};
|
||||
private _leader = leader _group;
|
||||
private _vehicle = vehicle _leader;
|
||||
|
||||
private _type_db = 0;
|
||||
private _array_pos = [];
|
||||
private _array_type = [];
|
||||
private _side = side _group;
|
||||
private _array_dam = [];
|
||||
private _array_in_veh = [];
|
||||
private _array_veh = [];
|
||||
private _index_wp = currentWaypoint _group;
|
||||
private _array_wp = (waypoints _group) apply {[
|
||||
waypointPosition _x,
|
||||
waypointType _x,
|
||||
waypointSpeed _x,
|
||||
waypointFormation _x,
|
||||
waypointCombatMode _x,
|
||||
waypointBehaviour _x,
|
||||
waypointTimeout _x,
|
||||
waypointCompletionRadius _x
|
||||
]};
|
||||
|
||||
{
|
||||
private _pos = getPosATL _x;
|
||||
if (surfaceIsWater _pos) then {
|
||||
_array_pos pushBack getPos _x;
|
||||
} else {
|
||||
_array_pos pushBack _pos;
|
||||
};
|
||||
|
||||
_array_type pushBack typeOf _x;
|
||||
_array_dam pushBack getDammage _x;
|
||||
} forEach _units;
|
||||
|
||||
if (_group getVariable ["btc_inHouse", ""] isNotEqualTo "") then {
|
||||
_type_db = 3;
|
||||
_array_veh = _group getVariable ["btc_inHouse", ""];
|
||||
};
|
||||
if (_group getVariable ["getWeapons", false]) then {_type_db = 4;};
|
||||
if (_group getVariable ["suicider", false]) then {_type_db = 5;};
|
||||
if (_group getVariable ["btc_data_inhouse", []] isNotEqualTo []) then {
|
||||
_type_db = 6;
|
||||
_array_veh = _group getVariable ["btc_data_inhouse", []];
|
||||
};
|
||||
if (_group getVariable ["btc_ied_drone", false]) then {_type_db = 7;};
|
||||
if (
|
||||
_vehicle != _leader &&
|
||||
{_type_db isNotEqualTo 7}
|
||||
) then {
|
||||
_type_db = 1;
|
||||
_array_veh = [typeOf _vehicle, getPosATL _vehicle, getDir _vehicle, fuel _vehicle, vectorUp _vehicle];
|
||||
};
|
||||
|
||||
[_vehicle, _group] call CBA_fnc_deleteEntity;
|
||||
|
||||
[_type_db, _array_pos, _array_type, _side, _array_dam, [], [_index_wp, _array_wp], _array_veh]
|
||||
115
hearts_and_minds.kunduz_valley/core/fnc/data/spawn_group.sqf
Normal file
115
hearts_and_minds.kunduz_valley/core/fnc/data/spawn_group.sqf
Normal file
@@ -0,0 +1,115 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_data_fnc_spawn_group
|
||||
|
||||
Description:
|
||||
Create group previously saved by btc_data_fnc_get_group.
|
||||
|
||||
Parameters:
|
||||
_data_unit - All data listed above. [Array]
|
||||
_type - Type of group (3: in house group, 4: civilian with weapon, 5: suicider ...). [Number]
|
||||
_array_pos - Position on units. [Array]
|
||||
_array_type - Type of units. [Array]
|
||||
_side - Side of the group. [Side]
|
||||
_array_dam - Damage of units. [Array]
|
||||
_behaviour - Behaviour of units. [Array]
|
||||
_array_wp - Waypoints of group. [Array]
|
||||
_array_veh - Vehicle occupied by the group. [Array, String]
|
||||
_city - City. [Object]
|
||||
_spawningRadius - Spawning radius. [Number]
|
||||
|
||||
Returns:
|
||||
_delay - Delay due to vehicle spawn. [Number]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_data_fnc_spawn_group;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_data_unit", [], [[]]],
|
||||
["_city", objNull, [objNull]],
|
||||
["_spawningRadius", 100, [0]]
|
||||
];
|
||||
_data_unit params [
|
||||
["_type", 1, [0]],
|
||||
["_array_pos", [], [[]]],
|
||||
["_array_type", [], [[]]],
|
||||
["_side", east, [east]],
|
||||
["_array_dam", [], [[]]],
|
||||
["_behaviour", [], [[]]],
|
||||
["_array_wp", [], [[]]],
|
||||
["_array_veh", [], [[], ""]]
|
||||
];
|
||||
|
||||
private _delay = 0;
|
||||
if (_type isEqualTo 5) exitWith {
|
||||
[[_city, _spawningRadius, _array_pos select 0, _array_type select 0], btc_ied_fnc_suicider_create] call btc_delay_fnc_exec;
|
||||
_delay + btc_delay_unit
|
||||
};
|
||||
if (_type isEqualTo 7) exitWith {
|
||||
[[_city, _spawningRadius, _array_pos select 0], btc_ied_fnc_drone_create] call btc_delay_fnc_exec;
|
||||
_delay + btc_delay_unit
|
||||
};
|
||||
|
||||
private _group = createGroup _side;
|
||||
_group setVariable ["btc_city", _city];
|
||||
if (_type isEqualTo 1) then {
|
||||
_array_veh params ["_typeOf", "_posATL", "_dir", "_fuel", ["_vectorUp", []]];
|
||||
_delay = [_group, _typeOf, _array_type, _posATL, _dir, _fuel, _vectorUp] call btc_delay_fnc_createVehicle;
|
||||
} else {
|
||||
for "_i" from 0 to (count _array_pos - 1) do {
|
||||
[_group, _array_type select _i, _array_pos select _i, "CAN_COLLIDE"] call btc_delay_fnc_createUnit;
|
||||
//_u setDamage (_array_dam select _i);
|
||||
};
|
||||
};
|
||||
|
||||
[{
|
||||
params ["_data_unit", "_group"];
|
||||
_data_unit params [
|
||||
["_type", 1, [0]],
|
||||
["_array_pos", [], [[]]],
|
||||
["_array_type", [], [[]]],
|
||||
["_side", east, [east]],
|
||||
["_array_dam", [], [[]]],
|
||||
["_behaviour", [], [[]]],
|
||||
["_array_wp", [], [[]]],
|
||||
["_array_veh", [], [[], ""]]
|
||||
];
|
||||
|
||||
if !(_type in [3, 6]) then {
|
||||
[_group] call CBA_fnc_clearWaypoints;
|
||||
{
|
||||
_x params [
|
||||
"_position",
|
||||
"_type",
|
||||
"_speed",
|
||||
"_formation",
|
||||
"_combat",
|
||||
"_behaviour",
|
||||
["_timeout", [0, 0, 0], [[]], 3],
|
||||
["_compRadius", 20, [0]]
|
||||
];
|
||||
[_group, _position, -1, _type, _behaviour, _combat, _speed, _formation, "", _timeout, _compRadius] call CBA_fnc_addWaypoint;
|
||||
} forEach (_array_wp select 1);
|
||||
if (_array_wp select 1 isNotEqualTo []) then {
|
||||
_group setCurrentWaypoint [_group, _array_wp select 0];
|
||||
};
|
||||
};
|
||||
if (_type isEqualTo 3) then {
|
||||
[_group, nearestObject [_array_pos select 0, _array_veh]] call btc_fnc_house_addWP;
|
||||
_group setVariable ["btc_inHouse", _array_veh];
|
||||
};
|
||||
if (_type isEqualTo 4) then {[[0, 0, 0], 0, units _group] call btc_civ_fnc_get_weapons;};
|
||||
if (_type isEqualTo 6) then {
|
||||
[_group, _array_veh select 0] call btc_civ_fnc_addWP;
|
||||
_group setVariable ["btc_data_inhouse", _array_veh];
|
||||
};
|
||||
}, [_data_unit, _group], _delay] call btc_delay_fnc_waitAndExecute;
|
||||
|
||||
_delay
|
||||
41
hearts_and_minds.kunduz_valley/core/fnc/db/autoRestart.sqf
Normal file
41
hearts_and_minds.kunduz_valley/core/fnc/db/autoRestart.sqf
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_autoRestart
|
||||
|
||||
Description:
|
||||
Save or not and restart/shutdown server.
|
||||
|
||||
Parameters:
|
||||
_p_autoRestartType - 0: "Off", 1: "Restart", 2: "Shutdown", 3: "Save and restart", 4: "Save and shutdown". [Number]
|
||||
_serverCommandPassword - Password defined in server.cfg. [String]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[4] call btc_db_fnc_autoRestart;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_p_autoRestartType", btc_p_db_autoRestartType, [0]],
|
||||
["_serverCommandPassword", btc_db_serverCommandPassword, ""]
|
||||
];
|
||||
|
||||
private _serverCommand = if (_p_autoRestartType in [1, 3]) then {
|
||||
"#restartserver"
|
||||
} else {
|
||||
"#shutdown"
|
||||
};
|
||||
|
||||
if (_p_autoRestartType > 2) then {
|
||||
[] call btc_db_fnc_save;
|
||||
};
|
||||
|
||||
if !(_serverCommandPassword serverCommand _serverCommand) then {
|
||||
["Invalid password", __FILE__, [true, true, true]] call btc_debug_fnc_message;
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_autoRestartLoop
|
||||
|
||||
Description:
|
||||
Start loop until restart.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_db_fnc_autoRestartLoop;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
if (btc_p_db_autoRestartTime > 0) then {
|
||||
[{
|
||||
[19, btc_db_warningTimeAutoRestart] remoteExecCall ["btc_fnc_show_hint", [0, -2] select isDedicated];
|
||||
[btc_db_fnc_autoRestart, [], btc_db_warningTimeAutoRestart * 60] call CBA_fnc_waitAndExecute;
|
||||
}, [], btc_p_db_autoRestartTime * 60 * 60 - btc_db_warningTimeAutoRestart * 60] call CBA_fnc_waitAndExecute;
|
||||
};
|
||||
|
||||
btc_p_db_autoRestartHour = btc_p_db_autoRestartHour - [-1];
|
||||
if (btc_p_db_autoRestartHour isNotEqualTo []) then {
|
||||
[{
|
||||
[{systemTime select 3 in btc_p_db_autoRestartHour}, btc_db_fnc_autoRestart] call CBA_fnc_waitUntilAndExecute;
|
||||
}, [], 1 * (60 - (systemTime select 4)) * 60] call CBA_fnc_waitAndExecute;
|
||||
};
|
||||
51
hearts_and_minds.kunduz_valley/core/fnc/db/delete.sqf
Normal file
51
hearts_and_minds.kunduz_valley/core/fnc/db/delete.sqf
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_delete
|
||||
|
||||
Description:
|
||||
Delete database.
|
||||
|
||||
Parameters:
|
||||
_showHint - Show the hint telling the database has been deleted. [Boolean]
|
||||
_name - Name of the current database. [String]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_db_fnc_delete;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_showHint", true, [true]],
|
||||
["_name", worldName, [""]]
|
||||
];
|
||||
|
||||
profileNamespace setVariable [format ["btc_hm_%1_version", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_date", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_cities", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_ho", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_ho_sel", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_cache", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_rep", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_fobs", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_vehs", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_objs", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_tags", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_respawnTickets", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_deadBodyPlayers", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_slotsSerialized", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_markers", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_explosives", _name], nil];
|
||||
profileNamespace setVariable [format ["btc_hm_%1_db", _name], nil];
|
||||
|
||||
saveProfileNamespace;
|
||||
|
||||
if (_showHint) then {
|
||||
[10] remoteExecCall ["btc_fnc_show_hint", 0];
|
||||
};
|
||||
292
hearts_and_minds.kunduz_valley/core/fnc/db/load.sqf
Normal file
292
hearts_and_minds.kunduz_valley/core/fnc/db/load.sqf
Normal file
@@ -0,0 +1,292 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_load
|
||||
|
||||
Description:
|
||||
Load database from profileNamespace depends one worldname
|
||||
|
||||
Parameters:
|
||||
_name - Name of the saved game. [String]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
["Altis"] call btc_db_fnc_load;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_name", worldName, [""]]
|
||||
];
|
||||
|
||||
setDate +(profileNamespace getVariable [format ["btc_hm_%1_date", _name], date]);
|
||||
|
||||
//CITIES
|
||||
private _cities_status = +(profileNamespace getVariable [format ["btc_hm_%1_cities", _name], []]);
|
||||
|
||||
{
|
||||
_x params ["_id", "_initialized", "_spawn_more", "_occupied", "_data_units", "_has_ho", "_ho_units_spawned", "_ieds", "_has_suicider",
|
||||
["_data_animals", [], [[]]],
|
||||
["_data_tags", [], [[]]],
|
||||
["_civKilled", [], [[]]],
|
||||
["_graves", [], [[]]]
|
||||
];
|
||||
|
||||
private _city = btc_city_all get _id;
|
||||
|
||||
_city setVariable ["initialized", _initialized];
|
||||
_city setVariable ["spawn_more", _spawn_more];
|
||||
_city setVariable ["occupied", _occupied];
|
||||
_city setVariable ["data_units", _data_units];
|
||||
_city setVariable ["has_ho", _has_ho];
|
||||
_city setVariable ["ho_units_spawned", _ho_units_spawned];
|
||||
_city setVariable ["ieds", _ieds];
|
||||
_city setVariable ["has_suicider", _has_suicider];
|
||||
_city setVariable ["data_animals", _data_animals];
|
||||
_city setVariable ["data_tags", _data_tags];
|
||||
_city setVariable ["btc_rep_civKilled", _civKilled];
|
||||
_city setVariable ["btc_rep_graves", _graves];
|
||||
|
||||
if (btc_debug) then {
|
||||
private _marker = _city getVariable ["marker", ""];
|
||||
if (_city getVariable ["occupied", false]) then {
|
||||
_marker setMarkerColor "colorRed";
|
||||
} else {
|
||||
_marker setMarkerColor "colorGreen";
|
||||
};
|
||||
};
|
||||
if (btc_debug_log) then {
|
||||
[format [
|
||||
"ID: %1 - _initialized %2 _spawn_more %3 _occupied %4 count _data_units %5 _has_ho %6",
|
||||
_id, _initialized, _spawn_more,
|
||||
_occupied, count _data_units, _has_ho
|
||||
], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
[format [
|
||||
"ID: %1 - _ho_units_spawned %2 count _ieds %3 _has_suicider %4 count _data_animals %5 count _data_tags %6 count _civKilled %7",
|
||||
_id, _ho_units_spawned, count _ieds, _has_suicider,
|
||||
count _data_animals, count _data_tags, count _civKilled
|
||||
], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
} forEach _cities_status;
|
||||
|
||||
//HIDEOUT
|
||||
private _array_ho = +(profileNamespace getVariable [format ["btc_hm_%1_ho", _name], []]);
|
||||
|
||||
{
|
||||
_x call btc_hideout_fnc_create;
|
||||
} forEach _array_ho;
|
||||
|
||||
private _ho = profileNamespace getVariable [format ["btc_hm_%1_ho_sel", _name], 0];
|
||||
private _select_ho = (btc_hideouts apply {_x getVariable "id"}) find _ho;
|
||||
if (_select_ho isEqualTo - 1) then {
|
||||
btc_hq = objNull;
|
||||
} else {
|
||||
btc_hq = btc_hideouts select _select_ho;
|
||||
};
|
||||
|
||||
if (btc_hideouts isEqualTo []) then {[] spawn btc_fnc_final_phase;};
|
||||
|
||||
//CACHE
|
||||
private _array_cache = +(profileNamespace getVariable [format ["btc_hm_%1_cache", _name], []]);
|
||||
_array_cache params ["_cache_pos", "_cache_n", "_cache_info", "_cache_markers", "_cache_pictures",
|
||||
["_isChem", false, [true]],
|
||||
["_cache_unitsSpawned", false, [true]]
|
||||
];
|
||||
|
||||
btc_cache_pos = _cache_pos;
|
||||
btc_cache_n = _cache_n;
|
||||
btc_cache_info = _cache_info;
|
||||
|
||||
[_cache_pos, btc_p_chem_cache_probability > 0, [1, 0] select _isChem] call btc_cache_fnc_create;
|
||||
btc_cache_obj setVariable ["btc_cache_unitsSpawned", _cache_unitsSpawned];
|
||||
|
||||
btc_cache_markers = [];
|
||||
{
|
||||
_x params ["_pos", "_marker_name"];
|
||||
|
||||
[_pos, 0, _marker_name] call btc_info_fnc_cacheMarker;
|
||||
} forEach _cache_markers;
|
||||
|
||||
btc_cache_pictures = _cache_pictures;
|
||||
{
|
||||
(btc_cache_pictures select 2) pushBack ([
|
||||
_x,
|
||||
btc_cache_n,
|
||||
btc_cache_pictures select 1 select _forEachindex
|
||||
] remoteExecCall ["btc_info_fnc_cachePicture", [0, -2] select isDedicated, true]);
|
||||
} forEach (btc_cache_pictures select 0);
|
||||
|
||||
//FOB
|
||||
private _fobs = +(profileNamespace getVariable [format ["btc_hm_%1_fobs", _name], []]);
|
||||
|
||||
{
|
||||
_x params ["_fob_name", "_pos", ["_direction", 0, [0]]];
|
||||
|
||||
[_pos, _direction, _fob_name] call btc_fob_fnc_create_s;
|
||||
} forEach _fobs;
|
||||
|
||||
//REP
|
||||
btc_global_reputation = profileNamespace getVariable [format ["btc_hm_%1_rep", _name], 0];
|
||||
|
||||
//Objects
|
||||
{deleteVehicle _x} forEach (getMissionLayerEntities "btc_vehicles" select 0);
|
||||
if !(isNil "btc_vehicles") then {
|
||||
{deleteVehicle _x} forEach btc_vehicles;
|
||||
btc_vehicles = [];
|
||||
};
|
||||
|
||||
private _objs = +(profileNamespace getVariable [format ["btc_hm_%1_objs", _name], []]);
|
||||
[{ // Can't use ace_cargo for objects created during first frame.
|
||||
{
|
||||
[_x] call btc_db_fnc_loadObjectStatus;
|
||||
} forEach _this;
|
||||
}, _objs] call CBA_fnc_execNextFrame;
|
||||
|
||||
//VEHICLES
|
||||
private _vehs = +(profileNamespace getVariable [format ["btc_hm_%1_vehs", _name], []]);
|
||||
[{ // Can't be executed just after because we can't delete and spawn vehicle during the same frame.
|
||||
private _loadVehicle = {
|
||||
params [
|
||||
"_veh_type",
|
||||
"_veh_pos",
|
||||
"_veh_dir",
|
||||
"_veh_fuel",
|
||||
"_veh_AllHitPointsDamage",
|
||||
"_veh_cargo",
|
||||
"_veh_inventory",
|
||||
"_customization",
|
||||
["_isMedicalVehicle", false, [false]],
|
||||
["_isRepairVehicle", false, [false]],
|
||||
["_fuelSource", [], [[]]],
|
||||
["_pylons", [], [[]]],
|
||||
["_isContaminated", false, [false]],
|
||||
["_supplyVehicle", [], [[]]],
|
||||
["_objectTexture", [], [[]]],
|
||||
["_EDENinventory", [], [[]]],
|
||||
["_vectorPos", [], [[]]],
|
||||
["_ViV", [], [[]]],
|
||||
["_flagTexture", "", [""]],
|
||||
["_turretMagazines", [], [[]]],
|
||||
["_tagTexture", "", [""]]
|
||||
];
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["_veh = %1", _x], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
private _veh = [_veh_type, _veh_pos, _veh_dir, _customization, _isMedicalVehicle, _isRepairVehicle, _fuelSource, _pylons, _isContaminated, _supplyVehicle, _objectTexture, _EDENinventory, _veh_AllHitPointsDamage, _flagTexture, _tagTexture] call btc_log_fnc_createVehicle;
|
||||
_veh setVectorDirAndUp _vectorPos;
|
||||
_veh setFuel _veh_fuel;
|
||||
|
||||
[_veh, _turretMagazines] call btc_db_fnc_setTurretMagazines;
|
||||
|
||||
[_veh, _veh_cargo, _veh_inventory] call btc_db_fnc_loadCargo;
|
||||
|
||||
if !(alive _veh) then {
|
||||
[_veh, objNull, objNull, nil, false] call btc_veh_fnc_killed;
|
||||
};
|
||||
if (_ViV isNotEqualTo []) then {
|
||||
{
|
||||
private _vehToLoad = _x call _loadVehicle;
|
||||
if !([_vehToLoad, _veh] call btc_tow_fnc_ViV) then {
|
||||
_vehToLoad setVehiclePosition [_veh, [], 100, "NONE"];
|
||||
private _marker = _vehToLoad getVariable ["marker", ""];
|
||||
if (_marker isNotEqualTo "") then {
|
||||
_marker setMarkerPos _vehToLoad;
|
||||
};
|
||||
};
|
||||
} forEach _ViV;
|
||||
};
|
||||
|
||||
_veh
|
||||
};
|
||||
{
|
||||
_x call _loadVehicle;
|
||||
} forEach _this;
|
||||
}, _vehs] call CBA_fnc_execNextFrame;
|
||||
|
||||
//Player Tags
|
||||
private _tags_properties = +(profileNamespace getVariable [format ["btc_hm_%1_tags", _name], []]);
|
||||
private _id = ["ace_tagCreated", {
|
||||
params ["_tag", "_texture", "_object"];
|
||||
btc_tags_player pushBack [_tag, _texture, _object];
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
{
|
||||
_x params ["_tagPosASL", "_vectorDirAndUp", "_texture", "_typeObject", "_tagModel"];
|
||||
private _object = objNull;
|
||||
if (_typeObject isNotEqualTo "") then {
|
||||
_object = nearestObject [ASLToATL _tagPosASL, _typeObject];
|
||||
};
|
||||
[_tagPosASL, _vectorDirAndUp, _texture, _object, objNull, "",_tagModel] call ace_tagging_fnc_createTag;
|
||||
} forEach _tags_properties;
|
||||
["ace_tagCreated", _id] call CBA_fnc_removeEventHandler;
|
||||
|
||||
//Player respawn tickets
|
||||
if (btc_p_respawn_ticketsAtStart >= 0) then {
|
||||
btc_respawn_tickets = +(profileNamespace getVariable [format ["btc_hm_%1_respawnTickets", _name], btc_respawn_tickets]);
|
||||
|
||||
private _deadBodyPlayers = +(profileNamespace getVariable [format ["btc_hm_%1_deadBodyPlayers", _name], []]);
|
||||
btc_body_deadPlayers = [_deadBodyPlayers] call btc_body_fnc_create;
|
||||
};
|
||||
|
||||
//Player slots
|
||||
private _slots_serialized = +(profileNamespace getVariable [format ["btc_hm_%1_slotsSerialized", _name], createHashMap]);
|
||||
[{
|
||||
{
|
||||
if (_y isEqualTo []) then {continue};
|
||||
private _objtClass = _y select 6;
|
||||
if (_objtClass isEqualTo "") then {
|
||||
_objtClass = objNull;
|
||||
} else {
|
||||
_objtClass = nearestObject [ASLToATL (_y select 0), _objtClass];
|
||||
};
|
||||
_y set [6, _objtClass];
|
||||
} forEach _this;
|
||||
}, _slots_serialized] call CBA_fnc_execNextFrame; // Need to wait for vehicle creation
|
||||
btc_slots_serialized = _slots_serialized;
|
||||
|
||||
//Explosives
|
||||
private _explosives = +(profileNamespace getVariable [format ["btc_hm_%1_explosives", _name], []]);
|
||||
btc_explosives = _explosives apply {
|
||||
_x params ["_explosiveType", "_dir", "_pitch", "_pos", "_side"];
|
||||
private _explosive = createVehicle [_explosiveType, _pos, [], 0, "CAN_COLLIDE"];
|
||||
_explosive setPosATL _pos;
|
||||
[_explosive, _dir, _pitch] call ACE_Explosives_fnc_setPosition;
|
||||
_explosive setVariable ["btc_side", _side];
|
||||
if (_side isEqualTo btc_player_side) then {
|
||||
_explosive setShotParents [btc_explosives_objectSide, objNull];
|
||||
};
|
||||
[
|
||||
_explosive,
|
||||
_dir,
|
||||
_pitch
|
||||
];
|
||||
};
|
||||
|
||||
//Player Markers
|
||||
private _markers_properties = +(profileNamespace getVariable [format ["btc_hm_%1_markers", _name], []]);
|
||||
{
|
||||
_x params ["_markerText", "_markerPos", "_markerColor", "_markerType", "_markerSize", "_markerAlpha", "_markerBrush", "_markerDir", "_markerShape",
|
||||
["_markerPolyline", [], [[]]],
|
||||
["_markerChannel", 0, [0]]
|
||||
];
|
||||
|
||||
private _marker = createMarker [format ["_USER_DEFINED #0/%1/%2 btc_hm", _forEachindex, _markerChannel], _markerPos, _markerChannel];
|
||||
_marker setMarkerText _markerText;
|
||||
_marker setMarkerColor _markerColor;
|
||||
_marker setMarkerType _markerType;
|
||||
_marker setMarkerSize _markerSize;
|
||||
_marker setMarkerAlpha _markerAlpha;
|
||||
_marker setMarkerBrush _markerBrush;
|
||||
_marker setMarkerDir _markerDir;
|
||||
|
||||
_marker setMarkerShape _markerShape;
|
||||
if (_markerPolyline isNotEqualTo []) then {
|
||||
_marker setMarkerPolyline _markerPolyline;
|
||||
};
|
||||
} forEach _markers_properties;
|
||||
@@ -0,0 +1,85 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_loadObjectStatus
|
||||
|
||||
Description:
|
||||
Load object status like ACE cargo, inventory and position.
|
||||
|
||||
Parameters:
|
||||
_object_data - Object to create with position, direction, cargo, inventory ... [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_db_fnc_loadObjectStatus;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_object_data", [], [[]]]
|
||||
];
|
||||
_object_data params [
|
||||
"_type",
|
||||
"_pos",
|
||||
"_dir",
|
||||
"",
|
||||
"_cargo",
|
||||
"_inventory",
|
||||
"_vectorPos",
|
||||
["_isContaminated", false, [false]],
|
||||
["_dogtagDataTaken", [], [[]]],
|
||||
["_flagTexture", "", [""]],
|
||||
["_turretMagazines", [], [[]]],
|
||||
["_customName", "", [""]],
|
||||
["_tagTexture", "", [""]],
|
||||
["_properties", [], [[]]],
|
||||
["_playerKiller", "", [""]]
|
||||
];
|
||||
|
||||
private _obj = createVehicle [_type, ASLToATL _pos, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_obj setDir _dir;
|
||||
_obj setPosASL _pos;
|
||||
_obj setVectorDirAndUp _vectorPos;
|
||||
|
||||
if (_isContaminated) then {
|
||||
if ((btc_chem_contaminated pushBackUnique _obj) > -1) then {
|
||||
publicVariable "btc_chem_contaminated";
|
||||
};
|
||||
};
|
||||
if (unitIsUAV _obj) then {
|
||||
createVehicleCrew _obj;
|
||||
};
|
||||
if (_flagTexture isNotEqualTo "") then {
|
||||
_obj forceFlagTexture _flagTexture;
|
||||
};
|
||||
|
||||
if (_turretMagazines isNotEqualTo []) then {
|
||||
[_obj, _turretMagazines] call btc_db_fnc_setTurretMagazines;
|
||||
};
|
||||
|
||||
[_obj, _dogtagDataTaken] call btc_body_fnc_dogtagSet;
|
||||
|
||||
if (_customName isNotEqualTo "") then {
|
||||
_obj setVariable ["ace_cargo_customName", _customName, true];
|
||||
};
|
||||
|
||||
if (_tagTexture isNotEqualTo "") then {
|
||||
[objNull, [], _tagTexture, _obj, objNull, "", "", true] call ace_tagging_fnc_createTag;
|
||||
};
|
||||
|
||||
if (_properties isNotEqualTo []) then {
|
||||
([_obj] + _properties) call btc_veh_fnc_propertiesSet;
|
||||
};
|
||||
|
||||
if (_playerKiller isNotEqualTo "") then {
|
||||
_obj setVariable ["btc_rep_playerKiller", _playerKiller];
|
||||
};
|
||||
|
||||
[_obj] call btc_log_fnc_init;
|
||||
[_obj, _cargo, _inventory] call btc_db_fnc_loadCargo;
|
||||
271
hearts_and_minds.kunduz_valley/core/fnc/db/load_old.sqf
Normal file
271
hearts_and_minds.kunduz_valley/core/fnc/db/load_old.sqf
Normal file
@@ -0,0 +1,271 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_load_old
|
||||
|
||||
Description:
|
||||
Load older database version thanks to profileNamespace getVariable [format ["btc_hm_%1_version", worldName], 1.13].
|
||||
|
||||
Parameters:
|
||||
_name - Name of the saved game. [String]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
["Altis"] call compileScript ["core\fnc\db\load_old.sqf"];
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_name", worldName, [""]]
|
||||
];
|
||||
|
||||
setDate +(profileNamespace getVariable [format ["btc_hm_%1_date", _name], date]);
|
||||
|
||||
//CITIES
|
||||
private _cities_status = +(profileNamespace getVariable [format ["btc_hm_%1_cities", _name], []]);
|
||||
|
||||
{
|
||||
_x params ["_id", "_initialized", "_spawn_more", "_occupied", "_data_units", "_has_ho", "_ho_units_spawned", "_ieds", "_has_suicider",
|
||||
["_data_animals", [], [[]]],
|
||||
["_data_tags", [], [[]]],
|
||||
["_civKilled", [], [[]]]
|
||||
];
|
||||
|
||||
private _city = btc_city_all get _id;
|
||||
|
||||
_city setVariable ["initialized", _initialized];
|
||||
_city setVariable ["spawn_more", _spawn_more];
|
||||
_city setVariable ["occupied", _occupied];
|
||||
_city setVariable ["data_units", _data_units];
|
||||
_city setVariable ["has_ho", _has_ho];
|
||||
_city setVariable ["ho_units_spawned", _ho_units_spawned];
|
||||
_city setVariable ["ieds", _ieds];
|
||||
_city setVariable ["has_suicider", _has_suicider];
|
||||
_city setVariable ["data_animals", _data_animals];
|
||||
_city setVariable ["data_tags", _data_tags];
|
||||
_city setVariable ["btc_rep_civKilled", _civKilled];
|
||||
|
||||
if (btc_debug) then {
|
||||
private _marker = _city getVariable ["marker", ""];
|
||||
if (_city getVariable ["occupied", false]) then {
|
||||
_marker setMarkerColor "colorRed";
|
||||
} else {
|
||||
_marker setMarkerColor "colorGreen";
|
||||
};
|
||||
};
|
||||
if (btc_debug_log) then {
|
||||
[format [
|
||||
"ID: %1 - _initialized %2 _spawn_more %3 _occupied %4 count _data_units %5 _has_ho %6",
|
||||
_id, _initialized, _spawn_more,
|
||||
_occupied, count _data_units, _has_ho
|
||||
], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
[format [
|
||||
"ID: %1 - _ho_units_spawned %2 count _ieds %3 _has_suicider %4 count _data_animals %5 count _data_tags %6 count _civKilled %7",
|
||||
_id, _ho_units_spawned, count _ieds, _has_suicider,
|
||||
count _data_animals, count _data_tags, count _civKilled
|
||||
], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
} forEach _cities_status;
|
||||
|
||||
//HIDEOUT
|
||||
private _array_ho = +(profileNamespace getVariable [format ["btc_hm_%1_ho", _name], []]);
|
||||
|
||||
{
|
||||
_x call btc_hideout_fnc_create;
|
||||
} forEach _array_ho;
|
||||
|
||||
private _ho = profileNamespace getVariable [format ["btc_hm_%1_ho_sel", _name], 0];
|
||||
private _select_ho = (btc_hideouts apply {_x getVariable "id"}) find _ho;
|
||||
if (_select_ho isEqualTo - 1) then {
|
||||
btc_hq = objNull;
|
||||
} else {
|
||||
btc_hq = btc_hideouts select _select_ho;
|
||||
};
|
||||
|
||||
if (btc_hideouts isEqualTo []) then {[] spawn btc_fnc_final_phase;};
|
||||
|
||||
//CACHE
|
||||
private _array_cache = +(profileNamespace getVariable [format ["btc_hm_%1_cache", _name], []]);
|
||||
_array_cache params ["_cache_pos", "_cache_n", "_cache_info", "_cache_markers", "_cache_pictures",
|
||||
["_isChem", false, [true]],
|
||||
["_cache_unitsSpawned", false, [true]]
|
||||
];
|
||||
|
||||
btc_cache_pos = _cache_pos;
|
||||
btc_cache_n = _cache_n;
|
||||
btc_cache_info = _cache_info;
|
||||
|
||||
[_cache_pos, btc_p_chem_cache_probability > 0, [1, 0] select _isChem] call btc_cache_fnc_create;
|
||||
btc_cache_obj setVariable ["btc_cache_unitsSpawned", _cache_unitsSpawned];
|
||||
|
||||
btc_cache_markers = [];
|
||||
{
|
||||
_x params ["_pos", "_marker_name"];
|
||||
|
||||
[_pos, 0, _marker_name] call btc_info_fnc_cacheMarker;
|
||||
} forEach _cache_markers;
|
||||
|
||||
btc_cache_pictures = _cache_pictures;
|
||||
{
|
||||
(btc_cache_pictures select 2) pushBack ([
|
||||
_x,
|
||||
btc_cache_n,
|
||||
btc_cache_pictures select 1 select _forEachindex
|
||||
] remoteExecCall ["btc_info_fnc_cachePicture", [0, -2] select isDedicated, true]);
|
||||
} forEach (btc_cache_pictures select 0);
|
||||
|
||||
//FOB
|
||||
private _fobs = +(profileNamespace getVariable [format ["btc_hm_%1_fobs", _name], []]);
|
||||
|
||||
{
|
||||
_x params ["_fob_name", "_pos", ["_direction", 0, [0]]];
|
||||
|
||||
[_pos, _direction, _fob_name] call btc_fob_fnc_create_s;
|
||||
} forEach _fobs;
|
||||
|
||||
//REP
|
||||
btc_global_reputation = profileNamespace getVariable [format ["btc_hm_%1_rep", _name], 0];
|
||||
|
||||
//Objects
|
||||
{deleteVehicle _x} forEach (getMissionLayerEntities "btc_vehicles" select 0);
|
||||
if !(isNil "btc_vehicles") then {
|
||||
{deleteVehicle _x} forEach btc_vehicles;
|
||||
btc_vehicles = [];
|
||||
};
|
||||
|
||||
private _objs = +(profileNamespace getVariable [format ["btc_hm_%1_objs", _name], []]);
|
||||
[{ // Can't use ace_cargo for objects created during first frame.
|
||||
{
|
||||
[_x] call btc_db_fnc_loadObjectStatus;
|
||||
} forEach _this;
|
||||
}, _objs] call CBA_fnc_execNextFrame;
|
||||
|
||||
//VEHICLES
|
||||
private _vehs = +(profileNamespace getVariable [format ["btc_hm_%1_vehs", _name], []]);
|
||||
[{ // Can't be executed just after because we can't delete and spawn vehicle during the same frame.
|
||||
private _loadVehicle = {
|
||||
params [
|
||||
"_veh_type",
|
||||
"_veh_pos",
|
||||
"_veh_dir",
|
||||
"_veh_fuel",
|
||||
"_veh_AllHitPointsDamage",
|
||||
"_veh_cargo",
|
||||
"_veh_inventory",
|
||||
"_customization",
|
||||
["_isMedicalVehicle", false, [false]],
|
||||
["_isRepairVehicle", false, [false]],
|
||||
["_fuelSource", [], [[]]],
|
||||
["_pylons", [], [[]]],
|
||||
["_isContaminated", false, [false]],
|
||||
["_supplyVehicle", [], [[]]],
|
||||
["_EDENinventory", [], [[]]],
|
||||
["_vectorPos", [], [[]]],
|
||||
["_ViV", [], [[]]],
|
||||
["_flagTexture", "", [""]],
|
||||
["_turretMagazines", [], [[]]],
|
||||
["_tagTexture", "", [""]]
|
||||
];
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["_veh = %1", _x], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
private _veh = [_veh_type, _veh_pos, _veh_dir, _customization, _isMedicalVehicle, _isRepairVehicle, _fuelSource, _pylons, _isContaminated, _supplyVehicle, nil, _EDENinventory, _veh_AllHitPointsDamage, _flagTexture, _tagTexture] call btc_log_fnc_createVehicle;
|
||||
_veh setVectorDirAndUp _vectorPos;
|
||||
_veh setFuel _veh_fuel;
|
||||
|
||||
[_veh, _turretMagazines] call btc_db_fnc_setTurretMagazines;
|
||||
|
||||
[_veh, _veh_cargo, _veh_inventory] call btc_db_fnc_loadCargo;
|
||||
|
||||
if !(alive _veh) then {
|
||||
[_veh, objNull, objNull, nil, false] call btc_veh_fnc_killed;
|
||||
};
|
||||
if (_ViV isNotEqualTo []) then {
|
||||
{
|
||||
private _vehToLoad = _x call _loadVehicle;
|
||||
if !([_vehToLoad, _veh] call btc_tow_fnc_ViV) then {
|
||||
_vehToLoad setVehiclePosition [_veh, [], 100, "NONE"];
|
||||
private _marker = _vehToLoad getVariable ["marker", ""];
|
||||
if (_marker isNotEqualTo "") then {
|
||||
_marker setMarkerPos _vehToLoad;
|
||||
};
|
||||
};
|
||||
} forEach _ViV;
|
||||
};
|
||||
|
||||
_veh
|
||||
};
|
||||
{
|
||||
_x call _loadVehicle;
|
||||
} forEach _this;
|
||||
}, _vehs] call CBA_fnc_execNextFrame;
|
||||
|
||||
//Player Tags
|
||||
private _tags_properties = +(profileNamespace getVariable [format ["btc_hm_%1_tags", _name], []]);
|
||||
private _id = ["ace_tagCreated", {
|
||||
params ["_tag", "_texture", "_object"];
|
||||
btc_tags_player pushBack [_tag, _texture, _object];
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
{
|
||||
_x params ["_tagPosASL", "_vectorDirAndUp", "_texture", "_typeObject", "_tagModel"];
|
||||
private _object = objNull;
|
||||
if (_typeObject isNotEqualTo "") then {
|
||||
_object = nearestObject [ASLToATL _tagPosASL, _typeObject];
|
||||
};
|
||||
[_tagPosASL, _vectorDirAndUp, _texture, _object, objNull, "",_tagModel] call ace_tagging_fnc_createTag;
|
||||
} forEach _tags_properties;
|
||||
["ace_tagCreated", _id] call CBA_fnc_removeEventHandler;
|
||||
|
||||
//Player respawn tickets
|
||||
if (btc_p_respawn_ticketsAtStart >= 0) then {
|
||||
btc_respawn_tickets = +(profileNamespace getVariable [format ["btc_hm_%1_respawnTickets", _name], btc_respawn_tickets]);
|
||||
|
||||
private _deadBodyPlayers = +(profileNamespace getVariable [format ["btc_hm_%1_deadBodyPlayers", _name], []]);
|
||||
btc_body_deadPlayers = [_deadBodyPlayers] call btc_body_fnc_create;
|
||||
};
|
||||
|
||||
//Player slots
|
||||
private _slots_serialized = +(profileNamespace getVariable [format ["btc_hm_%1_slotsSerialized", _name], createHashMap]);
|
||||
[{
|
||||
{
|
||||
if (_y isEqualTo []) then {continue};
|
||||
private _objtClass = _y select 6;
|
||||
if (_objtClass isEqualTo "") then {
|
||||
_objtClass = objNull;
|
||||
} else {
|
||||
_objtClass = nearestObject [ASLToATL (_y select 0), _objtClass];
|
||||
};
|
||||
_y set [6, _objtClass];
|
||||
} forEach _this;
|
||||
}, _slots_serialized] call CBA_fnc_execNextFrame; // Need to wait for vehicle creation
|
||||
btc_slots_serialized = _slots_serialized;
|
||||
|
||||
//Player Markers
|
||||
private _markers_properties = +(profileNamespace getVariable [format ["btc_hm_%1_markers", _name], []]);
|
||||
{
|
||||
_x params ["_markerText", "_markerPos", "_markerColor", "_markerType", "_markerSize", "_markerAlpha", "_markerBrush", "_markerDir", "_markerShape",
|
||||
["_markerPolyline", [], [[]]],
|
||||
["_markerChannel", 0, [0]]
|
||||
];
|
||||
|
||||
private _marker = createMarker [format ["_USER_DEFINED #0/%1/%2", _forEachindex, _markerChannel], _markerPos, _markerChannel];
|
||||
_marker setMarkerText _markerText;
|
||||
_marker setMarkerColor _markerColor;
|
||||
_marker setMarkerType _markerType;
|
||||
_marker setMarkerSize _markerSize;
|
||||
_marker setMarkerAlpha _markerAlpha;
|
||||
_marker setMarkerBrush _markerBrush;
|
||||
_marker setMarkerDir _markerDir;
|
||||
|
||||
_marker setMarkerShape _markerShape;
|
||||
if (_markerPolyline isNotEqualTo []) then {
|
||||
_marker setMarkerPolyline _markerPolyline;
|
||||
};
|
||||
} forEach _markers_properties;
|
||||
78
hearts_and_minds.kunduz_valley/core/fnc/db/loadcargo.sqf
Normal file
78
hearts_and_minds.kunduz_valley/core/fnc/db/loadcargo.sqf
Normal file
@@ -0,0 +1,78 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_loadCargo
|
||||
|
||||
Description:
|
||||
Load ACE cargo and inventory of a vehicle/container.
|
||||
|
||||
Parameters:
|
||||
_obj - Vehicle or container. [Object]
|
||||
_cargo - Object to load in ACE cargo. [Array]
|
||||
_inventory - Weapon and item to load in inventory. [Array]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
_result = [] call btc_db_fnc_loadCargo;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
[{
|
||||
params ["_obj", "_cargo", "_inventory"];
|
||||
|
||||
//handle cargo
|
||||
{
|
||||
_x params ["_type", "", "_inventory",
|
||||
["_isContaminated", false, [false]],
|
||||
["_dogtagDataTaken", [], [[]]],
|
||||
["_turretMagazines", [], [[]]],
|
||||
["_customName", "", [""]],
|
||||
["_properties", [], [[]]],
|
||||
["_playerKiller", "", [""]]
|
||||
];
|
||||
|
||||
private _l = createVehicle [_type, getPosATL _obj, [], 0, "CAN_COLLIDE"];
|
||||
[_l] call btc_log_fnc_init;
|
||||
private _isloaded = [_l, _obj, false] call ace_cargo_fnc_loadItem;
|
||||
if (btc_debug_log) then {
|
||||
[format ["Object loaded: %1 in veh/container %2 IsLoaded: %3", _l, _obj, _isloaded], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
[_l, _inventory] call btc_log_fnc_inventorySet;
|
||||
|
||||
if (_isContaminated) then {
|
||||
btc_chem_contaminated pushBack _l;
|
||||
publicVariable "btc_chem_contaminated";
|
||||
};
|
||||
|
||||
[_l, _dogtagDataTaken] call btc_body_fnc_dogtagSet;
|
||||
|
||||
if (_turretMagazines isNotEqualTo []) then {
|
||||
[_l, _turretMagazines] call btc_db_fnc_setTurretMagazines;
|
||||
};
|
||||
|
||||
if (_customName isNotEqualTo "") then {
|
||||
_l setVariable ["ace_cargo_customName", _customName, true];
|
||||
};
|
||||
|
||||
if (unitIsUAV _l) then {
|
||||
createVehicleCrew _l;
|
||||
};
|
||||
|
||||
if (_properties isNotEqualTo []) then {
|
||||
([_l] + _properties) call btc_veh_fnc_propertiesSet;
|
||||
};
|
||||
|
||||
if (_playerKiller isNotEqualTo "") then {
|
||||
_l setVariable ["btc_rep_playerKiller", _playerKiller];
|
||||
};
|
||||
} forEach _cargo;
|
||||
|
||||
//set inventory content for weapons, magazines and items
|
||||
[_obj, _inventory] call btc_log_fnc_inventorySet;
|
||||
}, _this] call CBA_fnc_execNextFrame;
|
||||
287
hearts_and_minds.kunduz_valley/core/fnc/db/save.sqf
Normal file
287
hearts_and_minds.kunduz_valley/core/fnc/db/save.sqf
Normal file
@@ -0,0 +1,287 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_save
|
||||
|
||||
Description:
|
||||
Save the current game into profileNamespace.
|
||||
|
||||
Parameters:
|
||||
_name - Name of the game saved. [String]
|
||||
|
||||
Returns:
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[] call btc_db_fnc_save;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Giallustio
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_name", worldName, [""]]
|
||||
];
|
||||
|
||||
if (btc_debug) then {
|
||||
["...1", __FILE__, [btc_debug, false, true]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
[8] remoteExecCall ["btc_fnc_show_hint", 0];
|
||||
|
||||
[false] call btc_db_fnc_delete;
|
||||
|
||||
//Version
|
||||
profileNamespace setVariable [format ["btc_hm_%1_version", _name], btc_version select 1];
|
||||
|
||||
//World Date
|
||||
profileNamespace setVariable [format ["btc_hm_%1_date", _name], date];
|
||||
|
||||
//City status
|
||||
private _cities_status = [];
|
||||
{
|
||||
private _city_status = [];
|
||||
_city_status pushBack _x;
|
||||
|
||||
_city_status pushBack (_y getVariable "initialized");
|
||||
|
||||
_city_status pushBack (_y getVariable "spawn_more");
|
||||
_city_status pushBack (_y getVariable "occupied");
|
||||
|
||||
_city_status pushBack (_y getVariable "data_units");
|
||||
|
||||
_city_status pushBack (_y getVariable ["has_ho", false]);
|
||||
_city_status pushBack (_y getVariable ["ho_units_spawned", false]);
|
||||
_city_status pushBack (_y getVariable ["ieds", []]);
|
||||
_city_status pushBack (_y getVariable ["has_suicider", false]);
|
||||
_city_status pushBack (_y getVariable ["data_animals", []]);
|
||||
_city_status pushBack (_y getVariable ["data_tags", []]);
|
||||
_city_status pushBack (_y getVariable ["btc_rep_civKilled", []]);
|
||||
_city_status pushBack (_y getVariable ["btc_rep_graves", []]);
|
||||
|
||||
_cities_status pushBack _city_status;
|
||||
if (btc_debug_log) then {
|
||||
[format ["ID %1 - IsOccupied %2", _y getVariable "id", _y getVariable "occupied"], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
} forEach btc_city_all;
|
||||
profileNamespace setVariable [format ["btc_hm_%1_cities", _name], +_cities_status];
|
||||
|
||||
//HIDEOUT
|
||||
private _array_ho = [];
|
||||
{
|
||||
private _data = [];
|
||||
(getPos _x) params ["_xx", "_yy"];
|
||||
_data pushBack [_xx, _yy, 0];
|
||||
_data pushBack (_x getVariable ["id", 0]);
|
||||
_data pushBack (_x getVariable ["rinf_time", 0]);
|
||||
_data pushBack (_x getVariable ["cap_time", 0]);
|
||||
_data pushBack ((_x getVariable ["assigned_to", objNull]) getVariable "id");
|
||||
|
||||
private _ho_markers = [];
|
||||
{
|
||||
private _marker = [];
|
||||
_marker pushBack (getMarkerPos _x);
|
||||
_marker pushBack (markerText _x);
|
||||
_ho_markers pushBack _marker;
|
||||
} forEach (_x getVariable ["markers", []]);
|
||||
_data pushBack _ho_markers;
|
||||
if (btc_debug_log) then {
|
||||
[format ["HO %1 DATA %2", _x, _data], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
_array_ho pushBack _data;
|
||||
} forEach btc_hideouts;
|
||||
profileNamespace setVariable [format ["btc_hm_%1_ho", _name], +_array_ho];
|
||||
|
||||
profileNamespace setVariable [format ["btc_hm_%1_ho_sel", _name], btc_hq getVariable ["id", 0]];
|
||||
|
||||
if (btc_debug) then {
|
||||
["...2", __FILE__, [btc_debug, false, true]] call btc_debug_fnc_message;
|
||||
};
|
||||
|
||||
//CACHE
|
||||
private _array_cache = [];
|
||||
_array_cache pushBack (getPosATL btc_cache_obj);
|
||||
_array_cache pushBack btc_cache_n;
|
||||
_array_cache pushBack btc_cache_info;
|
||||
private _cache_markers = [];
|
||||
{
|
||||
private _data = [];
|
||||
_data pushBack (getMarkerPos _x);
|
||||
_data pushBack (markerText _x);
|
||||
_cache_markers pushBack _data;
|
||||
} forEach btc_cache_markers;
|
||||
_array_cache pushBack _cache_markers;
|
||||
_array_cache pushBack [btc_cache_pictures select 0, btc_cache_pictures select 1, []];
|
||||
_array_cache pushBack (btc_cache_obj in btc_chem_contaminated);
|
||||
_array_cache pushBack (btc_cache_obj getVariable ["btc_cache_unitsSpawned", false]);
|
||||
profileNamespace setVariable [format ["btc_hm_%1_cache", _name], +_array_cache];
|
||||
|
||||
//REPUTATION
|
||||
profileNamespace setVariable [format ["btc_hm_%1_rep", _name], btc_global_reputation];
|
||||
|
||||
//FOBS
|
||||
private _fobs = [];
|
||||
{
|
||||
if !(isNull ((btc_fobs select 2) select _forEachIndex)) then {
|
||||
private _pos = getMarkerPos [_x, true];
|
||||
private _direction = getDir ((btc_fobs select 1) select _forEachIndex);
|
||||
_fobs pushBack [markerText _x, _pos, _direction];
|
||||
};
|
||||
} forEach (btc_fobs select 0);
|
||||
profileNamespace setVariable [format ["btc_hm_%1_fobs", _name], +_fobs];
|
||||
|
||||
//Vehicles status
|
||||
private _array_veh = [];
|
||||
private _vehicles = btc_vehicles - [objNull];
|
||||
private _vehiclesNotInCargo = _vehicles select {
|
||||
isNull isVehicleCargo _x &&
|
||||
{isNull isVehicleCargo attachedTo _x}
|
||||
};
|
||||
private _vehiclesInCargo = _vehicles - _vehiclesNotInCargo;
|
||||
{
|
||||
(_x call btc_db_fnc_saveObjectStatus) params [
|
||||
"_type", "_pos", "_dir", "", "_cargo",
|
||||
"_inventory", "_vectorPos", "_isContaminated", "",
|
||||
["_flagTexture", "", [""]],
|
||||
["_turretMagazines", [], [[]]],
|
||||
["_notuse", "", [""]],
|
||||
["_tagTexture", "", [""]],
|
||||
["_properties", [], [[]]],
|
||||
["_playerKiller", "", [""]]
|
||||
];
|
||||
|
||||
private _data = [];
|
||||
_data pushBack _type;
|
||||
_data pushBack _pos;
|
||||
_data pushBack _dir;
|
||||
_data pushBack (fuel _x);
|
||||
_data pushBack (getAllHitPointsDamage _x);
|
||||
_data pushBack _cargo;
|
||||
_data pushBack _inventory;
|
||||
_data append ([_x] call btc_veh_fnc_propertiesGet);
|
||||
_data pushBack (_x getVariable ["btc_EDENinventory", []]);
|
||||
_data pushBack _vectorPos;
|
||||
_data pushBack []; // ViV
|
||||
_data pushBack _flagTexture;
|
||||
_data pushBack _turretMagazines;
|
||||
_data pushBack _tagTexture;
|
||||
_data pushBack _properties;
|
||||
_data pushBack _playerKiller;
|
||||
|
||||
private _fakeViV = isVehicleCargo attachedTo _x;
|
||||
if (
|
||||
isNull _fakeViV &&
|
||||
{isNull isVehicleCargo _x}
|
||||
) then {
|
||||
_array_veh pushBack _data;
|
||||
} else {
|
||||
private _vehicleCargo = if (isNull _fakeViV) then {
|
||||
isVehicleCargo _x
|
||||
} else {
|
||||
_fakeViV
|
||||
};
|
||||
private _index = _vehiclesNotInCargo find _vehicleCargo;
|
||||
((_array_veh select _index) select 17) pushBack _data;
|
||||
};
|
||||
|
||||
if (btc_debug_log) then {
|
||||
[format ["VEH %1 DATA %2", _x, _data], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
} forEach (_vehiclesNotInCargo + _vehiclesInCargo);
|
||||
profileNamespace setVariable [format ["btc_hm_%1_vehs", _name], +_array_veh];
|
||||
|
||||
//Objects status
|
||||
private _array_obj = [];
|
||||
{
|
||||
if !(!alive _x || isNull _x) then {
|
||||
private _data = [_x] call btc_db_fnc_saveObjectStatus;
|
||||
_array_obj pushBack _data;
|
||||
};
|
||||
} forEach (btc_log_obj_created select {
|
||||
!(isObjectHidden _x) &&
|
||||
isNull objectParent _x &&
|
||||
isNull isVehicleCargo _x
|
||||
});
|
||||
profileNamespace setVariable [format ["btc_hm_%1_objs", _name], +_array_obj];
|
||||
|
||||
//Player Tags
|
||||
private _tags = btc_tags_player select {alive (_x select 0)};
|
||||
private _tags_properties = _tags apply {
|
||||
private _tag = _x select 0;
|
||||
[
|
||||
getPosASL _tag,
|
||||
[vectorDir _tag, vectorUp _tag],
|
||||
_x select 1,
|
||||
typeOf (_x select 2),
|
||||
typeOf _tag
|
||||
]
|
||||
};
|
||||
profileNamespace setVariable [format ["btc_hm_%1_tags", _name], +_tags_properties];
|
||||
|
||||
//Player respawn tickets
|
||||
if (btc_p_respawn_ticketsAtStart >= 0) then {
|
||||
profileNamespace setVariable [format ["btc_hm_%1_respawnTickets", _name], +btc_respawn_tickets];
|
||||
|
||||
private _deadBodyPlayers = [btc_body_deadPlayers] call btc_body_fnc_get;
|
||||
profileNamespace setVariable [format ["btc_hm_%1_deadBodyPlayers", _name], +_deadBodyPlayers];
|
||||
};
|
||||
|
||||
//Player slots
|
||||
{
|
||||
if (alive _x) then {
|
||||
_x call btc_slot_fnc_serializeState;
|
||||
};
|
||||
} forEach (allPlayers - entities "HeadlessClient_F");
|
||||
private _slots_serialized = +btc_slots_serialized;
|
||||
{
|
||||
if (btc_debug_log) then {
|
||||
[format ["btc_slots_serialized %1 %2", _x, _y], __FILE__, [false]] call btc_debug_fnc_message;
|
||||
};
|
||||
if (_y isEqualTo []) then {continue};
|
||||
private _vehicle = _y select 6;
|
||||
if !(isNull _vehicle) then {
|
||||
_y set [0, getPosASL _vehicle];
|
||||
};
|
||||
_y set [6, typeOf _vehicle];
|
||||
} forEach _slots_serialized;
|
||||
profileNamespace setVariable [format ["btc_hm_%1_slotsSerialized", _name], +_slots_serialized];
|
||||
|
||||
//Player Markers
|
||||
private _player_markers = allMapMarkers select {"_USER_DEFINED" in _x};
|
||||
private _markers_properties = _player_markers apply {
|
||||
[markerText _x, markerPos _x, markerColor _x, markerType _x, markerSize _x, markerAlpha _x, markerBrush _x, markerDir _x, markerShape _x, markerPolyline _x, markerChannel _x]
|
||||
};
|
||||
profileNamespace setVariable [format ["btc_hm_%1_markers", _name], +_markers_properties];
|
||||
|
||||
//Explosives
|
||||
private _explosives = [];
|
||||
{
|
||||
_x params ["_explosive", "_dir", "_pitch"];
|
||||
if (isNull _explosive) then {continue};
|
||||
_explosives pushBack [
|
||||
typeOf _explosive,
|
||||
_dir,
|
||||
_pitch,
|
||||
getPosATL _explosive,
|
||||
_explosive getVariable ["btc_side", sideEmpty]
|
||||
]
|
||||
} forEach btc_explosives;
|
||||
{
|
||||
_explosives pushBack [
|
||||
typeOf _x,
|
||||
getDir _x,
|
||||
0,
|
||||
getPosATL _x,
|
||||
_x getVariable ["btc_side", side group ((getShotParents _x) select 0)]
|
||||
]
|
||||
} forEach (allMines select {_x isKindOf "APERSMineDispenser_Mine_Ammo"});
|
||||
profileNamespace setVariable [format ["btc_hm_%1_explosives", _name], +_explosives];
|
||||
|
||||
//End
|
||||
profileNamespace setVariable [format ["btc_hm_%1_db", _name], true];
|
||||
saveProfileNamespace;
|
||||
if (btc_debug) then {
|
||||
["...3", __FILE__, [btc_debug, false, true]] call btc_debug_fnc_message;
|
||||
};
|
||||
[9] remoteExecCall ["btc_fnc_show_hint", 0];
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
Function: btc_db_fnc_saveObjectStatus
|
||||
|
||||
Description:
|
||||
Save all data from an object like position, ACE cargo, inventory ...
|
||||
|
||||
Parameters:
|
||||
_object - Object to get data. [Object]
|
||||
|
||||
Returns:
|
||||
_data - Data array (type, position, direction ...). [Array]
|
||||
|
||||
Examples:
|
||||
(begin example)
|
||||
[cursorObject] call btc_db_fnc_saveObjectStatus;
|
||||
(end)
|
||||
|
||||
Author:
|
||||
Vdauphin
|
||||
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
params [
|
||||
["_object", objNull, [objNull]]
|
||||
];
|
||||
|
||||
private _data = [];
|
||||
_data pushBack (typeOf _object);
|
||||
_data pushBack (getPosASL _object);
|
||||
_data pushBack (getDir _object);
|
||||
_data pushBack "";
|
||||
private _cargo = (_object getVariable ["ace_cargo_loaded", []]) apply {
|
||||
if (_x isEqualType "") then {
|
||||
[_x, nil, [[], [], []]]
|
||||
} else {
|
||||
[
|
||||
typeOf _x,
|
||||
nil,
|
||||
_x call btc_log_fnc_inventoryGet,
|
||||
_x in btc_chem_contaminated,
|
||||
_x call btc_body_fnc_dogtagGet,
|
||||
magazinesAllTurrets _x,
|
||||
_x getVariable ["ace_cargo_customName", ""],
|
||||
[_x] call btc_veh_fnc_propertiesGet,
|
||||
_x getVariable ["btc_rep_playerKiller", ""]
|
||||
]
|
||||
};
|
||||
};
|
||||
_data pushBack _cargo;
|
||||
_data pushBack (_object call btc_log_fnc_inventoryGet);
|
||||
_data pushBack [vectorDir _object, vectorUp _object];
|
||||
_data pushBack (_object in btc_chem_contaminated);
|
||||
_data pushBack (_object call btc_body_fnc_dogtagGet);
|
||||
_data pushBack (getForcedFlagTexture _object);
|
||||
_data pushBack (magazinesAllTurrets _object);
|
||||
_data pushBack (_object getVariable ["ace_cargo_customName", ""]);
|
||||
_data pushBack (_object getVariable ["btc_tag_vehicle", ""]);
|
||||
_data pushBack ([_object] call btc_veh_fnc_propertiesGet);
|
||||
_data pushBack (_object getVariable ["btc_rep_playerKiller", ""]);
|
||||
|
||||
_data
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user