diff --git a/addons/logistics_uavbattery/$PBOPREFIX$ b/addons/logistics_uavbattery/$PBOPREFIX$ new file mode 100644 index 0000000000..f1db4e78f0 --- /dev/null +++ b/addons/logistics_uavbattery/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\logistics_uavbattery \ No newline at end of file diff --git a/addons/logistics_uavbattery/CfgEventHandlers.hpp b/addons/logistics_uavbattery/CfgEventHandlers.hpp new file mode 100644 index 0000000000..b928bc2de6 --- /dev/null +++ b/addons/logistics_uavbattery/CfgEventHandlers.hpp @@ -0,0 +1,5 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; diff --git a/addons/logistics_uavbattery/CfgVehicles.hpp b/addons/logistics_uavbattery/CfgVehicles.hpp new file mode 100644 index 0000000000..933079071a --- /dev/null +++ b/addons/logistics_uavbattery/CfgVehicles.hpp @@ -0,0 +1,27 @@ +class CfgVehicles { + class Helicopter_Base_F; + class UAV_01_base_F: Helicopter_Base_F { + class ACE_Actions { + class GVAR(RefuelUAV) { + displayName = "$STR_ACE_logistics_uavbattery_Recharge"; + distance = 4; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRefuelUAV)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(refuelUAV)); + showDisabled = 0; \ + priority = 1.245; \ + icon = QUOTE(PATHTOF(ui\UAV_battery.paa)); + }; + }; + }; + + // Misc box content + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + class _xx_ACE_UAVBattery { + count = 6; + name = "ACE_UAVBattery"; + }; + }; + }; +}; diff --git a/addons/logistics_uavbattery/CfgWeapons.hpp b/addons/logistics_uavbattery/CfgWeapons.hpp new file mode 100644 index 0000000000..e84e053347 --- /dev/null +++ b/addons/logistics_uavbattery/CfgWeapons.hpp @@ -0,0 +1,15 @@ +class CfgWeapons { + class InventoryItem_Base_F; + class ACE_ItemCore; + + class ACE_UAVBattery: ACE_ItemCore { + scope = 2; + displayName = "$STR_ACE_logistics_uavbattery_Battery_Name"; + descriptionShort = "$STR_ACE_logistics_uavbattery_Battery_Description"; + model = QUOTE(PATHTOF(models\ace_battery.p3d)); + picture = QUOTE(PATHTOF(ui\UAV_battery.paa)); + class ItemInfo: InventoryItem_Base_F { + mass = 20; + }; + }; +}; diff --git a/addons/logistics_uavbattery/README.md b/addons/logistics_uavbattery/README.md new file mode 100644 index 0000000000..472b67365d --- /dev/null +++ b/addons/logistics_uavbattery/README.md @@ -0,0 +1,11 @@ +ace_logistics_uavbattery +=========== + +Adds an item `ACE_wirecutter` that allows cutting of fences in A3 and AiA maps. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/logistics_uavbattery/XEH_preInit.sqf b/addons/logistics_uavbattery/XEH_preInit.sqf new file mode 100644 index 0000000000..f41b2c4ce8 --- /dev/null +++ b/addons/logistics_uavbattery/XEH_preInit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(canRefuelUAV); +PREP(refuelUAV); + +ADDON = true; diff --git a/addons/logistics_uavbattery/config.cpp b/addons/logistics_uavbattery/config.cpp new file mode 100644 index 0000000000..2438bc59fa --- /dev/null +++ b/addons/logistics_uavbattery/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_UAVBattery"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"marc_book"}; + authorUrl = ""; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf new file mode 100644 index 0000000000..4256ddabf9 --- /dev/null +++ b/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf @@ -0,0 +1,19 @@ +/* fnc_refuel.sqf +* +* Author: marc_book (modified by PabstMirror) +* +* Tests if unit can refuel the target UAV +* +* Argument: +* 0: OBJECT - Player unit +* 1: OBJECT - UAV to test +* +* Return value: +* BOOL +*/ + +#include "script_component.hpp" + +PARAMS_2(_caller,_target); + +("ACE_UAVBattery" in (items _caller)) && {(fuel _target) < 1} && {(speed _target) < 1} && {!(isEngineOn _target)} && {(_target distance _caller) <= 4} diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf new file mode 100644 index 0000000000..7783846beb --- /dev/null +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -0,0 +1,34 @@ +/* fnc_refuel.sqf +* +* Author: marc_book (modified by PabstMirror) +* +* Starts refueling/recharging the 'Dartar' UAVs +* +* Argument: +* 0: OBJECT - Player unit +* 1: OBJECT - UAV +* +* Return value: +* NOTHING +*/ + +#include "script_component.hpp" + +PARAMS_2(_caller,_target); + +if (!(_this call FUNC(canRefuelUAV))) exitWith {}; + +_onFinish = { + EXPLODE_2_PVT((_this select 0),_caller,_target); + _target setFuel 1; + _caller removeItem "ACE_UAVBattery"; +}; + +_onFailure = { + EXPLODE_2_PVT((_this select 0),_caller,_target); + [_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); +}; + +[_caller, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); + +[10, [_caller, _target], _onFinish, _onFailure, (localize "STR_ACE_logistics_uavbattery_Battery_Recharge"), {(_this select 0) call FUNC(canRefuelUAV)}] call EFUNC(common,progressBar); diff --git a/addons/logistics_uavbattery/functions/script_component.hpp b/addons/logistics_uavbattery/functions/script_component.hpp new file mode 100644 index 0000000000..56cb8114f5 --- /dev/null +++ b/addons/logistics_uavbattery/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\logistics_uavbattery\script_component.hpp" \ No newline at end of file diff --git a/addons/logistics_uavbattery/models/ace_battery.p3d b/addons/logistics_uavbattery/models/ace_battery.p3d new file mode 100644 index 0000000000..bf756d62cb Binary files /dev/null and b/addons/logistics_uavbattery/models/ace_battery.p3d differ diff --git a/addons/logistics_uavbattery/models/battery.rvmat b/addons/logistics_uavbattery/models/battery.rvmat new file mode 100644 index 0000000000..36329ac896 --- /dev/null +++ b/addons/logistics_uavbattery/models/battery.rvmat @@ -0,0 +1,79 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.01,0.01,0.01,1}; //amount of glossiness - the higher the number, the higher the glossiness +specularPower=500; //area of glossiness - the higher the number, the smaller the area +PixelShaderID="Super"; +VertexShaderID="Super"; + +class Stage1 { + texture="z\ace\addons\logistics_uavbattery\models\battery_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,mc)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="z\ace\addons\logistics_uavbattery\models\default_as.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,1}; + }; +}; +class Stage5 { + texture="z\ace\addons\logistics_uavbattery\models\battery_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(4.7,1.2)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_ca.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/logistics_uavbattery/models/battery_co.paa b/addons/logistics_uavbattery/models/battery_co.paa new file mode 100644 index 0000000000..14abfa75b0 Binary files /dev/null and b/addons/logistics_uavbattery/models/battery_co.paa differ diff --git a/addons/logistics_uavbattery/models/battery_nohq.paa b/addons/logistics_uavbattery/models/battery_nohq.paa new file mode 100644 index 0000000000..11b7e6e14d Binary files /dev/null and b/addons/logistics_uavbattery/models/battery_nohq.paa differ diff --git a/addons/logistics_uavbattery/models/battery_smdi.paa b/addons/logistics_uavbattery/models/battery_smdi.paa new file mode 100644 index 0000000000..85ea45371f Binary files /dev/null and b/addons/logistics_uavbattery/models/battery_smdi.paa differ diff --git a/addons/logistics_uavbattery/models/default_as.paa b/addons/logistics_uavbattery/models/default_as.paa new file mode 100644 index 0000000000..b7efce459b Binary files /dev/null and b/addons/logistics_uavbattery/models/default_as.paa differ diff --git a/addons/logistics_uavbattery/script_component.hpp b/addons/logistics_uavbattery/script_component.hpp new file mode 100644 index 0000000000..01ea3608e7 --- /dev/null +++ b/addons/logistics_uavbattery/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT logistics_uavbattery +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_LOGISTICS_UAVBATTERY + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_LOGISTICS_UAVBATTERY + #define DEBUG_SETTINGS DEBUG_SETTINGS_LOGISTICS_UAVBATTERY +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/logistics_uavbattery/stringtable.xml b/addons/logistics_uavbattery/stringtable.xml new file mode 100644 index 0000000000..fbd9004290 --- /dev/null +++ b/addons/logistics_uavbattery/stringtable.xml @@ -0,0 +1,78 @@ + + + + + + Drone is full + Drohne ist voll + El VANT está lleno + L'UAV est chargé + Dron jest naładowany + A drón fel van töltve + Dron je nabitý + O VANT está cheio + Il drone è pieno + БПЛА заполнен + + + You need a UAV Battery + Du brauchst eine UAV-Batterie + Necesitas una batería para VANT + Pas de batterie UAV + Potrzebujesz baterii UAV + Szükséged van egy UAV akkumulátorra + Potřebuješ UAV-Baterii + Você precisa de uma Bateria para VANT + Hai bisogno di una Batteria UAV + Требуется аккумулятор БПЛА + + + Recharge + Aufladen + Recargar + Recharger + Naładuj + Feltöltés + Dobít + Recarregar + Ricarica + Подзарядить + + + UAV Battery + UAV-Batterie + Batería para VANT + Batterie UAV + Bateria UAV + UAV akkumulátor + UAV-Baterie + Bateria para VANT + Batteria UAV + Аккумулятор БПЛА + + + Used to refuel Carried UAV's + Verwendet zum Aufladen von tragbaren UAV's + Usada para reabastecer el VANT + Utilisée pour recharger l'UAV + Używana do naładowania UAV + Hordozható UAV-ok működéséhez való akkumulátor + Používané k dobíjení UAV + Usada para reabastecer VANT + Usata per ricaricare la Batteria dell'UAV + Используется для подзарядки БПЛА + + + Recharging ... + Aufladen ... + Recargando ... + Rechargement ... + Ładowanie ... + Akku feltöltése ... + Dobíjení ... + Recarregando ... + In ricarica ... + Подзаряжаем ... + + + \ No newline at end of file diff --git a/addons/logistics_uavbattery/ui/UAV_battery.paa b/addons/logistics_uavbattery/ui/UAV_battery.paa new file mode 100644 index 0000000000..5e6c0e1bf7 Binary files /dev/null and b/addons/logistics_uavbattery/ui/UAV_battery.paa differ