mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 20:24:34 +00:00
Compare commits
36 Commits
uav_tool_i
...
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
|
*.paa filter=lfs diff=lfs merge=lfs -text
|
||||||
*.p3d filter=lfs diff=lfs merge=lfs -text
|
*.p3d filter=lfs diff=lfs merge=lfs -text
|
||||||
*.jpeg 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
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
*.dll filter=lfs diff=lfs merge=lfs -text
|
*.dll filter=lfs diff=lfs merge=lfs -text
|
||||||
*.apk filter=lfs diff=lfs merge=lfs -text
|
*.apk filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,7 +3,6 @@
|
|||||||
hemtt
|
hemtt
|
||||||
hemtt.exe
|
hemtt.exe
|
||||||
*.biprivatekey
|
*.biprivatekey
|
||||||
.hemttprivatekey
|
|
||||||
source/
|
source/
|
||||||
.vscode
|
.vscode
|
||||||
releases/
|
releases/
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ url = "https://github.com/valmojr/armatak"
|
|||||||
preset = "Hemtt"
|
preset = "Hemtt"
|
||||||
|
|
||||||
[hemtt.launch.default]
|
[hemtt.launch.default]
|
||||||
|
mission = "hearts_and_minds.kunduz_valley"
|
||||||
workshop = [
|
workshop = [
|
||||||
"450814997", # CBA_A3
|
"450814997", # CBA_A3
|
||||||
"463939057", # ACE
|
"463939057", # ACE
|
||||||
@@ -43,13 +44,13 @@ workshop = [
|
|||||||
"2522638637", # ACE Extended Arsenal
|
"2522638637", # ACE Extended Arsenal
|
||||||
"333310405", # Enhanced Movement
|
"333310405", # Enhanced Movement
|
||||||
"2034363662", # Enhanced Movement Rework
|
"2034363662", # Enhanced Movement Rework
|
||||||
"2941986336", # Hatchet Interaction Framework - Stable Version
|
|
||||||
"1745501605", # Hatchet H-60 pack - Stable Version
|
|
||||||
"843577117", # RHSUSAF
|
"843577117", # RHSUSAF
|
||||||
"843425103", # RHSAFRF
|
"843425103", # RHSAFRF
|
||||||
"843632231", # RHSSAF
|
"843632231", # RHSSAF
|
||||||
"843593391", # RHSGREF
|
"843593391", # RHSGREF
|
||||||
"1673456286", # 3CB Factions
|
"1673456286", # 3CB Factions
|
||||||
|
"2585568796", # Taliban Forces 2021
|
||||||
|
"3030830594", # Western Dusk
|
||||||
"623475643", # 3den Enhanced
|
"623475643", # 3den Enhanced
|
||||||
"2257686620", # Blastcore Murr Edition
|
"2257686620", # Blastcore Murr Edition
|
||||||
"583496184", # CUP Terrains - Core
|
"583496184", # CUP Terrains - Core
|
||||||
@@ -58,8 +59,12 @@ workshop = [
|
|||||||
"1808238502", # LAMBS_Suppression
|
"1808238502", # LAMBS_Suppression
|
||||||
"3425368881", # M4A1_URGI
|
"3425368881", # M4A1_URGI
|
||||||
"2268351256", # Tier One Weapons
|
"2268351256", # Tier One Weapons
|
||||||
|
"3073216844", # Tier One Weapons - All NVG Compatible
|
||||||
"2560276469", # Restrict Markers
|
"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 = [
|
parameters = [
|
||||||
|
|||||||
1069
Cargo.lock
generated
1069
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -9,10 +9,6 @@ chrono = "0.4.39"
|
|||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
log = "0.4.22"
|
log = "0.4.22"
|
||||||
log4rs = "1.3.0"
|
log4rs = "1.3.0"
|
||||||
reqwest = { version = "0.12.15", default-features = false, features = ["blocking", "json", "rustls-tls"] }
|
|
||||||
rcgen = { version = "0.13.2", default-features = false, features = ["crypto", "pem", "aws_lc_rs"] }
|
|
||||||
rustls = "0.23.23"
|
|
||||||
rustls-pemfile = "2.2.0"
|
|
||||||
serde = { version = "1.0.210", features = ["derive"] }
|
serde = { version = "1.0.210", features = ["derive"] }
|
||||||
|
|
||||||
[dependencies.uuid]
|
[dependencies.uuid]
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
The server-side CoT router supports two transports:
|
## Operation Wings of Liberty
|
||||||
- Plain TCP, for legacy TAK ingress.
|
|
||||||
- Mutual TLS, using the TAK Server authentication API, so the Arma session can publish as an authenticated TAK device on port `8089`.
|
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
|
## Get in Touch
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Valmo Trindade
|
* Author: Valmo Trindade
|
||||||
* This function is used to convert the position of a unit to the world world location.
|
* This function is used to convert the position of a unit to the world world location.
|
||||||
*
|
*
|
||||||
* Argument:
|
* Argument:
|
||||||
* 0: in game latitude <NUMBER> is the latitude of the unit.
|
* 0: in game latitude <NUMBER> is the latitude of the unit.
|
||||||
* 1: in game longitude <NUMBER> is the longitude of the unit.
|
* 1: in game longitude <NUMBER> is the longitude of the unit.
|
||||||
* 2: in game altitude <NUMBER> is the altitude of the unit.
|
* 2: in game altitude <NUMBER> is the altitude of the unit.
|
||||||
* 3: in game bearing <NUMBER> is the bearing of the unit.
|
* 3: in game bearing <NUMBER> is the bearing of the unit.
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* ARRAY -> [latitude, longitude, altitude, bearing]
|
* ARRAY -> [latitude, longitude, altitude, bearing]
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [player] call armatak_client_fnc_convertClientLocation;
|
* [player] call armatak_client_fnc_convertClientLocation;
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params["_latitude", "_longitude", "_altitude"];
|
params["_latitude", "_longitude", "_altitude"];
|
||||||
@@ -38,9 +38,6 @@ switch (toLower worldName) do {
|
|||||||
case "vr": {
|
case "vr": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_vr;
|
_realLocation = _position call armatak_fnc_convert_to_vr;
|
||||||
};
|
};
|
||||||
case "lawn": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_lawn;
|
|
||||||
};
|
|
||||||
case "cucui": {
|
case "cucui": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_cucui;
|
_realLocation = _position call armatak_fnc_convert_to_cucui;
|
||||||
};
|
};
|
||||||
@@ -77,42 +74,12 @@ switch (toLower worldName) do {
|
|||||||
case "kunduz_valley": {
|
case "kunduz_valley": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_kunduz_valley;
|
_realLocation = _position call armatak_fnc_convert_to_kunduz_valley;
|
||||||
};
|
};
|
||||||
case "malvinasfalkands": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_malvinas_malvinasfalkands;
|
|
||||||
};
|
|
||||||
case "pebble_island_airfield": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_malvinas_pebble_island_airfield;
|
|
||||||
};
|
|
||||||
case "p_argentino_stanley": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_malvinas_p_argentino_stanley;
|
|
||||||
};
|
|
||||||
case "top_malo_house": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_malvinas_top_malo_house;
|
|
||||||
};
|
|
||||||
case "pradera_ganso": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_malvinas_pradera_ganso;
|
|
||||||
};
|
|
||||||
case "tanoa": {
|
case "tanoa": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_tanoa;
|
_realLocation = _position call armatak_fnc_convert_to_tanoa;
|
||||||
};
|
};
|
||||||
case "zagor_zagorsk_reserved_forest": {
|
case "zagor_zagorsk_reserved_forest": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_zagor_zagorsk_reserved_forest;
|
_realLocation = _position call armatak_fnc_convert_to_zagor_zagorsk_reserved_forest;
|
||||||
};
|
};
|
||||||
case "umb_colombia": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_colombia;
|
|
||||||
};
|
|
||||||
case "clafghan": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_clafghan;
|
|
||||||
};
|
|
||||||
case "rut_mandol": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_rut_mandol;
|
|
||||||
};
|
|
||||||
case "hellanmaa": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_hellanmaa;
|
|
||||||
};
|
|
||||||
case "hellanmaaw": {
|
|
||||||
_realLocation = _position call armatak_fnc_convert_to_hellanmaa;
|
|
||||||
};
|
|
||||||
default {
|
default {
|
||||||
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ player setVariable [QGVAR(eudConnected), true];
|
|||||||
if (player getVariable [QGVAR(eudConnected), false]) then {
|
if (player getVariable [QGVAR(eudConnected), false]) then {
|
||||||
"armatak" callExtension ["udp_socket:send_gps_cot", [player call FUNC(extractClientPosition)]];
|
"armatak" callExtension ["udp_socket:send_gps_cot", [player call FUNC(extractClientPosition)]];
|
||||||
};
|
};
|
||||||
}, 0.5, []] call CBA_fnc_addPerFrameHandler;
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
deleteVehicle _logic;
|
deleteVehicle _logic;
|
||||||
closeDialog 1;
|
closeDialog 1;
|
||||||
|
|||||||
@@ -78,16 +78,6 @@ class Cfg3den {
|
|||||||
condition = "objectVehicle";
|
condition = "objectVehicle";
|
||||||
typeName = "STRING";
|
typeName = "STRING";
|
||||||
};
|
};
|
||||||
class armatak_attribute_video_url {
|
|
||||||
displayName = "Video URL (RTSP)";
|
|
||||||
tooltip = "RTSP stream URL for UAS Tool integration. When set, the drone will appear in the ATAK UAS Tool with FOV cone and video feed. Format: rtsp://address:port/path (e.g. rtsp://192.168.1.10:8554/live/drone1). Leave empty to disable UAS Tool integration for this entity.";
|
|
||||||
property = "armatak_attribute_video_url";
|
|
||||||
control = "Edit";
|
|
||||||
expression = "_this setVariable ['armatak_attribute_video_url',_value]";
|
|
||||||
defaultValue = "''";
|
|
||||||
condition = "objectVehicle";
|
|
||||||
typeName = "STRING";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,12 +19,6 @@ class CfgFunctions {
|
|||||||
class send_marker_cot {
|
class send_marker_cot {
|
||||||
file = "\armatak\armatak\addons\main\functions\api\fn_send_marker_cot.sqf";
|
file = "\armatak\armatak\addons\main\functions\api\fn_send_marker_cot.sqf";
|
||||||
};
|
};
|
||||||
class send_uas_video_cot {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\api\fn_send_uas_video_cot.sqf";
|
|
||||||
};
|
|
||||||
class send_uas_sensor_cot {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\api\fn_send_uas_sensor_cot.sqf";
|
|
||||||
};
|
|
||||||
class stop_tcp_socket {
|
class stop_tcp_socket {
|
||||||
file = "\armatak\armatak\addons\main\functions\api\fn_stop_tcp_socket.sqf";
|
file = "\armatak\armatak\addons\main\functions\api\fn_stop_tcp_socket.sqf";
|
||||||
};
|
};
|
||||||
@@ -74,30 +68,12 @@ class CfgFunctions {
|
|||||||
class convert_to_kunduz_valley {
|
class convert_to_kunduz_valley {
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_kunduz_valley.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_kunduz_valley.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_lawn {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_lawn.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_livonia {
|
class convert_to_livonia {
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_livonia.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_livonia.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_malden {
|
class convert_to_malden {
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_malden.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_malden.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_malvinas_malvinasfalkands {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_malvinas_malvinasfalkands.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_malvinas_p_argentino_stanley {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_malvinas_p_argentino_stanley.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_malvinas_pebble_island_airfield {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_malvinas_pebble_island_airfield.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_malvinas_pradera_ganso {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_malvinas_pradera_ganso.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_malvinas_top_malo_house {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_malvinas_top_malo_house.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_southen_sahrani {
|
class convert_to_southen_sahrani {
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_southen_sahrani.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_southen_sahrani.sqf";
|
||||||
};
|
};
|
||||||
@@ -119,15 +95,6 @@ class CfgFunctions {
|
|||||||
class convert_to_zagor_zagorsk_reserved_forest {
|
class convert_to_zagor_zagorsk_reserved_forest {
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_zagor_zagorsk_reserved_forest.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_zagor_zagorsk_reserved_forest.sqf";
|
||||||
};
|
};
|
||||||
class convert_to_colombia {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_colombia.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_clafghan {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_clafghan.sqf";
|
|
||||||
};
|
|
||||||
class convert_to_rut_mandol {
|
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_rut_mandol.sqf";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,12 +35,7 @@ addMissionEventHandler ["ExtensionCallback", {
|
|||||||
[_function, "success", _name] call FUNC(notify);
|
[_function, "success", _name] call FUNC(notify);
|
||||||
};
|
};
|
||||||
case "TCP SOCKET ERROR": {
|
case "TCP SOCKET ERROR": {
|
||||||
_message = _function;
|
[_function, "error", _name] call FUNC(notify);
|
||||||
if (_data isNotEqualTo "") then {
|
|
||||||
_message = format ["%1: %2", _function, _data];
|
|
||||||
};
|
|
||||||
|
|
||||||
[_message, "error", _name] call FUNC(notify);
|
|
||||||
};
|
};
|
||||||
case "VIDEO": {
|
case "VIDEO": {
|
||||||
[_function, "success", _name] call FUNC(notify);
|
[_function, "success", _name] call FUNC(notify);
|
||||||
|
|||||||
@@ -32,6 +32,3 @@ if (!isNil "_pre_defined_role") then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_cot = [_drone, _atak_role, _atak_callsign] call armatak_fnc_send_marker_cot;
|
_cot = [_drone, _atak_role, _atak_callsign] call armatak_fnc_send_marker_cot;
|
||||||
|
|
||||||
[_drone] call armatak_fnc_send_uas_video_cot;
|
|
||||||
[_drone] call armatak_fnc_send_uas_sensor_cot;
|
|
||||||
|
|||||||
@@ -5,10 +5,9 @@
|
|||||||
params ["_unit", "_type", "_callsign"];
|
params ["_unit", "_type", "_callsign"];
|
||||||
|
|
||||||
_unit_position = _unit call armatak_client_fnc_extractClientPosition;
|
_unit_position = _unit call armatak_client_fnc_extractClientPosition;
|
||||||
_video_url = [_unit] call armatak_fnc_extract_marker_video_url;
|
|
||||||
|
|
||||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||||
|
|
||||||
_marker_cot = [_uuid, _type, _unit_position select 1, _unit_position select 2, _unit_position select 3, _callsign, _unit_position select 5, _unit_position select 6, _video_url];
|
_marker_cot = [_uuid, _type, _unit_position select 1, _unit_position select 2, _unit_position select 3, _callsign, _unit_position select 5, _unit_position select 6];
|
||||||
|
|
||||||
"armatak" callExtension ["tcp_socket:cot:marker", [_marker_cot]];
|
"armatak" callExtension ["tcp_socket:cot:marker", [_marker_cot]];
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
// function name: armatak_fnc_send_uas_sensor_cot
|
|
||||||
// function author: Valmo / ArmaTAK contributors
|
|
||||||
// function description:
|
|
||||||
// Sends a b-m-p-s-p-loc CoT event every router tick (1 s) for a drone.
|
|
||||||
// This is the "sensor position" event consumed by the ATAK UAS Tool to:
|
|
||||||
// - Draw the FOV cone on the moving map.
|
|
||||||
// - Compute four-corners for AR marker overlay on the video feed.
|
|
||||||
// - Show the SPoI (Sensor Point of Interest) crosshair.
|
|
||||||
//
|
|
||||||
// The event references the drone's b-i-v video endpoint via the drone UUID,
|
|
||||||
// so armatak_fnc_send_uas_video_cot must also be called for the same drone.
|
|
||||||
//
|
|
||||||
// Exits silently when "armatak_attribute_video_url" is not set, which keeps
|
|
||||||
// the behavior identical to the old fn_send_drone_cot for drones without a
|
|
||||||
// configured video stream.
|
|
||||||
//
|
|
||||||
// Arguments:
|
|
||||||
// 0: _drone <OBJECT> The drone object.
|
|
||||||
//
|
|
||||||
// Return value: none
|
|
||||||
|
|
||||||
params ["_drone"];
|
|
||||||
|
|
||||||
private _video_url = _drone getVariable ["armatak_attribute_video_url", ""];
|
|
||||||
if (_video_url == "") exitWith {};
|
|
||||||
|
|
||||||
private _uuid = _drone call armatak_fnc_extract_uuid;
|
|
||||||
private _sensor_uid = _uuid + "-sensor";
|
|
||||||
private _callsign = [_drone] call armatak_fnc_extract_marker_callsign;
|
|
||||||
|
|
||||||
private _pos = (getPos _drone) call armatak_client_fnc_convertClientLocation;
|
|
||||||
private _lat = _pos select 0;
|
|
||||||
private _lon = _pos select 1;
|
|
||||||
private _hae = _pos select 2;
|
|
||||||
|
|
||||||
private _azimuth = parseNumber ((getDir _drone) toFixed 0);
|
|
||||||
|
|
||||||
private _allTurrets = [_drone, false] call BIS_fnc_allTurrets;
|
|
||||||
if (count _allTurrets > 0) then {
|
|
||||||
private _firstTurretPath = _allTurrets select 0;
|
|
||||||
private _turretWeapons = _drone weaponsTurret _firstTurretPath;
|
|
||||||
if (_turretWeapons isNotEqualTo []) then {
|
|
||||||
private _tDir = _drone weaponDirection (_turretWeapons select 0);
|
|
||||||
if (!((_tDir select 0) == 0 && (_tDir select 1) == 0)) then {
|
|
||||||
_azimuth = round (((_tDir select 0) atan2 (_tDir select 1) + 360) mod 360);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
private _fov = _drone getVariable ["armatak_uas_fov", 60];
|
|
||||||
|
|
||||||
private _range = round (((getPosATL _drone) select 2) max 1);
|
|
||||||
|
|
||||||
private _payload = [_sensor_uid, _uuid, _callsign, _lat, _lon, _hae, _azimuth, _fov, _range];
|
|
||||||
"armatak" callExtension ["tcp_socket:cot:uas_sensor", [_payload]];
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
// function name: armatak_fnc_send_uas_video_cot
|
|
||||||
// function author: Valmo / ArmaTAK contributors
|
|
||||||
// function description:
|
|
||||||
// Sends a b-i-v CoT event that declares the RTSP video endpoint for a drone.
|
|
||||||
// The ATAK UAS Tool picks this up and shows the drone in its UAS list with
|
|
||||||
// the associated video feed available for playback.
|
|
||||||
//
|
|
||||||
// The drone entity MUST have the variable "armatak_attribute_video_url" set
|
|
||||||
// to a valid RTSP URL, e.g.:
|
|
||||||
// _drone setVariable ["armatak_attribute_video_url", "rtsp://192.168.1.10:8554/live/drone1"];
|
|
||||||
// or via the 3DEN attribute "Video URL (RTSP)" in the ARMA Team Awareness Kit
|
|
||||||
// attribute category.
|
|
||||||
//
|
|
||||||
// If the variable is absent or empty the function exits silently.
|
|
||||||
//
|
|
||||||
// Arguments:
|
|
||||||
// 0: _drone <OBJECT> The drone object.
|
|
||||||
//
|
|
||||||
// Return value: none
|
|
||||||
|
|
||||||
params ["_drone"];
|
|
||||||
|
|
||||||
private _video_url = _drone getVariable ["armatak_attribute_video_url", ""];
|
|
||||||
if (_video_url == "") exitWith {};
|
|
||||||
|
|
||||||
private _uuid = _drone call armatak_fnc_extract_uuid;
|
|
||||||
private _callsign = [_drone] call armatak_fnc_extract_marker_callsign;
|
|
||||||
|
|
||||||
private _payload = [_uuid, _callsign, _video_url];
|
|
||||||
"armatak" callExtension ["tcp_socket:cot:uas_video", [_payload]];
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// function name: armatak_fnc_extract_marker_video_url
|
|
||||||
// function author: Codex
|
|
||||||
// function description: Gets the marker video URL configured in 3DEN for a vehicle
|
|
||||||
|
|
||||||
params ["_unit"];
|
|
||||||
|
|
||||||
private _videoUrl = _unit getVariable ["armatak_attribute_marker_video_url", ""];
|
|
||||||
|
|
||||||
if (isNil "_videoUrl") exitWith {
|
|
||||||
""
|
|
||||||
};
|
|
||||||
|
|
||||||
_videoUrl
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
params["_latitude", "_longitude", "_altitude"];
|
|
||||||
|
|
||||||
_playerPosition = [_latitude, _longitude, _altitude];
|
|
||||||
|
|
||||||
_playerLatitude = _playerPosition select 0;
|
|
||||||
_playerLongitude = _playerPosition select 1;
|
|
||||||
|
|
||||||
_playerMaxLatitude = 20480;
|
|
||||||
_playerMaxLongitude = 20480;
|
|
||||||
|
|
||||||
_MapMaxLongitude = 33.728772;
|
|
||||||
_MapMinLongitude = 33.542815;
|
|
||||||
|
|
||||||
_MapMaxLatitude = 63.169746;
|
|
||||||
_MapMinLatitude = 62.938820;
|
|
||||||
|
|
||||||
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
|
||||||
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
|
||||||
|
|
||||||
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
|
||||||
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
|
||||||
|
|
||||||
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
params["_latitude", "_longitude", "_altitude"];
|
|
||||||
|
|
||||||
_playerPosition = [_latitude, _longitude, _altitude];
|
|
||||||
|
|
||||||
_playerLatitude = _playerPosition select 0;
|
|
||||||
_playerLongitude = _playerPosition select 1;
|
|
||||||
|
|
||||||
_playerMaxLatitude = 20480;
|
|
||||||
_playerMaxLongitude = 20480;
|
|
||||||
|
|
||||||
_MapMaxLatitude = -67.765153;
|
|
||||||
_MapMinLatitude = -68.223664;
|
|
||||||
|
|
||||||
_MapMaxLongitude = 10.593815;
|
|
||||||
_MapMinLongitude = 10.137466;
|
|
||||||
|
|
||||||
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
|
||||||
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
|
||||||
|
|
||||||
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
|
||||||
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
|
||||||
|
|
||||||
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
|
||||||
|
|
||||||
private _mapWidth = 8192;
|
|
||||||
private _mapHeight = 8192;
|
|
||||||
|
|
||||||
// SW corner (used as origin)
|
|
||||||
private _SW_lat = 63.005389;
|
|
||||||
private _SW_lon = 22.638957;
|
|
||||||
|
|
||||||
// SE corner
|
|
||||||
private _SE_lat = 63.010092;
|
|
||||||
private _SE_lon = 22.800107;
|
|
||||||
|
|
||||||
// NW corner
|
|
||||||
private _NW_lat = 63.078713;
|
|
||||||
private _NW_lon = 22.628542;
|
|
||||||
|
|
||||||
private _edgeSE_lat = _SE_lat - _SW_lat;
|
|
||||||
private _edgeSE_lon = _SE_lon - _SW_lon;
|
|
||||||
|
|
||||||
private _edgeNW_lat = _NW_lat - _SW_lat;
|
|
||||||
private _edgeNW_lon = _NW_lon - _SW_lon;
|
|
||||||
|
|
||||||
private _fx = _longitudeInGame / _mapWidth;
|
|
||||||
private _fy = _latitudeInGame / _mapHeight;
|
|
||||||
|
|
||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
params["_latitude", "_longitude", "_altitude"];
|
|
||||||
|
|
||||||
_playerPosition = [_latitude, _longitude, _altitude];
|
|
||||||
|
|
||||||
_playerLatitude = _playerPosition select 0;
|
|
||||||
_playerLongitude = _playerPosition select 1;
|
|
||||||
|
|
||||||
_playerMaxLongitude = 4992;
|
|
||||||
_playerMaxLatitude = 4992;
|
|
||||||
|
|
||||||
_MapMaxLongitude = -99.722665;
|
|
||||||
_MapMinLongitude = -99.775505;
|
|
||||||
|
|
||||||
_MapMaxLatitude = 32.159272;
|
|
||||||
_MapMinLatitude = 32.114011;
|
|
||||||
|
|
||||||
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
|
||||||
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
|
||||||
|
|
||||||
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
|
||||||
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
|
||||||
|
|
||||||
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
|
||||||
|
|
||||||
private _mapWidth = 11264;
|
|
||||||
private _mapHeight = 11264;
|
|
||||||
|
|
||||||
// SW corner (used as origin)
|
|
||||||
private _SW_lat = -51.736078;
|
|
||||||
private _SW_lon = -57.915032;
|
|
||||||
|
|
||||||
// SE corner
|
|
||||||
private _SE_lat = -51.736078;
|
|
||||||
private _SE_lon = -58.077879;
|
|
||||||
|
|
||||||
// NW corner
|
|
||||||
private _NW_lat = -51.634750;
|
|
||||||
private _NW_lon = -58.077879;
|
|
||||||
|
|
||||||
private _edgeSE_lat = _SE_lat - _SW_lat;
|
|
||||||
private _edgeSE_lon = _SE_lon - _SW_lon;
|
|
||||||
|
|
||||||
private _edgeNW_lat = _NW_lat - _SW_lat;
|
|
||||||
private _edgeNW_lon = _NW_lon - _SW_lon;
|
|
||||||
|
|
||||||
private _fx = _longitudeInGame / _mapWidth;
|
|
||||||
private _fy = _latitudeInGame / _mapHeight;
|
|
||||||
|
|
||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
|
||||||
|
|
||||||
private _mapWidth = 16384;
|
|
||||||
private _mapHeight = 16384;
|
|
||||||
|
|
||||||
// SW corner (used as origin)
|
|
||||||
private _SW_lat = -51.806546;
|
|
||||||
private _SW_lon = -57.939747;
|
|
||||||
|
|
||||||
// SE corner
|
|
||||||
private _SE_lat = -51.806546;
|
|
||||||
private _SE_lon = -57.701978;
|
|
||||||
|
|
||||||
// NW corner
|
|
||||||
private _NW_lat = -51.658913;
|
|
||||||
private _NW_lon = -57.939747;
|
|
||||||
|
|
||||||
private _edgeSE_lat = _SE_lat - _SW_lat;
|
|
||||||
private _edgeSE_lon = _SE_lon - _SW_lon;
|
|
||||||
|
|
||||||
private _edgeNW_lat = _NW_lat - _SW_lat;
|
|
||||||
private _edgeNW_lon = _NW_lon - _SW_lon;
|
|
||||||
|
|
||||||
private _fx = _longitudeInGame / _mapWidth;
|
|
||||||
private _fy = _latitudeInGame / _mapHeight;
|
|
||||||
|
|
||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
|
||||||
|
|
||||||
private _mapWidth = 10240;
|
|
||||||
private _mapHeight = 10240;
|
|
||||||
|
|
||||||
// SW corner (used as origin)
|
|
||||||
private _SW_lat = -51.863358;
|
|
||||||
private _SW_lon = -59.054585;
|
|
||||||
|
|
||||||
// SE corner
|
|
||||||
private _SE_lat = -51.863358;
|
|
||||||
private _SE_lon = -58.906155;
|
|
||||||
|
|
||||||
// NW corner
|
|
||||||
private _NW_lat = -51.771493;
|
|
||||||
private _NW_lon = -59.054585;
|
|
||||||
|
|
||||||
private _edgeSE_lat = _SE_lat - _SW_lat;
|
|
||||||
private _edgeSE_lon = _SE_lon - _SW_lon;
|
|
||||||
|
|
||||||
private _edgeNW_lat = _NW_lat - _SW_lat;
|
|
||||||
private _edgeNW_lon = _NW_lon - _SW_lon;
|
|
||||||
|
|
||||||
private _fx = _longitudeInGame / _mapWidth;
|
|
||||||
private _fy = _latitudeInGame / _mapHeight;
|
|
||||||
|
|
||||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
|
||||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
|
||||||
|
|
||||||
[_realLat, _realLon, _altitude]
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
params["_latitude", "_longitude", "_altitude"];
|
|
||||||
|
|
||||||
_playerPosition = [_latitude, _longitude, _altitude];
|
|
||||||
|
|
||||||
_playerLatitude = _playerPosition select 0;
|
|
||||||
_playerLongitude = _playerPosition select 1;
|
|
||||||
|
|
||||||
_playerMaxLongitude = 5120;
|
|
||||||
_playerMaxLatitude = 5120;
|
|
||||||
|
|
||||||
_MapMaxLatitude = -51.619725;
|
|
||||||
_MapMinLatitude = -51.664223;
|
|
||||||
|
|
||||||
_MapMaxLongitude = -58.394630;
|
|
||||||
_MapMinLongitude = -58.469580;
|
|
||||||
|
|
||||||
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
|
||||||
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
|
||||||
|
|
||||||
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
|
||||||
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
|
||||||
|
|
||||||
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
params["_latitude", "_longitude", "_altitude"];
|
|
||||||
|
|
||||||
_playerPosition = [_latitude, _longitude, _altitude];
|
|
||||||
|
|
||||||
_playerLatitude = _playerPosition select 0;
|
|
||||||
_playerLongitude = _playerPosition select 1;
|
|
||||||
|
|
||||||
_playerMaxLatitude = 32768;
|
|
||||||
_playerMaxLongitude = 32768;
|
|
||||||
|
|
||||||
_MapMaxLongitude = 35.285485;
|
|
||||||
_MapMinLongitude = 34.927617;
|
|
||||||
|
|
||||||
_MapMaxLatitude = 70.445404;
|
|
||||||
_MapMinLatitude = 70.016783;
|
|
||||||
|
|
||||||
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
|
||||||
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
|
||||||
|
|
||||||
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
|
||||||
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
|
||||||
|
|
||||||
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
|
||||||
@@ -1,28 +1,42 @@
|
|||||||
class CfgVehicles {
|
class CfgVehicles {
|
||||||
class Logic;
|
class Logic;
|
||||||
class Module_F : Logic {
|
class Module_F : Logic
|
||||||
class AttributesBase {
|
{
|
||||||
|
class AttributesBase
|
||||||
|
{
|
||||||
|
class Default;
|
||||||
class Edit;
|
class Edit;
|
||||||
|
class Combo;
|
||||||
|
class Checkbox;
|
||||||
|
class CheckboxNumber;
|
||||||
class ModuleDescription;
|
class ModuleDescription;
|
||||||
|
class Units;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ModuleDescription
|
||||||
|
{
|
||||||
|
class AnyBrain;
|
||||||
};
|
};
|
||||||
class ModuleDescription;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GVAR(moduleBase): Module_F {
|
class GVAR(moduleBase): Module_F {
|
||||||
author = PROJECT_AUTHOR;
|
author = PROJECT_AUTHOR;
|
||||||
category = QEGVAR(main,moduleCategory);
|
category = QEGVAR(main,moduleCategory);
|
||||||
function = QUOTE({});
|
function = QUOTE({});
|
||||||
functionPriority = 1;
|
functionPriority = 1;
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
isTriggerActivated = 0;
|
isTriggerActivated = 0;
|
||||||
scope = 1;
|
scope = 1;
|
||||||
scopeCurator = 2;
|
scopeCurator = 2;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GVAR(connectionModuleBase): GVAR(moduleBase) {
|
class GVAR(coreModule): GVAR(moduleBase) {
|
||||||
|
scope = 2;
|
||||||
scopeCurator = 0;
|
scopeCurator = 0;
|
||||||
|
displayname = "CoT Router";
|
||||||
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
||||||
category = QEGVAR(main,moduleCategory);
|
category = QEGVAR(main,moduleCategory);
|
||||||
|
function = QFUNC(3denCoreModuleConfig);
|
||||||
functionPriority = 1;
|
functionPriority = 1;
|
||||||
isGlobal = 0;
|
isGlobal = 0;
|
||||||
isTriggerActivated = 1;
|
isTriggerActivated = 1;
|
||||||
@@ -33,25 +47,19 @@ class CfgVehicles {
|
|||||||
canSetArea = 0;
|
canSetArea = 0;
|
||||||
canSetAreaShape = 0;
|
canSetAreaShape = 0;
|
||||||
canSetAreaHeight = 0;
|
canSetAreaHeight = 0;
|
||||||
};
|
|
||||||
|
|
||||||
class GVAR(tcpModule): GVAR(connectionModuleBase) {
|
|
||||||
scope = 2;
|
|
||||||
displayName = "CoT Router (TCP)";
|
|
||||||
function = QFUNC(3denTcpModuleConfig);
|
|
||||||
|
|
||||||
class Attributes: AttributesBase {
|
class Attributes: AttributesBase {
|
||||||
class GVAR(moduleInstanceAddress): Edit {
|
class GVAR(moduleInstanceAddress): Edit {
|
||||||
property = QGVAR(moduleInstanceAddress);
|
property = QGVAR(moduleInstanceAddress);
|
||||||
displayName = "TAK Server Address";
|
displayname = "TAK Server Address";
|
||||||
tooltip = "Hostname or IP address for the TAK or IronTAK server.";
|
tooltip = "TAK Server Instance Address";
|
||||||
typeName = "STRING";
|
typeName = "STRING";
|
||||||
defaultValue = "'localhost'";
|
defaultValue = "localhost";
|
||||||
};
|
};
|
||||||
class GVAR(moduleInstancePort): Edit {
|
class GVAR(moduleInstancePort): Edit {
|
||||||
property = QGVAR(moduleInstancePort);
|
property = QGVAR(moduleInstancePort);
|
||||||
displayName = "TAK Server TCP Port";
|
displayname = "TAK Server TCP Port";
|
||||||
tooltip = "Port for the unauthenticated TCP socket.";
|
tooltip = "TAK Server instance Port for TCP connection";
|
||||||
typeName = "NUMBER";
|
typeName = "NUMBER";
|
||||||
defaultValue = "8088";
|
defaultValue = "8088";
|
||||||
};
|
};
|
||||||
@@ -59,75 +67,24 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class ModuleDescription: ModuleDescription {
|
class ModuleDescription: ModuleDescription {
|
||||||
description = "Connect ArmaTAK to a TAK server over plain TCP.";
|
description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance";
|
||||||
sync[] = {"LocationArea_F"};
|
sync[] = {"LocationArea_F"};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class GVAR(enrollModule): GVAR(connectionModuleBase) {
|
class GVAR(coreModuleCurator): GVAR(coreModule) {
|
||||||
scope = 2;
|
|
||||||
displayName = "CoT Router (Authenticated)";
|
|
||||||
function = QFUNC(3denEnrollModuleConfig);
|
|
||||||
|
|
||||||
class Attributes: AttributesBase {
|
|
||||||
class GVAR(moduleInstanceAddress): Edit {
|
|
||||||
property = QGVAR(moduleInstanceAddress);
|
|
||||||
displayname = "TAK Server Address";
|
|
||||||
tooltip = "Hostname or IP address used for enrollment and the final TLS connection.";
|
|
||||||
typeName = "STRING";
|
|
||||||
defaultValue = "'localhost'";
|
|
||||||
};
|
|
||||||
class GVAR(moduleEnrollmentPort): Edit {
|
|
||||||
property = QGVAR(moduleEnrollmentPort);
|
|
||||||
displayName = "Enrollment HTTPS Port";
|
|
||||||
tooltip = "Port used for GET /Marti/api/tls/config and POST /Marti/api/tls/signClient/v2.";
|
|
||||||
typeName = "NUMBER";
|
|
||||||
defaultValue = "8446";
|
|
||||||
};
|
|
||||||
class GVAR(moduleEnrollmentUsername): Edit {
|
|
||||||
property = QGVAR(moduleEnrollmentUsername);
|
|
||||||
displayName = "Enrollment Username";
|
|
||||||
tooltip = "Username used in Basic Auth for client certificate enrollment.";
|
|
||||||
typeName = "STRING";
|
|
||||||
defaultValue = "''";
|
|
||||||
};
|
|
||||||
class GVAR(moduleEnrollmentPassword): Edit {
|
|
||||||
property = QGVAR(moduleEnrollmentPassword);
|
|
||||||
displayName = "Enrollment Password";
|
|
||||||
tooltip = "Password used in Basic Auth for client certificate enrollment.";
|
|
||||||
typeName = "STRING";
|
|
||||||
defaultValue = "''";
|
|
||||||
};
|
|
||||||
class ModuleDescription: ModuleDescription {};
|
|
||||||
};
|
|
||||||
|
|
||||||
class ModuleDescription: ModuleDescription {
|
|
||||||
description = "Enroll a client certificate and connect ArmaTAK over mTLS.";
|
|
||||||
sync[] = {"LocationArea_F"};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class GVAR(tcpModuleCurator): GVAR(tcpModule) {
|
|
||||||
scope = 1;
|
scope = 1;
|
||||||
scopeCurator = 2;
|
scopeCurator = 2;
|
||||||
function = "";
|
function = "";
|
||||||
displayName = "CoT Router (TCP, Zeus)";
|
displayName = "CoT Router (Zeus)";
|
||||||
curatorInfoType = "armatak_zeus_tcp_module_dialog";
|
curatorInfoType = "armatak_zeus_core_module_dialog";
|
||||||
};
|
|
||||||
|
|
||||||
class GVAR(enrollModuleCurator): GVAR(enrollModule) {
|
|
||||||
scope = 1;
|
|
||||||
scopeCurator = 2;
|
|
||||||
function = "";
|
|
||||||
displayName = "CoT Router (Authenticated, Zeus)";
|
|
||||||
curatorInfoType = "armatak_zeus_enroll_module_dialog";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GVAR(markEntity): GVAR(moduleBase) {
|
class GVAR(markEntity): GVAR(moduleBase) {
|
||||||
curatorCanAttach = 1;
|
curatorCanAttach = 1;
|
||||||
category = QEGVAR(main,moduleCategory);
|
category = QEGVAR(main,moduleCategory);
|
||||||
displayname = "Mark Entity";
|
displayname = "Mark Entity";
|
||||||
function = QFUNC(routerEntityAdd);
|
function = QFUNC(routerEntityAdd);
|
||||||
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
PREP(3denEnrollModuleConfig);
|
PREP(3denCoreModuleConfig);
|
||||||
PREP(3denTcpModuleConfig);
|
|
||||||
PREP(routerEntityAdd);
|
PREP(routerEntityAdd);
|
||||||
PREP(routerEntityRemove);
|
PREP(routerEntityRemove);
|
||||||
PREP(startCotRouter);
|
PREP(ZeusCoreModuleConfig);
|
||||||
PREP(ZeusEnrollModuleConfig);
|
|
||||||
PREP(ZeusTcpModuleConfig);
|
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ class CfgPatches {
|
|||||||
class ADDON {
|
class ADDON {
|
||||||
name = COMPONENT_NAME;
|
name = COMPONENT_NAME;
|
||||||
units[] = {
|
units[] = {
|
||||||
QGVAR(tcpModule),
|
QGVAR(coreModule),
|
||||||
QGVAR(tcpModuleCurator),
|
QGVAR(coreModuleCurator),
|
||||||
QGVAR(enrollModule),
|
|
||||||
QGVAR(enrollModuleCurator),
|
|
||||||
QGVAR(markEntity)
|
QGVAR(markEntity)
|
||||||
};
|
};
|
||||||
weapons[] = {};
|
weapons[] = {};
|
||||||
|
|||||||
@@ -3,172 +3,69 @@ class RscBackground;
|
|||||||
class RscButton;
|
class RscButton;
|
||||||
class RscEdit;
|
class RscEdit;
|
||||||
|
|
||||||
class armatak_zeus_tcp_module_dialog {
|
class armatak_zeus_core_module_dialog {
|
||||||
idd = 999991;
|
idd = 999991;
|
||||||
movingEnable = 0;
|
movingEnable = 0;
|
||||||
class ControlsBackground {
|
class ControlsBackground {
|
||||||
class main_frame: RscBackground {
|
class armatak_gui_module_zeus_core_dialog_main_frame: RscBackground {
|
||||||
idc = 1800;
|
idc = 1800;
|
||||||
x = "0.386562 * safezoneW + safezoneX";
|
x = "0.386562 * safezoneW + safezoneX";
|
||||||
y = "0.29 * safezoneH + safezoneY";
|
y = "0.401 * safezoneH + safezoneY";
|
||||||
w = "0.216563 * safezoneW";
|
w = "0.216563 * safezoneW";
|
||||||
h = "0.32 * safezoneH";
|
h = "0.242 * safezoneH";
|
||||||
colorBackground[] = {0,0,0,0.45};
|
colorBackground[]={0,0,0,0.45};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class Controls {
|
class Controls {
|
||||||
class address_text: RscText {
|
class armatak_gui_module_zeus_core_dialog_address_edit: RscEdit {
|
||||||
idc = 1000;
|
|
||||||
text = "TAK Server Address";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.332 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.033 * safezoneH";
|
|
||||||
};
|
|
||||||
class address_edit: RscEdit {
|
|
||||||
idc = 14000;
|
idc = 14000;
|
||||||
text = "localhost";
|
text = "localhost";
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
y = "0.365 * safezoneH + safezoneY";
|
y = "0.445 * safezoneH + safezoneY";
|
||||||
w = "0.20625 * safezoneW";
|
w = "0.20625 * safezoneW";
|
||||||
h = "0.044 * safezoneH";
|
h = "0.044 * safezoneH";
|
||||||
colorBackground[] = {0,0,0,0.5};
|
colorBackground[]={0,0,0,0.5};
|
||||||
};
|
};
|
||||||
class port_text: RscText {
|
class armatak_gui_module_zeus_core_dialog_address_port_edit: RscEdit {
|
||||||
idc = 1001;
|
|
||||||
text = "TAK Server Port";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.425 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.033 * safezoneH";
|
|
||||||
};
|
|
||||||
class port_edit: RscEdit {
|
|
||||||
idc = 14001;
|
idc = 14001;
|
||||||
text = "8088";
|
text = "8088";
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
y = "0.458 * safezoneH + safezoneY";
|
y = "0.522 * safezoneH + safezoneY";
|
||||||
w = "0.20625 * safezoneW";
|
w = "0.20625 * safezoneW";
|
||||||
h = "0.044 * safezoneH";
|
h = "0.044 * safezoneH";
|
||||||
colorBackground[] = {0,0,0,0.5};
|
colorBackground[]={0,0,0,0.5};
|
||||||
};
|
};
|
||||||
class button_cancel: RscButton {
|
class armatak_gui_module_zeus_core_dialog_address_text: RscText {
|
||||||
|
idc = 1000;
|
||||||
|
text = "TAK Server Address";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.412 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.033 * safezoneH";
|
||||||
|
};
|
||||||
|
class armatak_gui_module_zeus_core_dialog_address_port_text: RscText {
|
||||||
|
idc = 1001;
|
||||||
|
text = "TAK Server Port";
|
||||||
|
x = "0.391719 * safezoneW + safezoneX";
|
||||||
|
y = "0.489 * safezoneH + safezoneY";
|
||||||
|
w = "0.20625 * safezoneW";
|
||||||
|
h = "0.033 * safezoneH";
|
||||||
|
};
|
||||||
|
class armatak_gui_module_zeus_core_dialog_address_button_cancel: RscButton {
|
||||||
idc = 1601;
|
idc = 1601;
|
||||||
text = "Cancel";
|
text = "Cancel";
|
||||||
action = "closeDialog 2;";
|
action = "closeDialog 2;";
|
||||||
x = "0.551563 * safezoneW + safezoneX";
|
x = "0.551563 * safezoneW + safezoneX";
|
||||||
y = "0.535 * safezoneH + safezoneY";
|
y = "0.577 * safezoneH + safezoneY";
|
||||||
w = "0.0464063 * safezoneW";
|
w = "0.0464063 * safezoneW";
|
||||||
h = "0.055 * safezoneH";
|
h = "0.055 * safezoneH";
|
||||||
};
|
};
|
||||||
class button_ok: RscButton {
|
class armatak_gui_module_zeus_core_dialog_address_button_ok: RscButton {
|
||||||
idc = 1600;
|
idc = 1600;
|
||||||
text = "Ok";
|
text = "Ok";
|
||||||
action = QUOTE(call FUNC(ZeusTcpModuleConfig));
|
action = QUOTE(call FUNC(zeusCoreModuleConfig));
|
||||||
x = "0.5 * safezoneW + safezoneX";
|
x = "0.5 * safezoneW + safezoneX";
|
||||||
y = "0.535 * safezoneH + safezoneY";
|
y = "0.577 * safezoneH + safezoneY";
|
||||||
w = "0.0464063 * safezoneW";
|
|
||||||
h = "0.055 * safezoneH";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class armatak_zeus_enroll_module_dialog {
|
|
||||||
idd = 999992;
|
|
||||||
movingEnable = 0;
|
|
||||||
class ControlsBackground {
|
|
||||||
class main_frame: RscBackground {
|
|
||||||
idc = 1810;
|
|
||||||
x = "0.386562 * safezoneW + safezoneX";
|
|
||||||
y = "0.2 * safezoneH + safezoneY";
|
|
||||||
w = "0.216563 * safezoneW";
|
|
||||||
h = "0.52 * safezoneH";
|
|
||||||
colorBackground[] = {0,0,0,0.45};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
class Controls {
|
|
||||||
class address_text: RscText {
|
|
||||||
idc = 1010;
|
|
||||||
text = "TAK Server Address";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.242 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.033 * safezoneH";
|
|
||||||
};
|
|
||||||
class address_edit: RscEdit {
|
|
||||||
idc = 14100;
|
|
||||||
text = "localhost";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.275 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.044 * safezoneH";
|
|
||||||
colorBackground[] = {0,0,0,0.5};
|
|
||||||
};
|
|
||||||
class enroll_port_text: RscText {
|
|
||||||
idc = 1011;
|
|
||||||
text = "Enrollment HTTPS Port";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.335 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.033 * safezoneH";
|
|
||||||
};
|
|
||||||
class enroll_port_edit: RscEdit {
|
|
||||||
idc = 14101;
|
|
||||||
text = "8446";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.368 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.044 * safezoneH";
|
|
||||||
colorBackground[] = {0,0,0,0.5};
|
|
||||||
};
|
|
||||||
class username_text: RscText {
|
|
||||||
idc = 1012;
|
|
||||||
text = "Enrollment Username";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.428 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.033 * safezoneH";
|
|
||||||
};
|
|
||||||
class username_edit: RscEdit {
|
|
||||||
idc = 14102;
|
|
||||||
text = "";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.461 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.044 * safezoneH";
|
|
||||||
colorBackground[] = {0,0,0,0.5};
|
|
||||||
};
|
|
||||||
class password_text: RscText {
|
|
||||||
idc = 1013;
|
|
||||||
text = "Enrollment Password";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.521 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.033 * safezoneH";
|
|
||||||
};
|
|
||||||
class password_edit: RscEdit {
|
|
||||||
idc = 14103;
|
|
||||||
text = "";
|
|
||||||
x = "0.391719 * safezoneW + safezoneX";
|
|
||||||
y = "0.554 * safezoneH + safezoneY";
|
|
||||||
w = "0.20625 * safezoneW";
|
|
||||||
h = "0.044 * safezoneH";
|
|
||||||
colorBackground[] = {0,0,0,0.5};
|
|
||||||
};
|
|
||||||
class button_cancel: RscButton {
|
|
||||||
idc = 1611;
|
|
||||||
text = "Cancel";
|
|
||||||
action = "closeDialog 2;";
|
|
||||||
x = "0.551563 * safezoneW + safezoneX";
|
|
||||||
y = "0.645 * safezoneH + safezoneY";
|
|
||||||
w = "0.0464063 * safezoneW";
|
|
||||||
h = "0.055 * safezoneH";
|
|
||||||
};
|
|
||||||
class button_ok: RscButton {
|
|
||||||
idc = 1610;
|
|
||||||
text = "Ok";
|
|
||||||
action = QUOTE(call FUNC(ZeusEnrollModuleConfig));
|
|
||||||
x = "0.5 * safezoneW + safezoneX";
|
|
||||||
y = "0.645 * safezoneH + safezoneY";
|
|
||||||
w = "0.0464063 * safezoneW";
|
w = "0.0464063 * safezoneW";
|
||||||
h = "0.055 * safezoneH";
|
h = "0.055 * safezoneH";
|
||||||
};
|
};
|
||||||
|
|||||||
64
addons/server/functions/fnc_3denCoreModuleConfig.sqf
Normal file
64
addons/server/functions/fnc_3denCoreModuleConfig.sqf
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params [
|
||||||
|
["_logic", objNull, [objNull]],
|
||||||
|
["_units", [], [[]]],
|
||||||
|
["_activated", true, [true]]
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isServer) exitWith {
|
||||||
|
["Connecting to TCP Socket", "success", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
|
||||||
|
_tak_server_instance_address = _logic getVariable QGVAR(moduleInstanceAddress);
|
||||||
|
_tak_server_instance_port = _logic getVariable QGVAR(moduleInstancePort);
|
||||||
|
|
||||||
|
_tak_server_fulladdress = _tak_server_instance_address + ":" + (str _tak_server_instance_port);
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_server_instance", _tak_server_fulladdress];
|
||||||
|
missionNamespace setVariable ["armatak_tcp_socket_is_running", true];
|
||||||
|
|
||||||
|
"armatak" callExtension ["tcp_socket:start", [_tak_server_fulladdress]];
|
||||||
|
|
||||||
|
_syncUnits = synchronizedObjects _logic;
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_server_syncedUnits", _syncUnits];
|
||||||
|
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||||
|
|
||||||
|
[{
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||||
|
|
||||||
|
{
|
||||||
|
_objectType = _x call BIS_fnc_objectType;
|
||||||
|
switch (true) do {
|
||||||
|
case ((_objectType select 0) == "Soldier"): {
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
|
||||||
|
_group_name = [group _x] call armatak_fnc_extract_group_color;
|
||||||
|
_group_role = [_x] call armatak_fnc_extract_group_role;
|
||||||
|
|
||||||
|
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
|
||||||
|
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||||
|
};
|
||||||
|
case ((_objectType select 0) == "Vehicle"): {
|
||||||
|
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||||
|
|
||||||
|
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
||||||
|
|
||||||
|
_x call armatak_fnc_extract_sensor_data;
|
||||||
|
};
|
||||||
|
case ((_objectType select 0) == "VehicleAutonomous"): {
|
||||||
|
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||||
|
|
||||||
|
[_x, _atak_type, _callsign] call armatak_fnc_send_drone_cot;
|
||||||
|
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||||
|
|
||||||
|
_x call armatak_fnc_extract_sensor_data;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} forEach GVAR(syncedUnits);
|
||||||
|
}, 1, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
};
|
||||||
|
|
||||||
|
true;
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params [
|
|
||||||
["_logic", objNull, [objNull]],
|
|
||||||
["_units", [], [[]]],
|
|
||||||
["_activated", true, [true]]
|
|
||||||
];
|
|
||||||
|
|
||||||
if (isServer) exitWith {
|
|
||||||
if (missionNamespace getVariable ["armatak_tcp_socket_is_running", false]) exitWith {
|
|
||||||
["Socket was called twice", "error", "TCP Socket"] call EFUNC(main,notify);
|
|
||||||
};
|
|
||||||
|
|
||||||
["Connecting to authenticated TAK socket", "success", "TCP Socket"] call EFUNC(main,notify);
|
|
||||||
|
|
||||||
_tak_server_instance_address = _logic getVariable [QGVAR(moduleInstanceAddress), "localhost"];
|
|
||||||
_tak_server_enrollment_port = _logic getVariable [QGVAR(moduleEnrollmentPort), 8446];
|
|
||||||
_tak_server_enrollment_username = _logic getVariable [QGVAR(moduleEnrollmentUsername), ""];
|
|
||||||
_tak_server_enrollment_password = _logic getVariable [QGVAR(moduleEnrollmentPassword), ""];
|
|
||||||
|
|
||||||
"armatak" callExtension [
|
|
||||||
"tcp_socket:start_enroll_mtls",
|
|
||||||
[
|
|
||||||
_tak_server_instance_address,
|
|
||||||
_tak_server_instance_address,
|
|
||||||
str _tak_server_enrollment_port,
|
|
||||||
_tak_server_enrollment_username,
|
|
||||||
_tak_server_enrollment_password,
|
|
||||||
""
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
missionNamespace setVariable ["armatak_server_syncedUnits", synchronizedObjects _logic];
|
|
||||||
_tak_server_instance_address call FUNC(startCotRouter);
|
|
||||||
};
|
|
||||||
|
|
||||||
true
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params [
|
|
||||||
["_logic", objNull, [objNull]],
|
|
||||||
["_units", [], [[]]],
|
|
||||||
["_activated", true, [true]]
|
|
||||||
];
|
|
||||||
|
|
||||||
if (isServer) exitWith {
|
|
||||||
if (missionNamespace getVariable ["armatak_tcp_socket_is_running", false]) exitWith {
|
|
||||||
["Socket was called twice", "error", "TCP Socket"] call EFUNC(main,notify);
|
|
||||||
};
|
|
||||||
|
|
||||||
["Connecting to TCP Socket", "success", "TCP Socket"] call EFUNC(main,notify);
|
|
||||||
|
|
||||||
_tak_server_instance_address = _logic getVariable [QGVAR(moduleInstanceAddress), "localhost"];
|
|
||||||
_tak_server_instance_port = _logic getVariable [QGVAR(moduleInstancePort), 8088];
|
|
||||||
_tak_server_fulladdress = _tak_server_instance_address + ":" + (str _tak_server_instance_port);
|
|
||||||
|
|
||||||
"armatak" callExtension ["tcp_socket:start", [_tak_server_fulladdress]];
|
|
||||||
|
|
||||||
missionNamespace setVariable ["armatak_server_syncedUnits", synchronizedObjects _logic];
|
|
||||||
_tak_server_fulladdress call FUNC(startCotRouter);
|
|
||||||
};
|
|
||||||
|
|
||||||
true
|
|
||||||
67
addons/server/functions/fnc_ZeusCoreModuleConfig.sqf
Normal file
67
addons/server/functions/fnc_ZeusCoreModuleConfig.sqf
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params ["_logic"];
|
||||||
|
|
||||||
|
_socket_is_running = missionNamespace getVariable ["armatak_tcp_socket_is_running", false];
|
||||||
|
|
||||||
|
if (_socket_is_running) exitWith {
|
||||||
|
["Socket was called twice", "error", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
closeDialog 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
disableSerialization;
|
||||||
|
|
||||||
|
["Connecting to TCP Socket", "success", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
|
||||||
|
_tak_server_instance_address = ctrlText 14000;
|
||||||
|
_tak_server_instance_port = ctrlText 14001;
|
||||||
|
|
||||||
|
_tak_server_fulladdress = ((_tak_server_instance_address) + ":" + (_tak_server_instance_port));
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_server_instance", _tak_server_fulladdress];
|
||||||
|
missionNamespace setVariable ["armatak_tcp_socket_is_running", true];
|
||||||
|
|
||||||
|
"armatak" callExtension ["tcp_socket:start", [_tak_server_fulladdress]];
|
||||||
|
|
||||||
|
_syncUnits = [];
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_server_syncedUnits", _syncUnits];
|
||||||
|
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||||
|
|
||||||
|
[{
|
||||||
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||||
|
|
||||||
|
{
|
||||||
|
_objectType = _x call BIS_fnc_objectType;
|
||||||
|
switch (true) do {
|
||||||
|
case ((_objectType select 0) == "Soldier"): {
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
|
||||||
|
_group_name = [group _x] call armatak_fnc_extract_group_color;
|
||||||
|
_group_role = [_x] call armatak_fnc_extract_group_role;
|
||||||
|
|
||||||
|
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
|
||||||
|
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||||
|
};
|
||||||
|
case ((_objectType select 0) == "Vehicle"): {
|
||||||
|
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||||
|
|
||||||
|
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
||||||
|
|
||||||
|
_x call armatak_fnc_extract_sensor_data;
|
||||||
|
};
|
||||||
|
case ((_objectType select 0) == "VehicleAutonomous"): {
|
||||||
|
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||||
|
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||||
|
|
||||||
|
[_x, _atak_type, _callsign] call armatak_fnc_send_drone_cot;
|
||||||
|
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||||
|
|
||||||
|
_x call armatak_fnc_extract_sensor_data;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} forEach GVAR(syncedUnits);
|
||||||
|
}, 1, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
deleteVehicle _logic;
|
||||||
|
closeDialog 1;
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params ["_logic"];
|
|
||||||
|
|
||||||
if (missionNamespace getVariable ["armatak_tcp_socket_is_running", false]) exitWith {
|
|
||||||
["Socket was called twice", "error", "TCP Socket"] call EFUNC(main,notify);
|
|
||||||
closeDialog 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
disableSerialization;
|
|
||||||
|
|
||||||
["Connecting to authenticated TAK socket", "success", "TCP Socket"] call EFUNC(main,notify);
|
|
||||||
|
|
||||||
_tak_server_instance_address = ctrlText 14100;
|
|
||||||
_tak_server_enrollment_port = ctrlText 14101;
|
|
||||||
_tak_server_enrollment_username = ctrlText 14102;
|
|
||||||
_tak_server_enrollment_password = ctrlText 14103;
|
|
||||||
|
|
||||||
"armatak" callExtension [
|
|
||||||
"tcp_socket:start_enroll_mtls",
|
|
||||||
[
|
|
||||||
_tak_server_instance_address,
|
|
||||||
_tak_server_instance_address,
|
|
||||||
_tak_server_enrollment_port,
|
|
||||||
_tak_server_enrollment_username,
|
|
||||||
_tak_server_enrollment_password,
|
|
||||||
""
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
_tak_server_instance_address call FUNC(startCotRouter);
|
|
||||||
deleteVehicle _logic;
|
|
||||||
closeDialog 1;
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params ["_logic"];
|
|
||||||
|
|
||||||
if (missionNamespace getVariable ["armatak_tcp_socket_is_running", false]) exitWith {
|
|
||||||
["Socket was called twice", "error", "TCP Socket"] call EFUNC(main,notify);
|
|
||||||
closeDialog 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
disableSerialization;
|
|
||||||
|
|
||||||
["Connecting to TCP Socket", "success", "TCP Socket"] call EFUNC(main,notify);
|
|
||||||
|
|
||||||
_tak_server_instance_address = ctrlText 14000;
|
|
||||||
_tak_server_instance_port = ctrlText 14001;
|
|
||||||
_tak_server_fulladdress = _tak_server_instance_address + ":" + _tak_server_instance_port;
|
|
||||||
|
|
||||||
"armatak" callExtension ["tcp_socket:start", [_tak_server_fulladdress]];
|
|
||||||
|
|
||||||
_tak_server_fulladdress call FUNC(startCotRouter);
|
|
||||||
deleteVehicle _logic;
|
|
||||||
closeDialog 1;
|
|
||||||
@@ -34,7 +34,7 @@ switch (false) do {
|
|||||||
};
|
};
|
||||||
} forEach GVAR(syncedUnits);
|
} forEach GVAR(syncedUnits);
|
||||||
|
|
||||||
missionNamespace setVariable ["armatak_server_syncedUnits", GVAR(syncedUnits)];
|
missionNmaespace setVariable ["armatak_server_syncedUnits", GVAR(syncedUnits)];
|
||||||
SETVAR(_unit,GVAR(isRouting),false);
|
SETVAR(_unit,GVAR(isRouting),false);
|
||||||
|
|
||||||
deleteVehicle _logic;
|
deleteVehicle _logic;
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params [["_server_instance", "", [""]]];
|
|
||||||
|
|
||||||
missionNamespace setVariable ["armatak_server_instance", _server_instance];
|
|
||||||
missionNamespace setVariable ["armatak_tcp_socket_is_running", true];
|
|
||||||
|
|
||||||
if (isNil { missionNamespace getVariable "armatak_server_syncedUnits" }) then {
|
|
||||||
missionNamespace setVariable ["armatak_server_syncedUnits", []];
|
|
||||||
};
|
|
||||||
|
|
||||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
|
||||||
|
|
||||||
[{
|
|
||||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
|
||||||
|
|
||||||
{
|
|
||||||
_objectType = _x call BIS_fnc_objectType;
|
|
||||||
switch (true) do {
|
|
||||||
case ((_objectType select 0) == "Soldier"): {
|
|
||||||
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
|
|
||||||
_group_name = [group _x] call armatak_fnc_extract_group_color;
|
|
||||||
_group_role = [_x] call armatak_fnc_extract_group_role;
|
|
||||||
|
|
||||||
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
|
|
||||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
|
||||||
};
|
|
||||||
case ((_objectType select 0) == "Vehicle"): {
|
|
||||||
_atak_type = [_x] call armatak_fnc_extract_role;
|
|
||||||
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
|
||||||
|
|
||||||
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
|
||||||
_x call armatak_fnc_extract_sensor_data;
|
|
||||||
};
|
|
||||||
case ((_objectType select 0) == "VehicleAutonomous"): {
|
|
||||||
_atak_type = [_x] call armatak_fnc_extract_role;
|
|
||||||
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
|
||||||
|
|
||||||
[_x, _atak_type, _callsign] call armatak_fnc_send_drone_cot;
|
|
||||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
|
||||||
_x call armatak_fnc_extract_sensor_data;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} forEach GVAR(syncedUnits);
|
|
||||||
}, 1, []] call CBA_fnc_addPerFrameHandler;
|
|
||||||
|
|
||||||
true
|
|
||||||
1
addons/video/$PBOPREFIX$
Normal file
1
addons/video/$PBOPREFIX$
Normal file
@@ -0,0 +1 @@
|
|||||||
|
armatak\armatak\addons\video
|
||||||
11
addons/video/CfgEventHandlers.hpp
Normal file
11
addons/video/CfgEventHandlers.hpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class Extended_PreStart_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
73
addons/video/CfgVehicles.hpp
Normal file
73
addons/video/CfgVehicles.hpp
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
class CfgVehicles {
|
||||||
|
class Logic;
|
||||||
|
|
||||||
|
class Module_F : Logic
|
||||||
|
{
|
||||||
|
class AttributesBase
|
||||||
|
{
|
||||||
|
class Default;
|
||||||
|
class Edit;
|
||||||
|
class Combo;
|
||||||
|
class Checkbox;
|
||||||
|
class CheckboxNumber;
|
||||||
|
class ModuleDescription;
|
||||||
|
class Units;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ModuleDescription
|
||||||
|
{
|
||||||
|
class AnyBrain;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class EGVAR(server,moduleBase);
|
||||||
|
class GVAR(videoModule): EGVAR(server,moduleBase) {
|
||||||
|
scope = 2;
|
||||||
|
scopeCurator = 0;
|
||||||
|
displayname = "Video Streaming Handler";
|
||||||
|
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
||||||
|
category = QEGVAR(main,moduleCategory);
|
||||||
|
function = QFUNC(videoParser);
|
||||||
|
functionPriority = 1;
|
||||||
|
isGlobal = 0;
|
||||||
|
isTriggerActivated = 1;
|
||||||
|
isDisposable = 1;
|
||||||
|
is3den = 0;
|
||||||
|
curatorCanAttach = 0;
|
||||||
|
curatorInfoType = "RscDisplayAttributeModuleNuke";
|
||||||
|
canSetArea = 0;
|
||||||
|
canSetAreaShape = 0;
|
||||||
|
canSetAreaHeight = 0;
|
||||||
|
/*
|
||||||
|
class Attributes: AttributesBase {
|
||||||
|
class GVAR(instanceAddress): Edit {
|
||||||
|
property = QGVAR(instanceAddress);
|
||||||
|
displayname = "MediaMTX Provider Address";
|
||||||
|
tooltip = "MediaMTX Provider Instance Address";
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "localhost";
|
||||||
|
};
|
||||||
|
class GVAR(instancePort): Edit {
|
||||||
|
property = QGVAR(instancePort);
|
||||||
|
displayname = QUOTE(MediaMTX Provider Port);
|
||||||
|
tooltip = QUOTE(MediaMTX Provider Port for handling video streams);
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "8554";
|
||||||
|
};
|
||||||
|
class GVAR(instanceAuthUser): Edit {
|
||||||
|
property = QGVAR(instanceAuthUser);
|
||||||
|
displayname = QUOTE(MediaMTX Provider Username);
|
||||||
|
tooltip = QUOTE(MediaMTX Provider Instance Username);
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "administrator";
|
||||||
|
};
|
||||||
|
class GVAR(instanceAuthPassword): Edit {
|
||||||
|
property = QGVAR(instanceAuthPassword);
|
||||||
|
displayname = QUOTE(MediaMTX Provider Password);
|
||||||
|
tooltip = QUOTE(MediaMTX Provider Instance Password);
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "password";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
};
|
||||||
1
addons/video/XEH_PREP.hpp
Normal file
1
addons/video/XEH_PREP.hpp
Normal file
@@ -0,0 +1 @@
|
|||||||
|
PREP(videoParser);
|
||||||
9
addons/video/XEH_preInit.sqf
Normal file
9
addons/video/XEH_preInit.sqf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP_RECOMPILE_START;
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
|
PREP_RECOMPILE_END;
|
||||||
|
|
||||||
|
ADDON = true;
|
||||||
3
addons/video/XEH_preStart.sqf
Normal file
3
addons/video/XEH_preStart.sqf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
23
addons/video/config.cpp
Normal file
23
addons/video/config.cpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class ADDON {
|
||||||
|
name = COMPONENT_NAME;
|
||||||
|
units[] = {
|
||||||
|
QGVAR(videoModule)
|
||||||
|
};
|
||||||
|
weapons[] = {};
|
||||||
|
requiredAddons[] = {
|
||||||
|
"cba_main",
|
||||||
|
"ace_main",
|
||||||
|
"armatak_main",
|
||||||
|
"armatak_server"
|
||||||
|
};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
url = "https://github.com/valmojr/armatak";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
|
//#include "CfgVehicles.hpp"
|
||||||
84
addons/video/functions/fnc_videoParser.sqf
Normal file
84
addons/video/functions/fnc_videoParser.sqf
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params [
|
||||||
|
["_logic", objNull, [objNull]],
|
||||||
|
["_units", [], [[]]],
|
||||||
|
["_activated", true, [true]]
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isServer) exitWith {
|
||||||
|
private _instance_address = GETVAR(_logic,GVAR(instanceAddress),false);
|
||||||
|
private _instance_port = GETVAR(_logic,GVAR(instancePort),false);
|
||||||
|
private _instance_auth_user = GETVAR(_logic,GVAR(instanceAuthUser),false);
|
||||||
|
private _instance_auth_pass = GETVAR(_logic,GVAR(instanceAuthPassword),false);
|
||||||
|
|
||||||
|
SETMVAR(GVAR(instanceAddress),_instance_address);
|
||||||
|
SETMVAR(GVAR(instancePort),_instance_port);
|
||||||
|
SETMVAR(GVAR(instanceAuthUser),_instance_auth_user);
|
||||||
|
SETMVAR(GVAR(instanceAuthPassword),_instance_auth_pass);
|
||||||
|
|
||||||
|
_startAction = [
|
||||||
|
QGVAR(startStream),
|
||||||
|
"Start Video Feed",
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
_uuid = (_this select 0) call armatak_fnc_extract_uuid;
|
||||||
|
_uuid_short = _uuid select [0, 8];
|
||||||
|
_role = roleDescription (_this select 0);
|
||||||
|
_name = name (_this select 0);
|
||||||
|
|
||||||
|
_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);
|
||||||
|
armatak_mediamtx_video_stream_instance_port = missionNamespace getVariable "instance_port";
|
||||||
|
armatak_mediamtx_video_stream_instance_auth_user = missionNamespace getVariable "instance_auth_user";
|
||||||
|
armatak_mediamtx_video_stream_instance_auth_pass = missionNamespace getVariable "instance_auth_pass";
|
||||||
|
|
||||||
|
"armatak" callExtension ["video_stream:start", [armatak_mediamtx_video_stream_instance_address, armatak_mediamtx_video_stream_instance_port, _stream_path, armatak_mediamtx_video_stream_instance_auth_user, armatak_mediamtx_video_stream_instance_auth_pass]];
|
||||||
|
(_this select 0) setVariable ["armatak_video_feed_is_streaming", true];
|
||||||
|
},
|
||||||
|
{
|
||||||
|
(_this select 0) getVariable "armatak_video_feed_is_streaming" == false
|
||||||
|
}
|
||||||
|
] call ace_interact_menu_fnc_createAction;
|
||||||
|
[
|
||||||
|
"Man",
|
||||||
|
1,
|
||||||
|
["ACE_SelfActions"],
|
||||||
|
_startAction,
|
||||||
|
true
|
||||||
|
] call ace_interact_menu_fnc_addActionToClass;
|
||||||
|
|
||||||
|
_stopAction = [
|
||||||
|
"ArmatakStopStream",
|
||||||
|
"Stop Video Feed",
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"armatak" callExtension ["video_stream:stop", []];
|
||||||
|
SETVAR(_this select 0,GVAR(isStreaming),false);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GETVAR((this select 0),GVAR(isStreaming),false)
|
||||||
|
}
|
||||||
|
] call ace_interact_menu_fnc_createAction;
|
||||||
|
|
||||||
|
[
|
||||||
|
"Man",
|
||||||
|
1,
|
||||||
|
["ACE_SelfActions"],
|
||||||
|
_stopAction,
|
||||||
|
true
|
||||||
|
] call ace_interact_menu_fnc_addActionToClass;
|
||||||
|
if (isMultiplayer) then {
|
||||||
|
{
|
||||||
|
SETVAR(_x,GVAR(isStreaming),false);
|
||||||
|
} forEach playableUnits;
|
||||||
|
} else {
|
||||||
|
SETVAR(player,GVAR(isStreaming),false);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
true;
|
||||||
17
addons/video/script_component.hpp
Normal file
17
addons/video/script_component.hpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#define COMPONENT video
|
||||||
|
#define COMPONENT_BEAUTIFIED Video Streaming
|
||||||
|
#include "\armatak\armatak\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
|
// #define DEBUG_MODE_FULL
|
||||||
|
// #define DISABLE_COMPILE_CACHE
|
||||||
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED_MAIN
|
||||||
|
#define DEBUG_MODE_FULL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SETTINGS_MAIN
|
||||||
|
#define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
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];
|
||||||
|
};
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user