Merge remote-tracking branch 'origin' into pl-translation-4

This commit is contained in:
gienkov 2015-07-27 00:47:54 +02:00
commit 5bb1dded4b
219 changed files with 4127 additions and 5047 deletions

View File

@ -37,6 +37,7 @@ Aleksey EpMAK Yermakov <epmak777@gmail.com>
Alganthe <alganthe@live.fr>
Anthariel <Contact@storm-simulation.com>
Asgar Serran <piechottaf@web.de>
Bamse <bamsis@gmail.com>
Bla1337
BlackPixxel <blackpixxel96@gmail.com>
BlackQwar
@ -51,6 +52,7 @@ Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
Dimaslg <dimaslg@telecable.es>
eRazeri
evromalarkey <evromalarkey@gmail.com>
F3 Project <alanr@ferstaberinde.com>
Falke75
Ferenczi
Ferenzi
@ -66,8 +68,10 @@ Hamburger SV
Harakhti <shadowdragonphd@gmail.com>
havena <silveredenis@gmail.com>
Hawkins
Head
jokoho482 <jokoho482@gmail.com>`
Jonpas <jonpas33@gmail.com>
Karneck <dschultz26@hotmail.com>
Kavinsky <nmunozfernandez@gmail.com>
Kllrt <kllrtik@gmail.com>
legman <juicemelon@msn.com>
@ -102,3 +106,4 @@ Valentin Torikian <valentin.torikian@gmail.com>
VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
Winter <simon@agius-muscat.net>
zGuba
Drill <drill87@gmail.com>

View File

@ -114,7 +114,7 @@ if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) th
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _AmmoCacheEntry select 0, _AmmoCacheEntry select 6, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 5, _stabilityFactor, _WeaponCacheEntry select 1, _muzzleVelocity, _AmmoCacheEntry select 4, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(ACE_time), ACE_time - floor(ACE_time)];
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _AmmoCacheEntry select 0, _AmmoCacheEntry select 6, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 5, _stabilityFactor, _WeaponCacheEntry select 1, _muzzleVelocity, _AmmoCacheEntry select 4, getPosASL _bullet, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, floor(ACE_time), ACE_time - floor(ACE_time)];
[{
private ["_args", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"];

View File

@ -20,7 +20,7 @@ class CfgWeapons {
reloadTime = 0.01;
magazineReloadTime = 0.1;
};
// Manual Switching Of Flare Mode
class SmokeLauncher;
class CMFlareLauncher: SmokeLauncher {
@ -106,12 +106,14 @@ class CfgWeapons {
class M134_minigun: MGunCore {
class LowROF: Mode_FullAuto {
reloadTime = 0.015; //0.03; same as above @todo
dispersion = 0.006; //0.0023;
reloadTime = 0.03; //0.03; same as above @todo
dispersion = 0.0064; //0.0023;
multiplier = 1;
};
class HighROF: LowROF {
reloadTime = 0.015; //0.03;
dispersion = 0.006; //0.0023;
reloadTime = 0.02; //0.03;
dispersion = 0.0064; //0.0023;
multiplier = 1;
};
class close: HighROF {};
class short: close {};

View File

@ -24,10 +24,7 @@ class CfgVehicles {
displayName = "ATragMX";
vehicleClass = "Items";
class TransportItems {
class ACE_ATragMX {
name = "ACE_ATragMX";
count = 1;
};
MACRO_ADDITEM(ACE_ATragMX,1);
};
};

View File

@ -0,0 +1,30 @@
class RscTitles {
class GVAR(virtualAmmo) {
idd = -1;
movingEnable = 1;
duration = 9999999;
fadein = 0;
fadeout = 0;
onLoad = "uiNamespace setVariable ['ACE_attach_virtualAmmoDisplay', (_this select 0)];";
class controls {};
class objects {
class TheObject {
idc = 800851;
type = 82;
model = "\a3\weapons_f\Ammo\Handgrenade.p3d";
scale = 1;
direction[] = {0, 0, 1};
up[] = {0, 1, 0};
x = 0.5;
y = 0.5;
z = 1;
xBack = 0.5;
yBack = 0.5;
zBack = 0.5;
inBack = 0;
enableZoom = 0;
zoomDuration = 1;
};
};
};
};

View File

@ -16,3 +16,4 @@ class CfgPatches {
#include "CfgMagazines.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "GUI_VirtualAmmo.hpp"

View File

@ -17,7 +17,7 @@
*/
#include "script_component.hpp"
private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID"];
private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"];
PARAMS_3(_attachToVehicle,_unit,_args);
_itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam;
@ -47,26 +47,43 @@ if (_unit == _attachToVehicle) then { //Self Attachment
_attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true];
_attachToVehicle setVariable [QGVAR(ItemNames), [_itemClassname], true];
} else {
GVAR(placeAction) = -1;
_tempObject = _itemVehClass createVehicleLocal [0,0,-10000];
_tempObject enableSimulationGlobal false;
GVAR(placeAction) = PLACE_WAITING;
[_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus);
//MenuBack isn't working for now (localize "STR_ACE_Attach_CancelAction")
[{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call EFUNC(common,execNextFrame);
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = 1;}] call EFUNC(common,AddActionEventHandler)];
// _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)];
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)];
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize LSTRING(CancelAction)], {GVAR(placeAction) = 0}];
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}];
//Display to show virtual object:
private [];
_model = getText (configFile >> "CfgAmmo" >> _itemVehClass >> "model");
if (_model == "") then {
_model = getText (configFile >> "CfgVehicles" >> _itemVehClass >> "model");
};
//"\A3\Weapons_F\empty.p3d" is fine, but ctrlSetModel ""; - will crash game!
if (_model == "") exitWith {ERROR("No Model");};
(QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutRsc [QGVAR(virtualAmmo), "PLAIN", 0, false];
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _model;
[{
private "_startingPosition";
PARAMS_2(_args,_pfID);
EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText,_actionID);
private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"];
if ((GVAR(placeAction) != -1) ||
PARAMS_2(_args,_pfID);
EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID);
_virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]);
if (cameraView == "EXTERNAL") then {
_virtualPosASL = _virtualPosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0]));
};
_virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition);
_lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player];
//Don't allow placing in a bad position:
if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;};
if ((GVAR(placeAction) != PLACE_WAITING) ||
{_unit != ACE_player} ||
{!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} ||
{!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then {
@ -75,16 +92,31 @@ if (_unit == _attachToVehicle) then { //Self Attachment
[_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
[] call EFUNC(interaction,hideMouseHint);
[_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler);
//[_unit, "MenuBack", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler);
_unit removeAction _actionID;
if (GVAR(placeAction) == 1) then {
_startingPosition = _tempObject modelToWorldVisual [0,0,0];
[_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove);
(QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
if (GVAR(placeAction) == PLACE_APPROVE) then {
[_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _virtualPos] call FUNC(placeApprove);
};
deleteVehicle _tempObject;
} else {
_tempObject setPosATL ((ASLtoATL eyePos _unit) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));;
//Show the virtual object:
if (_lineInterection) then {
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false;
} else {
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow true;
_screenPos = worldToScreen _virtualPos;
if (_screenPos isEqualTo []) exitWith {
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false;
};
_realDistance = (_virtualPos distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1);
_screenPos = [(_screenPos select 0), _realDistance, (_screenPos select 1)];
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetPosition _screenPos;
_dir = (positionCameraToWorld [0,0,1]) vectorFromTo (positionCameraToWorld [0,0,0]);
_angle = asin (_dir select 2);
_up = [0, cos _angle, sin _angle];
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [[1,0,0], _up];
};
};
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _tempObject, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler;
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler;
};

View File

@ -25,7 +25,7 @@
*/
#include "script_component.hpp"
private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_setupObject", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];
private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];
PARAMS_6(_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition);
@ -37,9 +37,6 @@ _closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]);
_closeInMax = _startDistanceFromCenter;
_closeInMin = 0;
//Delete Local Placement Object
deleteVehicle _setupObject;
while {(_closeInMax - _closeInMin) > 0.01} do {
_closeInDistance = (_closeInMax + _closeInMin) / 2;
// systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter];

View File

@ -9,4 +9,8 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#include "\z\ace\addons\main\script_macros.hpp"
#define PLACE_WAITING -1
#define PLACE_CANCEL 0
#define PLACE_APPROVE 1

View File

@ -178,6 +178,7 @@
<Polish>Ustawienia więźniów</Polish>
<Spanish>Ajustes de prisioneros</Spanish>
<Czech>Nastavení zajatce</Czech>
<German>Gefangenen-Einstellungen</German>
<Portuguese>Ajustes de prisioneiros</Portuguese>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_Description">
@ -185,6 +186,7 @@
<Polish>Moduł ten kontroluje ustawienia kapitulacji oraz opasek zaciskowych</Polish>
<Spanish>Ajustes de control para rendición y precintos</Spanish>
<Czech>Toto kontroluje nastavení kapitulace a pout</Czech>
<German>Einstellungen zur Kapitulation und Kabelbindern</German>
<Portuguese>Controla as configurações de rendição e abraçadeiras</Portuguese>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_handcuffSide_name">
@ -192,6 +194,7 @@
<Polish>Skuwanie sojuszników</Polish>
<Spanish>Se puede esposar el bando propio</Spanish>
<Czech>Může spoutat spolubojovníky</Czech>
<German>Kann Teamkollegen fesseln</German>
<Portuguese>Pode algemar o próprio lado</Portuguese>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_handcuffSide_description">
@ -199,6 +202,7 @@
<Polish>Czy gracze mogą skuwać sojuszników?</Polish>
<Spanish>Pueden los jugadores esposar unidades en su propio bando</Spanish>
<Czech>Mohou hráči spoutat jednotky na své straně</Czech>
<German>Können Spieler eigene Einheiten fesseln</German>
<Portuguese>Os jogadores podem algemar unidades do seu lado</Portuguese>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_allowSurrender_name">
@ -206,6 +210,7 @@
<Polish>Pozwól kapitulować</Polish>
<Spanish>Permitir rendición</Spanish>
<Czech>Povolit vzdávání</Czech>
<German>Kapitulation erlauben</German>
<Portuguese>Permite rendição</Portuguese>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_allowSurrender_description">
@ -213,7 +218,8 @@
<Polish>Gracze mogą skapitulować po schowaniu swojej broni do kabury</Polish>
<Spanish>Los jugadores pueden rendirse después de enfundar su arma</Spanish>
<Czech>Hráč se může vzdát poté, co si skryje zbraň</Czech>
<German>Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben</German>
<Portuguese>Jogadores podem se render depois de guardar sua arma</Portuguese>
</Key>
</Package>
</Project>
</Project>

View File

@ -113,10 +113,7 @@ class CfgVehicles {
author = CSTRING(ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_banana {
name = "ACE_banana";
count = 1;
};
MACRO_ADDITEM(ACE_banana,1);
};
};
};

View File

@ -37,6 +37,14 @@
};
}] call FUNC(addEventhandler);
//~~~~~Get Map Data~~~~~
//Find MGRS zone and 100km grid for current map
[] call FUNC(getMGRSdata);
//Prepare variables for FUNC(getMapGridFromPos)/FUNC(getMapPosFromGrid)
[] call FUNC(getMapGridData);
["fixCollision", DFUNC(fixCollision)] call FUNC(addEventhandler);
["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler);
["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler);

View File

@ -69,7 +69,11 @@ PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getInPosition);
PREP(getMapGridData);
PREP(getMapGridFromPos);
PREP(getMapPosFromGrid);
PREP(getMarkerType);
PREP(getMGRSdata);
PREP(getName);
PREP(getNumberFromMissionSQM);
PREP(getNumberMagazinesIn);

View File

@ -0,0 +1,165 @@
/*
* Author: VKing
* Gets the current map's MGRS grid zone designator and 100km square.
* Also gets longitude, latitude and altitude offset for the map
*
* Argument:
* 0: Optional: Map name, if undefined the current map is used (String)
*
* Return value:
* 0: Grid zone designator (String)
* 1: 100km square (String)
* 2: GZD + 100km sq. as a single string (String)
* Writes return values to GVAR(MGRS_data) if run on the current map
*/
// #define DEBUG_MODE_FULL
#include "script_component.hpp"
private ["_zone","_band","_GZD","_long","_lat","_UTM","_easting","_northing", "_altitude"];
DEFAULT_PARAM(0,_map,worldName);
_long = getNumber (ConfigFile >> "CfgWorlds" >> _map >> "longitude");
_lat = getNumber (ConfigFile >> "CfgWorlds" >> _map >> "latitude");
_altitude = getNumber (ConfigFile >> "CfgWorlds" >> _map >> "elevationOffset");
if (_map in ["Chernarus", "Bootcamp_ACR", "Woodland_ACR", "utes"]) then { _lat = 50; _altitude = 0; };
if (_map in ["Altis", "Stratis"]) then { _lat = 40; _altitude = 0; };
if (_map in ["Takistan", "Zargabad", "Mountains_ACR"]) then { _lat = 35; _altitude = 2000; };
if (_map in ["Shapur_BAF", "ProvingGrounds_PMC"]) then { _lat = 35; _altitude = 100; };
if (_map in ["fallujah"]) then { _lat = 33; _altitude = 0; };
if (_map in ["fata", "Abbottabad"]) then { _lat = 30; _altitude = 1000; };
if (_map in ["sfp_wamako"]) then { _lat = 14; _altitude = 0; };
if (_map in ["sfp_sturko"]) then { _lat = 56; _altitude = 0; };
if (_map in ["Bornholm"]) then { _lat = 55; _altitude = 0; };
if (_map in ["Imrali"]) then { _lat = 40; _altitude = 0; };
if (_map in ["Caribou"]) then { _lat = 68; _altitude = 0; };
if (_map in ["Namalsk"]) then { _lat = 65; _altitude = 0; };
if (_map in ["MCN_Aliabad"]) then { _lat = 36; _altitude = 0; };
if (_map in ["Clafghan"]) then { _lat = 34; _altitude = 640; };
if (_map in ["Sangin", "hellskitchen"]) then { _lat = 32; _altitude = 0; };
if (_map in ["Sara"]) then { _lat = 40; _altitude = 0; };
if (_map in ["reshmaan"]) then { _lat = 35; _altitude = 2000; };
if (_map in ["Thirsk"]) then { _lat = 65; _altitude = 0; };
if (_map in ["lingor"]) then { _lat = -4; _altitude = 0; };
if (_map in ["Panthera3"]) then { _lat = 46; _altitude = 0; };
if (_map in ["Kunduz"]) then { _lat = 37; _altitude = 400; };
_UTM = [_long,_lat] call BIS_fnc_posDegToUTM;
_easting = _UTM select 0;
_northing = _UTM select 1;
// _zone = _UTM select 2;
TRACE_4("",_UTM,_easting,_northing,_zone);
/*
_band = switch (true) do {
case (_lat<-72): {"C"};
case (_lat<-64): {"D"};
case (_lat<-56): {"E"};
case (_lat<-48): {"F"};
case (_lat<-40): {"G"};
case (_lat<-32): {"H"};
case (_lat<-24): {"J"};
case (_lat<-16): {"K"};
case (_lat<-8): {"L"};
case (_lat<0): {"M"};
case (_lat>72): {"X"};
case (_lat>64): {"W"};
case (_lat>56): {"V"};
case (_lat>48): {"U"};
case (_lat>40): {"T"};
case (_lat>32): {"S"};
case (_lat>24): {"R"};
case (_lat>16): {"Q"};
case (_lat>8): {"P"};
case (_lat>=0): {"N"};
};
*/
_zone = 1 + (floor ((_long + 180) / 6));
_band = "Z";
if (_lat <= -80) then {
_band = "A";
} else {
if (_lat < 84) then {
_band = "CDEFGHJKLMNPQRSTUVWXX" select [(floor ((_lat / 8) + 10)), 1];
};
};
if (_map == "VR") then {_zone = 0; _band = "RV";};
_GZD = format ["%1%2",_zone,_band];
TRACE_3("",_zone,_band,_GZD);
private ["_set1","_set2","_set3","_set4","_set5","_set6","_metaE","_metaN","_letterE","_letterN","_grid100km"];
_set1 = [1,7,13,19,25,31,37,43,49,55];
_set2 = [2,8,14,20,26,32,38,44,50,56];
_set3 = [3,9,15,21,27,33,39,45,51,57];
_set4 = [4,10,16,22,28,34,40,46,52,58];
_set5 = [5,11,17,23,29,35,41,47,53,59];
_set6 = [6,12,18,24,30,36,42,48,54,60];
switch (true) do {
case (_zone in _set1): {_metaE = 1; _metaN = 1;};
case (_zone in _set2): {_metaE = 2; _metaN = 2;};
case (_zone in _set3): {_metaE = 3; _metaN = 1;};
case (_zone in _set4): {_metaE = 1; _metaN = 2;};
case (_zone in _set5): {_metaE = 2; _metaN = 1;};
case (_zone in _set6): {_metaE = 3; _metaN = 2;};
};
TRACE_2("",_metaE,_metaN);
switch (true) do {
case (_zone == 0): {_letterE = "E"};
case (_easting > 800000): {LOG("E8"); switch (_metaE) do {case 1: {_letterE="H"}; case 2: {_letterE="R"}; case 3: {_letterE="Z"}; }; };
case (_easting > 700000): {LOG("E7"); switch (_metaE) do {case 1: {_letterE="G"}; case 2: {_letterE="Q"}; case 3: {_letterE="Y"}; }; };
case (_easting > 600000): {LOG("E6"); switch (_metaE) do {case 1: {_letterE="F"}; case 2: {_letterE="P"}; case 3: {_letterE="X"}; }; };
case (_easting > 500000): {LOG("E5"); switch (_metaE) do {case 1: {_letterE="E"}; case 2: {_letterE="N"}; case 3: {_letterE="W"}; }; };
case (_easting > 400000): {LOG("E4"); switch (_metaE) do {case 1: {_letterE="D"}; case 2: {_letterE="M"}; case 3: {_letterE="V"}; }; };
case (_easting > 300000): {LOG("E3"); switch (_metaE) do {case 1: {_letterE="C"}; case 2: {_letterE="L"}; case 3: {_letterE="U"}; }; };
case (_easting > 200000): {LOG("E2"); switch (_metaE) do {case 1: {_letterE="B"}; case 2: {_letterE="K"}; case 3: {_letterE="T"}; }; };
case (_easting > 100000): {LOG("E1"); switch (_metaE) do {case 1: {_letterE="A"}; case 2: {_letterE="J"}; case 3: {_letterE="S"}; }; };
default {_letterE="@"};
};
TRACE_1("",_letterE);
_northing = _northing mod 2000000;
TRACE_1("",_northing);
switch (true) do {
case (_zone == 0): {_letterN = "N"};
case (_northing > 1900000): {LOG("N19"); switch (_metaN) do {case 1: {_letterN = "V"}; case 2: {_letterN = "E"}; }; };
case (_northing > 1800000): {LOG("N18"); switch (_metaN) do {case 1: {_letterN = "U"}; case 2: {_letterN = "D"}; }; };
case (_northing > 1700000): {LOG("N17"); switch (_metaN) do {case 1: {_letterN = "T"}; case 2: {_letterN = "C"}; }; };
case (_northing > 1600000): {LOG("N16"); switch (_metaN) do {case 1: {_letterN = "S"}; case 2: {_letterN = "B"}; }; };
case (_northing > 1500000): {LOG("N15"); switch (_metaN) do {case 1: {_letterN = "R"}; case 2: {_letterN = "A"}; }; };
case (_northing > 1400000): {LOG("N14"); switch (_metaN) do {case 1: {_letterN = "Q"}; case 2: {_letterN = "V"}; }; };
case (_northing > 1300000): {LOG("N13"); switch (_metaN) do {case 1: {_letterN = "P"}; case 2: {_letterN = "U"}; }; };
case (_northing > 1200000): {LOG("N12"); switch (_metaN) do {case 1: {_letterN = "N"}; case 2: {_letterN = "T"}; }; };
case (_northing > 1100000): {LOG("N11"); switch (_metaN) do {case 1: {_letterN = "M"}; case 2: {_letterN = "S"}; }; };
case (_northing > 1000000): {LOG("N10"); switch (_metaN) do {case 1: {_letterN = "L"}; case 2: {_letterN = "R"}; }; };
case (_northing > 900000): {LOG("N09"); switch (_metaN) do {case 1: {_letterN = "K"}; case 2: {_letterN = "Q"}; }; };
case (_northing > 800000): {LOG("N08"); switch (_metaN) do {case 1: {_letterN = "J"}; case 2: {_letterN = "P"}; }; };
case (_northing > 700000): {LOG("N07"); switch (_metaN) do {case 1: {_letterN = "H"}; case 2: {_letterN = "N"}; }; };
case (_northing > 600000): {LOG("N06"); switch (_metaN) do {case 1: {_letterN = "G"}; case 2: {_letterN = "M"}; }; };
case (_northing > 500000): {LOG("N05"); switch (_metaN) do {case 1: {_letterN = "F"}; case 2: {_letterN = "L"}; }; };
case (_northing > 400000): {LOG("N04"); switch (_metaN) do {case 1: {_letterN = "E"}; case 2: {_letterN = "K"}; }; };
case (_northing > 300000): {LOG("N03"); switch (_metaN) do {case 1: {_letterN = "D"}; case 2: {_letterN = "J"}; }; };
case (_northing > 200000): {LOG("N02"); switch (_metaN) do {case 1: {_letterN = "C"}; case 2: {_letterN = "H"}; }; };
case (_northing > 100000): {LOG("N01"); switch (_metaN) do {case 1: {_letterN = "B"}; case 2: {_letterN = "G"}; }; };
case (_northing > 0): {LOG("N00"); switch (_metaN) do {case 1: {_letterN = "A"}; case 2: {_letterN = "F"}; }; };
};
TRACE_1("",_letterN);
_grid100km = _letterE+_letterN;
TRACE_1("",_grid100km);
if (_map == worldName) then {
GVAR(MGRS_data) = [_GZD,_grid100km,_GZD+_grid100km];
GVAR(mapAltitude) = _altitude;
GVAR(mapLatitude) = _lat;
GVAR(mapLongitude) = _long;
};
[_GZD,_grid100km,_GZD+_grid100km]

View File

@ -0,0 +1,76 @@
/*
* Author: PabstMirror (ideas from Nou's mapGridToPos and BIS_fnc_gridToPos)
* Finds real x/y offset and map step for a 10 digit grid
* Save time by preparing data one time at startup
*
* Argument:
* None
*
* Return values:
* None
*
* Example:
* [] call ace_map_fnc_getMapGridData
*
* Public: No
*/
#include "script_component.hpp"
private["_cfgGrid", "_formatX", "_formatY", "_heightOffset", "_offsetX", "_offsetY", "_originGrid", "_realOffsetY", "_startGrid", "_stepX", "_stepY", "_zoom", "_zoomMax", "_letterGrid"];
GVAR(mapGridData) = [];
//--- Extract grid values from world config (Borrowed from BIS_fnc_gridToPos)
_cfgGrid = configFile >> "CfgWorlds" >> worldName >> "Grid";
_offsetX = getNumber (_cfgGrid >> "offsetX");
_offsetY = getNumber (_cfgGrid >> "offsetY");
_zoomMax = 1e99;
_formatX = "";
_formatY = "";
_stepX = 1e10;
_stepY = 1e10;
{
_zoom = getnumber (_x >> "zoomMax");
if (_zoom < _zoomMax) then {
_zoomMax = _zoom;
_formatX = getText (_x >> "formatX");
_formatY = getText (_x >> "formatY");
_stepX = getNumber (_x >> "stepX");
_stepY = getNumber (_x >> "stepY");
};
} foreach configProperties [_cfgGrid, "isClass _x", false];
_letterGrid = false;
if (((toLower _formatX) find "a") != -1) then {_letterGrid = true};
if (((toLower _formatY) find "a") != -1) then {_letterGrid = true};
if (_letterGrid) exitWith {
diag_log text format ["[ACE] Map Grid Warning (%1) - Map uses letter grids [%2,%3]", worldName, _formatX, _formatY];
};
//Start at [0, 500] and move north until we get a change in grid
_heightOffset = 500;
_startGrid = mapGridPosition [0, _heightOffset];
_originGrid = _startGrid;
while {_startGrid == _originGrid} do {
_heightOffset = _heightOffset + 1;
_originGrid = mapGridPosition [0, _heightOffset];
};
//Calculate the real y offset
_realOffsetY = parseNumber (_originGrid select [(count _formatX), (count _formatY)]) * _stepY + _heightOffset - 1;
//Calculate MGRS 10digit step - they should both be 1 meter:
_stepXat5 = _stepX * 10 ^ ((count _formatX) - 5);
_stepYat5 = -1 * _stepY * 10 ^ ((count _formatY) - 5);
if (_stepYat5 < 0) then {
diag_log text format ["[ACE] Map Grid Warning (%1) - Northing is reversed", worldName];
};
if (_stepXat5 != 1) then {
diag_log text format ["[ACE] Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for x", worldName, _stepXat5];
};
if ((_stepYat5 != 1) && {_stepYat5 != -1}) then {
diag_log text format ["[ACE] Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for y", worldName, _stepXat5];
};
GVAR(mapGridData) = [_offsetX, _realOffsetY, _stepXat5, _stepYat5];

View File

@ -0,0 +1,63 @@
/*
* Author: VKing, PabstMirror
* Gets a 10-digit map grid for the given world position
*
* Argument:
* 0: Position (2D Position) <ARRAY>
* 1: Return type; false for array of easting and northing, true for single string <Bool>
*
* Return values:
* 0: Easting <String>
* 1: Northing <String>
*
* Example:
* [(getPos player)] call ace_common_fnc_getMapGridFromPos;
*
* Public: Yes
*/
// #define DEBUG_MODE_FULL
#include "script_component.hpp"
PARAMS_1(_pos);
DEFAULT_PARAM(1,_returnSingleString,false);
private["_count", "_easting", "_nativeGrid", "_northing"];
//Fallback, when map data is weird (letters)
if ((count GVAR(mapGridData)) == 0) exitWith {
_nativeGrid = mapGridPosition _pos;
if (_returnSingleString) then {
_nativeGrid
} else {
_count = floor ((count _nativeGrid) / 2);
[(_nativeGrid select [0, _count]), (_nativeGrid select [_count, _count])]
};
};
EXPLODE_4_PVT(GVAR(mapGridData),_offsetX,_realOffsetY,_stepXat5,_stepYat5);
_easting = floor (((_pos select 0) - _offsetX) / _stepXat5);
_northing = floor (((_pos select 1) - _realOffsetY) / _stepYat5);
//Attempt to handle negative east/north (e.g.: moving west of map bounds)
if (_easting > 0) then {
_easting = str _easting;
while {count _easting < 5} do {_easting = "0" + _easting;};
} else {
_easting = str abs _easting;
while {count _easting < 4} do {_easting = "0" + _easting;};
_easting = "-" + _easting;
};
if (_northing > 0) then {
_northing = str _northing;
while {count _northing < 5} do {_northing = "0" + _northing;};
} else {
_northing = str abs _northing;
while {count _northing < 4} do {_northing = "0" + _northing;};
_northing = "-" + _northing;
};
if (_returnSingleString) then {
_easting + _northing
} else {
[_easting, _northing]
};

View File

@ -0,0 +1,46 @@
/*
* Author: PabstMirror
* Gets position from grid cords
*
* Argument:
* 0: Grid Cords <STRING>
* 1: Get Center or bottom right <BOOL><OPTIONAL>
*
* Return values:
* Position <ARRAY>
*
* Example:
* ["6900080085"] call ace_common_fnc_getMapPosFromGrid
*
* Public: Yes
*/
#include "script_component.hpp"
PARAMS_1(_inputString);
DEFAULT_PARAM(1,_getCenterOfGrid,true);
private["_countInput", "_countInputHalf", "_xPart", "_xPos", "_yPart", "_yPos"];
if ((count GVAR(mapGridData)) == 0) exitWith {
ERROR("Map has bad data, falling back to BIS_fnc_gridToPos");
(_this call BIS_fnc_gridToPos) select 0
};
EXPLODE_4_PVT(GVAR(mapGridData),_offsetX,_realOffsetY,_stepXat5,_stepYat5);
_countInput = count _inputString;
_countInputHalf = floor (_countInput / 2);
//Split string, ignoring middle
_xPart = _inputString select [0, _countInputHalf];
_yPart = _inputString select [(ceil (_countInput / 2)), _countInputHalf];
_xPos = ((parseNumber _xPart) * _stepXat5 * 10 ^ (5 - _countInputHalf)) + _offsetX;
_yPos = ((parseNumber _yPart) * _stepYat5 * 10 ^ (5 - _countInputHalf)) + _realOffsetY;
if (_getCenterOfGrid) then {
_xPos = _xPos + 0.5 * _stepXat5 * 10 ^ (5 - _countInputHalf);
_yPos = _yPos + 0.5 * _stepYat5 * 10 ^ (5 - _countInputHalf);
};
[_xPos, _yPos, 0];

View File

@ -41,11 +41,11 @@ if ((typeName _value) != (_settingData select 1)) then {
_failed = true;
if ((_settingData select 1) == "BOOL" and (typeName _value) == "SCALAR") then {
// If value is not 0 or 1 consider it invalid and don't set anything
if (_value == 0) then {
if (_value isEqualTo 0) then {
_value = false;
_failed = false;
};
if (_value == 1) then {
if (_value isEqualTo 1) then {
_value = true;
_failed = false;
};

View File

@ -10,21 +10,39 @@
*
* Public: No
*/
//#define DEBUG_MODE_FULL
#define DEBUG_MODE_FULL
#include "script_component.hpp"
#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson))
private ["_loaded", "_emptyPos"];
private ["_loaded", "_emptyPos","_validVehiclestate"];
PARAMS_2(_unit,_vehicle);
_validVehiclestate = true;
if (driver _vehicle == _unit) exitwith {TRACE_1("Exiting on Failed Driver Check", driver _vehicle == _unit); false;};
TRACE_1("Vehicle Check", driver _vehicle == _unit);
if !(speed _vehicle <1 && (((getPos _vehicle) select 2) < 2)) exitwith {TRACE_1("Exiting on Failed speed check", getPosASL _vehicle == _unit); false;};
TRACE_1("getPosASL Vehicle Check", getPos _vehicle);
if (_vehicle isKindOf "Ship" ) then {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
TRACE_1("SHIP Ground Check", getPosATL _vehicle );
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]); // TODO: if spot is underwater pick another spot.
} else {
if (_vehicle isKindOf "Air" ) then {
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
_emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition);
_emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ];
} else {
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]);
};
};
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
if (!_validVehiclestate) exitwith { diag_log format["Unable to unload patient because invalid vehicle state. Either moving or Not close enough on the ground. %1", getPos _vehicle]; false };
diag_log str _emptyPos;
if (count _emptyPos == 0) exitwith {diag_log format["No safe empty spots to unload patient. %1", _emptyPos]; false}; //consider displaying text saying there are no safe places to exit the vehicle
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]);
if (count _emptyPos == 0) exitwith {false}; //consider displaying text saying there are no safe places to exit the vehicle
unassignVehicle _unit;
[_unit] orderGetIn false;

View File

@ -577,6 +577,7 @@
<Key ID="STR_ACE_Common_toggleHandheldDevice">
<English>Toggle Handheld Device</English>
<Spanish>Seleccionar dispositivo de mano</Spanish>
<German>Handheld aufrufen</German>
<Portuguese>Ativa dispositivo de mão</Portuguese>
<Polish>Przełącz urządzenie podręczne</Polish>
<Czech>Přepnout ruční zařízení</Czech>
@ -584,6 +585,7 @@
<Key ID="STR_ACE_Common_closeHandheldDevice">
<English>Close Handheld Device</English>
<Spanish>Cerrar dispositivo de mano</Spanish>
<German>Handheld schließen</German>
<Portuguese>Fecha dispositivo de mão</Portuguese>
<Polish>Zamknij urządzenie podręczne</Polish>
<Czech>Zavřít ruční zařízení</Czech>
@ -591,9 +593,10 @@
<Key ID="STR_ACE_Common_cycleHandheldDevices">
<English>Cycle Handheld Devices</English>
<Spanish>Cambiar dispositivos de mano</Spanish>
<German>Handheld wechseln</German>
<Portuguese>Troca dispositivos de mão</Portuguese>
<Polish>Następne urządzenie podręczne</Polish>
<Czech>Procházet ruční zařízení</Czech>
</Key>
</Package>
</Project>
</Project>

View File

@ -9,3 +9,5 @@ GVAR(deployPFH) = -1;
GVAR(placer) setVariable [QGVAR(wireDeployed), true];
};
}] call EFUNC(common,addEventHandler);
[QGVAR(vehicleDamage), {_this call FUNC(vehicleDamage)}] call EFUNC(common,addEventHandler);

View File

@ -7,5 +7,6 @@ PREP(dismount);
PREP(dismountSuccess);
PREP(handleDamage);
PREP(handleKilled);
PREP(vehicleDamage);
ADDON = true;

View File

@ -17,7 +17,9 @@
PARAMS_2(_wire,_killer);
if (isNull _killer) then {
private ["_distance", "_vehicle"];
if (isNull _killer) then {
_killer = _wire getVariable ["ace_concertina_wire_lastDamager", objNull];
if (isNull _killer) then {
_killer = nearestObject [_wire, "car"];
@ -25,111 +27,9 @@ if (isNull _killer) then {
};
if (isNull _killer || {_killer == _wire} || {_killer == gunner (vehicle _killer)}) exitWith {};
private ["_type", "_mode", "_distance", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w", "_vehicle"];
_type = typeOf _wire;
_mode = switch (_type) do {
case "ACE_ConcertinaWire": { 0 };
case "Land_Razorwire_F": { 1 };
default { -1 };
};
if (_mode == -1) exitWith {};
// _mode = 0 = Single Coil
// _mode = 1 = Triple Coil
// --------------------------------
// L M R
// 4.54929 (4)
// 6.13564 (6)
//9.78744 (10)
_distance = _wire distance _killer;
if (_distance > 14 || {_distance < 2}) exitWith {}; // Fix if shooting wire
_type = typeOf _wire;
_anim = _wire animationPhase "wire_2";
_pos_w = getPos _wire;
_dir_w = getDir _wire;
_vehicle = vehicle _killer;
if (_mode == 0) then {
private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"];
_x = _pos_w select 0;
_y = _pos_w select 1;
// Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle)
_wireCheckPosAr = [
[_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)],
[(_x-(sin _dir_w)) + (sin (_dir_w+90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w+90) * 1.5)],
[_x + (sin (_dir_w-90) * 1.5),_y + (cos (_dir_w-90) * 1.5)],
[(_x-(sin _dir_w)) + (sin (_dir_w-90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w-90) * 1.5)]
];
{
_found = false;
_no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log ".....";
_no = _no - [_wire]; //diag_log _no;
if (count _no > 0) exitWith {
_found = true; //diag_log "found";
};
} foreach _wireCheckPosAr;
// Double coil found!
if (_found) then {
_mode = 1;
} else {
// Randomly make a single coil also catch tanks, if speed is high
if (_vehicle isKindOf "Tank" && {20 > random 100} && {speed _vehicle > 30}) then {
_mode = 1;
} else {
if !(_vehicle isKindOf "Tank") then {
_mode = 1;
};
};
};
};
if (_mode == 1) then {
switch (true) do {
case (_vehicle isKindOf "Tank"): {
_parts = ["ltrack","rtrack"];
};
case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): {
_parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"];
};
};
} else {
switch (true) do {
case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): {
_parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"];
};
};
};
if (canMove _vehicle) then {
{
_selectionPart = "hit" + _x;
if (isText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name")) then {
_selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name");
// TODO: Only the tires that have touched the wire should burst.
_vehicle setHit [_selection, 1];
};
} forEach _parts;
};
if (_mode == 1) then {
if (_vehicle isKindOf "StaticWeapon") exitWith {};
[{
PARAMS_2(_vehicle,_wire);
_vehicle setVelocity ((velocity _vehicle) vectorMultiply 0.75);
private ["_vPos", "_vDir"];
// Set vehicle back in front of wire, since the wire will make the vehicle jump, and a wire with no geometry lod is undestructible and not recognizeable
_vPos = getPosASL _vehicle;
_vDir = getDir _vehicle;
_vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]);
// TODO: Needs to be placed in safe distance to wire, so we do not constantly re-spawn new wires
}, [_vehicle, _wire], 0.1, 0] call EFUNC(common,waitAndExecute);
};
//TODO: Create broken geoless wire (two version)
//TODO: Make wire remains stop vehicles
[QGVAR(vehicleDamage), [_vehicle], [_wire, _vehicle]] call EFUNC(common,targetEvent);

View File

@ -0,0 +1,123 @@
/*
* Author: Rocko
* Handles vehicle damage from hitting wire
*
* Arguments:
* 0: wire <OBJECT>
* 1: vehicle <OBJECT>
*
* Return Value:
* Nothing
*
* Return value:
* None
*/
#include "script_component.hpp"
PARAMS_2(_wire,_vehicle);
private ["_type", "_mode", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w"];
_type = typeOf _wire;
_mode = switch (_type) do {
case "ACE_ConcertinaWire": { 0 };
case "Land_Razorwire_F": { 1 };
default { -1 };
};
if (_mode == -1) exitWith {};
// _mode = 0 = Single Coil
// _mode = 1 = Triple Coil
// --------------------------------
// L M R
// 4.54929 (4)
// 6.13564 (6)
//9.78744 (10)
_type = typeOf _wire;
_anim = _wire animationPhase "wire_2";
_pos_w = getPos _wire;
_dir_w = getDir _wire;
if (_mode == 0) then {
private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"];
_x = _pos_w select 0;
_y = _pos_w select 1;
// Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle)
_wireCheckPosAr = [
[_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)],
[(_x-(sin _dir_w)) + (sin (_dir_w+90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w+90) * 1.5)],
[_x + (sin (_dir_w-90) * 1.5),_y + (cos (_dir_w-90) * 1.5)],
[(_x-(sin _dir_w)) + (sin (_dir_w-90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w-90) * 1.5)]
];
{
_found = false;
_no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log ".....";
_no = _no - [_wire]; //diag_log _no;
if (count _no > 0) exitWith {
_found = true; //diag_log "found";
};
} foreach _wireCheckPosAr;
// Double coil found!
if (_found) then {
_mode = 1;
} else {
// Randomly make a single coil also catch tanks, if speed is high
if (_vehicle isKindOf "Tank" && {20 > random 100} && {speed _vehicle > 30}) then {
_mode = 1;
} else {
if !(_vehicle isKindOf "Tank") then {
_mode = 1;
};
};
};
};
if (_mode == 1) then {
switch (true) do {
case (_vehicle isKindOf "Tank"): {
_parts = ["ltrack","rtrack"];
};
case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): {
_parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"];
};
};
} else {
switch (true) do {
case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): {
_parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"];
};
};
};
if (canMove _vehicle) then {
{
_selectionPart = "hit" + _x;
if (isText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name")) then {
_selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name");
// TODO: Only the tires that have touched the wire should burst.
_vehicle setHit [_selection, 1];
};
} forEach _parts;
};
if (_mode == 1) then {
if (_vehicle isKindOf "StaticWeapon") exitWith {};
[{
PARAMS_2(_vehicle,_wire);
_vehicle setVelocity ((velocity _vehicle) vectorMultiply 0.75);
private ["_vPos", "_vDir"];
// Set vehicle back in front of wire, since the wire will make the vehicle jump, and a wire with no geometry lod is undestructible and not recognizeable
_vPos = getPosASL _vehicle;
_vDir = getDir _vehicle;
_vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]);
// TODO: Needs to be placed in safe distance to wire, so we do not constantly re-spawn new wires
}, [_vehicle, _wire], 0.1] call EFUNC(common,waitAndExecute);
};
//TODO: Create broken geoless wire (two version)
//TODO: Make wire remains stop vehicles

View File

@ -1,6 +1,8 @@
#define COMPONENT concertina_wire
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#ifdef DEBUG_ENABLED_CONCERTINA_WIRE
#define DEBUG_MODE_FULL
#endif

View File

@ -33,10 +33,7 @@ class CfgVehicles {
displayName = "DAGR";
vehicleClass = "Items";
class TransportItems {
class ACE_DAGR {
name = "ACE_DAGR";
count = 1;
};
MACRO_ADDITEM(ACE_DAGR,1);
};
};

View File

@ -30,7 +30,7 @@ __background ctrlSetText QUOTE(PATHTOF(UI\dagr_gps.paa));
if (GVAR(outputPFH) != -1) exitWith {};
GVAR(outputPFH) = [{
private ["_pos", "_mapSize", "_gridConfig", "_offsetX", "_offsetY", "_stepX", "_stepY", "_xgrid", "_ygrid", "_xcoord", "_ycoord", "_speed", "_dagrHeading", "_dagrGrid", "_dagrElevation", "_dagrSpeed", "_dagrTime", "_elevation"];
private["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"];
// Abort Condition
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
@ -40,54 +40,8 @@ GVAR(outputPFH) = [{
};
// GRID
_pos = getPosASL ACE_player;
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
_gridConfig = (configFile >> "CfgWorlds" >> worldName >> "Grid");
_offsetX = getNumber (_gridConfig >> "offsetX");
_offsetY = getNumber (_gridConfig >> "offsetY");
_stepX = getNumber (_gridConfig >> "Zoom1" >> "stepX");
_stepY = getNumber (_gridConfig >> "Zoom1" >> "stepY");
if (_stepY >= 0) then {
_pos set [1, (_mapSize - 100) - (_pos select 1) - _offsetY];
};
// Incase grids go neg due to 99-00 boundry
if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];};
if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];};
_xGrid = toArray Str(round(_pos select 0));
while {count _xGrid < 5} do {
_xGrid = [48] + _xGrid;
};
_xGrid resize 4;
_xGrid = toString _xGrid;
_xGrid = parseNumber _xGrid;
_yGrid = toArray Str(round(_pos select 1));
while {count _yGrid < 5} do {
_yGrid = [48] + _yGrid;
};
_yGrid resize 4;
_yGrid = toString _yGrid;
_yGrid = parseNumber _yGrid;
_xCoord = switch true do {
case (_xGrid >= 1000): { "" + Str(_xGrid) };
case (_xGrid >= 100): { "0" + Str(_xGrid) };
case (_xGrid >= 10): { "00" + Str(_xGrid) };
default { "000" + Str(_xGrid) };
};
_yCoord = switch true do {
case (_yGrid >= 1000): { "" + Str(_yGrid) };
case (_yGrid >= 100): { "0" + Str(_yGrid) };
case (_yGrid >= 10): { "00" + Str(_yGrid) };
default { "000" + Str(_yGrid) };
};
_dagrGrid = _xcoord + " " + _ycoord;
_gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
_dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])];
// SPEED
_speed = speed (vehicle ACE_player);
@ -97,7 +51,7 @@ GVAR(outputPFH) = [{
// Elevation
_elevation = getPosASL ACE_player;
_elevation = floor ((_elevation select 2) + EGVAR(weather,altitude));
_elevation = floor ((_elevation select 2) + EGVAR(common,mapAltitude));
_dagrElevation = str _elevation + "m";
// Heading

View File

@ -72,7 +72,7 @@ _yCoord = switch true do {
_dagrGrid = _xCoord + " " + _yCoord;
// Find target elevation
_elevation = floor ((GVAR(LAZPOS) select 2) + EGVAR(weather,altitude));
_elevation = floor ((GVAR(LAZPOS) select 2) + EGVAR(common,mapAltitude));
_dagrElevation = str _elevation + "m";
// Time

View File

@ -30,7 +30,7 @@ __background ctrlSetText QUOTE(PATHTOF(UI\dagr_wp.paa));
if (GVAR(outputPFH) != -1) exitWith {};
GVAR(outputPFH) = [{
private ["_pos", "_mapSize", "_gridConfig", "_offsetX", "_offsetY", "_stepX", "_stepY", "_xGrid", "_yGrid", "_xCoord", "_yCoord", "_dagrHeading", "_dagrGrid", "_bearing", "_MYpos", "_WPpos", "_dagrDistance", "_distance"];
private["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"];
// Abort Condition
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
@ -40,54 +40,8 @@ GVAR(outputPFH) = [{
};
// GRID
_pos = getPosASL ACE_player;
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
_gridConfig = (configFile >> "CfgWorlds" >> worldName >> "Grid");
_offsetX = getNumber (_gridConfig >> "offsetX");
_offsetY = getNumber (_gridConfig >> "offsetY");
_stepX = getNumber (_gridConfig >> "Zoom1" >> "stepX");
_stepY = getNumber (_gridConfig >> "Zoom1" >> "stepY");
if (_stepY >= 0) then {
_pos set [1, (_mapSize - 100) - (_pos select 1) - _offsetY];
};
// Incase grids go neg due to 99-00 boundry
if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];};
if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];};
_xGrid = toArray Str(round(_pos select 0));
while {count _xGrid < 5} do {
_xGrid = [48] + _xGrid;
};
_xGrid resize 4;
_xGrid = toString _xGrid;
_xGrid = parseNumber _xGrid;
_yGrid = toArray Str(round(_pos select 1));
while {count _yGrid < 5} do {
_yGrid = [48] + _yGrid;
};
_yGrid resize 4;
_yGrid = toString _yGrid;
_yGrid = parseNumber _yGrid;
_xCoord = switch true do {
case (_xGrid >= 1000): { "" + Str(_xGrid) };
case (_xGrid >= 100): { "0" + Str(_xGrid) };
case (_xGrid >= 10): { "00" + Str(_xGrid) };
default { "000" + Str(_xGrid) };
};
_yCoord = switch true do {
case (_yGrid >= 1000): { "" + Str(_yGrid) };
case (_yGrid >= 100): { "0" + Str(_yGrid) };
case (_yGrid >= 10): { "00" + Str(_yGrid) };
default { "000" + Str(_yGrid) };
};
_dagrGrid = _xCoord + " " + _yCoord;
_gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
_dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])];
// WP Grid
_xGrid2 = floor (DAGR_WP_INFO / 10000);
@ -110,8 +64,8 @@ GVAR(outputPFH) = [{
_dagrGrid2 = _xCoord2 + " " + _yCoord2;
// Distance
_WPpos = [[_xCoord2, _yCoord2], true] call CBA_fnc_mapGridToPos;
_MYpos = [[_xCoord, _yCoord], true] call CBA_fnc_mapGridToPos;
_WPpos = [_dagrGrid2, true] call EFUNC(common,getMapPosFromGrid);
_MYpos = [_dagrGrid, true] call EFUNC(common,getMapPosFromGrid);
_distance = _MYpos distance _WPpos;
_distance = floor (_distance * 10) / 10;
_dagrDistance = str _distance + "m";

View File

@ -0,0 +1 @@
z\ace\addons\finger

View File

@ -0,0 +1,27 @@
class ACE_Settings {
class GVAR(enabled) {
value = 0;
typeName = "BOOL";
displayName = CSTRING(enabled_displayName);
};
class GVAR(maxRange) {
value = 4;
typeName = "SCALAR";
displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description);
};
class GVAR(indicatorForSelf) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(indicatorForSelf_name);
description = CSTRING(indicatorForSelf_description);
};
class GVAR(indicatorColor) {
value[] = {0.83, 0.68, 0.21, 0.75};
typeName = "COLOR";
isClientSettable = 1;
displayName = CSTRING(indicatorColor_name);
description = CSTRING(indicatorColor_description);
};
};

View File

@ -0,0 +1,10 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -0,0 +1,25 @@
class CfgVehicles {
class ACE_Module;
class GVAR(moduleSettings): ACE_Module {
scope = 2;
category = "ACE";
displayName = CSTRING(moduleSettings_displayName);
icon = QUOTE(PATHTOF(UI\Icon_Module_finger_ca.paa));
function = QFUNC(moduleSettings);
isGlobal = 0;
author = ECSTRING(common,ACETeam);
class Arguments {
class enabled {
displayName = CSTRING(enabled_DisplayName);
typeName = "BOOL";
defaultValue = 1;
};
class maxRange {
displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description);
typeName = "NUMBER";
defaultValue = 4;
};
};
};
};

12
addons/finger/README.md Normal file
View File

@ -0,0 +1,12 @@
ace_finger
===========
Allows players to point and show a virtual spot in the distance to nearby players.
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [Drill](https://github.com/TheDrill/)
- [PabstMirror](https://github.com/PabstMirror)

View File

@ -0,0 +1,23 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
GVAR(lastFPTime) = -1;
GVAR(fingersHash) = HASH_CREATE;
GVAR(pfeh_id) = -1;
["SettingsInitialized", {
//If not enabled, dont't bother adding keybind or eventhandler
if (!GVAR(enabled)) exitWith {};
[QGVAR(fingered), {_this call FUNC(incomingFinger)}] call EFUNC(common,addEventHandler);
["ACE3 Common",
QGVAR(finger),
[(localize LSTRING(keyComb)), (localize LSTRING(keyComb_description))],
{
_this call FUNC(keyPress);
},
{false},
[41, [true, false, false]], true] call cba_fnc_addKeybind; // Shift + Tilda (hold)
}] call EFUNC(common,addEventHandler);

View File

@ -0,0 +1,10 @@
#include "script_component.hpp"
ADDON = false;
PREP(incomingFinger);
PREP(keyPress);
PREP(moduleSettings);
PREP(perFrameEH);
ADDON = true;

18
addons/finger/config.cpp Normal file
View File

@ -0,0 +1,18 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {QGVAR(moduleSettings)};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"Drill"};
authorUrl = "https://github.com/TheDrill/";
VERSION_CONFIG;
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"

View File

@ -0,0 +1,35 @@
/*
* Author: TheDrill, PabstMirror
* Recieve an finger event, adds to the array (or updates if already present) and starts PFEH if not already running
*
* Arguments:
* 0: Source Unit (can be self) <OBJECT>
* 1: Position being pointed at (from positionCameraToWorld) <ARRAY>
*
* Return Value:
* None
*
* Example:
* [bob, [1,2,3]] call ace_finger_fnc_incomingFinger;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_sourceUnit,_fingerPosPrecise);
private ["_data", "_fingerPos"];
//add some random float to location if it's not our own finger:
_fingerPos = if (_sourceUnit == ACE_player) then {
_fingerPosPrecise
} else {
_fingerPosPrecise vectorAdd [random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y]
};
_data = [ACE_diagTime, _fingerPos, ([_sourceUnit] call EFUNC(common,getName))];
HASH_SET(GVAR(fingersHash), _sourceUnit, _data);
if (GVAR(pfeh_id) == -1) then {
GVAR(pfeh_id) = [DFUNC(perFrameEH), 0, []] call CBA_fnc_addPerFrameHandler;
};

View File

@ -0,0 +1,61 @@
/*
* Author: TheDrill, PabstMirror
* On keypress, point and send position to nearby players
*
* Arguments:
* None
*
* Return Value:
* Key Handeled <BOOL>
*
* Example:
* [] call ace_finger_fnc_keyPress;
*
* Public: No
*/
#include "script_component.hpp"
private["_fingerPosPrecise", "_playerEyePos", "_sendFingerToPlayers", "_nearbyMen"];
if (!alive ACE_player) exitWith {false};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
//make sure player is dismounted or in a static weapon:
if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) exitWith {false};
//Check camera view (not in GUNNER)
if !(cameraView in ["INTERNAL", "EXTERNAL"]) exitWith {false};
//Exit if run recently (run every 1 seconds)
if (ACE_diagTime < (GVAR(lastFPTime) + FP_ACTION_TIMEOUT)) exitWith {true};
GVAR(lastFPTime) = ACE_diagTime;
_fingerPosPrecise = positionCameraToWorld [0, 0, FP_DISTANCE];
_playerEyePos = eyePos ACE_player;
_sendFingerToPlayers = [];
_nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]);
{
_nearbyMen append (crew _x);
} forEach (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]);
{
if ((((eyePos _x) vectorDistance _playerEyePos) < GVAR(maxRange)) &&
{alive _x} &&
{(_x == (vehicle _x)) || {(vehicle _x) isKindOf "StaticWeapon"}} &&
{GVAR(indicatorForSelf) || {_x != ACE_player}} &&
{!(lineIntersects [(eyePos _x), _playerEyePos, ACE_player, _x])} &&
{[_x] call EFUNC(common,isPlayer)}) then {
_sendFingerToPlayers pushBack _x;
};
} forEach _nearbyMen;
TRACE_1("sending finger to",_sendFingerToPlayers);
[QGVAR(fingered), _sendFingerToPlayers, [ACE_player, _fingerPosPrecise]] call EFUNC(common,targetEvent);
ACE_player playActionNow "GestureGo";
true

View File

@ -0,0 +1,21 @@
/*
* Author: PabstMirror
* Module for fingering settings
*
* Arguments:
* 0: The module logic <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_logic);
if !(isServer) exitWith {};
[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule);

View File

@ -0,0 +1,51 @@
/*
* Author: TheDrill, PabstMirror
* The perFrameEventHandler to draw the icons
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [fromCBA] call ace_finger_fnc_perFrameEH;
*
* Public: No
*/
#include "script_component.hpp"
private["_drawColor", "_fovCorrection", "_iconSize", "_timeLeftToShow", "_cameraOffset"];
if (!alive ACE_player) then {GVAR(fingersHash) = HASH_CREATE;};
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside"]] call EFUNC(common,canInteractWith)) then {GVAR(fingersHash) = HASH_CREATE;};
//make sure player is dismounted or in a static weapon:
if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) then {GVAR(fingersHash) = HASH_CREATE;};
_cameraOffset = worldToScreen (positionCameraToWorld [1000, 0, 10000]);
_fovCorrection = 0;
if (count _cameraOffset > 0) then {_fovCorrection = (_cameraOffset select 0) - 0.5;};
_iconSize = BASE_SIZE * _fovCorrection;
{
_data = HASH_GET(GVAR(fingersHash), _x);
EXPLODE_3_PVT(_data,_lastTime,_pos,_name);
_timeLeftToShow = _lastTime + FP_TIMEOUT - ACE_diagTime;
if (_timeLeftToShow <= 0) then {
HASH_REM(GVAR(fingersHash), _x);
} else {
_drawColor = + GVAR(indicatorColor);
//Fade out:
if (_timeLeftToShow < 0.5) then {
_drawColor set [3, ((_drawColor select 3) * (_timeLeftToShow / 0.5))];
};
drawIcon3D [QUOTE(PATHTOF(UI\fp_icon.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"];
};
} forEach (GVAR(fingersHash) select 0);
if ((count (GVAR(fingersHash) select 0)) == 0) then {
[GVAR(pfeh_id)] call CBA_fnc_removePerFrameHandler;
GVAR(pfeh_id) = -1;
};

View File

@ -0,0 +1 @@
#include "\z\ace\addons\finger\script_component.hpp"

View File

@ -0,0 +1,21 @@
#define COMPONENT finger
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_FINGER
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_FINGER
#define DEBUG_SETTINGS DEBUG_SETTINGS_FINGER
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define BASE_SIZE 44
#define FP_TIMEOUT 2
#define FP_ACTION_TIMEOUT 1
#define FP_DISTANCE 10000
#define FP_RANDOMIZATION_X 350
#define FP_RANDOMIZATION_Y 100

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="finger">
<Key ID="STR_ACE_finger_indicatorForSelf_name">
<English>Show finger indicator to self</English>
<Russian>Отображать пальце-индикатор для показывающего игрока</Russian>
</Key>
<Key ID="STR_ACE_finger_indicatorForSelf_description">
<English>Render the indicator for the pointing player. This option doesn't affect whether the other players would see the indicator</English>
<Russian>Отображать индикатор для показывающего игрока. Эта настройка не влияет на то, будутт ли другие игроки видеть индикатор</Russian>
</Key>
<Key ID="STR_ACE_finger_indicatorColor_name">
<English>Finger indicator</English>
<Russian>Пальце-индикатор</Russian>
</Key>
<Key ID="STR_ACE_finger_indicatorColor_description">
<English>Color of the finger-pointing indicator circle</English>
<Russian>Цвет индикатора пальце-указания</Russian>
</Key>
<Key ID="STR_ACE_finger_keyComb">
<English>Action "point a finger at"</English>
<Russian>Действие "показать пальцем на"</Russian>
</Key>
<Key ID="STR_ACE_finger_keyComb_description">
<English>Points, and shows a virtual marker of where you are looking to nearby units. Can be held down.</English>
</Key>
<Key ID="STR_ACE_finger_moduleSettings_displayName">
<English>Finger Settings</English>
</Key>
<Key ID="STR_ACE_finger_enabled_displayName">
<English>Finger Pointing Enabled</English>
</Key>
<Key ID="STR_ACE_finger_maxRange_displayName">
<English>Finger Max Range</English>
</Key>
<Key ID="STR_ACE_finger_maxRange_description">
<English>How far away players can finger each other. [default: 4]</English>
</Key>
</Package>
</Project>

Binary file not shown.

Binary file not shown.

View File

@ -6,7 +6,7 @@ if(GVAR(EnableDebugTrace) && !isMultiplayer) then {
};
if(isServer) then {
[QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler;
[QGVAR(frag_eh), { _this call FUNC(frago); }] call EFUNC(common,addEventHandler);
};
[FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
private ["_round"];
_round = _this select 0;
GVAR(blackList) set[(count GVAR(blackList)), _round];
GVAR(blackList) set [(count GVAR(blackList)), _round];

View File

@ -1,8 +1,9 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
private ["_enabled","_doFragTrack", "_doSpall", "_spallTrack", "_spallTrackID"];
private ["_enabled", "_doSpall", "_spallTrack", "_spallTrackID"];
PARAMS_3(_gun,_type,_round);
DEFAULT_PARAM(3,_doFragTrack,false);
if (!GVAR(enabled)) exitWith {};
@ -16,7 +17,6 @@ if(_round in GVAR(blackList)) exitWith {
// Exit on max track
if( (count GVAR(objects)) > GVAR(MaxTrack)) exitWith { };
_doFragTrack = false;
if(_gun == ACE_player) then {
_doFragTrack = true;
} else {
@ -28,14 +28,16 @@ if(_gun == ACE_player) then {
};
};
};
_doSpall = false;
if(GVAR(SpallEnabled)) then {
if(GVAR(spallIsTrackingCount) <= 0) then {
GVAR(spallHPData) = [];
};
if(GVAR(spallIsTrackingCount) > 5) then {
// ACE_player sideChat "LIMT!";
_doSpall = false;
} else {
_doSpall = true;
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
};
};
@ -46,30 +48,27 @@ if(GVAR(autoTrace)) then {
};
// We only do the single track object check here.
// We should do an {!(_round in GVAR(objects))}
// We should do an {!(_round in GVAR(objects))}
// But we leave that out here for optimization. So this cannot be a framework function
// Otherwise, it should only be added once and from the FiredEH
if(_doFragTrack && alive _round) then {
_spallTrack = [];
_spallTrackID = [];
private["_args"];
_args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID,
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))),
(getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")),
(getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")),
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))),
(getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")))))
];
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))),
(getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")),
(getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")),
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))),
(getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")))))
];
TRACE_1("Initializing track", _round);
GVAR(objects) pushBack _round;
GVAR(arguments) pushBack _args;
if(_doSpall) then {
[_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack);
};
// ACE_player sideChat "WTF2";
};

View File

@ -2,12 +2,11 @@
#include "script_component.hpp"
// ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA";
private ["_params", "_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"];
private ["_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"];
_params = _this select 0;
_hitData = _params select 0;
_hitData = _this select 0;
_initialData = GVAR(spallHPData) select (_hitData select 0);
_hpData = (_hitData select 1) select (_params select 1);
_hpData = (_hitData select 1) select (_this select 1);
_object = _hpData select 0;
@ -149,4 +148,4 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
};
};
};
};
};

View File

@ -1,11 +1,7 @@
//fnc_findReflections.sqf
#include "script_component.hpp"
private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange",
"_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos",
"_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp",
"_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec"];
private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange", "_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", "_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec", "_zAng"];
_params = _this select 0;
_pos = _params select 0;
@ -46,7 +42,7 @@ if(_zIndex < 5) then {
// } forEach _res;
// drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""];
// TEST_PAIRS pushBack [_pos, _lastPos, [1,0,0,1]];
};
// if(terrainIntersectASL [_pos, _testPos]) exitWith {};
_lastPos = _testPos;
@ -91,7 +87,7 @@ if(_zIndex < 5) then {
_avgX = 0;
_avgY = 0;
_avgZ = 0;
{
_avgX = _avgX + (_x select 0);
_avgY = _avgY + (_x select 1);
@ -99,7 +95,7 @@ if(_zIndex < 5) then {
} forEach _blist;
_c = count _blist;
_bpos = [_avgX/_c, _avgY/_c, _avgZ/_c];
_distance = _pos vectorDistance _bpos;
_hitFactor = 1-(((_distance/(_indirectHitRange*4)) min 1) max 0);
// _hitFactor = 1/(_distance^2);
@ -108,16 +104,16 @@ if(_zIndex < 5) then {
_hit = _hit - (_hit%10);
_range = (floor (_indirectHitRange-(_distance/4))) min 100;
_range = _range - (_range%2);
if(_hit >= 10 && _range > 0) then {
// TEST_ICONS pushBack [_bpos, format["h: %1, r: %2, hf: %3 d: %4 ihr: %5", _hit, _range, _hitFactor, _distance, _indirectHitRange*4]];
// TEST_PAIRS pushBack [_pos, _bpos, [1,0,0,1]];
_refExp = format["ace_explosion_reflection_%1_%2", _range, _hit];
// _refExp createVehicle (ASLtoATL _bpos);
// drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _bpos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""];
_explosions pushBack [_refExp, _bpos, _hit, _distance, _indirectHitRange/4, _depth];
};
if(count _explosions > (_radi*2)/_depth) exitWith {};
} forEach _buckets;

View File

@ -1,58 +1,8 @@
#include "script_component.hpp"
private ["_enabled", "_gun", "_type", "_round", "_doFragTrack", "_doSpall", "_spallTrack", "_spallTrackID"];
if (!GVAR(enabled)) exitWith {};
private["_gun", "_type", "_round"];
_gun = _this select 0;
_type = _this select 4;
_round = _this select 6;
_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled));
if(_enabled < 1) exitWith {};
if(_round in GVAR(blackList)) exitWith {
GVAR(blackList) = GVAR(blackList) - [_round];
};
_doFragTrack = false;
if(_gun == ACE_player) then {
_doFragTrack = true;
} else {
if((gunner _gun) == ACE_player) then {
_doFragTrack = true;
} else {
if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then {
_doFragTrack = true;
};
};
};
_doSpall = false;
if(_doSpall) then {
if(GVAR(spallIsTrackingCount) <= 0) then {
GVAR(spallHPData) = [];
};
if(GVAR(spallIsTrackingCount) > 5) then {
// ACE_player sideChat "LIMT!";
_doSpall = false;
} else {
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
};
};
// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)];
#ifdef DEBUG_MODE_FULL
[ACE_player, _round, [1,0,0,1]] call FUNC(addTrack);
#endif
if(_doFragTrack && alive _round) then {
GVAR(trackedObjects) pushBack _round;
_spallTrack = [];
_spallTrackID = [];
[DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, ACE_time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler;
if(_doSpall) then {
[_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack);
};
// ACE_player sideChat "WTF2";
};
[_gun, _type, _round] call FUNC(addPfhRound);

View File

@ -4,7 +4,7 @@
* Master single PFH abstraction for all rounds being tracked by frag/spall
*
* Arguments:
*
*
*
* Return Value:
* None
@ -15,30 +15,22 @@
if (!GVAR(enabled)) exitWith {};
private["_gcIndex"];
private["_gcIndex", "_iter"];
_gcIndex = [];
_iter = 0;
while { (count GVAR(objects)) > 0 && { _iter < GVAR(MaxTrackPerFrame) } } do {
while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (count GVAR(objects))) } } do {
private["_object", "_args"];
if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then {
GVAR(lastIterationIndex) = 0;
};
_object = GVAR(objects) select GVAR(lastIterationIndex);
if(!isNil "_object") then {
if(isNull _object) then {
_gcIndex pushBack GVAR(lastIterationIndex);
} else {
_args = GVAR(arguments) select GVAR(lastIterationIndex);
if(!(_args call FUNC(pfhRound))) then {
_gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false
};
// If its not alive anymore, remove it from the queue, it already ran once on dead
if(!alive _object) then {
_gcIndex pushBack GVAR(lastIterationIndex);
};
_args = GVAR(arguments) select GVAR(lastIterationIndex);
if(!(_args call FUNC(pfhRound))) then {
_gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false
};
};
_iter = _iter + 1;
@ -53,6 +45,6 @@ _deletionCount = 0;
_deleteIndex = _x - _deletionCount;
GVAR(objects) deleteAt _deleteIndex;
GVAR(arguments) deleteAt _deleteIndex;
_deletionCount = _deletionCount + 1;
} forEach _gcIndex;
} forEach _gcIndex;

View File

@ -14,15 +14,15 @@ _indirectRange = _this select 11;
_force = _this select 12;
_fragPower = _this select 13;
if(_round in GVAR(blackList)) exitWith {
if(_round in GVAR(blackList)) exitWith {
false
};
if (!alive _round) then {
if((diag_frameno - _firedFrame) > 1) then {
if (!alive _round) exitWith {
if((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame
if(_skip == 0) then {
if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then {
[QGVAR(frag_eh), _this] call ace_common_fnc_serverEvent;
[QGVAR(frag_eh), _this] call EFUNC(common,serverEvent);
};
};
};
@ -35,15 +35,16 @@ if (!alive _round) then {
};
} forEach _spallTrack;
};
} else {
_params set[1, (getPosASL _round)];
_params set[2, (velocity _round)];
if(_doSpall) then {
private["_scale"];
_scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1;
[_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack);
};
false
};
true
_this set[1, (getPosASL _round)];
_this set[2, (velocity _round)];
if(_doSpall) then {
private["_scale"];
_scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1;
[_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack);
};
true

View File

@ -2,8 +2,10 @@
// THIS FUNCTION SHOULD NOT BE USED BECAUSE IT CAUSES AN SEARCH AND REBUILD
PARAMS_1(_round);
if(_round in GVAR(blackList)) then {
GVAR(blackList) = GVAR(blackList) - [_round];
};
GVAR(objects) = GVAR(objects) - [_round];
GVAR(objects) = GVAR(objects) - [_round];

View File

@ -11,4 +11,4 @@ if(IS_ARRAY((_this select 0))) then {
_ret = false;
};
};
_ret
_ret

View File

@ -21,7 +21,7 @@ if ((_this select 0) <= (count GVAR(spallHPData))) then {
// diag_log text format["%1: %2", _forEachIndex, _x];
// } forEach _hp;
// } forEach (_this select 1);
[DFUNC(doSpall), 0, [_this, _forEachIndex]] call cba_fnc_addPerFrameHandler;
[DFUNC(doSpall), [_this, _forEachIndex]] call EFUNC(common,execNextFrame);
// player sideChat "WEEE";
} forEach (_this select 1);
};

View File

@ -2,4 +2,4 @@
if(!GVAR(tracesStarted)) then {
GVAR(tracesStarted) = true;
GVAR(traceID) = [FUNC(drawTraces), 0, []] call cba_fnc_addPerFrameHandler;
};
};

View File

@ -2,4 +2,4 @@
if(GVAR(tracesStarted)) then {
GVAR(tracesStarted) = false;
[GVAR(traceID)] call cba_fnc_removePerFrameHandler;
};
};

View File

@ -1,52 +0,0 @@
//fnc_trackFragRound.sqf
#include "script_component.hpp"
private ["_params", "_round", "_lastPos", "_lastVel", "_type", "_time", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"];
_params = _this select 0;
_round = _params select 0;
_lastPos = _params select 1;
_lastVel = _params select 2;
_type = _params select 3;
_time = _params select 4;
_doSpall = _params select 6;
_spallTrack = _params select 7;
_foundObjectHPIds = _params select 8;
if (!alive _round) then {
[_this select 1] call cba_fnc_removePerFrameHandler;
if(_time != ACE_time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then {
GVAR(trackedObjects) = GVAR(trackedObjects) - [_round];
_skip = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip));
if(_skip == 0) then {
_explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive");
_indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange");
_force = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force));
_fragPower = getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt(_indirectRange));
if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then {
[QGVAR(frag_eh), _params] call ace_common_fnc_serverEvent;
GVAR(trackedObjects) = GVAR(trackedObjects) - [_round];
};
};
};
if(_doSpall) then {
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1;
// diag_log text format["F: %1", _foundObjectHPIds];
{
if(!isNil "_x") then {
_x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex];
};
} forEach _spallTrack;
};
} else {
if(!(_round in GVAR(trackedObjects)) || {_round in GVAR(blackList)}) then {
[_this select 1] call cba_fnc_removePerFrameHandler;
if(_round in GVAR(blackList)) then {
GVAR(blackList) = GVAR(blackList) - [_round];
};
};
_params set[1, (getPosASL _round)];
_params set[2, (velocity _round)];
if(_doSpall) then {
[_round, 1, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack);
};
};

View File

@ -8,7 +8,7 @@ _index = _params select 1;
if (alive _tracerObj && (count GVAR(traces)) > 0) then {
_data = GVAR(traces) select _index;
_positions = _data select 4;
_positions set[(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]];
_positions set [(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]];
} else {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};

View File

@ -70,6 +70,7 @@
<Spanish>(Solo SP) Seguimiento de depuración de Fragmentación/Astillamiento </Spanish>
<Polish>(Tylko SP) Wizualny debug odł./odpr.</Polish>
<Czech>(Pouze SP) Debug sledování Frag/Úlomků</Czech>
<German>(nur SP) Splitter-/Explosions-Debug-Verfolgung</German>
<Portuguese>(Somente SP) Depuração de fragmentação e estilhaços traçantes</Portuguese>
</Key>
<Key ID="STR_ACE_Frag_EnableDebugTrace_Desc">
@ -81,4 +82,4 @@
<Portuguese>(Somente SP) Requer um reinício de missão / editor. Habilita o rastreamento visual de projéteis de fragmentação e estilhaçamento apenas no modo de jogo SP.</Portuguese>
</Key>
</Package>
</Project>
</Project>

View File

@ -2,15 +2,15 @@
#define COLOUR 8.0
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"Garth 'L-H' de Wet"};
authorUrl = "http://garth.snakebiteink.co.za/";
VERSION_CONFIG;
};
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"Garth 'L-H' de Wet"};
authorUrl = "http://garth.snakebiteink.co.za/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
@ -165,10 +165,6 @@ class CfgGlasses {
ACE_Resistance = 1;
};
class AV_ESS_blk:None{
COMBAT_GOGGLES
};
class G_Balaclava_blk;
class G_Balaclava_combat:G_Balaclava_blk {

View File

@ -40,7 +40,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
[_unit, false] call EFUNC(common,disableAI);
};
_unit setSkill (skill _unit * 50);
}, [_x], (7 * _strength), 0.1] call EFUNC(common,waitAndExecute); //0.1 precision is fine for AI
}, [_x], (7 * _strength)] call EFUNC(common,waitAndExecute);
} else {
//Do effects for player
// is there line of sight to the grenade?
@ -62,7 +62,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
//Add ace_hearing ear ringing sound effect
if ((isClass (configFile >> "CfgPatches" >> "ACE_Hearing")) && {_strength > 0}) then {
[_x, 0.5 + (_strength / 2)] call EFUNC(hearing,earRinging);
[_x, (20 * _strength)] call EFUNC(hearing,earRinging);
};
// account for people looking away by slightly
@ -95,7 +95,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
[{
PARAMS_1(_light);
deleteVehicle _light;
}, [_light], 0.1, 0] call EFUNC(common,waitAndExecute);
}, [_light], 0.1] call EFUNC(common,waitAndExecute);
// blind player
if (_strength > 0.1) then {
@ -113,7 +113,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
//FULLRECOVERY - end effect
[{
GVAR(flashbangPPEffectCC) ppEffectEnable false;
}, [], (17 * _strength), 0] call EFUNC(common,waitAndExecute);
}, [], (17 * _strength)] call EFUNC(common,waitAndExecute);
};
};
};

View File

@ -22,15 +22,15 @@ class CfgWeapons {
class H_HelmetCrew_I: H_HelmetCrew_B {};
class H_CrewHelmetHeli_B: H_HelmetB {
GVAR(protection) = 0.75;
GVAR(lowerVolume) = 0.70;
GVAR(protection) = 0.85;
GVAR(lowerVolume) = 0.75;
};
class H_CrewHelmetHeli_O: H_CrewHelmetHeli_B {};
class H_CrewHelmetHeli_I: H_CrewHelmetHeli_B {};
class H_PilotHelmetHeli_B: H_HelmetB {
GVAR(protection) = 0.75;
GVAR(lowerVolume) = 0.70;
GVAR(protection) = 0.85;
GVAR(lowerVolume) = 0.75;
};
class H_PilotHelmetHeli_O: H_PilotHelmetHeli_B {};
class H_PilotHelmetHeli_I: H_PilotHelmetHeli_B {};

View File

@ -2,8 +2,9 @@
if (!hasInterface) exitWith {};
GVAR(currentDeafness) = 0;
GVAR(newStrength) = 0;
GVAR(deafnessDV) = 0;
GVAR(deafnessPrior) = 0;
GVAR(volume) = 1;
GVAR(playerVehAttenuation) = 1;
GVAR(beep) = false;
@ -11,10 +12,11 @@ GVAR(beep2) = false;
GVAR(time2) = 0;
GVAR(time3) = 0;
GVAR(time4) = 0;
GVAR(earRingingPFH) = -1;
// Spawn volume updating process
[FUNC(updateVolume), 0.1, [] ] call CBA_fnc_addPerFrameHandler;
["SettingsInitialized", {
// Spawn volume updating process
[FUNC(updateVolume), 1, [false] ] call CBA_fnc_addPerFrameHandler;
}] call EFUNC(common,addEventHandler);
//Update veh attunation when player veh changes
["playerVehicleChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler);
@ -22,14 +24,13 @@ GVAR(earRingingPFH) = -1;
//Reset deafness on respawn (or remote control player switch)
["playerChanged", {
ACE_player setVariable [QGVAR(dv), 0];
ACE_player setVariable [QGVAR(prior), 0];
GVAR(deafnessDV) = 0;
GVAR(deafnessPrior) = 0;
ACE_player setvariable [QGVAR(deaf), false];
GVAR(beep) = false;
GVAR(beep2) = false;
GVAR(time2) = 0;
GVAR(time3) = 0;
GVAR(time4) = 0;
GVAR(currentDeafness) = 0;
GVAR(newStrength) = 0;
}] call EFUNC(common,addEventhandler);

View File

@ -16,12 +16,11 @@
*/
#include "script_component.hpp"
if (GVAR(DisableEarRinging)) exitWith {};
PARAMS_2(_unit,_strength);
if (isNull _unit) exitWith {};
if (_unit != ACE_player) exitWith {};
if (_strength < 0.05) exitWith {};
if (!isNull curatorCamera) exitWith {};
if (_unit getVariable ["ACE_hasEarPlugsin", false]) then {
_strength = _strength / 4;
@ -36,66 +35,4 @@ if(headgear _unit != "") then {
};
};
_unit setVariable [QGVAR(dv), (_unit getVariable [QGVAR(dv), 0]) + _strength];
if (GVAR(earRingingPFH) != -1) exitWith {};
GVAR(earRingingPFH) = [{
EXPLODE_1_PVT(_this select 0,_unit);
private ["_prior"];
_prior = (_unit getvariable [QGVAR(dv), 0]) min 20;
if (!alive _unit || _prior <= 0 || GVAR(DisableEarRinging)) exitWith {
_unit setVariable [QGVAR(dv), 0];
_unit setVariable [QGVAR(prior), 0];
GVAR(beep) = false;
GVAR(beep2) = false;
GVAR(time2) = 0;
GVAR(time3) = 0;
GVAR(time4) = 0;
GVAR(earRingingPFH) = -1;
[_this select 1] call cba_fnc_removePerFrameHandler;
};
if (((_unit getvariable [QGVAR(dv), 0]) - (_unit getvariable [QGVAR(prior), 0])) > 2) then {
if (ACE_time > GVAR(time3)) then {
GVAR(beep2) = false;
};
if (!GVAR(beep2)) then {
playSound "ACE_Combat_Deafness";
GVAR(beep2) = true;
GVAR(time3) = ACE_time + 5;
};
};
_unit setvariable [QGVAR(prior), _prior];
GVAR(volume) = (1 - (_prior / 20)) max 0;
if (_prior > 19.75) then {
_unit setvariable [QGVAR(deaf), true];
} else {
_unit setvariable [QGVAR(deaf), false];
};
if ((_unit getvariable [QGVAR(deaf), false]) && {ACE_time > GVAR(time4)}) then {
playSound "ACE_Combat_Deafness";
GVAR(beep2) = true;
GVAR(time3) = ACE_time + 10;
GVAR(time4) = ACE_time + 30;
};
// Hearing takes longer to return to normal after it hits rock bottom
_unit setvariable [QGVAR(dv), _prior - (0.5 * (GVAR(volume) max 0.1))];
if (_prior > 10) then {
//check if the ringing is already being played
if (ACE_time > GVAR(time2)) then {
GVAR(beep) = false;
};
if (!GVAR(beep)) then {
playSound "ACE_Ring_Backblast";
GVAR(time2) = ACE_time + 22;
GVAR(beep) = true;
};
};
}, 1, [_unit]] call CBA_fnc_addPerFrameHandler;
GVAR(deafnessDV) = GVAR(deafnessDV) + _strength;

View File

@ -16,6 +16,9 @@
*/
#include "script_component.hpp"
//Only run if deafness or ear ringing is enabled:
if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {};
PARAMS_2(_unit,_damage);
private ["_strength"];

View File

@ -21,17 +21,18 @@
*/
#include "script_component.hpp"
private ["_silencer", "_audibleFireCoef", "_loudness", "_strength", "_vehAttenuation", "_magazine", "_muzzles", "_weaponMagazines", "_muzzleMagazines", "_ammoType", "_initSpeed", "_ammoConfig", "_caliber", "_parentClasses"];
//Only run if deafness or ear ringing is enabled:
if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {};
PARAMS_7(_object,_firer,_distance,_weapon,_muzzle,_mode,_ammo);
//Only run if combatDeafness enabled:
if (!GVAR(enableCombatDeafness)) exitWith {};
//Only run if firedNear object is player or player's vehicle:
if ((ACE_player != _object) && {(vehicle ACE_player) != _object}) exitWith {};
if (_weapon in ["Throw", "Put"]) exitWith {};
if (_distance > 50) exitWith {};
private ["_silencer", "_audibleFireCoef", "_loudness", "_strength", "_vehAttenuation", "_magazine", "_muzzles", "_weaponMagazines", "_muzzleMagazines", "_ammoType", "_initSpeed", "_ammoConfig", "_caliber", "_parentClasses"];
_vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)};
_distance = 1 max _distance;
@ -67,7 +68,7 @@ if (count _weaponMagazines == 0) then {
_magazine = "";
{
EXPLODE_2_PVT(_x,_magazineType,_ammoType)
EXPLODE_2_PVT(_x,_magazineType,_ammoType);
if (_ammoType == _ammo) exitWith {
_magazine = _magazineType;
};

View File

@ -1,6 +1,6 @@
/*
* Author: esteldunedain
* Initializes the Map module.
* Initializes the Hearing module.
*
* Arguments:
* Whatever the module provides. (I dunno.)
@ -16,4 +16,4 @@ if !(_activated) exitWith {};
[_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule);
diag_log text "[ACE]: Interaction Module Initialized.";
diag_log text "[ACE]: Hearing Module Initialized.";

View File

@ -24,5 +24,8 @@ _player setVariable ["ACE_hasEarPlugsIn", true, true];
[localize LSTRING(EarPlugs_Are_On)] call EFUNC(common,displayTextStructured);
//Force an immediate fast volume update:
[[true]] call FUNC(updateVolume);
/*// No Earplugs in inventory, telling user
[localize LSTRING(NoPlugs)] call EFUNC(common,displayTextStructured);*/

View File

@ -27,3 +27,6 @@ _player addItem "ACE_EarPlugs";
_player setVariable ["ACE_hasEarPlugsIn", false, true];
[localize LSTRING(EarPlugs_Are_Off)] call EFUNC(common,displayTextStructured);
//Force an immediate fast volume update:
[[true]] call FUNC(updateVolume);

View File

@ -3,7 +3,8 @@
* Updates and applys the current deafness. Called every 0.1 sec from a PFEH.
*
* Arguments:
* None
* 0: Args <ARRAY>
* -----0: Just update volume (skip ringing/recovery) <BOOL><OPTIONAL>
*
* Return Value:
* None
@ -15,31 +16,62 @@
*/
#include "script_component.hpp"
private ["_recoverRate", "_volume"];
//Only run if deafness or ear ringing is enabled:
if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {};
// Exit if combat deafness is disabled
if !(GVAR(enableCombatDeafness)) exitWith {};
EXPLODE_1_PVT((_this select 0),_justUpdateVolume);
// Check if new noises increase deafness
GVAR(newStrength) = (((ACE_player getvariable [QGVAR(dv), 0]) min 20) / 20) ^ 2;
if (GVAR(newStrength) > GVAR(currentDeafness)) then {
GVAR(currentDeafness) = GVAR(newStrength);
};
private["_volume", "_soundTransitionTime"];
// Recover rate is slower if deafness is severe
_recoverRate = 0.01;
if (GVAR(currentDeafness) > 0.7) then {
_recoverRate = 0.005;
if (GVAR(currentDeafness) > 0.9) then {
_recoverRate = 0.002;
GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0;
GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0;
if (!_justUpdateVolume) then {
//If we got a big increase in the last second:
if ((GVAR(deafnessDV) - GVAR(deafnessPrior)) > 2) then {
if (ACE_time > GVAR(time3)) then {
GVAR(beep2) = false;
};
if ((!GVAR(DisableEarRinging)) && {!GVAR(beep2)}) then {
playSound "ACE_Combat_Deafness";
GVAR(beep2) = true;
GVAR(time3) = ACE_time + 5;
};
};
GVAR(deafnessPrior) = GVAR(deafnessDV);
if (GVAR(deafnessDV) > 19.75) then {
ACE_player setvariable [QGVAR(deaf), true];
if ((!GVAR(DisableEarRinging)) && {ACE_time > GVAR(time4)}) then {
playSound "ACE_Combat_Deafness";
GVAR(beep2) = true;
GVAR(time3) = ACE_time + 10;
GVAR(time4) = ACE_time + 30;
};
} else {
ACE_player setvariable [QGVAR(deaf), false];
};
if (GVAR(deafnessDV) > 10) then {
//check if the ringing is already being played
if (ACE_time > GVAR(time2)) then {
GVAR(beep) = false;
};
if ((!GVAR(DisableEarRinging)) && {!GVAR(beep)}) then {
playSound "ACE_Ring_Backblast";
GVAR(time2) = ACE_time + 22;
GVAR(beep) = true;
};
};
// Hearing takes longer to return to normal after it hits rock bottom
GVAR(deafnessDV) = (GVAR(deafnessDV) - (0.5 * (GVAR(volume) max 0.1))) max 0;
};
// Deafness recovers with ACE_time
GVAR(currentDeafness) = GVAR(currentDeafness) - _recoverRate max 0;
if ((missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false]) || {!GVAR(enableCombatDeafness)}) exitWith {};
// needed until Bohemia fixes playSound to actually use the second argument
_volume = (1 - GVAR(currentDeafness) max 0)^2 max 0.04;
_volume = GVAR(volume);
// Earplugs reduce hearing 50%
if ([ACE_player] call FUNC(hasEarPlugsIn)) then {
@ -60,11 +92,9 @@ if (ACE_player getVariable ["ACE_isUnconscious", false]) then {
_volume = _volume min GVAR(UnconsciousnessVolume);
};
if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then {
0.1 fadeSound _volume;
0.1 fadeSpeech _volume;
ACE_player setVariable ["tf_globalVolume", _volume];
if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume^(0.33)] call acre_api_fnc_setGlobalVolume;};
};
_soundTransitionTime = if (_justUpdateVolume) then {0.1} else {1};
//hintSilent format ["GVAR(currentDeafness), _Volume = %1, %2", GVAR(currentDeafness), _volume];
_soundTransitionTime fadeSound _volume;
_soundTransitionTime fadeSpeech _volume;
ACE_player setVariable ["tf_globalVolume", _volume];
if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume^(0.33)] call acre_api_fnc_setGlobalVolume;};

View File

@ -1,6 +1,8 @@
#define COMPONENT hearing
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#ifdef DEBUG_ENABLED_HEARING
#define DEBUG_MODE_FULL
#endif

View File

@ -16,7 +16,7 @@ class CfgVehicles {
};
};
};
class Parachute_02_base_F;
class ACE_HuntIR: Parachute_02_base_F {
author = ECSTRING(common,ACETeam);
@ -67,13 +67,10 @@ class CfgVehicles {
displayName = CSTRING(monitor_displayName);
vehicleClass = "Items";
class TransportItems {
class ACE_HuntIR_monitor {
name = "ACE_HuntIR_monitor";
count = 1;
};
MACRO_ADDITEM(ACE_HuntIR_monitor,1);
};
};
class ReammoBox_F;
class ACE_HuntIR_Box: ReammoBox_F {
model = PATHTOF(data\ace_huntirbox.p3d);

View File

@ -63,6 +63,11 @@ GVAR(no_cams) sort true;
GVAR(no_cams) set [_forEachIndex, _x select 1];
} forEach GVAR(no_cams);
[{
//Close monitor if we no longer have the item:
if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable ["ace_huntir_monitor", displayNull])}) then {
closeDialog 0;
};
GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];
{
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then {

View File

@ -25,6 +25,12 @@ if (_ammo != "F_HuntIR") exitWith {};
[{
PARAMS_1(_projectile);
//If null (deleted or hit water) exit:
if (isNull _projectile) exitWith {};
//If it's not spinning (hit ground), bail:
if ((vectorMagnitude (velocity _projectile)) < 0.1) exitWith {};
"ACE_HuntIR_Propell" createVehicle (getPosATL _projectile);
[{
PARAMS_1(_position);

View File

@ -38,6 +38,11 @@ createDialog "ace_huntir_cam_dialog_off";
GVAR(messageSearching) = toArray "Searching.....";
GVAR(messageConnecting) = toArray "Connecting.....";
[{
//Close monitor if we no longer have item:
if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable ["ace_huntir_monitor", displayNull])}) then {
closeDialog 0;
};
private ["_elapsedTime", "_nearestHuntIRs"];
_elapsedTime = ACE_time - GVAR(startTime);
_nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];

View File

@ -1,6 +1,8 @@
#define COMPONENT huntir
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#ifdef DEBUG_ENABLED_HUNTIR
#define DEBUG_MODE_FULL
#endif

View File

@ -228,6 +228,7 @@
<Polish>Tło menu interakcji</Polish>
<Spanish>Fondo del menú de interacción</Spanish>
<Czech>Pozadí menu interakce</Czech>
<German>Interaktionsmenü-Hintergrund</German>
<Portuguese>Fundo do menu de interação</Portuguese>
</Key>
<Key ID="STR_ACE_Interact_Menu_blurScreenDesc">
@ -235,6 +236,7 @@
<Polish>Rozmywa lub przyciemnia tło na czas otwarcia menu interakcji</Polish>
<Spanish>Desenfocar el fondo mientras el menú de interacción está abierto.</Spanish>
<Czech>Rozmazat obraz pokud je interakční menu otevřené.</Czech>
<German>Den Hintergrund verschwimmen lassen, während das Interaktionsmenü geöffnet ist.</German>
<Portuguese>Desfocar o fundo enquanto o menu de interação está aberto.</Portuguese>
</Key>
<Key ID="STR_ACE_Interact_Menu_backgroundBlur">
@ -242,6 +244,7 @@
<Polish>Rozmycie ekranu</Polish>
<Spanish>Pantalla de desenfoque</Spanish>
<Czech>Rozmazaný obraz</Czech>
<German>Verschwommenes Bild</German>
<Portuguese>Desfoque de tela</Portuguese>
</Key>
<Key ID="STR_ACE_Interact_Menu_backgroundBlack">
@ -250,6 +253,7 @@
<Spanish>Negro</Spanish>
<Czech>Černý obraz</Czech>
<Portuguese>Preto</Portuguese>
<German>Schwarz</German>
</Key>
<Key ID="STR_ACE_Interact_Menu_addBuildingActions">
<English>Show actions for buildings</English>
@ -264,4 +268,4 @@
<Spanish>Añade las acciones de interacción para la apertura de puertas y montaje de escaleras en los edificios. (Nota: Hay un coste de rendimiento al abrir el menú de interacción, especialmente en las ciudades)</Spanish>
</Key>
</Package>
</Project>
</Project>

View File

@ -42,10 +42,7 @@ class CfgVehicles {
displayName = "Kestrel 4500";
vehicleClass = "Items";
class TransportItems {
class ACE_Kestrel4500 {
name = "ACE_Kestrel4500";
count = 1;
};
MACRO_ADDITEM(ACE_Kestrel4500,1);
};
};

View File

@ -56,6 +56,7 @@ class Kestrel4500_Display {
controlsBackground[]={};
objects[]={};
class controls {
#define DIALOG_SAFE_Y(num) QUOTE((safeZoneY + num) min (safeZoneY + safeZoneH - 1.024*4/3 + num))
class BACKGROUND {
moving=1;
type=0;
@ -64,7 +65,7 @@ class Kestrel4500_Display {
idc=74000;
style=48;
x=safezoneX;
y=safezoneY;
y = DIALOG_SAFE_Y(0);
w=1.024;
h=1.024*4/3;
colorBackground[]={1,1,1,1};
@ -74,7 +75,7 @@ class Kestrel4500_Display {
class POWER: Kestrel4500_RscButton {
idc=-1;
x=safezoneX+0.385;
y=safezoneY+1.125;
y = DIALOG_SAFE_Y(1.125);
w=0.042;
h=0.042*4/3;
action=QUOTE(7 call FUNC(buttonPressed));
@ -83,7 +84,7 @@ class Kestrel4500_Display {
class ENTER: POWER {
idc=-1;
x=safezoneX+0.46;
y=safezoneY+1.0;
y = DIALOG_SAFE_Y(1.0);
w=0.1;
action=QUOTE(0 call FUNC(buttonPressed));
onMouseButtonDown = "playSound 'kestrel4500_center_button_click'";
@ -91,7 +92,7 @@ class Kestrel4500_Display {
class TOP: Kestrel4500_RscButton {
idc=-1;
x=safezoneX+0.46;
y=safezoneY+0.93;
y = DIALOG_SAFE_Y(0.93);
w=0.1;
h=0.03;
action=QUOTE(1 call FUNC(buttonPressed));
@ -99,14 +100,14 @@ class Kestrel4500_Display {
};
class BOTTOM: TOP {
idc=-1;
y=safezoneY+1.1;
y = DIALOG_SAFE_Y(1.1);
action=QUOTE(2 call FUNC(buttonPressed));
onMouseButtonDown = "playSound 'kestrel4500_bottom_button_click'";
};
class LEFT: Kestrel4500_RscButton {
idc=-1;
x=safezoneX+0.4;
y=safezoneY+0.97;
y = DIALOG_SAFE_Y(0.97);
w=0.046;
h=0.11;
action=QUOTE(3 call FUNC(buttonPressed));
@ -121,7 +122,7 @@ class Kestrel4500_Display {
class MEMORY: Kestrel4500_RscButton {
idc=-1;
x=safezoneX+0.395;
y=safezoneY+0.87;
y = DIALOG_SAFE_Y(0.87);
w=0.05;
h=0.045*4/3;
action=QUOTE(5 call FUNC(buttonPressed));
@ -131,39 +132,39 @@ class Kestrel4500_Display {
x=safezoneX+0.585;
action=QUOTE(6 call FUNC(buttonPressed));
};
class TEXT_TOP: Kestrel4500_RscText {
idc=74100;
x=safezoneX+0.40;
y=safezoneY+0.58;
y = DIALOG_SAFE_Y(0.58);
w=0.22;
h=0.04;
text="";
};
class TEXT_CENTER_BIG: TEXT_TOP {
idc=74200;
y=safezoneY+0.61;
y = DIALOG_SAFE_Y(0.61);
h=0.10;
SizeEx=0.06;
};
class TEXT_CENTER: TEXT_TOP {
idc=74201;
y=safezoneY+0.64;
y = DIALOG_SAFE_Y(0.64);
};
class TEXT_CENTER_LINE_1_LEFT: TEXT_TOP {
idc=74300;
y=safezoneY+0.60;
y = DIALOG_SAFE_Y(0.60);
style=ST_LEFT;
h=0.10;
SizeEx=0.05;
};
class TEXT_CENTER_LINE2_LEFT: TEXT_CENTER_LINE_1_LEFT {
idc=74301;
y=safezoneY+0.64;
y = DIALOG_SAFE_Y(0.64);
};
class TEXT_CENTER_LINE_3_LEFT: TEXT_CENTER_LINE2_LEFT {
idc=74302;
y=safezoneY+0.68;
y = DIALOG_SAFE_Y(0.68);
};
class TEXT_CENTER_LINE_1_RIGHT: TEXT_CENTER_LINE_1_LEFT {
idc=74303;
@ -179,42 +180,42 @@ class Kestrel4500_Display {
};
class TEXT_INFO_LINE_1: TEXT_TOP {
idc=74400;
y=safezoneY+0.68;
y = DIALOG_SAFE_Y(0.68);
};
class TEXT_INFO_LINE_2: TEXT_TOP {
idc=74401;
y=safezoneY+0.72;
y = DIALOG_SAFE_Y(0.72);
};
class TEXT_BOTTOM_BIG: TEXT_TOP {
idc=74500;
y=safezoneY+0.67;
y = DIALOG_SAFE_Y(0.67);
h=0.10;
SizeEx=0.06;
};
class TEXT_CENTER_LINE_1: TEXT_TOP {
idc=74600;
y=safezoneY+0.58;
y = DIALOG_SAFE_Y(0.58);
SizeEx=0.03;
};
class TEXT_CENTER_LINE_2: TEXT_CENTER_LINE_1 {
idc=74601;
y=safezoneY+0.61;
y = DIALOG_SAFE_Y(0.61);
};
class TEXT_CENTER_LINE_3: TEXT_CENTER_LINE_1 {
idc=74602;
y=safezoneY+0.64;
y = DIALOG_SAFE_Y(0.64);
};
class TEXT_CENTER_LINE_4: TEXT_CENTER_LINE_1 {
idc=74603;
y=safezoneY+0.67;
y = DIALOG_SAFE_Y(0.67);
};
class TEXT_CENTER_LINE_5: TEXT_CENTER_LINE_1 {
idc=74604;
y=safezoneY+0.70;
y = DIALOG_SAFE_Y(0.70);
};
class TEXT_CENTER_LINE_6: TEXT_CENTER_LINE_1 {
idc=74605;
y=safezoneY+0.73;
y = DIALOG_SAFE_Y(0.73);
};
};
};
@ -228,6 +229,7 @@ class RscTitles {
fadeIn="false";
fadeOut="false";
class controls {
#define DISPLAY_SAFE_Y(num) QUOTE((safeZoneY + 0.7 + num) min (safeZoneY + safeZoneH - 1.024*4/3*0.75 + num))
class RscKestrel4500 {
idc=75000;
moving=0;
@ -236,7 +238,7 @@ class RscTitles {
SizeEX=0.025*0.75;
style=48;
x=safezoneX+0.14;
y=safezoneY+0.7;
y = DISPLAY_SAFE_Y(0);
w=0.512*0.75;
h=1.024*4/3*0.75;
colorBackground[]={1,1,1,1};
@ -246,7 +248,7 @@ class RscTitles {
class RscTextTop: Kestrel4500_RscText {
idc=75100;
x=safezoneX-0.05+0.40*0.75;
y=safezoneY+0.7+0.58*0.75;
y = DISPLAY_SAFE_Y(0.58*0.75);
w=0.22*0.75;
h=0.04*0.75;
SizeEx=0.04*0.75;
@ -254,18 +256,18 @@ class RscTitles {
};
class RscTextCenterBig: RscTextTop {
idc=75200;
y=safezoneY+0.7+0.61*0.75;
y = DISPLAY_SAFE_Y(0.61*0.75);
h=0.10*0.75;
SizeEx=0.06*0.75;
text="";
};
class RscTextCenter: RscTextTop {
idc=75201;
y=safezoneY+0.7+0.64*0.75;
y = DISPLAY_SAFE_Y(0.64*0.75);
};
class RscTextCenterLine1Left: RscTextTop {
idc=75300;
y=safezoneY+0.7+0.60*0.75;
y = DISPLAY_SAFE_Y(0.60*0.75);
style=ST_LEFT;
h=0.10*0.75;
SizeEx=0.05*0.75;
@ -273,12 +275,12 @@ class RscTitles {
};
class RscTextCenterLine2Left: RscTextCenterLine1Left {
idc=75301;
y=safezoneY+0.7+0.64*0.75;
y = DISPLAY_SAFE_Y(0.64*0.75);
text="";
};
class RscTextCenterLine3Left: RscTextCenterLine2Left {
idc=75302;
y=safezoneY+0.7+0.68*0.75;
y = DISPLAY_SAFE_Y(0.68*0.75);
text="";
};
class RscTextCenterLine1Right: RscTextCenterLine1Left {
@ -295,49 +297,49 @@ class RscTitles {
};
class RscTextInfoLine1: RscTextTop {
idc=75400;
y=safezoneY+0.7+0.68*0.75;
y = DISPLAY_SAFE_Y(0.68*0.75);
text="";
};
class RscTextInfoLine2: RscTextTop {
idc=75401;
y=safezoneY+0.7+0.72*0.75;
y = DISPLAY_SAFE_Y(0.72*0.75);
text="";
};
class RscTextBottomBig: RscTextTop {
idc=75500;
y=safezoneY+0.7+0.67*0.75;
y = DISPLAY_SAFE_Y(0.67*0.75);
h=0.10*0.75;
SizeEx=0.06*0.75;
text="";
};
class RscTextCenterLine1: RscTextTop {
idc=75600;
y=safezoneY+0.7+0.58*0.75;
y = DISPLAY_SAFE_Y(0.58*0.75);
SizeEx=0.03*0.75;
};
class RscTextCenterLine2: RscTextCenterLine1 {
idc=75601;
y=safezoneY+0.7+0.61*0.75;
y = DISPLAY_SAFE_Y(0.61*0.75);
};
class RscTextCenterLine3: RscTextCenterLine1 {
idc=75602;
y=safezoneY+0.7+0.64*0.75;
y = DISPLAY_SAFE_Y(0.64*0.75);
};
class RscTextCenterLine4: RscTextCenterLine1 {
idc=75603;
y=safezoneY+0.7+0.67*0.75;
y = DISPLAY_SAFE_Y(0.67*0.75);
};
class RscTextCenterLine5: RscTextCenterLine1 {
idc=75604;
y=safezoneY+0.7+0.70*0.75;
y = DISPLAY_SAFE_Y(0.70*0.75);
};
class RscTextCenterLine6: RscTextCenterLine1 {
idc=75605;
y=safezoneY+0.7+0.73*0.75;
y = DISPLAY_SAFE_Y(0.73*0.75);
};
};
};
class RscKestrel4500_Preload {
idd = -1;
movingEnable = 0;

View File

@ -20,7 +20,7 @@ _playerAltitude = (getPosASL ACE_player) select 2;
_temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight);
_humidity = EGVAR(weather,currentHumidity);
_barometricPressure = _playerAltitude call EFUNC(weather,calculateBarometricPressure);
_altitude = EGVAR(weather,Altitude) + _playerAltitude;
_altitude = EGVAR(common,mapAltitude) + _playerAltitude;
_airDensity = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateAirDensity);
_densityAltitude = _airDensity call EFUNC(weather,calculateDensityAltitude);
_chill = [_temperature, _humidity] call EFUNC(weather,calculateWindChill);

View File

@ -276,7 +276,7 @@ if (GVAR(referenceHeadingMenu) == 0) then {
};
case 12: { // ALTITUDE
if (!GVAR(MinAvgMax)) then {
_textCenterBig = Str(round(EGVAR(weather,Altitude) + _playerAltitude));
_textCenterBig = Str(round(EGVAR(common,mapAltitude) + _playerAltitude));
} else {
_textCenterLine1Left = "Min";
_textCenterLine2Left = "Avg";
@ -300,7 +300,7 @@ if (GVAR(referenceHeadingMenu) == 0) then {
};
case 14: { // User Screen 1
_textCenterLine1Left = Str(round(_playerDir));
_textCenterLine2Left = Str(round(EGVAR(weather,Altitude) + _playerAltitude));
_textCenterLine2Left = Str(round(EGVAR(common,mapAltitude) + _playerAltitude));
_textCenterLine3Left = Str(round(abs(_windSpeed) * 10) / 10);
_textCenterLine1Right = GVAR(Directions) select GVAR(Direction);
_textCenterLine2Right = "m";

View File

@ -30,10 +30,7 @@ class CfgVehicles {
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
class _xx_ACE_UAVBattery {
count = 6;
name = "ACE_UAVBattery";
};
MACRO_ADDITEM(ACE_UAVBattery,6);
};
};
};

View File

@ -68,6 +68,11 @@
count = COUNT; \
}
#define MACRO_ADDBACKPACK(BACKPACK,COUNT) class _xx_##BACKPACK { \
backpack = #BACKPACK; \
count = COUNT; \
}
#ifdef DISABLE_COMPILE_CACHE
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf))

View File

@ -0,0 +1,6 @@
class CfgActions {
class None;
class Heal: None {
show = 0;
};
};

View File

@ -752,10 +752,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_fieldDressing {
name = "ACE_fieldDressing";
count = 1;
};
MACRO_ADDITEM(ACE_fieldDressing,1);
};
};
class ACE_packingBandageItem: Item_Base_F {
@ -765,10 +762,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_packingBandage {
name = "ACE_packingBandage";
count = 1;
};
MACRO_ADDITEM(ACE_packingBandage,1);
};
};
class ACE_elasticBandageItem: Item_Base_F {
@ -778,10 +772,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_elasticBandage {
name = "ACE_elasticBandage";
count = 1;
};
MACRO_ADDITEM(ACE_elasticBandage,1);
};
};
class ACE_tourniquetItem: Item_Base_F {
@ -791,10 +782,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_tourniquet {
name = "ACE_tourniquet";
count = 1;
};
MACRO_ADDITEM(ACE_tourniquet,1);
};
};
class ACE_morphineItem: Item_Base_F {
@ -804,10 +792,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_morphine {
name = "ACE_morphine";
count = 1;
};
MACRO_ADDITEM(ACE_morphine,1);
};
};
class ACE_atropineItem: Item_Base_F {
@ -817,10 +802,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_atropine {
name = "ACE_atropine";
count = 1;
};
MACRO_ADDITEM(ACE_atropine,1);
};
};
class ACE_epinephrineItem: Item_Base_F {
@ -830,10 +812,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_epinephrine {
name = "ACE_epinephrine";
count = 1;
};
MACRO_ADDITEM(ACE_epinephrine,1);
};
};
class ACE_plasmaIVItem: Item_Base_F {
@ -843,10 +822,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_plasmaIV {
name = "ACE_plasmaIV";
count = 1;
};
MACRO_ADDITEM(ACE_plasmaIV,1);
};
};
@ -857,10 +833,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_bloodIV {
name = "ACE_bloodIV";
count = 1;
};
MACRO_ADDITEM(ACE_bloodIV,1);
};
};
class ACE_salineIVItem: Item_Base_F {
@ -870,10 +843,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_salineIV {
name = "ACE_salineIV";
count = 1;
};
MACRO_ADDITEM(ACE_salineIV,1);
};
};
class ACE_quikClotItem: Item_Base_F {
@ -883,10 +853,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_quikClot {
name = "ACE_quikclot";
count = 1;
};
MACRO_ADDITEM(ACE_quikclot,1);
};
};
class ACE_personalAidKitItem: Item_Base_F {
@ -896,10 +863,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_personalAidKit {
name = "ACE_personalAidKit";
count = 1;
};
MACRO_ADDITEM(ACE_personalAidKit,1);
};
};
class ACE_surgicalKitItem: Item_Base_F {
@ -909,10 +873,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_surgicalKit {
name = "ACE_surgicalKit";
count = 1;
};
MACRO_ADDITEM(ACE_surgicalKit,1);
};
};
class ACE_bodyBagItem: Item_Base_F {
@ -922,10 +883,7 @@ class CfgVehicles {
author = ECSTRING(common,ACETeam);
vehicleClass = "Items";
class TransportItems {
class ACE_bodyBag {
name = "ACE_bodyBag";
count = 1;
};
MACRO_ADDITEM(ACE_bodyBag,1);
};
};
@ -937,119 +895,38 @@ class CfgVehicles {
model = PATHTOF(data\ace_medcrate.p3d);
author = ECSTRING(common,ACETeam);
class TransportItems {
class ACE_fieldDressing {
name = "ACE_fieldDressing";
count = 50;
};
class ACE_morphine {
name = "ACE_morphine";
count = 25;
};
class ACE_epinephrine {
name = "ACE_epinephrine";
count = 25;
};
class ACE_bloodIV {
name = "ACE_bloodIV";
count = 15;
};
class ACE_bloodIV_500 {
name = "ACE_bloodIV_500";
count = 15;
};
class ACE_bloodIV_250 {
name = "ACE_bloodIV_250";
count = 15;
};
class ACE_bodyBag {
name = "ACE_bodyBag";
count = 10;
};
MACRO_ADDITEM(ACE_fieldDressing,50);
MACRO_ADDITEM(ACE_morphine,25);
MACRO_ADDITEM(ACE_epinephrine,25);
MACRO_ADDITEM(ACE_bloodIV,15);
MACRO_ADDITEM(ACE_bloodIV_500,15);
MACRO_ADDITEM(ACE_bloodIV_250,15);
MACRO_ADDITEM(ACE_bodyBag,10);
};
};
class ACE_medicalSupplyCrate_advanced: ACE_medicalSupplyCrate {
displayName = CSTRING(medicalSupplyCrate_advanced);
class TransportItems {
class ACE_fieldDressing {
name = "ACE_fieldDressing";
count = 25;
};
class ACE_packingBandage {
name = "ACE_packingBandage";
count = 25;
};
class ACE_elasticBandage {
name = "ACE_elasticBandage";
count = 25;
};
class ACE_tourniquet {
name = "ACE_tourniquet";
count = 15;
};
class ACE_morphine {
name = "ACE_morphine";
count = 15;
};
class ACE_atropine {
name = "ACE_atropine";
count = 15;
};
class ACE_epinephrine {
name = "ACE_epinephrine";
count = 15;
};
class ACE_plasmaIV {
name = "ACE_plasmaIV";
count = 7;
};
class ACE_plasmaIV_500 {
name = "ACE_plasmaIV_500";
count = 7;
};
class ACE_plasmaIV_250 {
name = "ACE_plasmaIV_250";
count = 7;
};
class ACE_salineIV {
name = "ACE_salineIV";
count = 7;
};
class ACE_salineIV_500 {
name = "ACE_salineIV_500";
count = 7;
};
class ACE_salineIV_250 {
name = "ACE_salineIV_250";
count = 7;
};
class ACE_bloodIV {
name = "ACE_bloodIV";
count = 7;
};
class ACE_bloodIV_500 {
name = "ACE_bloodIV_500";
count = 7;
};
class ACE_bloodIV_250 {
name = "ACE_bloodIV_250";
count = 7;
};
class ACE_quikClot {
name = "ACE_quikclot";
count = 20;
};
class ACE_personalAidKit {
name = "ACE_personalAidKit";
count = 3;
};
class ACE_surgicalKit {
name = "ACE_surgicalKit";
count = 2;
};
class ACE_bodyBag {
name = "ACE_bodyBag";
count = 5;
};
MACRO_ADDITEM(ACE_fieldDressing,25);
MACRO_ADDITEM(ACE_packingBandage,25);
MACRO_ADDITEM(ACE_elasticBandage,25);
MACRO_ADDITEM(ACE_tourniquet,15);
MACRO_ADDITEM(ACE_morphine,15);
MACRO_ADDITEM(ACE_atropine,15);
MACRO_ADDITEM(ACE_epinephrine,15);
MACRO_ADDITEM(ACE_plasmaIV,7);
MACRO_ADDITEM(ACE_plasmaIV_500,7);
MACRO_ADDITEM(ACE_plasmaIV_250,7);
MACRO_ADDITEM(ACE_salineIV,7);
MACRO_ADDITEM(ACE_salineIV_500,7);
MACRO_ADDITEM(ACE_salineIV_250,7);
MACRO_ADDITEM(ACE_bloodIV,7);
MACRO_ADDITEM(ACE_bloodIV_500,7);
MACRO_ADDITEM(ACE_bloodIV_250,7);
MACRO_ADDITEM(ACE_quikClot,20);
MACRO_ADDITEM(ACE_personalAidKit,3);
MACRO_ADDITEM(ACE_surgicalKit,2);
MACRO_ADDITEM(ACE_bodyBag,5);
};
};
};

View File

@ -189,7 +189,7 @@ class CfgWeapons {
class ACE_quikclot: ACE_ItemCore {
scope = 2;
displayName = CSTRING(QuikClot_Display);
model = QUOTE(PATHTOF(data\QuikClot.p3d))
model = QUOTE(PATHTOF(data\QuikClot.p3d));
picture = QUOTE(PATHTOF(ui\items\quickclot_x_ca.paa));
descriptionShort = CSTRING(QuikClot_Desc_Short);
descriptionUse = CSTRING(QuikClot_Desc_Use);

View File

@ -12,6 +12,7 @@ class CfgPatches {
};
};
#include "CfgActions.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgFactionClasses.hpp"
#include "CfgVehicles.hpp"
@ -22,6 +23,3 @@ class CfgPatches {
#include "UI\RscTitles.hpp"
#include "UI\triagecard.hpp"
class ACE_Extensions {
extensions[] += {"ace_medical"};
};

View File

@ -17,7 +17,7 @@
#include "script_component.hpp"
private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_usersOfItems", "_weaponSelect"];
private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_usersOfItems", "_weaponSelect", "_lastAnim"];
_args = _this select 0;
_caller = _args select 0;
@ -30,7 +30,17 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
_caller removeWeapon "ACE_FakePrimaryWeapon";
};
if (vehicle _caller == _caller) then {
[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation);
_lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""];
//Don't play another medic animation (when player is rapidily treating)
TRACE_2("Reseting to old animation", animationState player, _lastAnim);
switch (true) do {
case (_lastAnim == "AinvPknlMstpSlayWrflDnon_medic"): {_lastAnim = "AmovPknlMstpSrasWrflDnon"};
case (_lastAnim == "AinvPpneMstpSlayWrflDnon_medic"): {_lastAnim = "AmovPpneMstpSrasWrflDnon"};
case (_lastAnim == "AinvPknlMstpSlayWnonDnon_medic"): {_lastAnim = "AmovPknlMstpSnonWnonDnon"};
case (_lastAnim == "AinvPpneMstpSlayWpstDnon_medic"): {_lastAnim = "AinvPpneMstpSlayWpstDnon"};
case (_lastAnim == "AinvPknlMstpSlayWpstDnon_medic"): {_lastAnim = "AmovPknlMstpSrasWpstDnon"};
};
[_caller, _lastAnim, 1] call EFUNC(common,doAnimation);
};
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];

View File

@ -17,7 +17,7 @@
#include "script_component.hpp"
private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_weaponSelect"];
private ["_args", "_caller", "_target","_selectionName","_className","_config","_callback", "_weaponSelect", "_lastAnim"];
_args = _this select 0;
_caller = _args select 0;
_target = _args select 1;
@ -28,7 +28,17 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
_caller removeWeapon "ACE_FakePrimaryWeapon";
};
if (vehicle _caller == _caller) then {
[_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation);
_lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""];
//Don't play another medic animation (when player is rapidily treating)
TRACE_2("Reseting to old animation", animationState player, _lastAnim);
switch (true) do {
case (_lastAnim == "AinvPknlMstpSlayWrflDnon_medic"): {_lastAnim = "AmovPknlMstpSrasWrflDnon"};
case (_lastAnim == "AinvPpneMstpSlayWrflDnon_medic"): {_lastAnim = "AmovPpneMstpSrasWrflDnon"};
case (_lastAnim == "AinvPknlMstpSlayWnonDnon_medic"): {_lastAnim = "AmovPknlMstpSnonWnonDnon"};
case (_lastAnim == "AinvPpneMstpSlayWpstDnon_medic"): {_lastAnim = "AinvPpneMstpSlayWpstDnon"};
case (_lastAnim == "AinvPknlMstpSlayWpstDnon_medic"): {_lastAnim = "AmovPknlMstpSrasWpstDnon"};
};
[_caller, _lastAnim, 1] call EFUNC(common,doAnimation);
};
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];

View File

@ -39,25 +39,4 @@ GVAR(newWaypointPosition) = [];
GVAR(currentWaypoint) = -1;
GVAR(rangeFinderPositionASL) = [];
GVAR(mapAltitude) = getNumber (configFile >> "CfgWorlds" >> worldName >> "elevationOffset");
private ["_worldMapLong", "_worldMapLat", "_zone", "_band", "_squareID"];
//Calculate the map's MGRS:
_worldMapLong = getNumber (configFile >> "CfgWorlds" >> worldName >> "longitude");
_worldMapLat = getNumber (configFile >> "CfgWorlds" >> worldName >> "latitude");
//Pull UTM grid from world's long/lat
_zone = 1 + (floor ((_worldMapLong + 180) / 6));
_band = "Z";
if (_worldMapLat <= -80) then {
_band = "A";
} else {
if (_worldMapLat < 84) then {
_band = "CDEFGHJKLMNPQRSTUVWXX" select [(floor ((_worldMapLat / 8) + 10)), 1];
};
};
//calculating square ID from long/lat is a pain in the ass, just fake it unless someone wants to actualy do this
_squareID = if ((count worldName) > 2) then {toUpper(worldName select [0,2])} else {"XG"};
GVAR(mgrsGridZoneDesignator) = format ["%1%2 %3", _zone, _band, _squareID];
GVAR(mgrsGridZoneDesignator) = format ["%1 %2",EGVAR(common,MGRS_data) select 0, EGVAR(common,MGRS_data) select 1];

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
private ["_display", "_editText", "_gridPosTuple", "_actualPos"];
private ["_display", "_editText", "_actualPos"];
PARAMS_1(_keypadButton);
disableSerialization;
@ -34,8 +34,7 @@ _editText = ctrlText (_display displayCtrl IDC_MODEMARK_CORDSEDIT);
switch (_keypadButton) do {
case ("ok"): {
if ((count GVAR(newWaypointPosition)) == 0) then {
_gridPosTuple = [_editText] call BIS_fnc_gridToPos;
_actualPos = [(((_gridPosTuple select 0) select 0) + 0.5 * ((_gridPosTuple select 1) select 0)), (((_gridPosTuple select 0) select 1) + 0.5 * ((_gridPosTuple select 1) select 1))];
_actualPos = [_editText, true] call EFUNC(common,getMapPosFromGrid);
_actualPos set [2, (getTerrainHeightASL _actualPos)];
GVAR(newWaypointPosition) = _actualPos;
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString", "_daylight"];
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString"];
disableSerialization;
_display = displayNull;
@ -37,18 +37,14 @@ _waypoints = [] call FUNC(deviceGetWaypoints);
switch (GVAR(currentApplicationPage)) do {
case (APP_MODE_INFODISPLAY): {
//Easting/Northing:
_posString = mapGridPosition ACE_player;
_eastingText = "";
_northingText = "";
if (count _posString > 0) then {
_eastingText = (_posString select [0, ((count _posString)/2)]) + "e";
_northingText = (_posString select [(count _posString)/2, (count _posString - 1)]) + "n";
};
_posString = [getPos ACE_player] call EFUNC(common,getMapGridFromPos);
_eastingText = (_posString select 0) + "e";
_northingText = (_posString select 1) + "n";
(_display displayCtrl IDC_MODEDISPLAY_EASTING) ctrlSetText _eastingText;
(_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText;
//Elevation:
_numASL = ((getPosASL ace_player) select 2) + GVAR(mapAltitude);
_numASL = ((getPosASL ace_player) select 2) + EGVAR(common,mapAltitude);
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
(_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText;
@ -82,7 +78,8 @@ case (APP_MODE_INFODISPLAY): {
if (GVAR(currentWaypoint) == -2) then {
if (!(GVAR(rangeFinderPositionASL) isEqualTo [])) then {
_targetPosName = format ["[%1]", (mapGridPosition GVAR(rangeFinderPositionASL))];
_targetPos = [GVAR(rangeFinderPositionASL)] call EFUNC(common,getMapGridFromPos);
_targetPosName = format ["[%1 %2 %3]", EGVAR(common,MGRS_data) select 1, _targetPos select 0, _targetPos select 1];
_targetPosLocationASL = GVAR(rangeFinderPositionASL);
};
} else {
@ -100,7 +97,7 @@ case (APP_MODE_INFODISPLAY): {
};
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
_numASL = (_targetPosLocationASL select 2) + GVAR(mapAltitude);
_numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude);
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
};
@ -136,7 +133,8 @@ case (APP_MODE_COMPASS): {
if (GVAR(currentWaypoint) == -2) then {
if (!(GVAR(rangeFinderPositionASL) isEqualTo [])) then {
_targetPosName = format ["[%1]", (mapGridPosition GVAR(rangeFinderPositionASL))];
_targetPos = [GVAR(rangeFinderPositionASL)] call EFUNC(common,getMapGridFromPos);
_targetPosName = format ["[%1 %2 %3]", EGVAR(common,MGRS_data) select 1, _targetPos select 0, _targetPos select 1];
_targetPosLocationASL = GVAR(rangeFinderPositionASL);
};
} else {

View File

@ -306,6 +306,7 @@
<Polish>Wypełnienie mapy MicroDAGR</Polish>
<Spanish>Relleno del mapa MicroDAGR</Spanish>
<Czech>MicroDAGR - Vyplnění mapy</Czech>
<German>MicroDAGR-Kartenfüllung</German>
<Portuguese>Preenchimento de mapa do MicroDAGR</Portuguese>
</Key>
<Key ID="STR_ACE_MicroDAGR_MapDataAvailable_DisplayName">
@ -313,6 +314,7 @@
<Polish>Wypełnienie mapy MicroDAGR</Polish>
<Spanish>Relleno del mapa MicroDAGR</Spanish>
<Czech>MicroDAGR - Vyplnění mapy</Czech>
<German>MicroDAGR-Kartenfüllung</German>
<Portuguese>Preenchimento de mapa do MicroDAGR</Portuguese>
</Key>
<Key ID="STR_ACE_MicroDAGR_MapDataAvailable_Description">
@ -356,4 +358,4 @@
<Portuguese>Controla quantos dados são preenchidos nos itens microDAGR. Menos dados restringe a visualização de mapa para mostrar menos informações no minimapa&lt;br/&gt;Fonte: MicroDAGR.pbo</Portuguese>
</Key>
</Package>
</Project>
</Project>

View File

@ -23,14 +23,15 @@ class CfgVehicles {
};
class StaticMortar: StaticWeapon {
class Turrets: Turrets {
class MainTurret: MainTurret {
};
class MainTurret: MainTurret {};
};
};
class Mortar_01_base_F: StaticMortar {
class Turrets: Turrets {
class MainTurret: MainTurret {
turretInfoType = "ACE_Mk6_RscWeaponRangeArtillery";
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
class ACE_SelfActions {
@ -58,7 +59,7 @@ class CfgVehicles {
displayName = CSTRING(airResistanceEnabled_DisplayName);
description = CSTRING(airResistanceEnabled_Description);
typeName = "BOOL";
defaultValue = 1;
defaultValue = 0;
};
class allowComputerRangefinder {
displayName = CSTRING(allowComputerRangefinder_DisplayName);

View File

@ -3,8 +3,17 @@ class RscInGameUI {
class CA_IGUI_elements_group: RscControlsGroup {};
};
class ACE_Mk6_RscWeaponRangeArtillery: RscWeaponRangeArtillery {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_Mk6_RscWeaponRangeArtillery',(_this select 0))]; _this call FUNC(turretDisplayLoaded););
controls[] = {"ACE_MILS_GROUP", "CA_IGUI_elements_group","CA_RangeElements_group"};
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_Mk6_RscWeaponRangeArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Mk6Mortar')])] call EFUNC(common,localEvent););
controls[] = {"ACE_ChargeDisplay", "ACE_MILS_GROUP", "CA_IGUI_elements_group","CA_RangeElements_group"};
class ACE_ChargeDisplay: RscStructuredText {
idc = 80085;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0, 0, 0, 0.1};
x = "(profilenamespace getvariable ['IGUI_GRID_WEAPON_X', ((safezoneX + safezoneW) - (12.4 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))])";
y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])";
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class ACE_MILS_GROUP: CA_IGUI_elements_group {
idc = 80170;
class controls {

View File

@ -3,3 +3,4 @@
if (!hasInterface) exitWith {};
["playerVehicleChanged", {_this call FUNC(handlePlayerVehicleChanged);}] call EFUNC(common,addEventHandler);
["infoDisplayChanged", {_this call FUNC(turretDisplayLoaded);}] call EFUNC(common,addEventHandler);

Some files were not shown because too many files have changed in this diff Show More