diff --git a/addons/attach/script_component.hpp b/addons/attach/script_component.hpp index c09a5b97e1..6d468d89c1 100644 --- a/addons/attach/script_component.hpp +++ b/addons/attach/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_ATTACH - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_ATTACH - #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH + #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/ballistics/scripts/initTargetWall.sqf b/addons/ballistics/scripts/initTargetWall.sqf index dd1f42bb7d..b09d5897bc 100644 --- a/addons/ballistics/scripts/initTargetWall.sqf +++ b/addons/ballistics/scripts/initTargetWall.sqf @@ -4,10 +4,10 @@ _wall = _this select 0; if (local _wall) then { - _paper = "UserTexture_1x2_F" createVehicle position _wall; + _paper = "UserTexture_1x2_F" createVehicle position _wall; - _paper attachTo [_wall, [0,-0.02,0.6]]; - _paper setDir getDir _wall; + _paper attachTo [_wall, [0,-0.02,0.6]]; + _paper setDir getDir _wall; - _paper setObjectTextureGlobal [0, QUOTE(PATHTOF(textures\target_ca.paa))]; + _paper setObjectTextureGlobal [0, QUOTE(PATHTOF(textures\target_ca.paa))]; }; diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 99815a08a7..ef46b23706 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -29,7 +29,7 @@ private "_index"; _index = _conditionNames find _conditionName; if (_index == -1) then { - _index = count _conditionNames; + _index = count _conditionNames; }; _conditionNames set [_index, _conditionName]; diff --git a/addons/common/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf index c3d101a37e..8f5e50289f 100644 --- a/addons/common/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -15,28 +15,28 @@ _id = _this select 0; _show = if (count _this > 1) then {_this select 1} else {false}; if (isnil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { - GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; + GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; }; if (typeName _show == typeName 0) then { - _show = (_show == 1); + _show = (_show == 1); }; if (_show) then { - GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushback _id; - // show blur - if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102]; - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9]; - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true; - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectCommit 0; - }; + GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushback _id; + // show blur + if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102]; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9]; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectCommit 0; + }; } else { - GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id]; - if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then { - // hide blur - if (!isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { - ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN); - GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil; - }; - }; + GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id]; + if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then { + // hide blur + if (!isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { + ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN); + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil; + }; + }; }; diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index 1fbc4e89aa..15cda902d7 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -34,13 +34,13 @@ #define Y_POS_ICONS_SECOND (TOP_SIDE + (1.1 * ICON_WIDTH)) // setting values -#define TOP_RIGHT_DOWN 1 -#define TOP_RIGHT_LEFT 2 -#define TOP_LEFT_DOWN 3 -#define TOP_LEFT_RIGHT 4 +#define TOP_RIGHT_DOWN 1 +#define TOP_RIGHT_LEFT 2 +#define TOP_LEFT_DOWN 3 +#define TOP_LEFT_RIGHT 4 // other constants -#define DEFAULT_TIME 6 +#define DEFAULT_TIME 6 private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"]; _iconId = _this select 0; @@ -53,68 +53,68 @@ disableSerialization; _list = missionNamespace getvariable [QGVAR(displayIconList),[]]; _refresh = { - private ["_allControls"]; - // Refreshing of all icons.. - _allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []]; - { - ctrlDelete _x; - }foreach _allControls; + private ["_allControls"]; + // Refreshing of all icons.. + _allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []]; + { + ctrlDelete _x; + }foreach _allControls; - _allControls = []; + _allControls = []; - private ["_ctrl", "_setting"]; - _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; - if (_setting > 0) then { - { - // +19000 because we want to make certain we are using free IDCs.. - _ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]); - _position = switch (_setting) do { - case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; - case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; - default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - }; - _ctrl ctrlSetPosition _position; - _ctrl ctrlsetText (_x select 1); - _ctrl ctrlSetTextColor (_x select 2); - _ctrl ctrlCommit 0; - _allControls pushback _ctrl; - }foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]); - }; - missionNamespace setvariable [QGVAR(displayIconListControls), _allControls]; + private ["_ctrl", "_setting"]; + _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; + if (_setting > 0) then { + { + // +19000 because we want to make certain we are using free IDCs.. + _ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]); + _position = switch (_setting) do { + case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; + default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + }; + _ctrl ctrlSetPosition _position; + _ctrl ctrlsetText (_x select 1); + _ctrl ctrlSetTextColor (_x select 2); + _ctrl ctrlCommit 0; + _allControls pushback _ctrl; + }foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]); + }; + missionNamespace setvariable [QGVAR(displayIconListControls), _allControls]; }; if (_show) then { - if ({(_x select 0 == _iconId)} count _list == 0) then { - _list pushback [_iconId, _icon, _color, time]; - } else { - { - if (_x select 0 == _iconId) exitwith { - _list set [_foreachIndex, [_iconId, _icon, _color, time]]; - }; - }foreach _list; - }; - missionNamespace setvariable [QGVAR(displayIconList), _list]; - call _refresh; + if ({(_x select 0 == _iconId)} count _list == 0) then { + _list pushback [_iconId, _icon, _color, time]; + } else { + { + if (_x select 0 == _iconId) exitwith { + _list set [_foreachIndex, [_iconId, _icon, _color, time]]; + }; + }foreach _list; + }; + missionNamespace setvariable [QGVAR(displayIconList), _list]; + call _refresh; - if (_timeAlive >= 0) then { - [{ + if (_timeAlive >= 0) then { + [{ [_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon); }, [_iconId], _timeAlive, _timeAlive] call EFUNC(common,waitAndExecute); - }; + }; } else { - if ({(_x select 0 == _iconId)} count _list == 1) then { - private "_newList"; - _newList = []; - { - if (_x select 0 != _iconId) then { - _newList pushback _x; - }; - }foreach _list; + if ({(_x select 0 == _iconId)} count _list == 1) then { + private "_newList"; + _newList = []; + { + if (_x select 0 != _iconId) then { + _newList pushback _x; + }; + }foreach _list; - missionNamespace setvariable [QGVAR(displayIconList), _newList]; - call _refresh; - }; + missionNamespace setvariable [QGVAR(displayIconList), _newList]; + call _refresh; + }; }; diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index a6f08cdd39..8a95172ea7 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -7,19 +7,19 @@ _var = _this select 0; _depth = _this select 1; _pad = ""; for "_i" from 0 to _depth do { - _pad = _pad + toString [9]; + _pad = _pad + toString [9]; }; _depth = _depth + 1; if(IS_ARRAY(_var)) then { - if((count _var) > 0) then { - diag_log text format["%1[", _pad]; - { - [_x, _depth] call FUNC(dumpArray); - } forEach _var; - diag_log text format["%1],", _pad]; - } else { - diag_log text format["%1[],", _pad]; - }; + if((count _var) > 0) then { + diag_log text format["%1[", _pad]; + { + [_x, _depth] call FUNC(dumpArray); + } forEach _var; + diag_log text format["%1],", _pad]; + } else { + diag_log text format["%1[],", _pad]; + }; } else { - diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)]; + diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)]; }; diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index b9afb8f7eb..acf81ff20a 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -6,42 +6,42 @@ diag_log text format["REGISTERED ACE PFH HANDLERS"]; diag_log text format["-------------------------------------------"]; if(!isNil "ACE_PFH_COUNTER") then { - { - private["_pfh"]; - _pfh = _x select 0; - diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ]; - } forEach ACE_PFH_COUNTER; + { + private["_pfh"]; + _pfh = _x select 0; + diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ]; + } forEach ACE_PFH_COUNTER; }; diag_log text format["ACE COUNTER RESULTS"]; diag_log text format["-------------------------------------------"]; { - private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; - _counterEntry = _x; - _iter = 0; - _total = 0; - _count = 0; - _averageResult = 0; - if( (count _counterEntry) > 3) then { - // calc - { - if(_iter > 2) then { - _count = _count + 1; - _delta = (_x select 1) - (_x select 0); - - _total = _total + _delta; - }; - _iter = _iter + 1; - } forEach _counterEntry; - - // results - _averageResult = (_total / _count) * 1000; - - // dump results - diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult]; - } else { - diag_log text format["%1: No results", (_counterEntry select 0) ]; - }; + private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; + _counterEntry = _x; + _iter = 0; + _total = 0; + _count = 0; + _averageResult = 0; + if( (count _counterEntry) > 3) then { + // calc + { + if(_iter > 2) then { + _count = _count + 1; + _delta = (_x select 1) - (_x select 0); + + _total = _total + _delta; + }; + _iter = _iter + 1; + } forEach _counterEntry; + + // results + _averageResult = (_total / _count) * 1000; + + // dump results + diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult]; + } else { + diag_log text format["%1: No results", (_counterEntry select 0) ]; + }; } forEach ACE_COUNTERS; /* @@ -49,21 +49,21 @@ diag_log text format["-------------------------------------------"]; diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"]; diag_log text format["-------------------------------------------"]; { - private["_delay"]; - _delay = _x select 2; - //if(_delay > 0) then { _delay = _delay / 1000; }; - - diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)]; + private["_delay"]; + _delay = _x select 2; + //if(_delay > 0) then { _delay = _delay / 1000; }; + + diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)]; } forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER; // Dump PFH Trackers diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"]; diag_log text format["-------------------------------------------"]; { - private["_delta"]; - _delta = _x select 1; - //if(_delta > 0) then { _delta = _delta / 1000; }; - diag_log text format[" DELTA: %1s", _delta]; + private["_delta"]; + _delta = _x select 1; + //if(_delta > 0) then { _delta = _delta / 1000; }; + diag_log text format[" DELTA: %1s", _delta]; } forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER; //{ diff --git a/addons/common/functions/fnc_logModEntries.sqf b/addons/common/functions/fnc_logModEntries.sqf index 827802ad3f..4b94c557bc 100644 --- a/addons/common/functions/fnc_logModEntries.sqf +++ b/addons/common/functions/fnc_logModEntries.sqf @@ -7,11 +7,11 @@ _configs = "true" configClasses (configFile >> _this); _entries = []; { - { - _name = toLower configName _x; - if !(_name in _entries) then { - diag_log text _name; - _entries pushBack _name; - }; - } forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false]; + { + _name = toLower configName _x; + if !(_name in _entries) then { + diag_log text _name; + _entries pushBack _name; + }; + } forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false]; } forEach _configs; diff --git a/addons/common/functions/fnc_sendDisplayInformationTo.sqf b/addons/common/functions/fnc_sendDisplayInformationTo.sqf index f22894e057..33254fa81e 100644 --- a/addons/common/functions/fnc_sendDisplayInformationTo.sqf +++ b/addons/common/functions/fnc_sendDisplayInformationTo.sqf @@ -18,30 +18,30 @@ _type = [_this, 3, 0,[0]] call BIS_fnc_Param; _parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc); - } else { - if (isLocalized _title) then { - _title = localize _title; - }; - _localizationArray = [_title]; - { - _localizationArray pushback _x; - }foreach _parameters; - _title = format _localizationArray; + if (!local _reciever) then { + [_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc); + } else { + if (isLocalized _title) then { + _title = localize _title; + }; + _localizationArray = [_title]; + { + _localizationArray pushback _x; + }foreach _parameters; + _title = format _localizationArray; - { - if (isLocalized _x) then { - _localizationArray = [localize _x]; - { - _localizationArray pushback _x; - }foreach _parameters; + { + if (isLocalized _x) then { + _localizationArray = [localize _x]; + { + _localizationArray pushback _x; + }foreach _parameters; - _content set [_foreachIndex, format _localizationArray]; - }; + _content set [_foreachIndex, format _localizationArray]; + }; - }foreach _content; + }foreach _content; - [_title,_content,_type] call EFUNC(common,displayInformation); - }; + [_title,_content,_type] call EFUNC(common,displayInformation); + }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_sendDisplayMessageTo.sqf b/addons/common/functions/fnc_sendDisplayMessageTo.sqf index 3c5b399659..e042f69939 100644 --- a/addons/common/functions/fnc_sendDisplayMessageTo.sqf +++ b/addons/common/functions/fnc_sendDisplayMessageTo.sqf @@ -18,29 +18,29 @@ _type = [_this, 3, 0,[0]] call BIS_fnc_Param; _parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QUOTE(FUNC(sendDisplayMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc); - } else { + if (!local _reciever) then { + [_this, QUOTE(FUNC(sendDisplayMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc); + } else { - if (isLocalized _title) then { - _title = localize _title; - }; - if (isLocalized _content) then { - _content = localize _content; - }; + if (isLocalized _title) then { + _title = localize _title; + }; + if (isLocalized _content) then { + _content = localize _content; + }; - _localizationArray = [_title]; - { - _localizationArray pushback _x; - }foreach _parameters; - _title = format _localizationArray; + _localizationArray = [_title]; + { + _localizationArray pushback _x; + }foreach _parameters; + _title = format _localizationArray; - _localizationArray = [_content]; - { - _localizationArray pushback _x; - }foreach _parameters; - _content = format _localizationArray; + _localizationArray = [_content]; + { + _localizationArray pushback _x; + }foreach _parameters; + _content = format _localizationArray; - [_title,_content,_type] call EFUNC(common,displayMessage); - }; + [_title,_content,_type] call EFUNC(common,displayMessage); + }; }; \ No newline at end of file diff --git a/addons/common/functions/script_component.hpp b/addons/common/functions/script_component.hpp index d1032476b6..95b7e86461 100644 --- a/addons/common/functions/script_component.hpp +++ b/addons/common/functions/script_component.hpp @@ -1,13 +1,13 @@ #include "\z\ace\addons\common\script_component.hpp" -#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)}) -#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo] -#define HANDLECATCH diag_log text _exception; assert(exception=="") +#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)}) +#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo] +#define HANDLECATCH diag_log text _exception; assert(exception=="") -#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\ - _callFrom = "";\ - _lineNo = -1;\ - if((count _this) > c) then {\ - _callFrom = _this select c;\ - _lineNo = _this select c+1;\ - }; \ No newline at end of file +#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\ + _callFrom = "";\ + _lineNo = -1;\ + if((count _this) > c) then {\ + _callFrom = _this select c;\ + _lineNo = _this select c+1;\ + }; \ No newline at end of file diff --git a/addons/disposable/script_component.hpp b/addons/disposable/script_component.hpp index 6d26a5431c..375e44147d 100644 --- a/addons/disposable/script_component.hpp +++ b/addons/disposable/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_ATTACH - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_ATTACH - #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH + #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index 2b44bf90d9..871c49db89 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -1,20 +1,20 @@ /* - Name: AGM_Drag_fnc_GetWeight - - Author(s): - L-H, edited by commy2 + Name: AGM_Drag_fnc_GetWeight + + Author(s): + L-H, edited by commy2 - Description: - Returns the weight of a crate. - - Parameters: - 0: OBJECT - Crate to get weight of - - Returns: - NUMBER - Weight - - Example: - _weight = Crate1 call AGM_Drag_fnc_GetWeight; + Description: + Returns the weight of a crate. + + Parameters: + 0: OBJECT - Crate to get weight of + + Returns: + NUMBER - Weight + + Example: + _weight = Crate1 call AGM_Drag_fnc_GetWeight; */ #include "script_component.hpp" @@ -25,24 +25,24 @@ _object = _this select 0; private ["_totalWeight", "_fnc","_fnc_Extra"]; _totalWeight = 0; _fnc_Extra = { - private ["_weight", "_items"]; - _items = _this select 0; - _weight = 0; - { - _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); - } foreach (_items select 0); - - _weight + private ["_weight", "_items"]; + _items = _this select 0; + _weight = 0; + { + _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); + } foreach (_items select 0); + + _weight }; _fnc = { - private ["_weight", "_items"]; - _items = _this select 0; - _weight = 0; - { - _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); - } foreach (_items select 0); - - _weight + private ["_weight", "_items"]; + _items = _this select 0; + _weight = 0; + { + _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); + } foreach (_items select 0); + + _weight }; _totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc); _totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra); diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index e3b40308c3..8ebf62090f 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -22,46 +22,46 @@ GVAR(CurrentSpeedDial) = 0; [{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); player addEventHandler ["Killed", { - private "_deadman"; - call FUNC(place_Cancel); - _deadman = [(_this select 0), "DeadManSwitch"] call FUNC(getPlacedExplosives); - { - [(_this select 0), -1, _x, true] call FUNC(detonateExplosive); - } count _deadman; + private "_deadman"; + call FUNC(place_Cancel); + _deadman = [(_this select 0), "DeadManSwitch"] call FUNC(getPlacedExplosives); + { + [(_this select 0), -1, _x, true] call FUNC(detonateExplosive); + } count _deadman; }]; player addEventHandler ["Take", { - private ["_item", "_getter", "_giver", "_config"]; - _item = _this select 2; - _getter = _this select 0; - _giver = _this select 1; + private ["_item", "_getter", "_giver", "_config"]; + _item = _this select 2; + _getter = _this select 0; + _giver = _this select 1; - _config = ConfigFile >> "CfgWeapons" >> _item; - if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { - private ["_clackerItems"]; - _clackerItems = _giver getVariable [QGVAR(Clackers), []]; - _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; + _config = ConfigFile >> "CfgWeapons" >> _item; + if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { + private ["_clackerItems"]; + _clackerItems = _giver getVariable [QGVAR(Clackers), []]; + _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; - _detonators = [_giver] call FUNC(getDetonators); - if (count _detonators == 0) then { - _giver setVariable [QGVAR(Clackers), nil, true]; - }; - }; + _detonators = [_giver] call FUNC(getDetonators); + if (count _detonators == 0) then { + _giver setVariable [QGVAR(Clackers), nil, true]; + }; + }; }]; player addEventHandler ["Put", { - private ["_item", "_getter", "_giver", "_config"]; - _item = _this select 2; - _getter = _this select 1; - _giver = _this select 0; + private ["_item", "_getter", "_giver", "_config"]; + _item = _this select 2; + _getter = _this select 1; + _giver = _this select 0; - _config = ConfigFile >> "CfgWeapons" >> _item; - if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { - private ["_clackerItems"]; - _clackerItems = _giver getVariable [QGVAR(Clackers), []]; - _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; + _config = ConfigFile >> "CfgWeapons" >> _item; + if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { + private ["_clackerItems"]; + _clackerItems = _giver getVariable [QGVAR(Clackers), []]; + _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; - _detonators = [_giver] call FUNC(getDetonators); - if (count _detonators == 0) then { - _giver setVariable [QGVAR(Clackers), nil, true]; - }; - }; + _detonators = [_giver] call FUNC(getDetonators); + if (count _detonators == 0) then { + _giver setVariable [QGVAR(Clackers), nil, true]; + }; + }; }]; diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index 4746dc66f5..b61daee3a4 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -28,9 +28,9 @@ _requiredItems = getArray(_config >> "requires"); _hasRequired = true; _detonators = [_unit] call FUNC(getDetonators); { - if !(_x in _detonators) exitWith{ - _hasRequired = false; - }; + if !(_x in _detonators) exitWith{ + _hasRequired = false; + }; } count _requiredItems; if !(_hasRequired) exitWith {}; @@ -39,6 +39,6 @@ _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> co _clacker = _unit getVariable [QGVAR(Clackers), []]; GVAR(PlacedCount) = GVAR(PlacedCount) + 1; _clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize "STR_ACE_Explosives_DetonateCode", - GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))]; + GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))]; _unit setVariable [QGVAR(Clackers), _clacker, true]; _unit sideChat format [localize "STR_ACE_Explosives_DetonateCode", GVAR(PlacedCount)]; diff --git a/addons/explosives/functions/fnc_addToSpeedDial.sqf b/addons/explosives/functions/fnc_addToSpeedDial.sqf index 142996e4c3..4f0772e601 100644 --- a/addons/explosives/functions/fnc_addToSpeedDial.sqf +++ b/addons/explosives/functions/fnc_addToSpeedDial.sqf @@ -22,16 +22,16 @@ _found = false; EXPLODE_2_PVT(_this,_name,_code); if ((_code) == "") ExitWith { - [_name] call FUNC(removeFromSpeedDial); + [_name] call FUNC(removeFromSpeedDial); }; { - if ((_x select 0) == _name) exitWith { - _speedDial set [_foreachindex, _this]; - _found = true; - }; + if ((_x select 0) == _name) exitWith { + _speedDial set [_foreachindex, _this]; + _found = true; + }; } foreach _speedDial; if (!_found) then { - _speedDial pushBack _this; + _speedDial pushBack _this; }; ace_player setVariable [QGVAR(SpeedDial), _speedDial]; diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index 5836c9e210..97bf9709b7 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -20,7 +20,7 @@ _unit = _this select 0; _explosive = _this select 1; if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "ACE_explodeOnDefuse") == 1) exitWith { - [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); + [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); }; _unit action ["Deactivate", _unit, _explosive]; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index 697c8eeed7..2285b9a8b8 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -6,8 +6,8 @@ * 0: Unit * 1: Max range (-1 to ignore) * 2: Explosive - * 0: Explosive - * 1: Fuse time + * 0: Explosive + * 1: Fuse time * * Return Value: * None @@ -29,23 +29,23 @@ _result = true; if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false}; if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then { - private ["_exp", "_previousExp"]; - _previousExp = _item select 0; - _exp = getText (ConfigFile >> "CfgAmmo" >> typeof (_previousExp) >> "ACE_Explosive"); - if (_exp != "") then { - _exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"]; - _exp setDir (getDir _previousExp); - _item set [0, _exp]; - _pos = getPosASL _previousExp; - deleteVehicle _previousExp; - _exp setPosASL _pos; - }; + private ["_exp", "_previousExp"]; + _previousExp = _item select 0; + _exp = getText (ConfigFile >> "CfgAmmo" >> typeof (_previousExp) >> "ACE_Explosive"); + if (_exp != "") then { + _exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"]; + _exp setDir (getDir _previousExp); + _item set [0, _exp]; + _pos = getPosASL _previousExp; + deleteVehicle _previousExp; + _exp setPosASL _pos; + }; }; [{ - _explosive = _this; - if (!isNull _explosive) then { - _explosive setDamage 1; - }; + _explosive = _this; + if (!isNull _explosive) then { + _explosive setDamage 1; + }; }, _item select 0, _item select 1, 0] call EFUNC(common,waitAndExecute); _result diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index 41b2a4a4f7..f00fa8a970 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -24,19 +24,19 @@ _unit setVariable [QGVAR(Dialing), true, true]; _ran = (ceil(random 8)) + 1; _arr = []; for [{_i=0}, {_i<_ran}, {_i=_i+1}] do { - _arr = _arr + ['.','..','...','']; + _arr = _arr + ['.','..','...','']; }; if (_unit == ace_player) then { - ctrlSetText [1400,"Calling"]; - [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); + ctrlSetText [1400,"Calling"]; + [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); } else { - private ["_explosive"]; - _explosive = [_code] call FUNC(getSpeedDialExplosive); - if ((count _explosive) > 0) then { - [{ - playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75]; - (_this select 0) setVariable [QGVAR(Dialing), false, true]; - }, [_unit,_explosive select 0], 0.25 * (count _arr - 4), 0] call EFUNC(common,waitAndExecute); - [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer); - }; + private ["_explosive"]; + _explosive = [_code] call FUNC(getSpeedDialExplosive); + if ((count _explosive) > 0) then { + [{ + playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75]; + (_this select 0) setVariable [QGVAR(Dialing), false, true]; + }, [_unit,_explosive select 0], 0.25 * (count _arr - 4), 0] call EFUNC(common,waitAndExecute); + [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer); + }; }; diff --git a/addons/explosives/functions/fnc_getDetonators.sqf b/addons/explosives/functions/fnc_getDetonators.sqf index 83e0087acc..26bde9b190 100644 --- a/addons/explosives/functions/fnc_getDetonators.sqf +++ b/addons/explosives/functions/fnc_getDetonators.sqf @@ -20,10 +20,10 @@ _items = (items _unit); _result = []; { - _config = ConfigFile >> "CfgWeapons" >> _x; - if (getNumber (_config >> "ACE_Detonator") == 1) then { - _result pushBack _x; - }; + _config = ConfigFile >> "CfgWeapons" >> _x; + if (getNumber (_config >> "ACE_Detonator") == 1) then { + _result pushBack _x; + }; } forEach _items; _result diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index 4ebcdb8f0b..1feddfabd9 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -20,29 +20,29 @@ private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"]; _unit = _this select 0; _filter = nil; if (count _this > 1) then { - _filter = ConfigFile >> "CfgACE_Triggers" >> (_this select 1); + _filter = ConfigFile >> "CfgACE_Triggers" >> (_this select 1); }; _clackerList = []; _adjustedList = false; _clackerList = _unit getVariable [QGVAR(Clackers), []]; _list = []; { - if isNull (_x select 0) then { - _clackerList set [_foreachIndex, "X"]; - _adjustedList = true; - } else { - if (isNil "_filter" || {(ConfigFile >> "CfgACE_Triggers" >> (_x select 4)) == _filter}) then { - _list pushBack _x; - }; - }; + if isNull (_x select 0) then { + _clackerList set [_foreachIndex, "X"]; + _adjustedList = true; + } else { + if (isNil "_filter" || {(ConfigFile >> "CfgACE_Triggers" >> (_x select 4)) == _filter}) then { + _list pushBack _x; + }; + }; } foreach _clackerList; if (_adjustedList) then { - _clackerList = _clackerList - ["X"]; - if (count _clackerList == 0) then { - _unit SetVariable [QGVAR(Clackers), nil, true]; - } else { - _unit SetVariable [QGVAR(Clackers), _clackerList, true]; - }; + _clackerList = _clackerList - ["X"]; + if (count _clackerList == 0) then { + _unit SetVariable [QGVAR(Clackers), nil, true]; + } else { + _unit SetVariable [QGVAR(Clackers), _clackerList, true]; + }; }; _list diff --git a/addons/explosives/functions/fnc_hasExplosives.sqf b/addons/explosives/functions/fnc_hasExplosives.sqf index ef1deef28a..794cebc57d 100644 --- a/addons/explosives/functions/fnc_hasExplosives.sqf +++ b/addons/explosives/functions/fnc_hasExplosives.sqf @@ -19,9 +19,9 @@ _result = false; _unit = _this select 0; _magazines = magazines _unit; { - if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith { - _result = true; - }; + if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith { + _result = true; + }; } count _magazines; _result diff --git a/addons/explosives/functions/fnc_openDetonateUI.sqf b/addons/explosives/functions/fnc_openDetonateUI.sqf index a14865bc20..fcea8b4b5c 100644 --- a/addons/explosives/functions/fnc_openDetonateUI.sqf +++ b/addons/explosives/functions/fnc_openDetonateUI.sqf @@ -23,39 +23,39 @@ _range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range"); _result = [_unit] call FUNC(getPlacedExplosives); _actions = [localize "STR_ACE_Explosives_DetonateMenu", localize "STR_ACE_Explosives_Detonate"] - call EFUNC(interaction,prepareSelectMenu); + call EFUNC(interaction,prepareSelectMenu); _count = 0; { - if (!isNull(_x select 0)) then { - _required = getArray (ConfigFile >> "CfgACE_Triggers" >> (_x select 4) >> "requires"); - if (_detonator in _required) then { - _item = ConfigFile >> "CfgMagazines" >> (_x select 3); - _actions = [ - _actions, - _x select 2, - getText(_item >> "picture"), - [_foreachIndex, _range] - ] call EFUNC(interaction,AddSelectableItem); - _count = _count + 1; - }; - }; + if (!isNull(_x select 0)) then { + _required = getArray (ConfigFile >> "CfgACE_Triggers" >> (_x select 4) >> "requires"); + if (_detonator in _required) then { + _item = ConfigFile >> "CfgMagazines" >> (_x select 3); + _actions = [ + _actions, + _x select 2, + getText(_item >> "picture"), + [_foreachIndex, _range] + ] call EFUNC(interaction,AddSelectableItem); + _count = _count + 1; + }; + }; } foreach _result; if (_count > 0) then { - [ - _actions, - { - [ - ACE_player, - [_this select 1] call EFUNC(common,toNumber), - (ACE_player getVariable [QGVAR(Clackers), []]) select ([_this select 0] call EFUNC(common,toNumber)), - false - ] call FUNC(detonateExplosive); - call EFUNC(interaction,hideMenu); - }, - {[ACE_player] call FUNC(openTransmitterUI);} - ] call EFUNC(interaction,openSelectMenu); + [ + _actions, + { + [ + ACE_player, + [_this select 1] call EFUNC(common,toNumber), + (ACE_player getVariable [QGVAR(Clackers), []]) select ([_this select 0] call EFUNC(common,toNumber)), + false + ] call FUNC(detonateExplosive); + call EFUNC(interaction,hideMenu); + }, + {[ACE_player] call FUNC(openTransmitterUI);} + ] call EFUNC(interaction,openSelectMenu); }else{ - call EFUNC(interaction,hideMenu); - [ACE_player] call FUNC(openTransmitterUI); - [localize "STR_ACE_Explosives_NoExplosivesAvailable"] call EFUNC(common,displayTextStructured); + call EFUNC(interaction,hideMenu); + [ACE_player] call FUNC(openTransmitterUI); + [localize "STR_ACE_Explosives_NoExplosivesAvailable"] call EFUNC(common,displayTextStructured); }; diff --git a/addons/explosives/functions/fnc_openPlaceUI.sqf b/addons/explosives/functions/fnc_openPlaceUI.sqf index 6eb2d478bf..a1b839ec35 100644 --- a/addons/explosives/functions/fnc_openPlaceUI.sqf +++ b/addons/explosives/functions/fnc_openPlaceUI.sqf @@ -22,34 +22,34 @@ _mags = magazines _unit; _list = []; _itemCount = []; { - _item = ConfigFile >> "CfgMagazines" >> _x; - if (getNumber(_item >> "ACE_Placeable") == 1) then { - _index = _list find _item; - if (_index != -1) then { - _itemCount set [_index, (_itemCount select _index) + 1]; - } else { - _list pushBack _item; - _itemCount pushBack 1; - }; - }; + _item = ConfigFile >> "CfgMagazines" >> _x; + if (getNumber(_item >> "ACE_Placeable") == 1) then { + _index = _list find _item; + if (_index != -1) then { + _itemCount set [_index, (_itemCount select _index) + 1]; + } else { + _list pushBack _item; + _itemCount pushBack 1; + }; + }; } forEach _mags; _actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosives_Place"] - call EFUNC(interaction,prepareSelectMenu); + call EFUNC(interaction,prepareSelectMenu); { - _actions = [ - _actions, - format [getText(_x >> "displayName") + " (%1)", _itemCount select _foreachIndex], - getText(_x >> "picture"), - configName _x - ] call EFUNC(interaction,AddSelectableItem); + _actions = [ + _actions, + format [getText(_x >> "displayName") + " (%1)", _itemCount select _foreachIndex], + getText(_x >> "picture"), + configName _x + ] call EFUNC(interaction,AddSelectableItem); } foreach _list; [ - _actions, - { - [_this] call FUNC(openTriggerSelectionUI); - }, - { - call EFUNC(interaction,hideMenu); - } + _actions, + { + [_this] call FUNC(openTriggerSelectionUI); + }, + { + call EFUNC(interaction,hideMenu); + } ] call EFUNC(interaction,openSelectMenu); diff --git a/addons/explosives/functions/fnc_openTransmitterUI.sqf b/addons/explosives/functions/fnc_openTransmitterUI.sqf index f90636474e..275aef4dd0 100644 --- a/addons/explosives/functions/fnc_openTransmitterUI.sqf +++ b/addons/explosives/functions/fnc_openTransmitterUI.sqf @@ -19,30 +19,30 @@ _unit = _this select 0; _items = (items _unit); _actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"] - call EFUNC(interaction,prepareSelectMenu); + call EFUNC(interaction,prepareSelectMenu); _detonators = [_unit] call FUNC(getDetonators); { - _config = ConfigFile >> "CfgWeapons" >> _x; - _actions = [ - _actions, - getText(_config >> "displayName"), - getText(_config >> "picture"), - _x - ] call EFUNC(interaction,addSelectableItem); + _config = ConfigFile >> "CfgWeapons" >> _x; + _actions = [ + _actions, + getText(_config >> "displayName"), + getText(_config >> "picture"), + _x + ] call EFUNC(interaction,addSelectableItem); } count _detonators; if (count _detonators == 0) then { - call EFUNC(interaction,hideMenu); - "ACE_Explosives" call EFUNC(interaction,openMenuSelf); - [format[localize "STR_ACE_Explosives_NoTriggersAvailable", "player"]] call EFUNC(Common,displayTextStructured); + call EFUNC(interaction,hideMenu); + "ACE_Explosives" call EFUNC(interaction,openMenuSelf); + [format[localize "STR_ACE_Explosives_NoTriggersAvailable", "player"]] call EFUNC(Common,displayTextStructured); }else{ - [ - _actions, - { - [ACE_player, _this] call FUNC(openDetonateUI); - }, - { - call EFUNC(interaction,hideMenu); - } - ] call EFUNC(interaction,openSelectMenu); + [ + _actions, + { + [ACE_player, _this] call FUNC(openDetonateUI); + }, + { + call EFUNC(interaction,hideMenu); + } + ] call EFUNC(interaction,openSelectMenu); }; diff --git a/addons/explosives/functions/fnc_openTriggerSelectionUI.sqf b/addons/explosives/functions/fnc_openTriggerSelectionUI.sqf index 011bda9bee..ce5efd7dff 100644 --- a/addons/explosives/functions/fnc_openTriggerSelectionUI.sqf +++ b/addons/explosives/functions/fnc_openTriggerSelectionUI.sqf @@ -21,37 +21,37 @@ _detonators = [ACE_player] call FUNC(getDetonators); _triggerTypes = [_magazine] call FUNC(triggerType); _magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; _actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"] - call EFUNC(interaction,prepareSelectMenu); + call EFUNC(interaction,prepareSelectMenu); _count = 0; { - _required = getArray (_x >> "requires"); - _hasRequiredItems = true; - { - if !(_x in _detonators) exitWith { - _hasRequiredItems = false; - }; - } count _required; - if (_hasRequiredItems) then { - _actions = [ - _actions, - if(isText(_magTriggers >> configName _x >> "displayName"))then{getText(_magTriggers >> configName _x >> "displayName")}else{getText(_x >> "displayName")}, - if(isText(_magTriggers >> configName _x >> "picture"))then{getText(_magTriggers >> configName _x >> "picture")}else{getText(_x >> "picture")}, - [configName _x, _magazine] - ] call EFUNC(interaction,addSelectableItem); - _count = _count + 1; - }; + _required = getArray (_x >> "requires"); + _hasRequiredItems = true; + { + if !(_x in _detonators) exitWith { + _hasRequiredItems = false; + }; + } count _required; + if (_hasRequiredItems) then { + _actions = [ + _actions, + if(isText(_magTriggers >> configName _x >> "displayName"))then{getText(_magTriggers >> configName _x >> "displayName")}else{getText(_x >> "displayName")}, + if(isText(_magTriggers >> configName _x >> "picture"))then{getText(_magTriggers >> configName _x >> "picture")}else{getText(_x >> "picture")}, + [configName _x, _magazine] + ] call EFUNC(interaction,addSelectableItem); + _count = _count + 1; + }; } count _triggerTypes; if (_count == 0) then { - [ACE_player] call FUNC(openPlaceUI); - [format[localize "STR_ACE_Explosives_NoTriggersAvailable", - getText(configFile >> "CfgMagazines" >> _magazine >> "DisplayName")]] call EFUNC(Common,displayTextStructured); + [ACE_player] call FUNC(openPlaceUI); + [format[localize "STR_ACE_Explosives_NoTriggersAvailable", + getText(configFile >> "CfgMagazines" >> _magazine >> "DisplayName")]] call EFUNC(Common,displayTextStructured); }else{ - [ - _actions, - { - [_this select 1, _this select 0] call FUNC(selectTrigger); - }, - {[ACE_player] call FUNC(openPlaceUI);} - ] call EFUNC(interaction,openSelectMenu); + [ + _actions, + { + [_this select 1, _this select 0] call FUNC(selectTrigger); + }, + {[ACE_player] call FUNC(openPlaceUI);} + ] call EFUNC(interaction,openSelectMenu); }; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index ce43698309..1a09d531d0 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -16,7 +16,7 @@ * * Example: * _explosive = [player, player modelToWorldVisual [0,0.5, 0.1], 134, - * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; + * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; * * Public: Yes */ @@ -30,32 +30,32 @@ _triggerConfig = _this select 4; _triggerSpecificVars = _this select 5; _setDir = true; if (count _this > 6) then { - _setDir = _this select 6; + _setDir = _this select 6; }; if (isNil "_triggerConfig") exitWith { - diag_log format ["ACE_Explosives: Error config not passed to PlaceExplosive: %1", _this]; - objNull + diag_log format ["ACE_Explosives: Error config not passed to PlaceExplosive: %1", _this]; + objNull }; _magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig; _triggerConfig = ConfigFile >> "CfgACE_Triggers" >> _triggerConfig; if (isNil "_triggerConfig") exitWith { - diag_log format ["ACE_Explosives: Error config not found in PlaceExplosive: %1", _this]; - objNull + diag_log format ["ACE_Explosives: Error config not found in PlaceExplosive: %1", _this]; + objNull }; _ammo = getText(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ammo"); if (isText(_magazineTrigger >> "ammo")) then { - _ammo = getText (_magazineTrigger >> "ammo"); + _ammo = getText (_magazineTrigger >> "ammo"); }; _triggerSpecificVars pushBack _triggerConfig; _explosive = createVehicle [_ammo, _pos, [], 0, "NONE"]; if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars] - call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive}; + call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive}; if (_setDir) then { - [[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)] - call EFUNC(common,execRemoteFnc); + [[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)] + call EFUNC(common,execRemoteFnc); }; _explosive diff --git a/addons/explosives/functions/fnc_place_Approve.sqf b/addons/explosives/functions/fnc_place_Approve.sqf index 77cfbb92a1..2eb7b7fde9 100644 --- a/addons/explosives/functions/fnc_place_Approve.sqf +++ b/addons/explosives/functions/fnc_place_Approve.sqf @@ -16,8 +16,8 @@ */ #include "script_component.hpp" if (GVAR(pfeh_running)) then { - [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); - GVAR(pfeh_running) = false; + [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); + GVAR(pfeh_running) = false; }; private ["_mag", "_setup", "_player"]; _setup = GVAR(Setup); @@ -29,77 +29,77 @@ _player = ACE_player; [_player, "MenuBack", _player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); call EFUNC(interaction,hideMouseHint); if ((_setup getVariable [QGVAR(Class), ""]) == "") exitWith { - deleteVehicle _setup; + deleteVehicle _setup; }; _dir = (getDir _setup); if (_dir > 180) then { - _dir = _dir - 180; + _dir = _dir - 180; } else { - _dir = 180 + _dir; + _dir = 180 + _dir; }; _setup setVariable [QGVAR(Direction), _dir]; _player setVariable [QGVAR(PlantingExplosive), true]; _setup addEventHandler ["EpeContactStart", { - if (!((_this select 0) getVariable [QGVAR(Handled), false])) then { - private ["_player", "_pos", "_attachTo"]; - _player = ACE_player; - _player setVariable [QGVAR(PlantingExplosive), false]; - _pos = getPosATL (_this select 0); - (_this select 0) enableSimulationGlobal false; - if (surfaceIsWater _pos) then { - _pos = getPosASL (_this select 0); - (_this select 0) setPosASL _pos; - }else{ - (_this select 0) setPosATL _pos; - }; - (_this select 0) setVariable [QGVAR(Handled), true]; - _attachTo = objNull; - if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then { - _attachTo = (_this select 1); - }; - [(_this select 0),_attachTo, _pos] spawn { // TODO: Change to scheduled delay execution - private ["_mag", "_setup", "_dir", "_player"]; - _setup = _this select 0; - _player = ACE_player; - _mag = _setup getVariable [QGVAR(Class), ""]; - _dir = _setup getVariable [QGVAR(Direction), 0]; + if (!((_this select 0) getVariable [QGVAR(Handled), false])) then { + private ["_player", "_pos", "_attachTo"]; + _player = ACE_player; + _player setVariable [QGVAR(PlantingExplosive), false]; + _pos = getPosATL (_this select 0); + (_this select 0) enableSimulationGlobal false; + if (surfaceIsWater _pos) then { + _pos = getPosASL (_this select 0); + (_this select 0) setPosASL _pos; + }else{ + (_this select 0) setPosATL _pos; + }; + (_this select 0) setVariable [QGVAR(Handled), true]; + _attachTo = objNull; + if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then { + _attachTo = (_this select 1); + }; + [(_this select 0),_attachTo, _pos] spawn { // TODO: Change to scheduled delay execution + private ["_mag", "_setup", "_dir", "_player"]; + _setup = _this select 0; + _player = ACE_player; + _mag = _setup getVariable [QGVAR(Class), ""]; + _dir = _setup getVariable [QGVAR(Direction), 0]; - sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime"); - _explosive = [_player, _this select 2, _dir, _mag, _setup getVariable QGVAR(Trigger), - [_setup getVariable QGVAR(Timer)], isNull (_this select 1)] call FUNC(placeExplosive); - deleteVehicle _setup; - if (!isNull(_explosive)) then { - _player RemoveMagazine _mag; - if (!isNull (_this select 1)) then { - _explosive attachTo [(_this select 1)]; - _dir = _dir - (getDir (_this select 1)); - [[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); - }; - }; - }; - }; + sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime"); + _explosive = [_player, _this select 2, _dir, _mag, _setup getVariable QGVAR(Trigger), + [_setup getVariable QGVAR(Timer)], isNull (_this select 1)] call FUNC(placeExplosive); + deleteVehicle _setup; + if (!isNull(_explosive)) then { + _player RemoveMagazine _mag; + if (!isNull (_this select 1)) then { + _explosive attachTo [(_this select 1)]; + _dir = _dir - (getDir (_this select 1)); + [[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); + }; + }; + }; + }; }]; _setup enableSimulationGlobal true; _player playActionNow "MedicOther"; [_setup] spawn { // TODO: Change to scheduled delay execution - private ["_setup", "_player"]; - _setup = _this select 0; - _player = ACE_player; - sleep 5; - _player setVariable [QGVAR(PlantingExplosive), false]; - if (!isNull _setup) then { - private ["_mag", "_dir", "_delayTime"]; - _mag = _setup getVariable [QGVAR(Class), ""]; - _dir = _setup getVariable [QGVAR(Direction), 0]; - _delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime")) - 5; - if (_delayTime > 0) then { - sleep _delayTime; - }; - if (!isNull _setup) then { - [_player, GetPosATL _setup, _dir, _mag, _setup getVariable QGVAR(Trigger), - [_setup getVariable QGVAR(Timer)], true] call FUNC(placeExplosive); - deleteVehicle _setup; - _player RemoveMagazine _mag; - }; - }; + private ["_setup", "_player"]; + _setup = _this select 0; + _player = ACE_player; + sleep 5; + _player setVariable [QGVAR(PlantingExplosive), false]; + if (!isNull _setup) then { + private ["_mag", "_dir", "_delayTime"]; + _mag = _setup getVariable [QGVAR(Class), ""]; + _dir = _setup getVariable [QGVAR(Direction), 0]; + _delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime")) - 5; + if (_delayTime > 0) then { + sleep _delayTime; + }; + if (!isNull _setup) then { + [_player, GetPosATL _setup, _dir, _mag, _setup getVariable QGVAR(Trigger), + [_setup getVariable QGVAR(Timer)], true] call FUNC(placeExplosive); + deleteVehicle _setup; + _player RemoveMagazine _mag; + }; + }; }; diff --git a/addons/explosives/functions/fnc_place_Cancel.sqf b/addons/explosives/functions/fnc_place_Cancel.sqf index c149d35584..56775c910e 100644 --- a/addons/explosives/functions/fnc_place_Cancel.sqf +++ b/addons/explosives/functions/fnc_place_Cancel.sqf @@ -15,15 +15,15 @@ */ #include "script_component.hpp" if (GVAR(pfeh_running)) then { - [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); - GVAR(pfeh_running) = false; + [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); + GVAR(pfeh_running) = false; }; if (!isNull (GVAR(Setup))) then { - deleteVehicle GVAR(Setup); + deleteVehicle GVAR(Setup); }; GVAR(Setup) = objNull; if (isNil {GVAR(placer)}) then { - GVAR(placer) = objNull; + GVAR(placer) = objNull; }; [GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus); GVAR(placer) = objNull; diff --git a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf index c0a467e6f1..c67313966c 100644 --- a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf +++ b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf @@ -18,9 +18,9 @@ private "_speedDial"; _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; if (count _speedDial == 0) exitWith {}; { - if ((_x select 0) == (_this select 0)) exitWith { - _speedDial set [_foreachIndex, "x"]; - _speedDial = _speedDial - ["x"]; - ace_player setVariable [QGVAR(SpeedDial),_speedDial]; - }; + if ((_x select 0) == (_this select 0)) exitWith { + _speedDial set [_foreachIndex, "x"]; + _speedDial = _speedDial - ["x"]; + ace_player setVariable [QGVAR(SpeedDial),_speedDial]; + }; } foreach _speedDial; diff --git a/addons/explosives/functions/fnc_setPosition.sqf b/addons/explosives/functions/fnc_setPosition.sqf index 2f61c522aa..4b6536d24d 100644 --- a/addons/explosives/functions/fnc_setPosition.sqf +++ b/addons/explosives/functions/fnc_setPosition.sqf @@ -20,6 +20,6 @@ private "_ex"; _ex = _this select 0; _ex setDir (_this select 1); if ((_this select 2) != 0) then { - [_ex, _this select 2, 0] call CALLSTACK(BIS_fnc_setPitchBank); + [_ex, _this select 2, 0] call CALLSTACK(BIS_fnc_setPitchBank); }; //_ex setVectorUp (surfaceNormal _pos); diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index 4dba9a8d8e..8ebcbf6699 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -20,6 +20,6 @@ _config = getArray (ConfigFile >> "CfgMagazines" >> (_this select 0) >> "ACE_Tri _count = count _config; for "_index" from 0 to (_count - 1) do { - _result set [_index, ConfigFile >> "CfgACE_Triggers" >> (_config select _index)]; + _result set [_index, ConfigFile >> "CfgACE_Triggers" >> (_config select _index)]; }; _result diff --git a/addons/explosives/script_component.hpp b/addons/explosives/script_component.hpp index fa8b2bac4d..60c7e88d06 100644 --- a/addons/explosives/script_component.hpp +++ b/addons/explosives/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_EXPLOSIVES - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_EXPLOSIVES - #define DEBUG_SETTINGS DEBUG_SETTINGS_EXPLOSIVES + #define DEBUG_SETTINGS DEBUG_SETTINGS_EXPLOSIVES #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf index 7e8480ce18..31c2540790 100644 --- a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf +++ b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf @@ -5,7 +5,7 @@ _projectile = _this select 0 select 1; _zeroing = _this select 0 select 2; if (isNull _projectile || {!alive _projectile}) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_this select 1] call CBA_fnc_removePerFrameHandler; }; if (_projectile distance _vehicle < _zeroing) exitWith {}; diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 58ed5573e1..8ad76e6ae8 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -1,352 +1,352 @@ -#define BASE_DRAG -0.01 -#define HD_MULT 5 -#define BASE_DRAG_HD (BASE_DRAG*HD_MULT) +#define BASE_DRAG -0.01 +#define HD_MULT 5 +#define BASE_DRAG_HD (BASE_DRAG*HD_MULT) class CfgAmmo { - //class ace_arty_105mm_m1_m782_time; - //class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {}; - //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { - // ACE_FRAG_SKIP = 1; - //}; - class Bo_GBU12_LGB; - class Nou_GBU12 : Bo_GBU12_LGB { - ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; - ACE_FRAG_METAL = 140000; - ACE_FRAG_CHARGE = 87000; - ACE_FRAG_GURNEY_C = 2320; - ACE_FRAG_GURNEY_K = 1/2; - sideAirFriction = 0.04; - airFriction = 0.04; - laserLock = 0; - }; - - class GrenadeBase; - class Grenade; - class GrenadeHand: Grenade { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; - // This is a good high-drag frag type for grenades. - ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"}; - /* - These values are based on the M67 Grenade, should be tweaked for - individual grenades. - */ - ACE_FRAG_METAL = 210; // metal in grams - ACE_FRAG_CHARGE = 185; // explosive in grams - ACE_FRAG_GURNEY_C = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations - ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations - }; - class GrenadeHand_stone: GrenadeHand { - ACE_FRAG_SKIP = 1; - }; - class SmokeShell: GrenadeHand { - ACE_FRAG_SKIP = 1; - }; - - class RocketBase; - //class R_Hydra_HE: RocketBase { - // ACE_FRAG_SKIP = 1; - //}; - - //class R_57mm_HE: RocketBase { - // ACE_FRAG_SKIP = 1; - //}; - - class R_80mm_HE: RocketBase { - ACE_FRAG_SKIP = 1; - }; - - //class R_S8T_AT: RocketBase { - // ACE_FRAG_SKIP = 1; - //}; - - class BombCore; - class Bo_Mk82: BombCore { - ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; - ACE_FRAG_METAL = 140000; - ACE_FRAG_CHARGE = 87000; - ACE_FRAG_GURNEY_C = 2320; - ACE_FRAG_GURNEY_K = 1/2; - }; - - - class G_40mm_HE: GrenadeBase { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; - }; - - class ACE_G_40mm_HEDP: G_40mm_HE { - }; - class ACE_G_40mm_HE: ACE_G_40mm_HEDP { - }; - class ACE_G_40mm_Practice: ACE_G_40mm_HE { - ACE_FRAG_SKIP = 1; - }; - class ACE_G40mm_HE_VOG25P: G_40mm_HE { - ACE_FRAG_SKIP = 0; - ACE_FRAG_FORCE = 1; - }; - - //class R_SMAW_HEDP; - //class R_MEEWS_HEDP : R_SMAW_HEDP { - // ACE_FRAG_FORCE = 1; - // ACE_FRAG_MULTIPLIER = 1.2; - //}; - - //class MissileBase; - //class M_Hellfire_AT: MissileBase { - // ACE_FRAG_FORCE = 1; - // ACE_FRAG_MULTIPLIER = 1.75; - //}; - - /* - class B_762x51_Ball; - class ACE_frag_base: B_762x51_Ball { ////TODO: B_762x45_Ball no longer exists, is this a valid replacement? - model = "\A3\Weapons_f\ammo\shell"; - timeToLive = 12; - typicalSpeed = 800; - // Fix sounds - effectFly = "AmmoClassic"; - soundDefault1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.158114,1,30}; - soundDefault2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.158114,1,30}; - soundDefault3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.158114,1,30}; - soundDefault4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.158114,1,30}; - soundDefault5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.158114,1,30}; - soundDefault6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.158114,1,30}; - soundDefault7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.158114,1,30}; - soundDefault8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.158114,1,30}; - soundGroundSoft1[] = {"A3\sounds_f\weapons\hits\soft_ground_1.wav",0.02811705,1,30}; - soundGroundSoft2[] = {"A3\sounds_f\weapons\hits\soft_ground_2.wav",0.02811705,1,30}; - soundGroundSoft3[] = {"A3\sounds_f\weapons\hits\soft_ground_3.wav",0.02811705,1,30}; - soundGroundSoft4[] = {"A3\sounds_f\weapons\hits\soft_ground_4.wav",0.02811705,1,30}; - soundGroundSoft5[] = {"A3\sounds_f\weapons\hits\soft_ground_5.wav",0.02811705,1,30}; - soundGroundSoft6[] = {"A3\sounds_f\weapons\hits\soft_ground_6.wav",0.02811705,1,30}; - soundGroundSoft7[] = {"A3\sounds_f\weapons\hits\soft_ground_7.wav",0.02811705,1,30}; - soundGroundSoft8[] = {"A3\sounds_f\weapons\hits\soft_ground_8.wav",0.02811705,1,30}; - soundGroundHard1[] = {"A3\sounds_f\weapons\hits\hard_ground_1.wav",0.62946,1,40}; - soundGroundHard2[] = {"A3\sounds_f\weapons\hits\hard_ground_2.wav",0.62946,1,40}; - soundGroundHard3[] = {"A3\sounds_f\weapons\hits\hard_ground_3.wav",0.62946,1,40}; - soundGroundHard4[] = {"A3\sounds_f\weapons\hits\hard_ground_4.wav",0.62946,1,40}; - soundGroundHard5[] = {"A3\sounds_f\weapons\hits\hard_ground_5.wav",0.62946,1,40}; - soundGroundHard6[] = {"A3\sounds_f\weapons\hits\hard_ground_6.wav",0.62946,1,40}; - soundGroundHard7[] = {"A3\sounds_f\weapons\hits\hard_ground_7.wav",0.62946,1,40}; - soundGroundHard8[] = {"A3\sounds_f\weapons\hits\hard_ground_8.wav",0.62946,1,40}; - soundMetal1[] = {"A3\sounds_f\weapons\hits\metal_1.wav",0.158114,1,45}; - soundMetal2[] = {"A3\sounds_f\weapons\hits\metal_2.wav",0.158114,1,45}; - soundMetal3[] = {"A3\sounds_f\weapons\hits\metal_3.wav",0.158114,1,45}; - soundMetal4[] = {"A3\sounds_f\weapons\hits\metal_4.wav",0.158114,1,45}; - soundMetal5[] = {"A3\sounds_f\weapons\hits\metal_5.wav",0.158114,1,45}; - soundMetal6[] = {"A3\sounds_f\weapons\hits\metal_6.wav",0.158114,1,45}; - soundMetal7[] = {"A3\sounds_f\weapons\hits\metal_7.wav",0.158114,1,45}; - soundMetal8[] = {"A3\sounds_f\weapons\hits\metal_8.wav",0.158114,1,45}; - soundGlass1[] = {"A3\sounds_f\weapons\hits\glass_1.wav",0.177828,1,25}; - soundGlass2[] = {"A3\sounds_f\weapons\hits\glass_2.wav",0.177828,1,25}; - soundGlass3[] = {"A3\sounds_f\weapons\hits\glass_3.wav",0.177828,1,25}; - soundGlass4[] = {"A3\sounds_f\weapons\hits\glass_4.wav",0.177828,1,25}; - soundGlass5[] = {"A3\sounds_f\weapons\hits\glass_5.wav",0.177828,1,25}; - soundGlass6[] = {"A3\sounds_f\weapons\hits\glass_6.wav",0.177828,1,25}; - soundGlass7[] = {"A3\sounds_f\weapons\hits\glass_7.wav",0.177828,1,25}; - soundGlass8[] = {"A3\sounds_f\weapons\hits\glass_8.wav",0.177828,1,25}; - soundGlassArmored1[] = {"A3\sounds_f\weapons\hits\glass_arm_1.wav",0.177828,1,30}; - soundGlassArmored2[] = {"A3\sounds_f\weapons\hits\glass_arm_2.wav",0.177828,1,30}; - soundGlassArmored3[] = {"A3\sounds_f\weapons\hits\glass_arm_3.wav",0.177828,1,30}; - soundGlassArmored4[] = {"A3\sounds_f\weapons\hits\glass_arm_4.wav",0.177828,1,30}; - soundGlassArmored5[] = {"A3\sounds_f\weapons\hits\glass_arm_5.wav",0.177828,1,30}; - soundGlassArmored6[] = {"A3\sounds_f\weapons\hits\glass_arm_6.wav",0.177828,1,30}; - soundGlassArmored7[] = {"A3\sounds_f\weapons\hits\glass_arm_7.wav",0.177828,1,30}; - soundGlassArmored8[] = {"A3\sounds_f\weapons\hits\glass_arm_8.wav",0.177828,1,30}; - soundVehiclePlate1[] = {"A3\sounds_f\weapons\hits\metal_plate_1.wav",0.281170,1,40}; - soundVehiclePlate2[] = {"A3\sounds_f\weapons\hits\metal_plate_2.wav",0.281170,1,40}; - soundVehiclePlate3[] = {"A3\sounds_f\weapons\hits\metal_plate_3.wav",0.281170,1,40}; - soundVehiclePlate4[] = {"A3\sounds_f\weapons\hits\metal_plate_4.wav",0.281170,1,40}; - soundVehiclePlate5[] = {"A3\sounds_f\weapons\hits\metal_plate_5.wav",0.281170,1,40}; - soundVehiclePlate6[] = {"A3\sounds_f\weapons\hits\metal_plate_6.wav",0.281170,1,40}; - soundVehiclePlate7[] = {"A3\sounds_f\weapons\hits\metal_plate_7.wav",0.281170,1,40}; - soundVehiclePlate8[] = {"A3\sounds_f\weapons\hits\metal_plate_8.wav",0.281170,1,40}; - soundWood1[] = {"A3\sounds_f\weapons\hits\wood_1.wav",0.158114,1,30}; - soundWood2[] = {"A3\sounds_f\weapons\hits\wood_2.wav",0.158114,1,30}; - soundWood3[] = {"A3\sounds_f\weapons\hits\wood_3.wav",0.158114,1,30}; - soundWood4[] = {"A3\sounds_f\weapons\hits\wood_4.wav",0.158114,1,30}; - soundWood5[] = {"A3\sounds_f\weapons\hits\wood_5.wav",0.158114,1,30}; - soundWood6[] = {"A3\sounds_f\weapons\hits\wood_6.wav",0.158114,1,30}; - soundWood7[] = {"A3\sounds_f\weapons\hits\wood_7.wav",0.158114,1,30}; - soundWood8[] = {"A3\sounds_f\weapons\hits\wood_8.wav",0.158114,1,30}; - soundHitBody1[] = {"A3\sounds_f\weapons\hits\body_1.wav",0.0177828,1,25}; - soundHitBody2[] = {"A3\sounds_f\weapons\hits\body_2.wav",0.0177828,1,25}; - soundHitBody3[] = {"A3\sounds_f\weapons\hits\body_3.wav",0.0177828,1,25}; - soundHitBody4[] = {"A3\sounds_f\weapons\hits\body_4.wav",0.0177828,1,25}; - soundHitBody5[] = {"A3\sounds_f\weapons\hits\body_5.wav",0.0177828,1,25}; - soundHitBody6[] = {"A3\sounds_f\weapons\hits\body_6.wav",0.0177828,1,25}; - soundHitBody7[] = {"A3\sounds_f\weapons\hits\body_7.wav",0.0177828,1,25}; - soundHitBody8[] = {"A3\sounds_f\weapons\hits\body_8.wav",0.0177828,1,25}; - soundHitBuilding1[] = {"A3\sounds_f\weapons\hits\building_1.wav",0.251189,1,30}; - soundHitBuilding2[] = {"A3\sounds_f\weapons\hits\building_2.wav",0.251189,1,30}; - soundHitBuilding3[] = {"A3\sounds_f\weapons\hits\building_3.wav",0.251189,1,30}; - soundHitBuilding4[] = {"A3\sounds_f\weapons\hits\building_4.wav",0.251189,1,30}; - soundHitBuilding5[] = {"A3\sounds_f\weapons\hits\building_5.wav",0.251189,1,30}; - soundHitBuilding6[] = {"A3\sounds_f\weapons\hits\building_6.wav",0.251189,1,30}; - soundHitBuilding7[] = {"A3\sounds_f\weapons\hits\building_7.wav",0.251189,1,30}; - soundHitBuilding8[] = {"A3\sounds_f\weapons\hits\building_8.wav",0.251189,1,30}; - soundHitFoliage1[] = {"A3\sounds_f\weapons\hits\foliage_1.wav",0.177828,1,25}; - soundHitFoliage2[] = {"A3\sounds_f\weapons\hits\foliage_2.wav",0.177828,1,25}; - soundHitFoliage3[] = {"A3\sounds_f\weapons\hits\foliage_3.wav",0.177828,1,25}; - soundHitFoliage4[] = {"A3\sounds_f\weapons\hits\foliage_4.wav",0.177828,1,25}; - soundHitFoliage5[] = {"A3\sounds_f\weapons\hits\foliage_5.wav",0.177828,1,25}; - soundHitFoliage6[] = {"A3\sounds_f\weapons\hits\foliage_6.wav",0.177828,1,25}; - soundHitFoliage7[] = {"A3\sounds_f\weapons\hits\foliage_7.wav",0.177828,1,25}; - soundHitFoliage8[] = {"A3\sounds_f\weapons\hits\foliage_8.wav",0.177828,1,25}; - soundPlastic1[] = {"A3\sounds_f\weapons\hits\plastic_1.wav",0.177828,1,25}; - soundPlastic2[] = {"A3\sounds_f\weapons\hits\plastic_2.wav",0.177828,1,25}; - soundPlastic3[] = {"A3\sounds_f\weapons\hits\plastic_3.wav",0.177828,1,25}; - soundPlastic4[] = {"A3\sounds_f\weapons\hits\plastic_4.wav",0.177828,1,25}; - soundPlastic5[] = {"A3\sounds_f\weapons\hits\plastic_5.wav",0.177828,1,25}; - soundPlastic6[] = {"A3\sounds_f\weapons\hits\plastic_6.wav",0.177828,1,25}; - soundPlastic7[] = {"A3\sounds_f\weapons\hits\plastic_7.wav",0.177828,1,25}; - soundPlastic8[] = {"A3\sounds_f\weapons\hits\plastic_8.wav",0.177828,1,25}; - soundConcrete1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.177828,1,35}; - soundConcrete2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.177828,1,35}; - soundConcrete3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.177828,1,35}; - soundConcrete4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.177828,1,35}; - soundConcrete5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.177828,1,35}; - soundConcrete6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.177828,1,35}; - soundConcrete7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.177828,1,35}; - soundConcrete8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.177828,1,35}; - soundRubber1[] = {"A3\sounds_f\weapons\hits\tyre_1.wav",0.158114,1,25}; - soundRubber2[] = {"A3\sounds_f\weapons\hits\tyre_2.wav",0.158114,1,25}; - soundRubber3[] = {"A3\sounds_f\weapons\hits\tyre_3.wav",0.158114,1,25}; - soundRubber4[] = {"A3\sounds_f\weapons\hits\tyre_4.wav",0.158114,1,25}; - soundRubber5[] = {"A3\sounds_f\weapons\hits\tyre_5.wav",0.158114,1,25}; - soundRubber6[] = {"A3\sounds_f\weapons\hits\tyre_6.wav",0.158114,1,25}; - soundRubber7[] = {"A3\sounds_f\weapons\hits\tyre_7.wav",0.158114,1,25}; - soundRubber8[] = {"A3\sounds_f\weapons\hits\tyre_8.wav",0.158114,1,25}; - soundWater1[] = {"A3\sounds_f\weapons\hits\water_01.wav",0.158114,1,25}; - soundWater2[] = {"A3\sounds_f\weapons\hits\water_02.wav",0.158114,1,25}; - soundWater3[] = {"A3\sounds_f\weapons\hits\water_03.wav",0.158114,1,25}; - soundWater4[] = {"A3\sounds_f\weapons\hits\water_04.wav",0.158114,1,25}; - soundWater5[] = {"A3\sounds_f\weapons\hits\water_05.wav",0.158114,1,25}; - soundWater6[] = {"A3\sounds_f\weapons\hits\water_06.wav",0.158114,1,25}; - soundWater7[] = {"A3\sounds_f\weapons\hits\water_07.wav",0.158114,1,25}; - soundWater8[] = {"A3\sounds_f\weapons\hits\water_08.wav",0.158114,1,25}; - hitGroundSoft[] = {"soundGroundSoft1",0.2,"soundGroundSoft2",0.2,"soundGroundSoft3",0.1,"soundGroundSoft4",0.1,"soundGroundSoft5",0.1,"soundGroundSoft6",0.1,"soundGroundSoft7",0.1,"soundGroundSoft8",0.1}; - hitGroundHard[] = {"soundGroundHard1",0.2,"soundGroundHard2",0.2,"soundGroundHard3",0.1,"soundGroundHard4",0.1,"soundGroundHard5",0.1,"soundGroundHard6",0.1,"soundGroundHard7",0.1,"soundGroundHard8",0.1}; - hitMan[] = {"soundHitBody1",0.125,"soundHitBody2",0.125,"soundHitBody3",0.125,"soundHitBody4",0.125,"soundHitBody5",0.125,"soundHitBody6",0.125,"soundHitBody7",0.125,"soundHitBody8",0.125}; - hitArmor[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; - hitBuilding[] = {"soundHitBuilding1",0.2,"soundHitBuilding2",0.2,"soundHitBuilding3",0.1,"soundHitBuilding4",0.1,"soundHitBuilding5",0.1,"soundHitBuilding6",0.1,"soundHitBuilding7",0.1,"soundHitBuilding8",0.1}; - hitFoliage[] = {"soundHitFoliage1",0.125,"soundHitFoliage2",0.125,"soundHitFoliage3",0.125,"soundHitFoliage4",0.125,"soundHitFoliage5",0.125,"soundHitFoliage6",0.125,"soundHitFoliage7",0.125,"soundHitFoliage8",0.125}; - hitWood[] = {"soundWood1",0.125,"soundWood2",0.125,"soundWood3",0.125,"soundWood4",0.125,"soundWood5",0.125,"soundWood6",0.125,"soundWood7",0.125,"soundWood8",0.125}; - hitGlass[] = {"soundGlass1",0.125,"soundGlass2",0.125,"soundGlass3",0.125,"soundGlass4",0.125,"soundGlass5",0.125,"soundGlass6",0.125,"soundGlass7",0.125,"soundGlass8",0.125}; - hitGlassArmored[] = {"soundGlassArmored1",0.125,"soundGlassArmored2",0.125,"soundGlassArmored3",0.125,"soundGlassArmored4",0.125,"soundGlassArmored5",0.125,"soundGlassArmored6",0.125,"soundGlassArmored7",0.125,"soundGlassArmored8",0.125}; - hitConcrete[] = {"soundConcrete1",0.125,"soundConcrete2",0.125,"soundConcrete3",0.125,"soundConcrete4",0.125,"soundConcrete5",0.125,"soundConcrete6",0.125,"soundConcrete7",0.125,"soundConcrete8",0.125}; - hitRubber[] = {"soundRubber1",0.125,"soundRubber2",0.125,"soundRubber3",0.125,"soundRubber4",0.125,"soundRubber5",0.125,"soundRubber6",0.125,"soundRubber7",0.125,"soundRubber8",0.125}; - hitPlastic[] = {"soundPlastic1",0.125,"soundPlastic2",0.125,"soundPlastic3",0.125,"soundPlastic4",0.125,"soundPlastic5",0.125,"soundPlastic6",0.125,"soundPlastic7",0.125,"soundPlastic8",0.125}; - hitDefault[] = {"soundDefault1",0.2,"soundDefault2",0.2,"soundDefault3",0.1,"soundDefault4",0.1,"soundDefault5",0.1,"soundDefault6",0.1,"soundDefault7",0.1,"soundDefault8",0.1}; - hitMetal[] = {"soundMetal1",0.125,"soundMetal2",0.125,"soundMetal3",0.125,"soundMetal4",0.125,"soundMetal5",0.125,"soundMetal6",0.125,"soundMetal7",0.125,"soundMetal8",0.125}; - hitMetalplate[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; - hitWater[] = {"soundWater1",0.125,"soundWater2",0.125,"soundWater3",0.125,"soundWater4",0.125,"soundWater5",0.125,"soundWater6",0.125,"soundWater7",0.125,"soundWater8",0.125}; - bulletFly1[] = {"A3\sounds_f\weapons\hits\bullet_by_1.wav",1,1,35}; - bulletFly2[] = {"A3\sounds_f\weapons\hits\bullet_by_2.wav",1,1,35}; - bulletFly3[] = {"A3\sounds_f\weapons\hits\bullet_by_3.wav",1,1,35}; - bulletFly4[] = {"A3\sounds_f\weapons\hits\bullet_by_4.wav",1,1,35}; - bulletFly5[] = {"A3\sounds_f\weapons\hits\bullet_by_5.wav",1,1,35}; - bulletFly6[] = {"A3\sounds_f\weapons\hits\bullet_by_6.wav",1,1,35}; - bulletFly7[] = {"A3\sounds_f\weapons\hits\bullet_by_7.wav",1,1,35}; - bulletFly8[] = {"A3\sounds_f\weapons\hits\bullet_by_8.wav",1,1,35}; - bulletFly[] = {"bulletFly1",0.166,"bulletFly2",0.166,"bulletFly3",0.166,"bulletFly4",0.166,"bulletFly5",0.166,"bulletFly6",0.167,"bulletFly7",0.166,"bulletFly8",0.167}; - supersonicCrackNear[] = {"A3\sounds_f\weapons\hits\sscrack1.wav",1,1,35}; - supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135}; - }; - */ - - class B_65x39_Caseless; - class ACE_frag_base: B_65x39_Caseless { - timeToLive = 12; - typicalSpeed = 1500; - deflecting = 65; - }; - - class ACE_frag_tiny: ACE_frag_base { - hit = 6; - airFriction = BASE_DRAG; - caliber = 0.75; - }; - - class ACE_frag_tiny_HD: ACE_frag_base { - hit = 6; - airFriction = BASE_DRAG_HD; - caliber = 0.75; - }; - - class ACE_frag_small: ACE_frag_base { - hit = 12; - airFriction = BASE_DRAG*0.9; - }; - - class ACE_frag_small_HD: ACE_frag_base { - hit = 12; - airFriction = BASE_DRAG_HD*0.9; - }; - - class ACE_frag_medium: ACE_frag_base { - hit = 14; - airFriction = BASE_DRAG*0.75; - caliber = 1.2; - }; - - class ACE_frag_medium_HD: ACE_frag_base { - hit = 14; - airFriction = BASE_DRAG_HD*0.75; - caliber = 1.2; - }; - - class ACE_frag_large: ACE_frag_base { - hit = 28; - indirectHit = 2; - indirectHitRange = 0.25; - airFriction = BASE_DRAG*0.65; - caliber = 2; - explosive = 0; - - }; - - class ACE_frag_large_HD: ACE_frag_large { - hit = 28; - indirectHit = 2; - indirectHitRange = 0.25; - airFriction = BASE_DRAG_HD*0.65; - caliber = 2; - - - }; - - class ACE_frag_huge: ACE_frag_large { - hit = 40; - indirectHit = 4; - indirectHitRange = 0.5; - airFriction = BASE_DRAG*0.5; - caliber = 2.8; - }; - - class ACE_frag_huge_HD: ACE_frag_large { - hit = 40; - indirectHit = 4; - indirectHitRange = 0.5; - airFriction = BASE_DRAG_HD*0.5; - caliber = 2.8; - }; - - class ACE_frag_spall_small: ACE_frag_small { - timeToLive = 0.1; - }; - - class ACE_frag_spall_medium: ACE_frag_medium { - timeToLive = 0.15; - }; - - class ACE_frag_spall_large: ACE_frag_large { - timeToLive = 0.25; - }; - - class ACE_frag_spall_huge: ACE_frag_huge { - timeToLive = 0.3; - }; + //class ace_arty_105mm_m1_m782_time; + //class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {}; + //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { + // ACE_FRAG_SKIP = 1; + //}; + class Bo_GBU12_LGB; + class Nou_GBU12 : Bo_GBU12_LGB { + ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; + ACE_FRAG_METAL = 140000; + ACE_FRAG_CHARGE = 87000; + ACE_FRAG_GURNEY_C = 2320; + ACE_FRAG_GURNEY_K = 1/2; + sideAirFriction = 0.04; + airFriction = 0.04; + laserLock = 0; + }; + + class GrenadeBase; + class Grenade; + class GrenadeHand: Grenade { + ACE_FRAG_SKIP = 0; + ACE_FRAG_FORCE = 1; + // This is a good high-drag frag type for grenades. + ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"}; + /* + These values are based on the M67 Grenade, should be tweaked for + individual grenades. + */ + ACE_FRAG_METAL = 210; // metal in grams + ACE_FRAG_CHARGE = 185; // explosive in grams + ACE_FRAG_GURNEY_C = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations + ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations + }; + class GrenadeHand_stone: GrenadeHand { + ACE_FRAG_SKIP = 1; + }; + class SmokeShell: GrenadeHand { + ACE_FRAG_SKIP = 1; + }; + + class RocketBase; + //class R_Hydra_HE: RocketBase { + // ACE_FRAG_SKIP = 1; + //}; + + //class R_57mm_HE: RocketBase { + // ACE_FRAG_SKIP = 1; + //}; + + class R_80mm_HE: RocketBase { + ACE_FRAG_SKIP = 1; + }; + + //class R_S8T_AT: RocketBase { + // ACE_FRAG_SKIP = 1; + //}; + + class BombCore; + class Bo_Mk82: BombCore { + ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; + ACE_FRAG_METAL = 140000; + ACE_FRAG_CHARGE = 87000; + ACE_FRAG_GURNEY_C = 2320; + ACE_FRAG_GURNEY_K = 1/2; + }; + + + class G_40mm_HE: GrenadeBase { + ACE_FRAG_SKIP = 0; + ACE_FRAG_FORCE = 1; + }; + + class ACE_G_40mm_HEDP: G_40mm_HE { + }; + class ACE_G_40mm_HE: ACE_G_40mm_HEDP { + }; + class ACE_G_40mm_Practice: ACE_G_40mm_HE { + ACE_FRAG_SKIP = 1; + }; + class ACE_G40mm_HE_VOG25P: G_40mm_HE { + ACE_FRAG_SKIP = 0; + ACE_FRAG_FORCE = 1; + }; + + //class R_SMAW_HEDP; + //class R_MEEWS_HEDP : R_SMAW_HEDP { + // ACE_FRAG_FORCE = 1; + // ACE_FRAG_MULTIPLIER = 1.2; + //}; + + //class MissileBase; + //class M_Hellfire_AT: MissileBase { + // ACE_FRAG_FORCE = 1; + // ACE_FRAG_MULTIPLIER = 1.75; + //}; + + /* + class B_762x51_Ball; + class ACE_frag_base: B_762x51_Ball { ////TODO: B_762x45_Ball no longer exists, is this a valid replacement? + model = "\A3\Weapons_f\ammo\shell"; + timeToLive = 12; + typicalSpeed = 800; + // Fix sounds + effectFly = "AmmoClassic"; + soundDefault1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.158114,1,30}; + soundDefault2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.158114,1,30}; + soundDefault3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.158114,1,30}; + soundDefault4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.158114,1,30}; + soundDefault5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.158114,1,30}; + soundDefault6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.158114,1,30}; + soundDefault7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.158114,1,30}; + soundDefault8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.158114,1,30}; + soundGroundSoft1[] = {"A3\sounds_f\weapons\hits\soft_ground_1.wav",0.02811705,1,30}; + soundGroundSoft2[] = {"A3\sounds_f\weapons\hits\soft_ground_2.wav",0.02811705,1,30}; + soundGroundSoft3[] = {"A3\sounds_f\weapons\hits\soft_ground_3.wav",0.02811705,1,30}; + soundGroundSoft4[] = {"A3\sounds_f\weapons\hits\soft_ground_4.wav",0.02811705,1,30}; + soundGroundSoft5[] = {"A3\sounds_f\weapons\hits\soft_ground_5.wav",0.02811705,1,30}; + soundGroundSoft6[] = {"A3\sounds_f\weapons\hits\soft_ground_6.wav",0.02811705,1,30}; + soundGroundSoft7[] = {"A3\sounds_f\weapons\hits\soft_ground_7.wav",0.02811705,1,30}; + soundGroundSoft8[] = {"A3\sounds_f\weapons\hits\soft_ground_8.wav",0.02811705,1,30}; + soundGroundHard1[] = {"A3\sounds_f\weapons\hits\hard_ground_1.wav",0.62946,1,40}; + soundGroundHard2[] = {"A3\sounds_f\weapons\hits\hard_ground_2.wav",0.62946,1,40}; + soundGroundHard3[] = {"A3\sounds_f\weapons\hits\hard_ground_3.wav",0.62946,1,40}; + soundGroundHard4[] = {"A3\sounds_f\weapons\hits\hard_ground_4.wav",0.62946,1,40}; + soundGroundHard5[] = {"A3\sounds_f\weapons\hits\hard_ground_5.wav",0.62946,1,40}; + soundGroundHard6[] = {"A3\sounds_f\weapons\hits\hard_ground_6.wav",0.62946,1,40}; + soundGroundHard7[] = {"A3\sounds_f\weapons\hits\hard_ground_7.wav",0.62946,1,40}; + soundGroundHard8[] = {"A3\sounds_f\weapons\hits\hard_ground_8.wav",0.62946,1,40}; + soundMetal1[] = {"A3\sounds_f\weapons\hits\metal_1.wav",0.158114,1,45}; + soundMetal2[] = {"A3\sounds_f\weapons\hits\metal_2.wav",0.158114,1,45}; + soundMetal3[] = {"A3\sounds_f\weapons\hits\metal_3.wav",0.158114,1,45}; + soundMetal4[] = {"A3\sounds_f\weapons\hits\metal_4.wav",0.158114,1,45}; + soundMetal5[] = {"A3\sounds_f\weapons\hits\metal_5.wav",0.158114,1,45}; + soundMetal6[] = {"A3\sounds_f\weapons\hits\metal_6.wav",0.158114,1,45}; + soundMetal7[] = {"A3\sounds_f\weapons\hits\metal_7.wav",0.158114,1,45}; + soundMetal8[] = {"A3\sounds_f\weapons\hits\metal_8.wav",0.158114,1,45}; + soundGlass1[] = {"A3\sounds_f\weapons\hits\glass_1.wav",0.177828,1,25}; + soundGlass2[] = {"A3\sounds_f\weapons\hits\glass_2.wav",0.177828,1,25}; + soundGlass3[] = {"A3\sounds_f\weapons\hits\glass_3.wav",0.177828,1,25}; + soundGlass4[] = {"A3\sounds_f\weapons\hits\glass_4.wav",0.177828,1,25}; + soundGlass5[] = {"A3\sounds_f\weapons\hits\glass_5.wav",0.177828,1,25}; + soundGlass6[] = {"A3\sounds_f\weapons\hits\glass_6.wav",0.177828,1,25}; + soundGlass7[] = {"A3\sounds_f\weapons\hits\glass_7.wav",0.177828,1,25}; + soundGlass8[] = {"A3\sounds_f\weapons\hits\glass_8.wav",0.177828,1,25}; + soundGlassArmored1[] = {"A3\sounds_f\weapons\hits\glass_arm_1.wav",0.177828,1,30}; + soundGlassArmored2[] = {"A3\sounds_f\weapons\hits\glass_arm_2.wav",0.177828,1,30}; + soundGlassArmored3[] = {"A3\sounds_f\weapons\hits\glass_arm_3.wav",0.177828,1,30}; + soundGlassArmored4[] = {"A3\sounds_f\weapons\hits\glass_arm_4.wav",0.177828,1,30}; + soundGlassArmored5[] = {"A3\sounds_f\weapons\hits\glass_arm_5.wav",0.177828,1,30}; + soundGlassArmored6[] = {"A3\sounds_f\weapons\hits\glass_arm_6.wav",0.177828,1,30}; + soundGlassArmored7[] = {"A3\sounds_f\weapons\hits\glass_arm_7.wav",0.177828,1,30}; + soundGlassArmored8[] = {"A3\sounds_f\weapons\hits\glass_arm_8.wav",0.177828,1,30}; + soundVehiclePlate1[] = {"A3\sounds_f\weapons\hits\metal_plate_1.wav",0.281170,1,40}; + soundVehiclePlate2[] = {"A3\sounds_f\weapons\hits\metal_plate_2.wav",0.281170,1,40}; + soundVehiclePlate3[] = {"A3\sounds_f\weapons\hits\metal_plate_3.wav",0.281170,1,40}; + soundVehiclePlate4[] = {"A3\sounds_f\weapons\hits\metal_plate_4.wav",0.281170,1,40}; + soundVehiclePlate5[] = {"A3\sounds_f\weapons\hits\metal_plate_5.wav",0.281170,1,40}; + soundVehiclePlate6[] = {"A3\sounds_f\weapons\hits\metal_plate_6.wav",0.281170,1,40}; + soundVehiclePlate7[] = {"A3\sounds_f\weapons\hits\metal_plate_7.wav",0.281170,1,40}; + soundVehiclePlate8[] = {"A3\sounds_f\weapons\hits\metal_plate_8.wav",0.281170,1,40}; + soundWood1[] = {"A3\sounds_f\weapons\hits\wood_1.wav",0.158114,1,30}; + soundWood2[] = {"A3\sounds_f\weapons\hits\wood_2.wav",0.158114,1,30}; + soundWood3[] = {"A3\sounds_f\weapons\hits\wood_3.wav",0.158114,1,30}; + soundWood4[] = {"A3\sounds_f\weapons\hits\wood_4.wav",0.158114,1,30}; + soundWood5[] = {"A3\sounds_f\weapons\hits\wood_5.wav",0.158114,1,30}; + soundWood6[] = {"A3\sounds_f\weapons\hits\wood_6.wav",0.158114,1,30}; + soundWood7[] = {"A3\sounds_f\weapons\hits\wood_7.wav",0.158114,1,30}; + soundWood8[] = {"A3\sounds_f\weapons\hits\wood_8.wav",0.158114,1,30}; + soundHitBody1[] = {"A3\sounds_f\weapons\hits\body_1.wav",0.0177828,1,25}; + soundHitBody2[] = {"A3\sounds_f\weapons\hits\body_2.wav",0.0177828,1,25}; + soundHitBody3[] = {"A3\sounds_f\weapons\hits\body_3.wav",0.0177828,1,25}; + soundHitBody4[] = {"A3\sounds_f\weapons\hits\body_4.wav",0.0177828,1,25}; + soundHitBody5[] = {"A3\sounds_f\weapons\hits\body_5.wav",0.0177828,1,25}; + soundHitBody6[] = {"A3\sounds_f\weapons\hits\body_6.wav",0.0177828,1,25}; + soundHitBody7[] = {"A3\sounds_f\weapons\hits\body_7.wav",0.0177828,1,25}; + soundHitBody8[] = {"A3\sounds_f\weapons\hits\body_8.wav",0.0177828,1,25}; + soundHitBuilding1[] = {"A3\sounds_f\weapons\hits\building_1.wav",0.251189,1,30}; + soundHitBuilding2[] = {"A3\sounds_f\weapons\hits\building_2.wav",0.251189,1,30}; + soundHitBuilding3[] = {"A3\sounds_f\weapons\hits\building_3.wav",0.251189,1,30}; + soundHitBuilding4[] = {"A3\sounds_f\weapons\hits\building_4.wav",0.251189,1,30}; + soundHitBuilding5[] = {"A3\sounds_f\weapons\hits\building_5.wav",0.251189,1,30}; + soundHitBuilding6[] = {"A3\sounds_f\weapons\hits\building_6.wav",0.251189,1,30}; + soundHitBuilding7[] = {"A3\sounds_f\weapons\hits\building_7.wav",0.251189,1,30}; + soundHitBuilding8[] = {"A3\sounds_f\weapons\hits\building_8.wav",0.251189,1,30}; + soundHitFoliage1[] = {"A3\sounds_f\weapons\hits\foliage_1.wav",0.177828,1,25}; + soundHitFoliage2[] = {"A3\sounds_f\weapons\hits\foliage_2.wav",0.177828,1,25}; + soundHitFoliage3[] = {"A3\sounds_f\weapons\hits\foliage_3.wav",0.177828,1,25}; + soundHitFoliage4[] = {"A3\sounds_f\weapons\hits\foliage_4.wav",0.177828,1,25}; + soundHitFoliage5[] = {"A3\sounds_f\weapons\hits\foliage_5.wav",0.177828,1,25}; + soundHitFoliage6[] = {"A3\sounds_f\weapons\hits\foliage_6.wav",0.177828,1,25}; + soundHitFoliage7[] = {"A3\sounds_f\weapons\hits\foliage_7.wav",0.177828,1,25}; + soundHitFoliage8[] = {"A3\sounds_f\weapons\hits\foliage_8.wav",0.177828,1,25}; + soundPlastic1[] = {"A3\sounds_f\weapons\hits\plastic_1.wav",0.177828,1,25}; + soundPlastic2[] = {"A3\sounds_f\weapons\hits\plastic_2.wav",0.177828,1,25}; + soundPlastic3[] = {"A3\sounds_f\weapons\hits\plastic_3.wav",0.177828,1,25}; + soundPlastic4[] = {"A3\sounds_f\weapons\hits\plastic_4.wav",0.177828,1,25}; + soundPlastic5[] = {"A3\sounds_f\weapons\hits\plastic_5.wav",0.177828,1,25}; + soundPlastic6[] = {"A3\sounds_f\weapons\hits\plastic_6.wav",0.177828,1,25}; + soundPlastic7[] = {"A3\sounds_f\weapons\hits\plastic_7.wav",0.177828,1,25}; + soundPlastic8[] = {"A3\sounds_f\weapons\hits\plastic_8.wav",0.177828,1,25}; + soundConcrete1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.177828,1,35}; + soundConcrete2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.177828,1,35}; + soundConcrete3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.177828,1,35}; + soundConcrete4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.177828,1,35}; + soundConcrete5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.177828,1,35}; + soundConcrete6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.177828,1,35}; + soundConcrete7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.177828,1,35}; + soundConcrete8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.177828,1,35}; + soundRubber1[] = {"A3\sounds_f\weapons\hits\tyre_1.wav",0.158114,1,25}; + soundRubber2[] = {"A3\sounds_f\weapons\hits\tyre_2.wav",0.158114,1,25}; + soundRubber3[] = {"A3\sounds_f\weapons\hits\tyre_3.wav",0.158114,1,25}; + soundRubber4[] = {"A3\sounds_f\weapons\hits\tyre_4.wav",0.158114,1,25}; + soundRubber5[] = {"A3\sounds_f\weapons\hits\tyre_5.wav",0.158114,1,25}; + soundRubber6[] = {"A3\sounds_f\weapons\hits\tyre_6.wav",0.158114,1,25}; + soundRubber7[] = {"A3\sounds_f\weapons\hits\tyre_7.wav",0.158114,1,25}; + soundRubber8[] = {"A3\sounds_f\weapons\hits\tyre_8.wav",0.158114,1,25}; + soundWater1[] = {"A3\sounds_f\weapons\hits\water_01.wav",0.158114,1,25}; + soundWater2[] = {"A3\sounds_f\weapons\hits\water_02.wav",0.158114,1,25}; + soundWater3[] = {"A3\sounds_f\weapons\hits\water_03.wav",0.158114,1,25}; + soundWater4[] = {"A3\sounds_f\weapons\hits\water_04.wav",0.158114,1,25}; + soundWater5[] = {"A3\sounds_f\weapons\hits\water_05.wav",0.158114,1,25}; + soundWater6[] = {"A3\sounds_f\weapons\hits\water_06.wav",0.158114,1,25}; + soundWater7[] = {"A3\sounds_f\weapons\hits\water_07.wav",0.158114,1,25}; + soundWater8[] = {"A3\sounds_f\weapons\hits\water_08.wav",0.158114,1,25}; + hitGroundSoft[] = {"soundGroundSoft1",0.2,"soundGroundSoft2",0.2,"soundGroundSoft3",0.1,"soundGroundSoft4",0.1,"soundGroundSoft5",0.1,"soundGroundSoft6",0.1,"soundGroundSoft7",0.1,"soundGroundSoft8",0.1}; + hitGroundHard[] = {"soundGroundHard1",0.2,"soundGroundHard2",0.2,"soundGroundHard3",0.1,"soundGroundHard4",0.1,"soundGroundHard5",0.1,"soundGroundHard6",0.1,"soundGroundHard7",0.1,"soundGroundHard8",0.1}; + hitMan[] = {"soundHitBody1",0.125,"soundHitBody2",0.125,"soundHitBody3",0.125,"soundHitBody4",0.125,"soundHitBody5",0.125,"soundHitBody6",0.125,"soundHitBody7",0.125,"soundHitBody8",0.125}; + hitArmor[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; + hitBuilding[] = {"soundHitBuilding1",0.2,"soundHitBuilding2",0.2,"soundHitBuilding3",0.1,"soundHitBuilding4",0.1,"soundHitBuilding5",0.1,"soundHitBuilding6",0.1,"soundHitBuilding7",0.1,"soundHitBuilding8",0.1}; + hitFoliage[] = {"soundHitFoliage1",0.125,"soundHitFoliage2",0.125,"soundHitFoliage3",0.125,"soundHitFoliage4",0.125,"soundHitFoliage5",0.125,"soundHitFoliage6",0.125,"soundHitFoliage7",0.125,"soundHitFoliage8",0.125}; + hitWood[] = {"soundWood1",0.125,"soundWood2",0.125,"soundWood3",0.125,"soundWood4",0.125,"soundWood5",0.125,"soundWood6",0.125,"soundWood7",0.125,"soundWood8",0.125}; + hitGlass[] = {"soundGlass1",0.125,"soundGlass2",0.125,"soundGlass3",0.125,"soundGlass4",0.125,"soundGlass5",0.125,"soundGlass6",0.125,"soundGlass7",0.125,"soundGlass8",0.125}; + hitGlassArmored[] = {"soundGlassArmored1",0.125,"soundGlassArmored2",0.125,"soundGlassArmored3",0.125,"soundGlassArmored4",0.125,"soundGlassArmored5",0.125,"soundGlassArmored6",0.125,"soundGlassArmored7",0.125,"soundGlassArmored8",0.125}; + hitConcrete[] = {"soundConcrete1",0.125,"soundConcrete2",0.125,"soundConcrete3",0.125,"soundConcrete4",0.125,"soundConcrete5",0.125,"soundConcrete6",0.125,"soundConcrete7",0.125,"soundConcrete8",0.125}; + hitRubber[] = {"soundRubber1",0.125,"soundRubber2",0.125,"soundRubber3",0.125,"soundRubber4",0.125,"soundRubber5",0.125,"soundRubber6",0.125,"soundRubber7",0.125,"soundRubber8",0.125}; + hitPlastic[] = {"soundPlastic1",0.125,"soundPlastic2",0.125,"soundPlastic3",0.125,"soundPlastic4",0.125,"soundPlastic5",0.125,"soundPlastic6",0.125,"soundPlastic7",0.125,"soundPlastic8",0.125}; + hitDefault[] = {"soundDefault1",0.2,"soundDefault2",0.2,"soundDefault3",0.1,"soundDefault4",0.1,"soundDefault5",0.1,"soundDefault6",0.1,"soundDefault7",0.1,"soundDefault8",0.1}; + hitMetal[] = {"soundMetal1",0.125,"soundMetal2",0.125,"soundMetal3",0.125,"soundMetal4",0.125,"soundMetal5",0.125,"soundMetal6",0.125,"soundMetal7",0.125,"soundMetal8",0.125}; + hitMetalplate[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; + hitWater[] = {"soundWater1",0.125,"soundWater2",0.125,"soundWater3",0.125,"soundWater4",0.125,"soundWater5",0.125,"soundWater6",0.125,"soundWater7",0.125,"soundWater8",0.125}; + bulletFly1[] = {"A3\sounds_f\weapons\hits\bullet_by_1.wav",1,1,35}; + bulletFly2[] = {"A3\sounds_f\weapons\hits\bullet_by_2.wav",1,1,35}; + bulletFly3[] = {"A3\sounds_f\weapons\hits\bullet_by_3.wav",1,1,35}; + bulletFly4[] = {"A3\sounds_f\weapons\hits\bullet_by_4.wav",1,1,35}; + bulletFly5[] = {"A3\sounds_f\weapons\hits\bullet_by_5.wav",1,1,35}; + bulletFly6[] = {"A3\sounds_f\weapons\hits\bullet_by_6.wav",1,1,35}; + bulletFly7[] = {"A3\sounds_f\weapons\hits\bullet_by_7.wav",1,1,35}; + bulletFly8[] = {"A3\sounds_f\weapons\hits\bullet_by_8.wav",1,1,35}; + bulletFly[] = {"bulletFly1",0.166,"bulletFly2",0.166,"bulletFly3",0.166,"bulletFly4",0.166,"bulletFly5",0.166,"bulletFly6",0.167,"bulletFly7",0.166,"bulletFly8",0.167}; + supersonicCrackNear[] = {"A3\sounds_f\weapons\hits\sscrack1.wav",1,1,35}; + supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135}; + }; + */ + + class B_65x39_Caseless; + class ACE_frag_base: B_65x39_Caseless { + timeToLive = 12; + typicalSpeed = 1500; + deflecting = 65; + }; + + class ACE_frag_tiny: ACE_frag_base { + hit = 6; + airFriction = BASE_DRAG; + caliber = 0.75; + }; + + class ACE_frag_tiny_HD: ACE_frag_base { + hit = 6; + airFriction = BASE_DRAG_HD; + caliber = 0.75; + }; + + class ACE_frag_small: ACE_frag_base { + hit = 12; + airFriction = BASE_DRAG*0.9; + }; + + class ACE_frag_small_HD: ACE_frag_base { + hit = 12; + airFriction = BASE_DRAG_HD*0.9; + }; + + class ACE_frag_medium: ACE_frag_base { + hit = 14; + airFriction = BASE_DRAG*0.75; + caliber = 1.2; + }; + + class ACE_frag_medium_HD: ACE_frag_base { + hit = 14; + airFriction = BASE_DRAG_HD*0.75; + caliber = 1.2; + }; + + class ACE_frag_large: ACE_frag_base { + hit = 28; + indirectHit = 2; + indirectHitRange = 0.25; + airFriction = BASE_DRAG*0.65; + caliber = 2; + explosive = 0; + + }; + + class ACE_frag_large_HD: ACE_frag_large { + hit = 28; + indirectHit = 2; + indirectHitRange = 0.25; + airFriction = BASE_DRAG_HD*0.65; + caliber = 2; + + + }; + + class ACE_frag_huge: ACE_frag_large { + hit = 40; + indirectHit = 4; + indirectHitRange = 0.5; + airFriction = BASE_DRAG*0.5; + caliber = 2.8; + }; + + class ACE_frag_huge_HD: ACE_frag_large { + hit = 40; + indirectHit = 4; + indirectHitRange = 0.5; + airFriction = BASE_DRAG_HD*0.5; + caliber = 2.8; + }; + + class ACE_frag_spall_small: ACE_frag_small { + timeToLive = 0.1; + }; + + class ACE_frag_spall_medium: ACE_frag_medium { + timeToLive = 0.15; + }; + + class ACE_frag_spall_large: ACE_frag_large { + timeToLive = 0.25; + }; + + class ACE_frag_spall_huge: ACE_frag_huge { + timeToLive = 0.3; + }; }; diff --git a/addons/frag/CfgEventhandlers.hpp b/addons/frag/CfgEventhandlers.hpp index 121b24d062..1e631e07eb 100644 --- a/addons/frag/CfgEventhandlers.hpp +++ b/addons/frag/CfgEventhandlers.hpp @@ -1,17 +1,17 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_pre_init)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_pre_init)); + }; }; class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_post_init)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_post_init)); + }; }; class Extended_FiredBIS_EventHandlers { - class AllVehicles { - ADDON = QUOTE(_this call FUNC(fired)); - }; + class AllVehicles { + ADDON = QUOTE(_this call FUNC(fired)); + }; }; diff --git a/addons/frag/XEH_post_init.sqf b/addons/frag/XEH_post_init.sqf index ed0e715376..9769148871 100644 --- a/addons/frag/XEH_post_init.sqf +++ b/addons/frag/XEH_post_init.sqf @@ -1,18 +1,18 @@ #include "script_component.hpp" if(isServer) then { - [QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler; + [QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler; }; /* GVAR(replacedBisArtyWrapper) = false; [] spawn { - waitUntil { - if(!(isNil "BIS_ARTY_F_ShellFlight")) then { - ACE_WRAPPER_BIS_ARTY_F_ShellFlight = BIS_ARTY_F_ShellFlight; - BIS_ARTY_F_ShellFlight = FUNC(BIS_ARTY_WRAPPER); - GVAR(replacedBisArtyWrapper) = true; - }; - sleep 4; - GVAR(replacedBisArtyWrapper) - }; + waitUntil { + if(!(isNil "BIS_ARTY_F_ShellFlight")) then { + ACE_WRAPPER_BIS_ARTY_F_ShellFlight = BIS_ARTY_F_ShellFlight; + BIS_ARTY_F_ShellFlight = FUNC(BIS_ARTY_WRAPPER); + GVAR(replacedBisArtyWrapper) = true; + }; + sleep 4; + GVAR(replacedBisArtyWrapper) + }; }; */ \ No newline at end of file diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index 98a159a78e..d4fa788e97 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "A3_Misc_F", "A3_Weapons_F" }; - author[] = {"Nou"}; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "A3_Misc_F", "A3_Weapons_F" }; + author[] = {"Nou"}; + VERSION_CONFIG; + }; }; //PRELOAD_ADDONS; diff --git a/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf b/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf index ee7881277b..0d71cf58ac 100644 --- a/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf +++ b/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf @@ -1,13 +1,13 @@ #include "script_component.hpp" _ret = [(_this select 6)] call FUNC(removeTrack); if(!_ret) then { - [(_this select 6)] call FUNC(addBlackList); + [(_this select 6)] call FUNC(addBlackList); }; _this call ACE_WRAPPER_BIS_ARTY_F_ShellFlight; _catEntry = BIS_ARTY_SHELLCAT select ((count BIS_ARTY_SHELLCAT) - 1); _shell = _catEntry select 0; _ARTY_DeployOnImpact = getText (configFile >> "CfgAmmo" >> "ARTY_DeployOnImpact"); if(_ARTY_DeployOnImpact == "") then { - _this set[6, _shell]; - _this call FUNC(fired); + _this set[6, _shell]; + _this call FUNC(fired); }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_addManualTrack.sqf b/addons/frag/functions/fnc_addManualTrack.sqf index 066499f6aa..3dc14cc748 100644 --- a/addons/frag/functions/fnc_addManualTrack.sqf +++ b/addons/frag/functions/fnc_addManualTrack.sqf @@ -2,6 +2,6 @@ private ["_round"]; _round = _this select 0; if(alive _round) then { - GVAR(trackedObjects) set[(count GVAR(trackedObjects)), _round]; - [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), (typeOf _round), time, objNull, false, 0, 0]] call cba_fnc_addPerFrameHandler; + GVAR(trackedObjects) set[(count GVAR(trackedObjects)), _round]; + [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), (typeOf _round), time, objNull, false, 0, 0]] call cba_fnc_addPerFrameHandler; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf index 65ad3b6a22..2beea1dd56 100644 --- a/addons/frag/functions/fnc_addTrack.sqf +++ b/addons/frag/functions/fnc_addTrack.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" if(GVAR(autoTrace)) then { - [] call FUNC(startTracing); + [] call FUNC(startTracing); }; // setAccTime 0.05; @@ -9,7 +9,7 @@ _obj = _this select 1; _origin = _this select 0; _color = [1,0,0,1]; if((count _this) > 2) then { - _color = _this select 2; + _color = _this select 2; }; _positions = []; _objVel = velocity _obj; diff --git a/addons/frag/functions/fnc_denyFrag.sqf b/addons/frag/functions/fnc_denyFrag.sqf index 5459f0160a..6c4aa9bf8d 100644 --- a/addons/frag/functions/fnc_denyFrag.sqf +++ b/addons/frag/functions/fnc_denyFrag.sqf @@ -3,5 +3,5 @@ private ["_ret"]; _ret = [(_this select 0)] call FUNC(removeTrack); if(!_ret) then { - [(_this select 0)] call FUNC(addBlackList); + [(_this select 0)] call FUNC(addBlackList); }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 5560a4f0af..761490fa90 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -1,14 +1,14 @@ //fnc_doSpall.sqf #include "script_component.hpp" #ifdef DEBUG_MODE_FULL - GVAR(traceFrags) = true; + GVAR(traceFrags) = true; #endif // player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; private ["_params", "_initialData", "_hpData", "_roundType", "_round", "_object", "_caliber", "_explosive", - "_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar", - "_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k", - "_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", - "_fragment"]; + "_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar", + "_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k", + "_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", + "_fragment"]; _params = _this select 0; @@ -23,7 +23,7 @@ _object removeEventHandler ["hitPart", _initialData select 0]; _foundObjects = _initialData select 7; _index = _foundObjects find _object; if(_index != -1) then { - _foundObjecsts set[_index, nil]; + _foundObjecsts set[_index, nil]; }; _roundType = (_initialData select 2); @@ -36,131 +36,131 @@ _idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); _alive = true; if(!alive _round && (_initialData select 6) == 1) then { - _alive = false; + _alive = false; }; if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { - // player sideChat format["BBBB"]; - _exit = false; - _vm = 1; - _velocity = _initialData select 5; - - _oldVelocity = _velocity call BIS_fnc_magnitude; - _curVelocity = (velocity _round) call BIS_fnc_magnitude; - - if(alive _round) then { - _diff = _velocity vectorDiff (velocity _round); - _polar = _diff call CBA_fnc_vect2polar; - // player sideChat format["polar: %1", _polar]; - if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then { - if(_caliber < 2.5) then { - // player sideChat format["exit!"]; - _exit = true; - } else { - _vm = 1-(_curVelocity/_oldVelocity); - }; - }; - }; - if(!_exit) then { - _unitDir = vectorNormalized _velocity; - _pos = _hpData select 3; - _spallPos = nil; - for "_i" from 0 to 100 do { - _pos1 = [ - (_pos select 0) + (((_unitDir select 0)*0.01)*_i), - (_pos select 1) + (((_unitDir select 1)*0.01)*_i), - (_pos select 2) + (((_unitDir select 2)*0.01)*_i) - ]; - _pos2 = [ - (_pos select 0) + (((_unitDir select 0)*0.01)*(_i+1)), - (_pos select 1) + (((_unitDir select 1)*0.01)*(_i+1)), - (_pos select 2) + (((_unitDir select 2)*0.01)*(_i+1)) - ]; - // _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)]; - // diag_log text format["b: %1", _blah]; - - // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; - // NOU_TRACES set[(count NOU_TRACES), _data]; - - if(!lineIntersects [_pos1, _pos2]) exitWith { - // player sideChat format["FOUND!"]; - _spallPos = _pos2; - }; - }; - if(!isNil "_spallPos") then { - _spallPolar = _velocity call CBA_fnc_vect2polar; - - if(_explosive > 0) then { - // player sideChat format["EXPLOSIVE!"]; - _warn = false; - _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE"); - if(_c == 0) then { _c = 1; _warn = true;}; - _m = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_METAL"); - if(_m == 0) then { _m = 2; _warn = true;}; - _k = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_K"); - if(_k == 0) then { _k = 1/2; _warn = true;}; - _gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_C"); - if(_gC == 0) then { _gC = 2440; _warn = true;}; + // player sideChat format["BBBB"]; + _exit = false; + _vm = 1; + _velocity = _initialData select 5; + + _oldVelocity = _velocity call BIS_fnc_magnitude; + _curVelocity = (velocity _round) call BIS_fnc_magnitude; + + if(alive _round) then { + _diff = _velocity vectorDiff (velocity _round); + _polar = _diff call CBA_fnc_vect2polar; + // player sideChat format["polar: %1", _polar]; + if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then { + if(_caliber < 2.5) then { + // player sideChat format["exit!"]; + _exit = true; + } else { + _vm = 1-(_curVelocity/_oldVelocity); + }; + }; + }; + if(!_exit) then { + _unitDir = vectorNormalized _velocity; + _pos = _hpData select 3; + _spallPos = nil; + for "_i" from 0 to 100 do { + _pos1 = [ + (_pos select 0) + (((_unitDir select 0)*0.01)*_i), + (_pos select 1) + (((_unitDir select 1)*0.01)*_i), + (_pos select 2) + (((_unitDir select 2)*0.01)*_i) + ]; + _pos2 = [ + (_pos select 0) + (((_unitDir select 0)*0.01)*(_i+1)), + (_pos select 1) + (((_unitDir select 1)*0.01)*(_i+1)), + (_pos select 2) + (((_unitDir select 2)*0.01)*(_i+1)) + ]; + // _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)]; + // diag_log text format["b: %1", _blah]; + + // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; + // NOU_TRACES set[(count NOU_TRACES), _data]; + + if(!lineIntersects [_pos1, _pos2]) exitWith { + // player sideChat format["FOUND!"]; + _spallPos = _pos2; + }; + }; + if(!isNil "_spallPos") then { + _spallPolar = _velocity call CBA_fnc_vect2polar; + + if(_explosive > 0) then { + // player sideChat format["EXPLOSIVE!"]; + _warn = false; + _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE"); + if(_c == 0) then { _c = 1; _warn = true;}; + _m = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_METAL"); + if(_m == 0) then { _m = 2; _warn = true;}; + _k = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_K"); + if(_k == 0) then { _k = 1/2; _warn = true;}; + _gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_C"); + if(_gC == 0) then { _gC = 2440; _warn = true;}; - if(_warn) then { - diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _roundType]; //TODO: turn this off when we get closer to release - }; + if(_warn) then { + diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _roundType]; //TODO: turn this off when we get closer to release + }; - _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; - _spallPolar set[0, _fragPower*0.66]; - }; - - _fragTypes = [ - "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small", - "ACE_frag_spall_small","ACE_frag_spall_medium","ACE_frag_spall_medium","ACE_frag_spall_medium", - "ACE_frag_spall_medium", "ACE_frag_spall_large", "ACE_frag_spall_large", "ACE_frag_spall_huge", - "ACE_frag_spall_huge" + _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; + _spallPolar set[0, _fragPower*0.66]; + }; + + _fragTypes = [ + "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small", + "ACE_frag_spall_small","ACE_frag_spall_medium","ACE_frag_spall_medium","ACE_frag_spall_medium", + "ACE_frag_spall_medium", "ACE_frag_spall_large", "ACE_frag_spall_large", "ACE_frag_spall_huge", + "ACE_frag_spall_huge" - ]; - - // diag_log text format["SPALL POWER: %1", _spallPolar select 0]; - _spread = 15+(random 25); - _spallCount = 5+(random 10); - for "_i" from 1 to _spallCount do { - _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); - _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); - if(abs _elev > 90) then { - _dir = _dir + 180; - }; - _dir = _dir % 360; - _vel = (_spallPolar select 0)*0.33*_vm; - _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - - _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - _fragType = round (random ((count _fragTypes)-1)); - _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - _fragment setPosASL _spallPos; - _fragment setVelocity _spallFragVect; - if(GVAR(traceFrags)) then { - [player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); - }; - }; - _spread = 5+(random 5); - _spallCount = 3+(random 5); - for "_i" from 1 to _spallCount do { - _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); - _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); - if(abs _elev > 90) then { - _dir = _dir + 180; - }; - _dir = _dir % 360; - _vel = (_spallPolar select 0)*0.55*_vm; - _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); - - _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; - _fragType = round (random ((count _fragTypes)-1)); - _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - _fragment setPosASL _spallPos; - _fragment setVelocity _spallFragVect; - if(GVAR(traceFrags)) then { - [player, _fragment, [1,0,0,1]] call FUNC(addTrack); - }; - }; - }; - }; + ]; + + // diag_log text format["SPALL POWER: %1", _spallPolar select 0]; + _spread = 15+(random 25); + _spallCount = 5+(random 10); + for "_i" from 1 to _spallCount do { + _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); + _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); + if(abs _elev > 90) then { + _dir = _dir + 180; + }; + _dir = _dir % 360; + _vel = (_spallPolar select 0)*0.33*_vm; + _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); + + _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; + _fragType = round (random ((count _fragTypes)-1)); + _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + _fragment setPosASL _spallPos; + _fragment setVelocity _spallFragVect; + if(GVAR(traceFrags)) then { + [player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); + }; + }; + _spread = 5+(random 5); + _spallCount = 3+(random 5); + for "_i" from 1 to _spallCount do { + _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); + _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); + if(abs _elev > 90) then { + _dir = _dir + 180; + }; + _dir = _dir % 360; + _vel = (_spallPolar select 0)*0.55*_vm; + _vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); + + _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; + _fragType = round (random ((count _fragTypes)-1)); + _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + _fragment setPosASL _spallPos; + _fragment setVelocity _spallFragVect; + if(GVAR(traceFrags)) then { + [player, _fragment, [1,0,0,1]] call FUNC(addTrack); + }; + }; + }; + }; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_drawTraces.sqf b/addons/frag/functions/fnc_drawTraces.sqf index 8e3ab6146e..b9645bab97 100644 --- a/addons/frag/functions/fnc_drawTraces.sqf +++ b/addons/frag/functions/fnc_drawTraces.sqf @@ -1,32 +1,32 @@ #include "script_component.hpp" { - _positions = _x select 4; - _color = _x select 5; - _index = 0; - _max = count _positions; - _startSpeed = (_positions select 0) select 1; - if(_startSpeed <= 0) then { - _startSpeed = 0.01; - }; - _lastSpd = []; - _lastPos = []; - while {_index < _max} do { - _data1 = _positions select _index; - _data2 = nil; - if(_index + ACE_TRACE_DRAW_INC >= _max) then { - _data2 = _positions select (_max - 1); - } else { - _data2 = _positions select (_index + ACE_TRACE_DRAW_INC); - }; - - _pos1 = _data1 select 0; - _pos2 = _data2 select 0; - _index = _index + ACE_TRACE_DRAW_INC; - - - drawLine3D [_pos1, _pos2, _color]; - _lastPos = _pos2; - _lastSpd = _data1 select 1; - }; - // drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format["%1m/s", _lastSpd], 1, 0.05, "PuristaMedium"]; + _positions = _x select 4; + _color = _x select 5; + _index = 0; + _max = count _positions; + _startSpeed = (_positions select 0) select 1; + if(_startSpeed <= 0) then { + _startSpeed = 0.01; + }; + _lastSpd = []; + _lastPos = []; + while {_index < _max} do { + _data1 = _positions select _index; + _data2 = nil; + if(_index + ACE_TRACE_DRAW_INC >= _max) then { + _data2 = _positions select (_max - 1); + } else { + _data2 = _positions select (_index + ACE_TRACE_DRAW_INC); + }; + + _pos1 = _data1 select 0; + _pos2 = _data2 select 0; + _index = _index + ACE_TRACE_DRAW_INC; + + + drawLine3D [_pos1, _pos2, _color]; + _lastPos = _pos2; + _lastSpd = _data1 select 1; + }; + // drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format["%1m/s", _lastSpd], 1, 0.05, "PuristaMedium"]; } forEach GVAR(traces); \ No newline at end of file diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index a6e934c667..e7d7d09682 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -7,42 +7,42 @@ _type = _this select 4; _round = _this select 6; if(_round in GVAR(blackList)) exitWith { - GVAR(blackList) = GVAR(blackList) - [_round]; + GVAR(blackList) = GVAR(blackList) - [_round]; }; _doFragTrack = false; if(_gun == player) then { - _doFragTrack = true; + _doFragTrack = true; } else { - if((gunner _gun) == player) then { - _doFragTrack = true; - } else { - if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then { - _doFragTrack = true; - }; - }; + if((gunner _gun) == 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 { - // player sideChat "LIMT!"; - _doSpall = false; - } else { - GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1; - }; + if(GVAR(spallIsTrackingCount) <= 0) then { + GVAR(spallHPData) = []; + }; + if(GVAR(spallIsTrackingCount) > 5) then { + // player sideChat "LIMT!"; + _doSpall = false; + } else { + GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1; + }; }; // player sideChat format["c: %1", GVAR(spallIsTrackingCount)]; [player, _round, [1,0,0,1]] call nou_fnc_addTrack; if(_doFragTrack && alive _round) then { - GVAR(trackedObjects) pushBack _round; - _spallTrack = []; - _spallTrackID = []; - [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler; - if(_doSpall) then { - [_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack); - }; - // player sideChat "WTF2"; + GVAR(trackedObjects) pushBack _round; + _spallTrack = []; + _spallTrackID = []; + [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler; + if(_doSpall) then { + [_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack); + }; + // player sideChat "WTF2"; }; diff --git a/addons/frag/functions/fnc_frag_trace.sqf b/addons/frag/functions/fnc_frag_trace.sqf index f4e14fa12a..664e117793 100644 --- a/addons/frag/functions/fnc_frag_trace.sqf +++ b/addons/frag/functions/fnc_frag_trace.sqf @@ -4,7 +4,7 @@ private ["_params", "_shell"]; _params = _this select 0; _shell = _params select 0; if(alive _shell) then { - drop ["\Ca\Data\Cl_basic","","Billboard",1,30,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,1,0,1]],[0],0.0,2.0,"","",""]; + drop ["\Ca\Data\Cl_basic","","Billboard",1,30,(getPos _shell),[0,0,0],1,1.275,1.0,0.0,[0.5],[[0,1,0,1]],[0],0.0,2.0,"","",""]; } else { - [_this select 1] call cba_fnc_removePerFrameHandler; + [_this select 1] call cba_fnc_removePerFrameHandler; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 79eea53cd7..1b737dc70d 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -10,43 +10,43 @@ if(!isServer) exitWith { }; // _startTime = diag_tickTime; private ["_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", - "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", - "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox", - "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", - "_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", - "_sectorSize", "_sectorOffset", "_randomDir"]; - - + "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", + "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox", + "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", + "_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", + "_sectorSize", "_sectorOffset", "_randomDir"]; + + _round = _this select 0; _lastPos = _this select 1; _lastVel = _this select 2; _shellType = _this select 3; _gun = nil; if((count _this) > 5) then { - _gun = _this select 5; + _gun = _this select 5; }; _fragTypes = [ - "ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny", - "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", - "ACE_frag_small","ACE_frag_small","ACE_frag_small","ACE_frag_small", - "ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD", - "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD" - ]; + "ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny", + "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", + "ACE_frag_small","ACE_frag_small","ACE_frag_small","ACE_frag_small", + "ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD", + "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD" + ]; _warn = false; if(isArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES")) then { - _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES"); + _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES"); } else { - _warn = true; + _warn = true; }; _atlPos = ASLtoATL _lastPos; _isArmed = true; if(!isNil "_gun") then { - _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); - _isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist); + _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); + _isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist); }; _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange"); @@ -72,7 +72,7 @@ _gC = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_C"); if(_gC == 0) then { _gC = 2440; _warn = true;}; if(_warn) then { - diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _shellType]; //TODO: turn this off when we get closer to release + diag_log text format["Ammo class %1 lacks proper explosive properties definitions for frag!", _shellType]; //TODO: turn this off when we get closer to release }; _fragPower = (((_m/_c)+_k)^-(1/2))*_gC; @@ -80,7 +80,7 @@ _fragPower = _fragPower*0.8; // Gunery equation is for a non-fragmenting metal, _fragPowerRandom = _fragPower*0.5; if((_atlPos select 2) < 0.5) then { - _lastPos set[2, (_lastPos select 2)+0.5]; + _lastPos set[2, (_lastPos select 2)+0.5]; }; // _manObjects = _atlPos nearEntities ["CaManBase", _fragRange]; @@ -108,123 +108,123 @@ _fragArcs = []; _fragArcs set[360, 0]; #ifdef DEBUG_MODE_FULL - player sideChat format["_fragRange: %1", _fragRange]; - player sideChat format["_objects: %1", _objects]; + player sideChat format["_fragRange: %1", _fragRange]; + player sideChat format["_objects: %1", _objects]; #endif _doRandom = false; if(_isArmed && (count _objects) > 0) then { - { - //if(random(1) > 0.5) then { - _target = _x; - if(alive _target) then { - _boundingBox = boundingBox _target; - _targetPos = (getPosASL _target); - _distance = _targetPos distance _lastPos; - _add = (((_boundingBox select 1) select 2)/2)+((((_distance-(_fragpower/8)) max 0)/_fragPower)*10); - _bbX = (abs((_boundingBox select 0) select 0))+((_boundingBox select 1) select 0); - _bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1); - _bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2); - _cubic = _bbX*_bbY*_bbZ; - if(_cubic > 1) then { - _doRandom = true; - - _targetVel = (velocity _target); - - - _targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))]; - _targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))]; - _targetPos set[2, (_targetPos select 2)+_add]; + { + //if(random(1) > 0.5) then { + _target = _x; + if(alive _target) then { + _boundingBox = boundingBox _target; + _targetPos = (getPosASL _target); + _distance = _targetPos distance _lastPos; + _add = (((_boundingBox select 1) select 2)/2)+((((_distance-(_fragpower/8)) max 0)/_fragPower)*10); + _bbX = (abs((_boundingBox select 0) select 0))+((_boundingBox select 1) select 0); + _bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1); + _bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2); + _cubic = _bbX*_bbY*_bbZ; + if(_cubic > 1) then { + _doRandom = true; + + _targetVel = (velocity _target); + + + _targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))]; + _targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))]; + _targetPos set[2, (_targetPos select 2)+_add]; _baseVec = _lastPos vectorFromTo _targetPos; - - _dir = floor(_baseVec call CBA_fnc_vectDir); - _currentCount = _fragArcs select _dir; - if(isNil "_currentCount") then { - _currentCount = 0; - }; - if(_currentCount < 20) then { - _count = ceil(random(sqrt(_m/1000))); - _vecVar = FRAG_VEC_VAR; - if(!(_target isKindOf "Man")) then { - _vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR; - if((count (crew _target)) == 0 && _count > 0) then { - _count = 0 max (_count/2); - }; - }; - for "_i" from 1 to _count do { - _vec = +_baseVec; - - _vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)]; - _vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)]; - _vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)]; - - _fp = (_fragPower-(random (_fragPowerRandom))); - _vel = [ - (_vec select 0)*_fp, - (_vec select 1)*_fp, - (_vec select 2)*_fp - ]; - - _fragType = round (random ((count _fragTypes)-1)); - _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - // diag_log text format["fp: %1 %2", _fp, typeOf _fragObj]; - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; - #ifdef DEBUG_MODE_FULL - GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; - GVAR(traceFrags) = true; - #endif - if(GVAR(traceFrags)) then { - [player, _fragObj, [1,0,0,1]] call FUNC(addTrack); - }; - _fragCount = _fragCount + 1; - _currentCount = _currentCount + 1; - }; - _fragArcs set[_dir, _currentCount]; - }; - }; - }; - //}; - if(_fragCount > MAX_FRAG_COUNT) exitWith {}; - } forEach _objects; - if(_fragCount > MAX_FRAG_COUNT) exitWith {}; - _randomCount = (ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0; - _sectorSize = 360 / (_randomCount max 1); - // _doRandom = false; - if(_doRandom) then { - for "_i" from 1 to _randomCount do { - // Distribute evenly - _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); - _randomDir = random(_sectorSize); - _vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))]; - - _fp = (_fragPower-(random (_fragPowerRandom))); - - _vel = [ - (_vec select 0)*_fp, - (_vec select 1)*_fp, - (_vec select 2)*_fp - ]; - - _fragType = round (random ((count _fragTypes)-1)); - _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; - _fragObj setPosASL _lastPos; - _fragObj setVectorDir _vec; - _fragObj setVelocity _vel; - #ifdef DEBUG_MODE_FULL - GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; - GVAR(traceFrags) = true; - #endif - if(GVAR(traceFrags)) then { - [player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); - }; - _fragCount = _fragCount + 1; - }; - }; + + _dir = floor(_baseVec call CBA_fnc_vectDir); + _currentCount = _fragArcs select _dir; + if(isNil "_currentCount") then { + _currentCount = 0; + }; + if(_currentCount < 20) then { + _count = ceil(random(sqrt(_m/1000))); + _vecVar = FRAG_VEC_VAR; + if(!(_target isKindOf "Man")) then { + _vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR; + if((count (crew _target)) == 0 && _count > 0) then { + _count = 0 max (_count/2); + }; + }; + for "_i" from 1 to _count do { + _vec = +_baseVec; + + _vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)]; + _vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)]; + _vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)]; + + _fp = (_fragPower-(random (_fragPowerRandom))); + _vel = [ + (_vec select 0)*_fp, + (_vec select 1)*_fp, + (_vec select 2)*_fp + ]; + + _fragType = round (random ((count _fragTypes)-1)); + _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + // diag_log text format["fp: %1 %2", _fp, typeOf _fragObj]; + _fragObj setPosASL _lastPos; + _fragObj setVectorDir _vec; + _fragObj setVelocity _vel; + #ifdef DEBUG_MODE_FULL + GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; + GVAR(traceFrags) = true; + #endif + if(GVAR(traceFrags)) then { + [player, _fragObj, [1,0,0,1]] call FUNC(addTrack); + }; + _fragCount = _fragCount + 1; + _currentCount = _currentCount + 1; + }; + _fragArcs set[_dir, _currentCount]; + }; + }; + }; + //}; + if(_fragCount > MAX_FRAG_COUNT) exitWith {}; + } forEach _objects; + if(_fragCount > MAX_FRAG_COUNT) exitWith {}; + _randomCount = (ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0; + _sectorSize = 360 / (_randomCount max 1); + // _doRandom = false; + if(_doRandom) then { + for "_i" from 1 to _randomCount do { + // Distribute evenly + _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); + _randomDir = random(_sectorSize); + _vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))]; + + _fp = (_fragPower-(random (_fragPowerRandom))); + + _vel = [ + (_vec select 0)*_fp, + (_vec select 1)*_fp, + (_vec select 2)*_fp + ]; + + _fragType = round (random ((count _fragTypes)-1)); + _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; + _fragObj setPosASL _lastPos; + _fragObj setVectorDir _vec; + _fragObj setVelocity _vel; + #ifdef DEBUG_MODE_FULL + GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; + GVAR(traceFrags) = true; + #endif + if(GVAR(traceFrags)) then { + [player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); + }; + _fragCount = _fragCount + 1; + }; + }; }; // #ifdef DEBUG_MODE_FULL - // player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; - // player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; + // player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; + // player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; // #endif // _endTime = diag_tickTime; diff --git a/addons/frag/functions/fnc_removeTrack.sqf b/addons/frag/functions/fnc_removeTrack.sqf index b72830051a..804719a7ca 100644 --- a/addons/frag/functions/fnc_removeTrack.sqf +++ b/addons/frag/functions/fnc_removeTrack.sqf @@ -3,12 +3,12 @@ private ["_ret"]; _ret = true; if(IS_ARRAY((_this select 0))) then { - _ret = false; + _ret = false; } else { - if((_this select 0) in GVAR(trackedObjects)) then { - GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)]; - } else { - _ret = false; - }; + if((_this select 0) in GVAR(trackedObjects)) then { + GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)]; + } else { + _ret = false; + }; }; _ret \ No newline at end of file diff --git a/addons/frag/functions/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf index 89ba572ce2..fb894be499 100644 --- a/addons/frag/functions/fnc_spallHP.sqf +++ b/addons/frag/functions/fnc_spallHP.sqf @@ -3,27 +3,27 @@ private ["_initialData", "_currentCount", "_hpData", "_round", "_hpRound"]; //player sideChat format["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; if((_this select 0) <= (count GVAR(spallHPData))) then { - _initialData = GVAR(spallHPData) select (_this select 0); - if(!isNil "_initialData") then { - _hpRound = ((_this select 1) select 0) select 2; - _round = _initialData select 3; - _hpDirect = ((_this select 1) select 0) select 10; - if(_hpDirect && {_round == _hpRound}) then { - - { - _hpData = _x; - _round = _initialData select 3; - // diag_log text format["HPDUMP-------------------------------------"]; - // { - // _hp = _x; - // diag_log text format["%1 --", _forEachIndex]; - // { - // diag_log text format["%1: %2", _forEachIndex, _x]; - // } forEach _hp; - // } forEach (_this select 1); - [DFUNC(doSpall), 0, [_this, _forEachIndex]] call cba_fnc_addPerFrameHandler; - // player sideChat "WEEE"; - } forEach (_this select 1); - }; - }; + _initialData = GVAR(spallHPData) select (_this select 0); + if(!isNil "_initialData") then { + _hpRound = ((_this select 1) select 0) select 2; + _round = _initialData select 3; + _hpDirect = ((_this select 1) select 0) select 10; + if(_hpDirect && {_round == _hpRound}) then { + + { + _hpData = _x; + _round = _initialData select 3; + // diag_log text format["HPDUMP-------------------------------------"]; + // { + // _hp = _x; + // diag_log text format["%1 --", _forEachIndex]; + // { + // diag_log text format["%1: %2", _forEachIndex, _x]; + // } forEach _hp; + // } forEach (_this select 1); + [DFUNC(doSpall), 0, [_this, _forEachIndex]] call cba_fnc_addPerFrameHandler; + // player sideChat "WEEE"; + } forEach (_this select 1); + }; + }; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf index 31e9c228bb..a264e1ded9 100644 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ b/addons/frag/functions/fnc_spallTrack.sqf @@ -12,29 +12,29 @@ _curPos = getPosASL _round; _velocity = velocity _round; _velocityStep = [ - (_velocity select 0)*_delta, - (_velocity select 1)*_delta, - (_velocity select 2)*_delta - ]; + (_velocity select 0)*_delta, + (_velocity select 1)*_delta, + (_velocity select 2)*_delta + ]; _forwardPos = [ - (_curPos select 0) + (_velocityStep select 0), - (_curPos select 1) + (_velocityStep select 1), - (_curPos select 2) + (_velocityStep select 2) - ]; - + (_curPos select 0) + (_velocityStep select 0), + (_curPos select 1) + (_velocityStep select 1), + (_curPos select 2) + (_velocityStep select 2) + ]; + _intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; if(count _intersectsWith > 0) then { - // player sideChat format["inter: %1", _intersectsWith]; - { - if(!(_x in _foundObjects)) then { - // diag_log text format["Adding HP: %1", _x]; - _index = (count GVAR(spallHPData)); - _hpId = _x addEventHandler ["hitPart", format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]]; - _foundObjects set[(count _foundObjects), _x]; - _foundObjectHPIds set[(count _foundObjectHPIds), _hpId]; - _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; - GVAR(spallHPData) set[_index, _data]; - }; - } forEach _intersectsWith; + // player sideChat format["inter: %1", _intersectsWith]; + { + if(!(_x in _foundObjects)) then { + // diag_log text format["Adding HP: %1", _x]; + _index = (count GVAR(spallHPData)); + _hpId = _x addEventHandler ["hitPart", format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]]; + _foundObjects set[(count _foundObjects), _x]; + _foundObjectHPIds set[(count _foundObjectHPIds), _hpId]; + _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; + GVAR(spallHPData) set[_index, _data]; + }; + } forEach _intersectsWith; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_startTracing.sqf b/addons/frag/functions/fnc_startTracing.sqf index 31f4b99762..4ed9240ed6 100644 --- a/addons/frag/functions/fnc_startTracing.sqf +++ b/addons/frag/functions/fnc_startTracing.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" if(!GVAR(tracesStarted)) then { - GVAR(tracesStarted) = true; - GVAR(traceID) = [FUNC(drawTraces), 0, []] call cba_fnc_addPerFrameHandler; + GVAR(tracesStarted) = true; + GVAR(traceID) = [FUNC(drawTraces), 0, []] call cba_fnc_addPerFrameHandler; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_stopTracing.sqf b/addons/frag/functions/fnc_stopTracing.sqf index 693390fff2..56d7508d6b 100644 --- a/addons/frag/functions/fnc_stopTracing.sqf +++ b/addons/frag/functions/fnc_stopTracing.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" if(GVAR(tracesStarted)) then { - GVAR(tracesStarted) = false; - [GVAR(traceID)] call cba_fnc_removePerFrameHandler; + GVAR(tracesStarted) = false; + [GVAR(traceID)] call cba_fnc_removePerFrameHandler; }; \ No newline at end of file diff --git a/addons/frag/functions/fnc_trackFragRound.sqf b/addons/frag/functions/fnc_trackFragRound.sqf index 0a8e3948d0..586bbc0166 100644 --- a/addons/frag/functions/fnc_trackFragRound.sqf +++ b/addons/frag/functions/fnc_trackFragRound.sqf @@ -12,41 +12,41 @@ _spallTrack = _params select 7; _foundObjectHPIds = _params select 8; if (!alive _round) then { - [_this select 1] call cba_fnc_removePerFrameHandler; - if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then { - GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; - _skip = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_SKIP"); - if(_skip == 0) then { - _explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"); - _indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"); - _force = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_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; - }; + [_this select 1] call cba_fnc_removePerFrameHandler; + if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then { + GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; + _skip = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_SKIP"); + if(_skip == 0) then { + _explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"); + _indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"); + _force = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_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); - }; + 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); + }; }; diff --git a/addons/frag/functions/fnc_trackTrace.sqf b/addons/frag/functions/fnc_trackTrace.sqf index 628fece605..b0f3f06633 100644 --- a/addons/frag/functions/fnc_trackTrace.sqf +++ b/addons/frag/functions/fnc_trackTrace.sqf @@ -4,11 +4,11 @@ _tracerObj = _params select 0; _index = _params select 1; if(alive _tracerObj && (count GVAR(traces)) > 0) then { - _data = GVAR(traces) select _index; - _positions = _data select 4; - _objVel = velocity _tracerObj; - _objTVel = sqrt((_objVel select 0)^2 + (_objVel select 1)^2 + (_objVel select 2)^2); - _positions set[(count _positions), [(getPos _tracerObj), _objTVel]]; + _data = GVAR(traces) select _index; + _positions = _data select 4; + _objVel = velocity _tracerObj; + _objTVel = sqrt((_objVel select 0)^2 + (_objVel select 1)^2 + (_objVel select 2)^2); + _positions set[(count _positions), [(getPos _tracerObj), _objTVel]]; } else { - [(_this select 1)] call cba_fnc_removePerFrameHandler; -}; \ No newline at end of file + [(_this select 1)] call cba_fnc_removePerFrameHandler; +}; \ No newline at end of file diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 371067db3e..3740ed23fa 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -4,13 +4,13 @@ //#define DEBUG_ENABLED_FRAG #ifdef DEBUG_ENABLED_FRAG - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_FRAG - #define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG + #define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG #endif #include "\z\ace\Addons\main\script_macros.hpp" -#define ACE_TRACE_DRAW_INC 1 \ No newline at end of file +#define ACE_TRACE_DRAW_INC 1 \ No newline at end of file diff --git a/addons/gforces/script_component.hpp b/addons/gforces/script_component.hpp index bd52732420..cf665c21ec 100644 --- a/addons/gforces/script_component.hpp +++ b/addons/gforces/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_GFORCES - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_GFORCES - #define DEBUG_SETTINGS DEBUG_SETTINGS_GFORCES + #define DEBUG_SETTINGS DEBUG_SETTINGS_GFORCES #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/goggles/RscTitles.hpp b/addons/goggles/RscTitles.hpp index 57975e052f..6c1b9870b6 100644 --- a/addons/goggles/RscTitles.hpp +++ b/addons/goggles/RscTitles.hpp @@ -1,42 +1,42 @@ class RscTitles{ - #include "define.hpp" - - class RscACE_Goggles_BaseTitle{ - idd = -1; - onLoad = "uiNamespace setVariable ['ACE_Goggles_Display', _this select 0]"; - onUnload = "uiNamespace setVariable ['ACE_Goggles_Display', displayNull]"; - fadeIn=0.5; - fadeOut=0.5; - movingEnable = false; - duration = 10e10; - name = "RscACE_Goggles_BaseTitle"; - class controls; - }; - - class RscACE_Goggles:RscACE_Goggles_BaseTitle{ - idd = 1044; - name = "RscACE_Goggles"; - class controls{ - class gogglesImage: RscPicture{ - idc = 10650; - }; - }; - }; - - class RscACE_GogglesEffects:RscACE_Goggles_BaseTitle{ - idd = 1045; - onLoad = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', _this select 0]"; - onUnload = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', displayNull]"; - name = "RscACE_GogglesEffects"; - fadeIn=0; - fadeOut=0.5; - class controls{ - class dirtImage: RscPicture { - idc = 10660; - }; - class dustImage: RscPicture { - idc = 10662; - }; - }; - }; + #include "define.hpp" + + class RscACE_Goggles_BaseTitle{ + idd = -1; + onLoad = "uiNamespace setVariable ['ACE_Goggles_Display', _this select 0]"; + onUnload = "uiNamespace setVariable ['ACE_Goggles_Display', displayNull]"; + fadeIn=0.5; + fadeOut=0.5; + movingEnable = false; + duration = 10e10; + name = "RscACE_Goggles_BaseTitle"; + class controls; + }; + + class RscACE_Goggles:RscACE_Goggles_BaseTitle{ + idd = 1044; + name = "RscACE_Goggles"; + class controls{ + class gogglesImage: RscPicture{ + idc = 10650; + }; + }; + }; + + class RscACE_GogglesEffects:RscACE_Goggles_BaseTitle{ + idd = 1045; + onLoad = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', _this select 0]"; + onUnload = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', displayNull]"; + name = "RscACE_GogglesEffects"; + fadeIn=0; + fadeOut=0.5; + class controls{ + class dirtImage: RscPicture { + idc = 10660; + }; + class dustImage: RscPicture { + idc = 10662; + }; + }; + }; }; \ No newline at end of file diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index dcc9c6ed0e..efda9b5436 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -3,279 +3,279 @@ #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; + 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" -#define COMBAT_GOGGLES ACE_Overlay = QUOTE(PATHTOF(textures\HUD\CombatGoggles.paa)); \ - ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\CombatGogglesCracked.paa)); \ - ACE_Resistance = 2; \ - ACE_Protection = 1; +#define COMBAT_GOGGLES ACE_Overlay = QUOTE(PATHTOF(textures\HUD\CombatGoggles.paa)); \ + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\CombatGogglesCracked.paa)); \ + ACE_Resistance = 2; \ + ACE_Protection = 1; class CfgGlasses { - class None { - ACE_Color[] = {0,0,0}; - ACE_TintAmount=0; - ACE_Overlay = ""; - ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa"; - ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\Cracked.paa)); - ACE_Resistance = 0; - ACE_Protection = 0; - ACE_DustPath = QUOTE(PATHTOF(textures\fx\dust\%1.paa)); - }; + class None { + ACE_Color[] = {0,0,0}; + ACE_TintAmount=0; + ACE_Overlay = ""; + ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa"; + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\Cracked.paa)); + ACE_Resistance = 0; + ACE_Protection = 0; + ACE_DustPath = QUOTE(PATHTOF(textures\fx\dust\%1.paa)); + }; - class G_Combat:None { - COMBAT_GOGGLES - }; + class G_Combat:None { + COMBAT_GOGGLES + }; - class G_Diving { - ACE_Overlay = QUOTE(PATHTOF(textures\HUD\DivingGoggles.paa)); - ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\DivingGogglesCracked.paa)); - ACE_Resistance = 2; - ACE_Protection = 1; - }; + class G_Diving { + ACE_Overlay = QUOTE(PATHTOF(textures\HUD\DivingGoggles.paa)); + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\DivingGogglesCracked.paa)); + ACE_Resistance = 2; + ACE_Protection = 1; + }; - class G_Lowprofile:None { - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 2; - ACE_Protection = 1; - }; + class G_Lowprofile:None { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 2; + ACE_Protection = 1; + }; - class G_Shades_Black:None { - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Shades_Black:None { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Shades_Blue:None{ - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Shades_Blue:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Shades_Green:None{ - ACE_Color[] = {0,1,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Shades_Green:None{ + ACE_Color[] = {0,1,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Shades_Red:None{ - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Shades_Red:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Spectacles:None{ - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Spectacles:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Spectacles_Tinted:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Spectacles_Tinted:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Sport_Blackred:None{ - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Sport_Blackred:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Sport_BlackWhite:None{ - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Sport_BlackWhite:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Sport_Blackyellow:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Sport_Blackyellow:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Sport_Checkered:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Sport_Checkered:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Sport_Greenblack:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Sport_Greenblack:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Sport_Red:None{ - ACE_TintAmount=COLOUR*2; - ACE_Color[] = {0,0,0}; - ACE_Resistance = 1; - }; + class G_Sport_Red:None{ + ACE_TintAmount=COLOUR*2; + ACE_Color[] = {0,0,0}; + ACE_Resistance = 1; + }; - class G_Squares:None{ - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Squares:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Squares_Tinted:None{ - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Squares_Tinted:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Tactical_Black:None{ - ACE_TintAmount=COLOUR; - ACE_Color[] = {0,0,-1.5}; - ACE_Resistance = 1; - }; + class G_Tactical_Black:None{ + ACE_TintAmount=COLOUR; + ACE_Color[] = {0,0,-1.5}; + ACE_Resistance = 1; + }; - class G_Tactical_Clear:None{ - ACE_TintAmount=COLOUR; - ACE_Color[] = {0,0,-1}; - ACE_Resistance = 1; - }; + class G_Tactical_Clear:None{ + ACE_TintAmount=COLOUR; + ACE_Color[] = {0,0,-1}; + ACE_Resistance = 1; + }; - class G_Aviator:None{ - ACE_Color[] = {0,0,-1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Aviator:None{ + ACE_Color[] = {0,0,-1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Lady_Blue:None{ - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Lady_Blue:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Lady_Red:None{ - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Lady_Red:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class G_Lady_Dark:None{ - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - }; + class G_Lady_Dark:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; - class G_Lady_Mirror:None{ - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; + class G_Lady_Mirror:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; - class AV_ESS_blk:None{ - COMBAT_GOGGLES - }; + class AV_ESS_blk:None{ + COMBAT_GOGGLES + }; - class G_Balaclava_blk; + class G_Balaclava_blk; - class G_Balaclava_combat:G_Balaclava_blk { - COMBAT_GOGGLES - }; + class G_Balaclava_combat:G_Balaclava_blk { + COMBAT_GOGGLES + }; - class G_Balaclava_lowprofile:G_Balaclava_blk { - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 2; - ACE_Protection = 1; - }; + class G_Balaclava_lowprofile:G_Balaclava_blk { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 2; + ACE_Protection = 1; + }; - class G_Bandanna_blk; - class G_Bandanna_shades:G_Bandanna_blk { - ACE_TintAmount=COLOUR*2; - ACE_Resistance = 1; - ACE_Protection = 1; - }; - class G_Bandanna_sport:G_Bandanna_blk { - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - ACE_Protection = 1; - }; - class G_Bandanna_aviator:G_Bandanna_blk { - ACE_Color[] = {0,0,-1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - ACE_Protection = 1; - }; + class G_Bandanna_blk; + class G_Bandanna_shades:G_Bandanna_blk { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_Bandanna_sport:G_Bandanna_blk { + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_Bandanna_aviator:G_Bandanna_blk { + ACE_Color[] = {0,0,-1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + ACE_Protection = 1; + }; }; #include "RscTitles.hpp" class CfgMovesBasic { - class ManActions { - GestureWipeFace[] = {"GestureWipeFace", "gesture"}; - }; + class ManActions { + GestureWipeFace[] = {"GestureWipeFace", "gesture"}; + }; }; class CfgGesturesMale { - class States { - class GestureFreezeStand; - class GestureWipeFace: GestureFreezeStand { - file = QUOTE(PATHTOF(anim\WipeGlasses.rtm)); - canPullTrigger = 0; - }; - }; + class States { + class GestureFreezeStand; + class GestureWipeFace: GestureFreezeStand { + file = QUOTE(PATHTOF(anim\WipeGlasses.rtm)); + canPullTrigger = 0; + }; + }; }; class CfgWeapons { - class H_HelmetB; + class H_HelmetB; - class H_CrewHelmetHeli_B:H_HelmetB { - ACE_Protection = 1; - }; - class H_PilotHelmetHeli_B:H_HelmetB { - ACE_Protection = 1; - }; - class H_PilotHelmetFighter_B:H_HelmetB { - ACE_Protection = 1; - }; + class H_CrewHelmetHeli_B:H_HelmetB { + ACE_Protection = 1; + }; + class H_PilotHelmetHeli_B:H_HelmetB { + ACE_Protection = 1; + }; + class H_PilotHelmetFighter_B:H_HelmetB { + ACE_Protection = 1; + }; }; class RifleAssaultCloud { - ACE_Goggles_BulletCount = 4; + ACE_Goggles_BulletCount = 4; }; class MachineGunCloud { - ACE_Goggles_BulletCount = 3; + ACE_Goggles_BulletCount = 3; }; class SniperCloud { - ACE_Goggles_BulletCount = 1; + ACE_Goggles_BulletCount = 1; }; class ACE_Settings { - class GVAR(showInThirdPerson) { - value = 0; - typeName = "BOOL"; - isClientSetable = 1; - displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; - }; + class GVAR(showInThirdPerson) { + value = 0; + typeName = "BOOL"; + isClientSetable = 1; + displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; + }; }; class CfgCloudlets { - class Default; - class ACERainEffect:Default { - interval = 0.001; - particleShape = "\A3\data_f\ParticleEffects\Universal\Refract"; - particleFSNtieth = 1; - particleFSIndex = 0; - particleFSFrameCount = 1; - particleFSLoop = 1; + class Default; + class ACERainEffect:Default { + interval = 0.001; + particleShape = "\A3\data_f\ParticleEffects\Universal\Refract"; + particleFSNtieth = 1; + particleFSIndex = 0; + particleFSFrameCount = 1; + particleFSLoop = 1; - particleType = "Billboard"; - lifeTime = 0.5; - rotationVelocity = 1; - weight = 100; - volume = 0.000; - rubbing = 1.7; - size[] = {0.1}; - color[] = {{1,1,1,1}}; - animationSpeed[] = {0,1}; - randomDirectionPeriod = 0.2; - randomDirectionIntensity = 1.2; - positionVar[] = {2, 2, 2.5}; - sizeVar = 0.01; - colorVar[] = {0, 0, 0, 0.1}; - destroyOnWaterSurface = 1; - }; + particleType = "Billboard"; + lifeTime = 0.5; + rotationVelocity = 1; + weight = 100; + volume = 0.000; + rubbing = 1.7; + size[] = {0.1}; + color[] = {{1,1,1,1}}; + animationSpeed[] = {0,1}; + randomDirectionPeriod = 0.2; + randomDirectionIntensity = 1.2; + positionVar[] = {2, 2, 2.5}; + sizeVar = 0.01; + colorVar[] = {0, 0, 0, 0.1}; + destroyOnWaterSurface = 1; + }; }; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index f12cf74f29..182ffac910 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -22,12 +22,12 @@ _effects set [DIRT, true]; SETGLASSES(ace_player,_effects); if ([ace_player] call FUNC(isGogglesVisible)) then{ - _dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt"); - if (_dirtImage != "") then { - 100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false]; + _dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt"); + if (_dirtImage != "") then { + 100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false]; - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; - }; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; + }; }; true diff --git a/addons/goggles/functions/fnc_applyDust.sqf b/addons/goggles/functions/fnc_applyDust.sqf index 311a993904..197b50b30d 100644 --- a/addons/goggles/functions/fnc_applyDust.sqf +++ b/addons/goggles/functions/fnc_applyDust.sqf @@ -16,10 +16,10 @@ #include "script_component.hpp" if (call FUNC(ExternalCamera)) exitWith {}; if ([ace_player] call FUNC(isGogglesVisible)) exitWith { - 100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false]; - (uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1]; - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1)); - SETDUST(DBULLETS,0); + 100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false]; + (uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1]; + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1)); + SETDUST(DBULLETS,0); }; if (GETVAR(ace_player,ACE_EyesDamaged,false)) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);}; @@ -34,26 +34,26 @@ GVAR(PostProcessEyes) ppEffectEnable true; SETDUST(DBULLETS,0); if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; }; GVAR(DustHandler) = [{ - if (diag_tickTime >= GETDUSTT(DTIME) + 3) then { - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - private "_amount"; - _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); - if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 0.5; - }; - if (GETDUSTT(DAMOUNT) <= 0) then { - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 2; - [{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute); - SETDUST(DACTIVE,false); - SETDUST(DBULLETS,0); - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - }; + if (diag_tickTime >= GETDUSTT(DTIME) + 3) then { + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); + private "_amount"; + _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); + if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 0.5; + }; + if (GETDUSTT(DAMOUNT) <= 0) then { + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 2; + [{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute); + SETDUST(DACTIVE,false); + SETDUST(DBULLETS,0); + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + }; },0,[]] call CALLSTACK(cba_fnc_addPerFrameHandler); diff --git a/addons/goggles/functions/fnc_applyGlassesEffect.sqf b/addons/goggles/functions/fnc_applyGlassesEffect.sqf index 1d69041d81..8c2edb531e 100644 --- a/addons/goggles/functions/fnc_applyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -26,29 +26,29 @@ call FUNC(removeGlassesEffect); GVAR(EffectsActive) = true; if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { - _postProcessColour set [3, _postProcessTintAmount/100]; - GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; - GVAR(PostProcess) ppEffectCommit 0; - GVAR(PostProcess) ppEffectEnable true; - _postProcessColour set [3, _postProcessTintAmount/250]; - GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; - GVAR(PostProcess) ppEffectCommit 30; + _postProcessColour set [3, _postProcessTintAmount/100]; + GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; + GVAR(PostProcess) ppEffectCommit 0; + GVAR(PostProcess) ppEffectEnable true; + _postProcessColour set [3, _postProcessTintAmount/250]; + GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; + GVAR(PostProcess) ppEffectCommit 30; }; _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Overlay"); if GETBROKEN then { - _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked"); + _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked"); }; if (_glassImagePath != "") then { - 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath; + 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; + (GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath; }; if GETDIRT then { - call FUNC(applyDirtEffect); + call FUNC(applyDirtEffect); }; if GETDUSTT(DACTIVE) then { - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - call FUNC(applyDust); + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); + call FUNC(applyDust); }; diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf index 6d8f493c3e..f222ea9881 100644 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -17,30 +17,30 @@ #include "script_component.hpp" if (!alive ace_player) exitWith {}; if (true) then { - // Detect if curator interface is open and disable effects - if (!isNull(findDisplay 312)) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - call FUNC(checkGlasses); - if !([ace_player] call FUNC(isGogglesVisible)) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - if (call FUNC(externalCamera)) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - if !(GVAR(EffectsActive)) then { - [goggles ace_player] call FUNC(applyGlassesEffect); - } else { - if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then { - call FUNC(removeRainEffect); - call FUNC(removeDirtEffect); - call FUNC(removeDustEffect); - }; - }; + // Detect if curator interface is open and disable effects + if (!isNull(findDisplay 312)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + call FUNC(checkGlasses); + if !([ace_player] call FUNC(isGogglesVisible)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + if (call FUNC(externalCamera)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + if !(GVAR(EffectsActive)) then { + [goggles ace_player] call FUNC(applyGlassesEffect); + } else { + if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then { + call FUNC(removeRainEffect); + call FUNC(removeDirtEffect); + call FUNC(removeDustEffect); + }; + }; }; diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf index fb2e9bfa91..b70b962940 100644 --- a/addons/goggles/functions/fnc_clearGlasses.sqf +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -23,12 +23,12 @@ _effects set [BROKEN, _broken]; SETGLASSES(ace_player,_effects); if ((stance ace_player) != "PRONE") then { - ace_player playActionNow "gestureWipeFace"; + ace_player playActionNow "gestureWipeFace"; }; [{ - if (cameraView == "INTERNAL") then { - addCamShake [5, 1.75, 2]; - }; + if (cameraView == "INTERNAL") then { + addCamShake [5, 1.75, 2]; + }; }, [], 0.3, 0] call EFUNC(common,waitAndExecute); call FUNC(removeDirtEffect); diff --git a/addons/goggles/functions/fnc_dustHandler.sqf b/addons/goggles/functions/fnc_dustHandler.sqf index 979a4a1bf0..9624fc21b3 100644 --- a/addons/goggles/functions/fnc_dustHandler.sqf +++ b/addons/goggles/functions/fnc_dustHandler.sqf @@ -24,11 +24,11 @@ if (rain > 0.1) exitWith {true}; if ((stance _unit) != "PRONE") exitWith {true}; if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then { - _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName"); + _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName"); } else { - if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1")) then { - _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1" >> "effectName"); - }; + if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1")) then { + _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1" >> "effectName"); + }; }; if (_cloudType == "") exitWith {true}; @@ -49,7 +49,7 @@ if (!_found) exitWith {}; _bullets = GETDUSTT(DBULLETS); if ((diag_tickTime - GETDUSTT(DTIME)) > 1) then { - _bullets = 0; + _bullets = 0; }; _bullets = _bullets + 1; @@ -57,15 +57,15 @@ SETDUST(DBULLETS,_bullets); SETDUST(DTIME,diag_tickTime); if (GETDUSTT(DAMOUNT) < 2) then { - private "_bulletsRequired"; - _bulletsRequired = 100; - if (isNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount")) then { - _bulletsRequired = getNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount"); - }; + private "_bulletsRequired"; + _bulletsRequired = 100; + if (isNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount")) then { + _bulletsRequired = getNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount"); + }; - if (_bulletsRequired <= _bullets) then { - SETDUST(DACTIVE,true); - call FUNC(applyDust); - }; + if (_bulletsRequired <= _bullets) then { + SETDUST(DACTIVE,true); + call FUNC(applyDust); + }; }; true diff --git a/addons/goggles/functions/fnc_getExplosionIndex.sqf b/addons/goggles/functions/fnc_getExplosionIndex.sqf index 5b81c63655..5519bf397c 100644 --- a/addons/goggles/functions/fnc_getExplosionIndex.sqf +++ b/addons/goggles/functions/fnc_getExplosionIndex.sqf @@ -16,10 +16,10 @@ private ["_effectIndex"]; _effectIndex = switch true do { - case (_this <= 0.04): {0}; - case (_this <= 0.06): {1}; - case (_this <= 0.09): {2}; - default {3}; + case (_this <= 0.04): {0}; + case (_this <= 0.06): {1}; + case (_this <= 0.09): {2}; + default {3}; }; _effectIndex diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 3d87499b90..9206965995 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -23,14 +23,14 @@ _result = false; if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")}; if (_currentGlasses != "") then { - _position =(getPosASLW _unit); - if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { - _result = ([_currentGlasses] call FUNC(isDivingGoggles)); - }; - if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith { - _result = false; - }; - _result = !([_currentGlasses] call FUNC(isDivingGoggles)); + _position =(getPosASLW _unit); + if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { + _result = ([_currentGlasses] call FUNC(isDivingGoggles)); + }; + if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith { + _result = false; + }; + _result = !([_currentGlasses] call FUNC(isDivingGoggles)); }; _result diff --git a/addons/goggles/functions/fnc_isInRotorWash.sqf b/addons/goggles/functions/fnc_isInRotorWash.sqf index 0d9e22f7da..ef6391fdc6 100644 --- a/addons/goggles/functions/fnc_isInRotorWash.sqf +++ b/addons/goggles/functions/fnc_isInRotorWash.sqf @@ -8,8 +8,8 @@ * * Return Value: * : - * 0: In rotorwash - * 1: Amount of rotor wash. + * 0: In rotorwash + * 1: Amount of rotor wash. * * Example: * if (([ace_player, 10] call ace_goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; }; @@ -22,25 +22,25 @@ private ["_heli", "_unit", "_result", "_radius"]; _unit = _this select 0; _radius = 15; if (count _this > 1) then { - _radius = _this select 1; + _radius = _this select 1; }; _result = [false, _radius + 2]; _heli = (getPosATL _unit) nearEntities [["Helicopter"], _radius]; { - if !(_x isKindOf "ParachuteBase") then { - if (isEngineOn _x) then { - private "_distance"; - _distance = (_radius - (_unit distance _x)); - if (_distance != 0) then { - _distance = _distance / _radius; - }; - if (_distance < (_result select 1)) then { - _result = [true, _distance]; - }; - }; - }; - false + if !(_x isKindOf "ParachuteBase") then { + if (isEngineOn _x) then { + private "_distance"; + _distance = (_radius - (_unit distance _x)); + if (_distance != 0) then { + _distance = _distance / _radius; + }; + if (_distance < (_result select 1)) then { + _result = [true, _distance]; + }; + }; + }; + false } count _heli; _result diff --git a/addons/goggles/functions/fnc_onEachFrame.sqf b/addons/goggles/functions/fnc_onEachFrame.sqf index a3c65cac6b..863046da7f 100644 --- a/addons/goggles/functions/fnc_onEachFrame.sqf +++ b/addons/goggles/functions/fnc_onEachFrame.sqf @@ -17,62 +17,62 @@ if (isNull(ace_player)) exitWith {}; GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)]; if (GVAR(FrameEvent) select 0) exitWith { - if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; - GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))]; + if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; + GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))]; }; private ["_rotorWash","_safe"]; _rotorWash = GVAR(FrameEvent) select 1; _safe = false; if !(_rotorWash select 0) exitWith { - if (GVAR(PostProcessEyes_Enabled)) then { - GVAR(PostProcessEyes_Enabled) = false; - if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 2; - GVAR(DustHandler) = [{ - GVAR(PostProcessEyes) ppEffectEnable false; - GVAR(DustHandler) = -1; - }, [], 2, 0.5] call EFUNC(common,waitAndExecute); - }; + if (GVAR(PostProcessEyes_Enabled)) then { + GVAR(PostProcessEyes_Enabled) = false; + if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 2; + GVAR(DustHandler) = [{ + GVAR(PostProcessEyes) ppEffectEnable false; + GVAR(DustHandler) = -1; + }, [], 2, 0.5] call EFUNC(common,waitAndExecute); + }; }; if ((headgear ace_player) != "") then { - _safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1); + _safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1); }; if !(_safe) then { - if !([ace_player] call FUNC(isGogglesVisible)) exitWith{}; - if (GETDUSTT(DAMOUNT) < 2) then { - if (!GETDUSTT(DACTIVE)) then { - SETDUST(DACTIVE,true); - call FUNC(ApplyDust); - } else { - if ((_rotorWash select 1) > 0.5) then { - call FUNC(ApplyDust); - }; - }; - }; - _safe = (getNumber (ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Protection") == 1); + if !([ace_player] call FUNC(isGogglesVisible)) exitWith{}; + if (GETDUSTT(DAMOUNT) < 2) then { + if (!GETDUSTT(DACTIVE)) then { + SETDUST(DACTIVE,true); + call FUNC(ApplyDust); + } else { + if ((_rotorWash select 1) > 0.5) then { + call FUNC(ApplyDust); + }; + }; + }; + _safe = (getNumber (ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Protection") == 1); }; if (_safe) exitWith {}; if ((_rotorWash select 1) <= 15) then { - private "_scale"; - _scale = 0.7; - if ((_rotorWash select 1) != 0) then { - _scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3); - } else { - _scale = 0.1; - }; - _scale = 1 - _scale; - if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { - GVAR(PostProcessEyes_Enabled) = true; - GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 0.5; - GVAR(PostProcessEyes) ppEffectEnable true; - }; + private "_scale"; + _scale = 0.7; + if ((_rotorWash select 1) != 0) then { + _scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3); + } else { + _scale = 0.1; + }; + _scale = 1 - _scale; + if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { + GVAR(PostProcessEyes_Enabled) = true; + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 0.5; + GVAR(PostProcessEyes) ppEffectEnable true; + }; }; diff --git a/addons/goggles/functions/fnc_rainEffect.sqf b/addons/goggles/functions/fnc_rainEffect.sqf index 37ffbf64f6..b5badef6f2 100644 --- a/addons/goggles/functions/fnc_rainEffect.sqf +++ b/addons/goggles/functions/fnc_rainEffect.sqf @@ -17,37 +17,37 @@ private ["_fnc_underCover"]; if (isNull(ace_player) || {!(alive ace_player)}) exitWith {}; _fnc_underCover = { - private ["_pos", "_unit"]; - _unit = (_this select 0); - if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true}; - _pos = eyePos _unit; - ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} + private ["_pos", "_unit"]; + _unit = (_this select 0); + if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true}; + _pos = eyePos _unit; + ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} }; if (!isNull(findDisplay 312)) exitWith { - if (GVAR(RainActive)) then { - call FUNC(RemoveRainEffect); - }; + if (GVAR(RainActive)) then { + call FUNC(RemoveRainEffect); + }; }; // Ignore if ace_player is under water if (!GVAR(EffectsActive) || {underwater ace_player}) exitWith{call FUNC(RemoveRainEffect);}; if (GVAR(RainLastLevel) != rain) then { - call FUNC(RemoveRainEffect); - GVAR(RainLastLevel) = rain; - // Rain is happening - if (GVAR(RainLastLevel) > 0.05 && {!([ace_player] call _fnc_underCover)}) then { - GVAR(RainActive) = true; - GVAR(RainDrops) = "#particlesource" createVehicleLocal GetPos ace_player; - GVAR(RainDrops) setParticleClass "ACERainEffect"; - GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); - GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]]; - }; + call FUNC(RemoveRainEffect); + GVAR(RainLastLevel) = rain; + // Rain is happening + if (GVAR(RainLastLevel) > 0.05 && {!([ace_player] call _fnc_underCover)}) then { + GVAR(RainActive) = true; + GVAR(RainDrops) = "#particlesource" createVehicleLocal GetPos ace_player; + GVAR(RainDrops) setParticleClass "ACERainEffect"; + GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); + GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]]; + }; }else{ - if (GVAR(RainLastLevel) > 0.05) then { - if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith { - call FUNC(RemoveRainEffect); - }; - if (!GVAR(RainActive)) then { - GVAR(RainLastLevel) = -1; - }; - }; + if (GVAR(RainLastLevel) > 0.05) then { + if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith { + call FUNC(RemoveRainEffect); + }; + if (!GVAR(RainActive)) then { + GVAR(RainLastLevel) = -1; + }; + }; }; diff --git a/addons/goggles/functions/fnc_removeDirtEffect.sqf b/addons/goggles/functions/fnc_removeDirtEffect.sqf index 20812d6140..f7efd39af3 100644 --- a/addons/goggles/functions/fnc_removeDirtEffect.sqf +++ b/addons/goggles/functions/fnc_removeDirtEffect.sqf @@ -15,5 +15,5 @@ */ #include "script_component.hpp" if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then { - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText ""; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText ""; }; diff --git a/addons/goggles/functions/fnc_removeDustEffect.sqf b/addons/goggles/functions/fnc_removeDustEffect.sqf index 7bd4be7c22..1e179ed6b4 100644 --- a/addons/goggles/functions/fnc_removeDustEffect.sqf +++ b/addons/goggles/functions/fnc_removeDustEffect.sqf @@ -15,5 +15,5 @@ */ #include "script_component.hpp" if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then { - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText ""; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText ""; }; diff --git a/addons/goggles/functions/fnc_removeGlassesEffect.sqf b/addons/goggles/functions/fnc_removeGlassesEffect.sqf index f409f3c16e..c7965fefbc 100644 --- a/addons/goggles/functions/fnc_removeGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_removeGlassesEffect.sqf @@ -1,7 +1,7 @@ /* * Author: Garth 'L-H' de Wet - * Removes the glasses effect from the screen, removes dirt effect, removes rain effect, - * removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.) + * Removes the glasses effect from the screen, removes dirt effect, removes rain effect, + * removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.) * * Arguments: * None @@ -19,7 +19,7 @@ GVAR(EffectsActive) = false; GVAR(PostProcess) ppEffectEnable false; if (!isNull(GLASSDISPLAY)) then { - GLASSDISPLAY closeDisplay 0; + GLASSDISPLAY closeDisplay 0; }; call FUNC(removeDirtEffect); diff --git a/addons/goggles/functions/fnc_removeRainEffect.sqf b/addons/goggles/functions/fnc_removeRainEffect.sqf index fbbf1b9b7b..0d322e12da 100644 --- a/addons/goggles/functions/fnc_removeRainEffect.sqf +++ b/addons/goggles/functions/fnc_removeRainEffect.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" if (!isNull (GVAR(RainDrops))) then { - deleteVehicle (GVAR(RainDrops)); + deleteVehicle (GVAR(RainDrops)); }; GVAR(RainActive) = false; GVAR(RainLastLevel) = 0; diff --git a/addons/hearing/script_component.hpp b/addons/hearing/script_component.hpp index 15023f2509..6d4df68370 100644 --- a/addons/hearing/script_component.hpp +++ b/addons/hearing/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_HEARING - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_HEARING - #define DEBUG_SETTINGS DEBUG_SETTINGS_HEARING + #define DEBUG_SETTINGS DEBUG_SETTINGS_HEARING #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/interact_menu/functions/fnc_splitPath.sqf b/addons/interact_menu/functions/fnc_splitPath.sqf index 609f26f972..935e947b30 100644 --- a/addons/interact_menu/functions/fnc_splitPath.sqf +++ b/addons/interact_menu/functions/fnc_splitPath.sqf @@ -19,9 +19,9 @@ for [{_i = 0},{_i < (count _this) - 1},{_i = _i + 1}] do { _parentPath pushBack (_this select _i); }; _actionName = if (count _this > 0) then { - _this select ((count _this) - 1); + _this select ((count _this) - 1); } else { - "" + "" }; [_parentPath, _actionName] diff --git a/addons/interaction/functions/fnc_AddSelectableItem.sqf b/addons/interaction/functions/fnc_AddSelectableItem.sqf index 966c4fe043..498b852635 100644 --- a/addons/interaction/functions/fnc_AddSelectableItem.sqf +++ b/addons/interaction/functions/fnc_AddSelectableItem.sqf @@ -1,19 +1,19 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Adds an item to the select menu + Description: + Adds an item to the select menu - Parameters: - 0: ARRAY/NUMBER - List container - 1: String - Display Name - 2: String - Picture - 3: String/code - data + Parameters: + 0: ARRAY/NUMBER - List container + 1: String - Display Name + 2: String - Picture + 3: String/code - data - Returns: - ARRAY/Number + Returns: + ARRAY/Number - Example: + Example: */ #include "script_component.hpp" @@ -26,7 +26,7 @@ _picture = _this select 2; _data = _this select 3; if (_picture == "" || _picture == "PictureThing") then { - _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); + _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); }; _index = lbAdd [_container, _displayName]; diff --git a/addons/interaction/functions/fnc_MoveDown.sqf b/addons/interaction/functions/fnc_MoveDown.sqf index 2221deab62..eac30e4008 100644 --- a/addons/interaction/functions/fnc_MoveDown.sqf +++ b/addons/interaction/functions/fnc_MoveDown.sqf @@ -1,18 +1,18 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Depending on the passed value, either scrolls down through the list or up. + Description: + Depending on the passed value, either scrolls down through the list or up. - Parameters: - NUMBER - Amount to increase current interaction target + Parameters: + NUMBER - Amount to increase current interaction target - Returns: - Nothing + Returns: + Nothing - Example: - 1 call FUNC(MoveDown); - -1 call FUNC(MoveDown); + Example: + 1 call FUNC(MoveDown); + -1 call FUNC(MoveDown); */ #include "script_component.hpp" @@ -31,27 +31,27 @@ _dlgInteractionDialog = uiNamespace getVariable QGVAR(Flow_Display); _top = GVAR(SelectedButton) - 2; _i = 0; while {_i <= 4} do { - _index =_i + _top; - _ctrl = _dlgInteractionDialog displayCtrl (1200 + _i); - if (_index >= 0 && {_index <= _count}) then { - _action = GVAR(Buttons) select _index; - _ctrl ctrlShow true; - _ctrl ctrlSetText (_action select 5); - _color = [1,1,1,1]; - if !([_target, _player] call (_action select 2)) then { - _color = [0.3,0.3,0.3,0.8]; - }; - if (_i == 0 || _i == 4) then { - _color set [3, 0.5]; - }; - if (_i == 1 || _i == 3) then { - _color set [3, 0.75]; - }; - _ctrl ctrlSetTextColor _color; - }else{ - _ctrl ctrlShow false; - }; - _i = _i + 1; + _index =_i + _top; + _ctrl = _dlgInteractionDialog displayCtrl (1200 + _i); + if (_index >= 0 && {_index <= _count}) then { + _action = GVAR(Buttons) select _index; + _ctrl ctrlShow true; + _ctrl ctrlSetText (_action select 5); + _color = [1,1,1,1]; + if !([_target, _player] call (_action select 2)) then { + _color = [0.3,0.3,0.3,0.8]; + }; + if (_i == 0 || _i == 4) then { + _color set [3, 0.5]; + }; + if (_i == 1 || _i == 3) then { + _color set [3, 0.75]; + }; + _ctrl ctrlSetTextColor _color; + }else{ + _ctrl ctrlShow false; + }; + _i = _i + 1; }; _ctrl = _dlgInteractionDialog displayCtrl 1000; @@ -60,7 +60,7 @@ _ctrl = _dlgInteractionDialog displayCtrl 1100; _current = (GVAR(Buttons) select GVAR(SelectedButton)); _infoText = ""; if !([_target, _player] call (_current select 2)) then { - _infoText = "Unavailable"; + _infoText = "Unavailable"; }; _ctrl ctrlSetText _infoText; _ctrl ctrlShow (_infoText != ""); diff --git a/addons/interaction/functions/fnc_applyButtons.sqf b/addons/interaction/functions/fnc_applyButtons.sqf index 7459b1a7bf..be35b34877 100644 --- a/addons/interaction/functions/fnc_applyButtons.sqf +++ b/addons/interaction/functions/fnc_applyButtons.sqf @@ -13,12 +13,12 @@ _dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog); /* for "_a" from 0 to (_count - 1) do { - _action = GVAR(Buttons) select _a; + _action = GVAR(Buttons) select _a; - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a); - _ctrlInteractionDialog ctrlShow true; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable (call (_action select 2)); + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a); + _ctrlInteractionDialog ctrlShow true; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable (call (_action select 2)); }; */ @@ -27,27 +27,27 @@ _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; GVAR(MainButton) = "(findDisplay 1713999) closeDisplay 1;"; if (_object isKindOf "Man") then { - _ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["ACE_Name", "Unknown"]}); + _ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["ACE_Name", "Unknown"]}); } else { - _ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName")); + _ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName")); }; for "_index" from 0 to 9 do { - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index); - _ctrlInteractionDialog ctrlShow true; + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index); + _ctrlInteractionDialog ctrlShow true; - _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index); + _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index); - if (_index < _count) then { - _action = GVAR(Buttons) select _index; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable (call (_action select 2)); + if (_index < _count) then { + _action = GVAR(Buttons) select _index; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable (call (_action select 2)); - _ctrlInteractionDialogIcon ctrlSetText (_action select 5); - } else { - _ctrlInteractionDialog ctrlSetText ""; - _ctrlInteractionDialog ctrlEnable false; + _ctrlInteractionDialogIcon ctrlSetText (_action select 5); + } else { + _ctrlInteractionDialog ctrlSetText ""; + _ctrlInteractionDialog ctrlEnable false; - _ctrlInteractionDialogIcon ctrlSetText ""; - }; + _ctrlInteractionDialogIcon ctrlSetText ""; + }; }; diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index ebb820584a..ca59ec177c 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -7,101 +7,101 @@ _house = _this select 0; _door = _this select 1; _index = [ - "door_1", - "door_2", - "door_3", - "door_4", - "door_5", - "door_6", - "door_7", - "door_8", - "door_9", - "door_10", - "door_11", - "door_12", - "door_13", - "Door_14", - "door_15", - "door_16", - "door_17", - "door_18", - "door_19", - "door_20", - "door_21", - "door_22", + "door_1", + "door_2", + "door_3", + "door_4", + "door_5", + "door_6", + "door_7", + "door_8", + "door_9", + "door_10", + "door_11", + "door_12", + "door_13", + "Door_14", + "door_15", + "door_16", + "door_17", + "door_18", + "door_19", + "door_20", + "door_21", + "door_22", - "hatch_1", - "hatch_2", - "hatch_3", - "hatch_4", - "hatch_5", - "hatch_6" + "hatch_1", + "hatch_2", + "hatch_3", + "hatch_4", + "hatch_5", + "hatch_6" ] find toLower _door; if (_index == -1) exitWith {[[],""]}; _animations = [ - ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], - ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], - ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], - ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], - ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], - ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], - ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], - ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], - ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], - ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], - ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], - ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], - ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], - ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], - ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], - ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], - ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], - ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], - ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], - ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], - ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], - ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], + ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], + ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], + ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], + ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], + ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], + ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], + ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], + ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], + ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], + ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], + ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], + ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], + ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], + ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], + ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], + ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], + ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], + ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], + ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], + ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], + ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], + ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], - ["Hatch_1_rot"], - ["Hatch_2_rot"], - ["Hatch_3_rot"], - ["Hatch_4_rot"], - ["Hatch_5_rot"], - ["Hatch_6_rot"] + ["Hatch_1_rot"], + ["Hatch_2_rot"], + ["Hatch_3_rot"], + ["Hatch_4_rot"], + ["Hatch_5_rot"], + ["Hatch_6_rot"] ] select _index; _lockedVariable = [ - ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], - ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], - ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], - ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], - ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], - ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], - ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], - ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], - ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], - ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], - ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], - ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], - ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], - ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], - ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], - ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], - ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], - ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], - ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], - ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], - ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], - ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], + ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], + ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], + ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], + ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], + ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], + ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], + ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], + ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], + ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], + ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], + ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], + ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], + ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], + ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], + ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], + ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], + ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], + ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], + ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], + ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], + ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], + ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""] + ["", ""], + ["", ""], + ["", ""], + ["", ""], + ["", ""], + ["", ""] ] select _index; [_animations, _lockedVariable] diff --git a/addons/interaction/functions/fnc_hideMenu.sqf b/addons/interaction/functions/fnc_hideMenu.sqf index 43444b7d99..54263ef032 100644 --- a/addons/interaction/functions/fnc_hideMenu.sqf +++ b/addons/interaction/functions/fnc_hideMenu.sqf @@ -1,17 +1,17 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Closes the Interaction menu + Description: + Closes the Interaction menu - Parameters: - Nothing + Parameters: + Nothing - Returns: - Nothing + Returns: + Nothing - Example: - call FUNC(hideMenu); + Example: + call FUNC(hideMenu); */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index 4efc4a3094..d910352076 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -1,18 +1,18 @@ /* - Author(s): - Garth de Wet (LH) + Author(s): + Garth de Wet (LH) - Description: - Hides the interaction helper text with the mouse buttons at the bottom middle of the screen + Description: + Hides the interaction helper text with the mouse buttons at the bottom middle of the screen - Parameters: - Nothing + Parameters: + Nothing - Returns: - Nothing + Returns: + Nothing - Example: - call FUNC(hideMouseHint); + Example: + call FUNC(hideMouseHint); */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf index 24b5793d6f..5048b66001 100644 --- a/addons/interaction/functions/fnc_isInRange.sqf +++ b/addons/interaction/functions/fnc_isInRange.sqf @@ -43,8 +43,8 @@ _position1 = ATLToASL positionCameraToWorld [0, 0, _distance]; _position1 set [2, (_position1 select 2) - (getTerrainHeightASL _position1 min 0)]; if (_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance}) then { - true + true } else { - ["Not in Range"] call FUNC(addToTooltip); - false + ["Not in Range"] call FUNC(addToTooltip); + false } diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index d0aeccc3ad..2e4d1f2898 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -10,12 +10,12 @@ _unit setVariable [QGVAR(assignedFireTeam), _team, true]; [_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc); if (_unit == ACE_player) then { - _message = if (_team == "MAIN") then { - localize "STR_ACE_Interaction_LeftTeam"; - } else { - _team = localize format ["STR_ACE_Interaction_Team%1", _team]; - format [localize "STR_ACE_Interaction_JoinedTeam", _team]; - }; + _message = if (_team == "MAIN") then { + localize "STR_ACE_Interaction_LeftTeam"; + } else { + _team = localize format ["STR_ACE_Interaction_Team%1", _team]; + format [localize "STR_ACE_Interaction_JoinedTeam", _team]; + }; - [_message] call EFUNC(common,displayTextStructured); + [_message] call EFUNC(common,displayTextStructured); }; diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf index 44c4e340f0..cee524c55f 100644 --- a/addons/interaction/functions/fnc_onButtonUp.sqf +++ b/addons/interaction/functions/fnc_onButtonUp.sqf @@ -11,9 +11,9 @@ _count = count GVAR(Buttons); _index = call FUNC(getSelectedButton); _action = if (_index != -1 && {_index < _count}) then { - GVAR(Buttons) select _index + GVAR(Buttons) select _index } else { - ["", {}, {false}, 0, [], "", "", {false}, [], 0] + ["", {}, {false}, 0, [], "", "", {false}, [], 0] }; (findDisplay 1713999) closeDisplay 1; @@ -28,5 +28,5 @@ _exceptions = _action select 8;// _distance = _action select 9; if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { - [_target, _player] call _statement; + [_target, _player] call _statement; }; diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf index 39581db3a3..29fffb8b94 100644 --- a/addons/interaction/functions/fnc_onClick.sqf +++ b/addons/interaction/functions/fnc_onClick.sqf @@ -10,35 +10,35 @@ _count = count GVAR(Buttons); _index = _this; _action = if (_index != -1 && {_index < _count}) then { - GVAR(Buttons) select _index + GVAR(Buttons) select _index } else { - ["", {}, {false}, 0, [], "", "", {false}, [], 0] + ["", {}, {false}, 0, [], "", "", {false}, [], 0] }; _subMenu = _action select 4; // back if (_index == -1) exitWith { - call GVAR(MainButton); + call GVAR(MainButton); }; if (count _subMenu < 2) then { - (findDisplay 1713999) closeDisplay 1; - closeDialog 0; + (findDisplay 1713999) closeDisplay 1; + closeDialog 0; - _statement = _action select 1; - _condition = _action select 2; - _conditionShow = _action select 7; - _exceptions = _action select 8;// - _distance = _action select 9; + _statement = _action select 1; + _condition = _action select 2; + _conditionShow = _action select 7; + _exceptions = _action select 8;// + _distance = _action select 9; - if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { - [_target, _player] call _statement; - }; + if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { + [_target, _player] call _statement; + }; } else { - if (_subMenu select 1 < 1) then { - [_subMenu select 0] call FUNC(openSubMenu); - } else { - [_subMenu select 0] call FUNC(openSubMenuSelf); - }; + if (_subMenu select 1 < 1) then { + [_subMenu select 0] call FUNC(openSubMenu); + } else { + [_subMenu select 0] call FUNC(openSubMenuSelf); + }; }; diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index dc9150491d..e175e752cb 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -18,40 +18,40 @@ _animations = _animations select 0; if (count _animations == 0) exitWith {}; if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { - _lockedVariable set [0, _house]; - _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; + _lockedVariable set [0, _house]; + _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; }; GVAR(isOpeningDoor) = true; playSound "ACE_Sound_Click"; [_house, _animations] spawn { - _house = _this select 0; - _animations = _this select 1; + _house = _this select 0; + _animations = _this select 1; - _phase = _house animationPhase (_animations select 0); - _position = getPosASL ACE_player; + _phase = _house animationPhase (_animations select 0); + _position = getPosASL ACE_player; - _time = time + 0.2; - _usedMouseWheel = false; - waitUntil { - if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { - _usedMouseWheel = true; - }; + _time = time + 0.2; + _usedMouseWheel = false; + waitUntil { + if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { + _usedMouseWheel = true; + }; - _phase = _phase + (inputAction "PrevAction" / 12) min 1; - _phase = _phase - (inputAction "NextAction" / 12) max 0; + _phase = _phase + (inputAction "PrevAction" / 12) min 1; + _phase = _phase - (inputAction "NextAction" / 12) max 0; - {_house animate [_x, _phase]} forEach _animations; + {_house animate [_x, _phase]} forEach _animations; - !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} - }; + !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} + }; - if (!_usedMouseWheel && {time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then { - _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); + if (!_usedMouseWheel && {time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then { + _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); - {_house animate [_x, _phase]} forEach _animations; - }; + {_house animate [_x, _phase]} forEach _animations; + }; - GVAR(isOpeningDoor) = false; + GVAR(isOpeningDoor) = false; }; diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf index ba2cf7ce10..de5459f88c 100644 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -1,43 +1,43 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Opens the select menu UI and sets up the UI + Description: + Opens the select menu UI and sets up the UI - Parameters: - 0: ARRAY - items - ARRAY - 0 = Text - 1 = statement to execute - 2 = condition before execute - 3 = showDisabled - 4 = priority - 5 = icon - 6 = extra variables. Passed to the code. - 1: Code - select action - 2: Code - Cancel Action - Returns: - Nothing + Parameters: + 0: ARRAY - items + ARRAY + 0 = Text + 1 = statement to execute + 2 = condition before execute + 3 = showDisabled + 4 = priority + 5 = icon + 6 = extra variables. Passed to the code. + 1: Code - select action + 2: Code - Cancel Action + Returns: + Nothing - Example: + Example: */ #include "script_component.hpp" if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { - GVAR(SelectAccept) = _this select 1; - GVAR(SelectCancel) = _this select 2; - buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel - buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept - lbSetCurSel [8866, 0]; + GVAR(SelectAccept) = _this select 1; + GVAR(SelectCancel) = _this select 2; + buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel + buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept + lbSetCurSel [8866, 0]; }else{ - _customActions = _this select 0; - _count = count _customActions; - if (_count == 0) exitWith {}; - _customActions call FUNC(sortOptionsByPriority); - for "_i" from 0 to _count -1 do { - _action = _customActions select _i; - _action set [1, (_this select 1)]; - }; - GVAR(Buttons) = _customActions; - [(_this select 2), true, true, false, ACE_player] call FUNC(initialiseInteraction); + _customActions = _this select 0; + _count = count _customActions; + if (_count == 0) exitWith {}; + _customActions call FUNC(sortOptionsByPriority); + for "_i" from 0 to _count -1 do { + _action = _customActions select _i; + _action set [1, (_this select 1)]; + }; + GVAR(Buttons) = _customActions; + [(_this select 2), true, true, false, ACE_player] call FUNC(initialiseInteraction); }; diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index acff7fa5e2..593f0d4c47 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -1,18 +1,18 @@ /* - Author: Garth de Wet (LH) + Author: Garth de Wet (LH) - Description: - Prepares the select menu for use. + Description: + Prepares the select menu for use. - Parameters: - 0: TEXT - Header text - 1: TEXT - Approve button text + Parameters: + 0: TEXT - Header text + 1: TEXT - Approve button text - Returns: - ARRAY/NUMBER - container object for use with AddSelectableItem. + Returns: + ARRAY/NUMBER - container object for use with AddSelectableItem. - Example: - ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); + Example: + ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); */ #include "script_component.hpp" @@ -21,7 +21,7 @@ closeDialog 0; _header = _this select 0; _buttonText = _this select 1; if (isNil "_buttonText" or {_buttonText == ""}) then { - _buttonText = localize "STR_ACE_Interaction_MakeSelection"; + _buttonText = localize "STR_ACE_Interaction_MakeSelection"; }; createDialog "RscACE_SelectAnItem"; ctrlSetText [8860, _buttonText]; diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf index 7a9b9b4bc0..0894520149 100644 --- a/addons/interaction/functions/fnc_removeTag.sqf +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -2,19 +2,19 @@ #include "script_component.hpp" 0 spawn { - waitUntil {player getVariable ["ACE_Name", ""] != ""}; + waitUntil {player getVariable ["ACE_Name", ""] != ""}; - _name = player getVariable ["ACE_Name", ""]; - _name = toArray _name; + _name = player getVariable ["ACE_Name", ""]; + _name = toArray _name; - _index = _name find (toArray "]" select 0); + _index = _name find (toArray "]" select 0); - if (_index != -1) then { - for "_index" from 0 to _index do { - _name set [_index, -1]; - }; - _name = _name - [-1]; - _name = toString _name; - player setVariable ["ACE_Name", _name, true]; - }; + if (_index != -1) then { + for "_index" from 0 to _index do { + _name set [_index, -1]; + }; + _name = _name - [-1]; + _name = toString _name; + player setVariable ["ACE_Name", _name, true]; + }; }; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index b162754b13..5cb96a0eae 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -1,20 +1,20 @@ /* - Author(s): - Garth de Wet (LH) + Author(s): + Garth de Wet (LH) - Description: - Shows the interaction helper text with the mouse buttons at the bottom middle of the screen + Description: + Shows the interaction helper text with the mouse buttons at the bottom middle of the screen - Parameters: - 0: STRING - Left click text - 1: STRING - Right click text - 3: STRING - (Optional) Scroll text + Parameters: + 0: STRING - Left click text + 1: STRING - Right click text + 3: STRING - (Optional) Scroll text - Returns: - Nothing + Returns: + Nothing - Example: - ["Place Explosive", "Cancel"] call FUNC(showMouseHint); + Example: + ["Place Explosive", "Cancel"] call FUNC(showMouseHint); */ #include "script_component.hpp" @@ -25,7 +25,7 @@ _leftClick = _this select 0; _rightClick = _this select 1; _scroll = ""; if (count _this > 2) then { - _scroll = _this select 2; + _scroll = _this select 2; }; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(InteractionHelper), "PLAIN",0.5, false]; @@ -42,13 +42,13 @@ if (isNull _display) exitWith{}; (_display displayCtrl 1201) ctrlShow (_rightClick != ""); if (_scroll == "") exitWith { - (_display displayCtrl 1002) ctrlShow false; - (_display displayCtrl 1202) ctrlShow false; + (_display displayCtrl 1002) ctrlShow false; + (_display displayCtrl 1202) ctrlShow false; - (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; - (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; - (_display displayCtrl 1001) ctrlCommit 0; - (_display displayCtrl 1201) ctrlCommit 0; + (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; + (_display displayCtrl 1001) ctrlCommit 0; + (_display displayCtrl 1201) ctrlCommit 0; }; (_display displayCtrl 1002) ctrlSetText _scroll; showHUD false; \ No newline at end of file diff --git a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf index d29ebd3e5f..28daa4e7e5 100644 --- a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf +++ b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf @@ -8,14 +8,14 @@ _count = count _actions; _index = 0; while {_index < _count - 1} do { - _actionN = + _actions select _index; - _actionM = + _actions select (_index + 1); + _actionN = + _actions select _index; + _actionM = + _actions select (_index + 1); - if (_actionN select 3 < _actionM select 3) then { - _actions set [_index, _actionM]; - _actions set [_index + 1, _actionN]; - _index = 0; - } else { - _index = _index + 1; - }; + if (_actionN select 3 < _actionM select 3) then { + _actions set [_index, _actionM]; + _actions set [_index + 1, _actionN]; + _index = 0; + } else { + _index = _index + 1; + }; }; diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf index c4b2a6e102..27148c5aa3 100644 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -5,9 +5,9 @@ disableSerialization; _ctrl = ctrlParent (_this select 0) displayCtrl 40; _ctrl ctrlSetPosition [ - (_this select 1) + 0.01 * safezoneW, - (_this select 2) + 0.01 * safezoneH, - 2.0 / 16 * safezoneW, - 0.3 / 9 * safezoneH + (_this select 1) + 0.01 * safezoneW, + (_this select 2) + 0.01 * safezoneH, + 2.0 / 16 * safezoneW, + 0.3 / 9 * safezoneH ]; _ctrl ctrlCommit 0; diff --git a/addons/interaction/script_component.hpp b/addons/interaction/script_component.hpp index 07fcac5740..caa87ce3ce 100644 --- a/addons/interaction/script_component.hpp +++ b/addons/interaction/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_INTERACTION - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_INTERACTION - #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACTION + #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACTION #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/main/About.hpp b/addons/main/About.hpp index 814fab7454..c455c43cc3 100644 --- a/addons/main/About.hpp +++ b/addons/main/About.hpp @@ -1,35 +1,35 @@ #include "script_dialog_defines.hpp" class ACE_ABOUT_DLG { - idd = 114137; - movingEnable = 0; - onLoad = "with uiNameSpace do { ACE_ABOUT_DLG = _this select 0; };"; - onKeyDown = "if((_this select 1) == 1) then {ACE_ABOUT_STP = true;};"; - class controlsBackground { - class Contents : RscStructuredText { - idc = 1141371; - colorBackground[] = { 0, 0, 0, 0 }; - __SX(0.45); - __SY(0.25); - __SW(0.45); - __SH(0.6); - size = "0.025 * SafeZoneH"; - class Attributes { - font = "TahomaB"; - color = "#C8C8C8"; - align = "left"; - valign = "middle"; - shadow = true; - shadowColor = "#191970"; - size = "1"; - }; - }; - class ACE_ABOUT_NEXT : ACE_ABOUT_CTRL { //dummy visible - idc = 1141372; - __SX(0.065); - __SW(0.03); - text = ""; - action = ""; - }; - }; //controlsBackground + idd = 114137; + movingEnable = 0; + onLoad = "with uiNameSpace do { ACE_ABOUT_DLG = _this select 0; };"; + onKeyDown = "if((_this select 1) == 1) then {ACE_ABOUT_STP = true;};"; + class controlsBackground { + class Contents : RscStructuredText { + idc = 1141371; + colorBackground[] = { 0, 0, 0, 0 }; + __SX(0.45); + __SY(0.25); + __SW(0.45); + __SH(0.6); + size = "0.025 * SafeZoneH"; + class Attributes { + font = "TahomaB"; + color = "#C8C8C8"; + align = "left"; + valign = "middle"; + shadow = true; + shadowColor = "#191970"; + size = "1"; + }; + }; + class ACE_ABOUT_NEXT : ACE_ABOUT_CTRL { //dummy visible + idc = 1141372; + __SX(0.065); + __SW(0.03); + text = ""; + action = ""; + }; + }; //controlsBackground }; diff --git a/addons/main/CfgModuleCategories.hpp b/addons/main/CfgModuleCategories.hpp index ad8e18f15a..1f86959585 100644 --- a/addons/main/CfgModuleCategories.hpp +++ b/addons/main/CfgModuleCategories.hpp @@ -1,8 +1,8 @@ class CfgFactionClasses { - class NO_CATEGORY; - class ACE: NO_CATEGORY { - displayName = "ACE"; - priority = 2; - side = 7; - }; + class NO_CATEGORY; + class ACE: NO_CATEGORY { + displayName = "ACE"; + priority = 2; + side = 7; + }; }; \ No newline at end of file diff --git a/addons/main/about.sqf b/addons/main/about.sqf index 5d500c60d5..c9004edfe1 100644 --- a/addons/main/about.sqf +++ b/addons/main/about.sqf @@ -26,184 +26,184 @@ __cr_testers, ]; _pkeynam = { //local function - _shift = if (_shift > 0) then {42} else {0}; - _ctrl = if (_ctrl > 0) then {56} else {0}; - _alt = if (_alt > 0) then {29} else {0}; - _keys = [_shift,_ctrl,_alt,_key]; - _keystrg = "^"; - { - _mod = _x in [42,56,29]; - _knaml = call compile format["format['%2',%1]",(keyName _x),"%1"]; - _knaml = [_knaml, " "] call CBA_fnc_split; - _knam = "^"; - {_k = _x; if (!_mod || (_k != (localize "STR_ACE_KN_LEFT") && _k != (localize "STR_ACE_KN_RIGHT"))) then {_knam = _knam + " " + _k}} forEach _knaml; - _knam = [_knam, "^ ", ""] call CBA_fnc_replace; - _keystrg = _keystrg + "-" + _knam; - } forEach _keys; - _keystrg = [_keystrg, "^ ", ""] call CBA_fnc_replace; - _keystrg = [_keystrg, "^-", ""] call CBA_fnc_replace; - _keystrg = [_keystrg, "^", "None"] call CBA_fnc_replace; - _keystrg + _shift = if (_shift > 0) then {42} else {0}; + _ctrl = if (_ctrl > 0) then {56} else {0}; + _alt = if (_alt > 0) then {29} else {0}; + _keys = [_shift,_ctrl,_alt,_key]; + _keystrg = "^"; + { + _mod = _x in [42,56,29]; + _knaml = call compile format["format['%2',%1]",(keyName _x),"%1"]; + _knaml = [_knaml, " "] call CBA_fnc_split; + _knam = "^"; + {_k = _x; if (!_mod || (_k != (localize "STR_ACE_KN_LEFT") && _k != (localize "STR_ACE_KN_RIGHT"))) then {_knam = _knam + " " + _k}} forEach _knaml; + _knam = [_knam, "^ ", ""] call CBA_fnc_replace; + _keystrg = _keystrg + "-" + _knam; + } forEach _keys; + _keystrg = [_keystrg, "^ ", ""] call CBA_fnc_replace; + _keystrg = [_keystrg, "^-", ""] call CBA_fnc_replace; + _keystrg = [_keystrg, "^", "None"] call CBA_fnc_replace; + _keystrg }; _pkeys = { - _pary = []; - _tpages = []; - _cEvents = configFile/"CfgSettings"/"CBA"/"events"; - for "_i" from 0 to (count _cEvents) - 1 do { - _cSys = _cEvents select _i; - _tSys = configName _cSys; - if (isNumber ((_cSys select 0)/"key")) then { - //format system name - _aSys = [_tSys, "_"] call CBA_fnc_split; - _tS = "^"; - {if (_x != "ace" && _x != "sys") then {_tS = _tS + " " + _x}} forEach _aSys; - _tS = [_tS, "^ ", ""] call CBA_fnc_replace; - _tS = format["%1:",_tS]; - PUSH(_pary,_tS); - for "_j" from 0 to (count _cSys) - 1 do { - _c = _cSys select _j; - _tC = configName _c; - _tC = [_tC, "_", " "] call CBA_fnc_replace; - //key - _key = getNumber (_c/"key"); - _shift = getNumber (_c/"shift"); - _ctrl = getNumber (_c/"ctrl"); - _alt = getNumber (_c/"alt"); - _keyn = [_key,_shift,_ctrl,_alt] call _pkeynam; - _tC = format[" %1: %2",_tC,_keyn]; - PUSH(_pary,_tC); - }; - }; - if (count _pary > 20) then { //split full page - PUSH(_tpages,_pary); - _pary = []; - }; - }; - if (count _pary > 0) then { //partial page - PUSH(_tpages,_pary); - _pary = []; - }; - _tpages + _pary = []; + _tpages = []; + _cEvents = configFile/"CfgSettings"/"CBA"/"events"; + for "_i" from 0 to (count _cEvents) - 1 do { + _cSys = _cEvents select _i; + _tSys = configName _cSys; + if (isNumber ((_cSys select 0)/"key")) then { + //format system name + _aSys = [_tSys, "_"] call CBA_fnc_split; + _tS = "^"; + {if (_x != "ace" && _x != "sys") then {_tS = _tS + " " + _x}} forEach _aSys; + _tS = [_tS, "^ ", ""] call CBA_fnc_replace; + _tS = format["%1:",_tS]; + PUSH(_pary,_tS); + for "_j" from 0 to (count _cSys) - 1 do { + _c = _cSys select _j; + _tC = configName _c; + _tC = [_tC, "_", " "] call CBA_fnc_replace; + //key + _key = getNumber (_c/"key"); + _shift = getNumber (_c/"shift"); + _ctrl = getNumber (_c/"ctrl"); + _alt = getNumber (_c/"alt"); + _keyn = [_key,_shift,_ctrl,_alt] call _pkeynam; + _tC = format[" %1: %2",_tC,_keyn]; + PUSH(_pary,_tC); + }; + }; + if (count _pary > 20) then { //split full page + PUSH(_tpages,_pary); + _pary = []; + }; + }; + if (count _pary > 0) then { //partial page + PUSH(_tpages,_pary); + _pary = []; + }; + _tpages }; //pages (make sure each will fit within 24 lines, word wrap is on) switch(_menu) do { - case "MAIN": { //note: not all scripting commands available on main menu (not compiled yet?) - _fadet = 13; - _page1 = _pcredits; - }; - case "SING": { - _fadet = 20; //fade time - _color = [1,1,1,1]; - //_bcolor = [0,0,0,0.3]; - _page1 = _pcredits; - _newpages = [] call _pkeys; - _pstart = 2; - _pcount = count _newpages; - _pnext = _pstart + _pcount; - }; - case "MULT": { - _fadet = 20; - _color = [1,1,1,1]; - //_bcolor = [0,0,0,0.3]; - _page1 = _pcredits; - _newpages = [] call _pkeys; - _pstart = 2; - _pcount = count _newpages; - _pnext = _pstart + _pcount; - }; - default {}; + case "MAIN": { //note: not all scripting commands available on main menu (not compiled yet?) + _fadet = 13; + _page1 = _pcredits; + }; + case "SING": { + _fadet = 20; //fade time + _color = [1,1,1,1]; + //_bcolor = [0,0,0,0.3]; + _page1 = _pcredits; + _newpages = [] call _pkeys; + _pstart = 2; + _pcount = count _newpages; + _pnext = _pstart + _pcount; + }; + case "MULT": { + _fadet = 20; + _color = [1,1,1,1]; + //_bcolor = [0,0,0,0.3]; + _page1 = _pcredits; + _newpages = [] call _pkeys; + _pstart = 2; + _pcount = count _newpages; + _pnext = _pstart + _pcount; + }; + default {}; }; //main menu display if (typeName(_data select 0) == "DISPLAY") then { - _display = _data select 0; + _display = _data select 0; }; if (typeName(_data select 0) == "CONTROL") then { - _control = _data select 0; - _display = ctrlParent _control; + _control = _data select 0; + _display = ctrlParent _control; }; //dynamic pages _pnames = []; for "_x" from _pstart to _pnext - 1 do { - _pnam = format ["_page%1",_x]; - PUSH(_pnames,_pnam); + _pnam = format ["_page%1",_x]; + PUSH(_pnames,_pnam); }; private _pnames; for "_x" from 0 to _pcount - 1 do { - call compile format ["%1 = %2", _pnames select _x, _newpages select _x]; + call compile format ["%1 = %2", _pnames select _x, _newpages select _x]; }; //get num pages _pages = 0; _run = true; while {_run} do { - INC(_pages); - if (isNil format ["_page%1", _pages]) exitWith {_pages = _pages - 1; _run = false}; + INC(_pages); + if (isNil format ["_page%1", _pages]) exitWith {_pages = _pages - 1; _run = false}; }; if (_pages > 0) then { - //Dialog - createDialog "ACE_ABOUT_DLG"; - _disp = uiNamespace getVariable "ACE_ABOUT_DLG"; - _ctrl = _disp displayCtrl 1141371; - _next = _disp displayCtrl 1141372; + //Dialog + createDialog "ACE_ABOUT_DLG"; + _disp = uiNamespace getVariable "ACE_ABOUT_DLG"; + _ctrl = _disp displayCtrl 1141371; + _next = _disp displayCtrl 1141372; - if (_pages > 1) then {_next ctrlSetText "Next"}; + if (_pages > 1) then {_next ctrlSetText "Next"}; - _ctrl ctrlSetFade 1; - _ctrl ctrlCommit 0; - _ctrl ctrlSetFade 0; - _ctrl ctrlCommit 3; + _ctrl ctrlSetFade 1; + _ctrl ctrlCommit 0; + _ctrl ctrlSetFade 0; + _ctrl ctrlCommit 3; - ACE_ABOUT_INC = 0; - _input = { //local function - _nesc = isNil "ACE_ABOUT_STP"; - if (_pages == 1) then {ACE_ABOUT_INC = 0}; //ignore special control - _unset = (ACE_ABOUT_INC == 0) && ACE_ABOUT_RUN; - if (_unset && _nesc) then {false} else {_fadet = _fadet + 5; true}; - }; + ACE_ABOUT_INC = 0; + _input = { //local function + _nesc = isNil "ACE_ABOUT_STP"; + if (_pages == 1) then {ACE_ABOUT_INC = 0}; //ignore special control + _unset = (ACE_ABOUT_INC == 0) && ACE_ABOUT_RUN; + if (_unset && _nesc) then {false} else {_fadet = _fadet + 5; true}; + }; - //by default cycle - for "_p" from 1 to _pages do { - _text = ""; - _page = call compile format["_page%1",_p]; - _curPage = _p; - { - _text = _text + _x + "
"; - _ctrl ctrlSetStructuredText parseText _text; - if (call _input) exitWith {_p = _pages}; - if (_x != "") then {uisleep 0.8}; - } forEach _page; - }; + //by default cycle + for "_p" from 1 to _pages do { + _text = ""; + _page = call compile format["_page%1",_p]; + _curPage = _p; + { + _text = _text + _x + "
"; + _ctrl ctrlSetStructuredText parseText _text; + if (call _input) exitWith {_p = _pages}; + if (_x != "") then {uisleep 0.8}; + } forEach _page; + }; - _run = true; - while {if (isNil "ACE_ABOUT_STP") then {_run} else {false}} do { - _ctrl ctrlSetFade 0; - _ctrl ctrlCommit 0; - if (!isNil "_color") then {_ctrl ctrlSetTextColor _color}; - if (!isNil "_bcolor") then {_ctrl ctrlSetBackgroundColor _bcolor}; + _run = true; + while {if (isNil "ACE_ABOUT_STP") then {_run} else {false}} do { + _ctrl ctrlSetFade 0; + _ctrl ctrlCommit 0; + if (!isNil "_color") then {_ctrl ctrlSetTextColor _color}; + if (!isNil "_bcolor") then {_ctrl ctrlSetBackgroundColor _bcolor}; - _curPage = _curPage + ACE_ABOUT_INC; - if (_curPage > _pages) then {_curPage = 1}; - if (_curPage <= 0) then {_curPage = 1}; - ACE_ABOUT_INC = 0; + _curPage = _curPage + ACE_ABOUT_INC; + if (_curPage > _pages) then {_curPage = 1}; + if (_curPage <= 0) then {_curPage = 1}; + ACE_ABOUT_INC = 0; - if (!ACE_ABOUT_RUN) then {ACE_ABOUT_RUN = true}; + if (!ACE_ABOUT_RUN) then {ACE_ABOUT_RUN = true}; - _text = ""; - _page = call compile format ["_page%1",_curPage]; - {_text = _text + _x + "
"} forEach _page; - _ctrl ctrlSetStructuredText parseText _text; + _text = ""; + _page = call compile format ["_page%1",_curPage]; + {_text = _text + _x + "
"} forEach _page; + _ctrl ctrlSetStructuredText parseText _text; - _ctrl ctrlSetFade 1; - _ctrl ctrlCommit _fadet; + _ctrl ctrlSetFade 1; + _ctrl ctrlCommit _fadet; - _time = time + _fadet + 2; - waitUntil{uisleep 1; _run = call _input; _faded = time > _time; (_run || _faded)}; - }; //while RUN + _time = time + _fadet + 2; + waitUntil{uisleep 1; _run = call _input; _faded = time > _time; (_run || _faded)}; + }; //while RUN }; ACE_ABOUT_STP = Nil; ACE_ABOUT_RUN = Nil; diff --git a/addons/main/license.sqf b/addons/main/license.sqf index e97d9c51a3..d078710247 100644 --- a/addons/main/license.sqf +++ b/addons/main/license.sqf @@ -16,10 +16,10 @@ Waiver Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license. Other Rights — In no way are any of the following rights affected by the license: - - Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; - - The author's moral rights; - - Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. - + - Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; + - The author's moral rights; + - Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. + Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. diff --git a/addons/main/script_component.hpp b/addons/main/script_component.hpp index 8c224ed41f..9a18b78a7a 100644 --- a/addons/main/script_component.hpp +++ b/addons/main/script_component.hpp @@ -4,11 +4,11 @@ // #define DEBUG_MODE_FULL #ifdef DEBUG_ENABLED_CORE - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_CORE - #define DEBUG_SETTINGS DEBUG_SETTINGS_CORE + #define DEBUG_SETTINGS DEBUG_SETTINGS_CORE #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/main/script_config.hpp b/addons/main/script_config.hpp index ac8e18fa12..e39240286e 100644 --- a/addons/main/script_config.hpp +++ b/addons/main/script_config.hpp @@ -1,38 +1,38 @@ -#define true 1 -#define false 0 +#define true 1 +#define false 0 -#define private 0 -#define protected 1 -#define public 2 +#define private 0 +#define protected 1 +#define public 2 -#define TEast 0 -#define TWest 1 -#define TGuerrila 2 -#define TCivilian 3 -#define TSideUnknown 4 -#define TEnemy 5 -#define TFriendly 6 -#define TLogic 7 +#define TEast 0 +#define TWest 1 +#define TGuerrila 2 +#define TCivilian 3 +#define TSideUnknown 4 +#define TEnemy 5 +#define TFriendly 6 +#define TLogic 7 -#define VSoft 0 -#define VArmor 1 -#define VAir 2 +#define VSoft 0 +#define VArmor 1 +#define VAir 2 -#define LockNo 0 -#define LockCadet 1 -#define LockYes 2 +#define LockNo 0 +#define LockCadet 1 +#define LockYes 2 -#define ReadAndWrite 0 -#define ReadAndCreate 1 -#define ReadOnly 2 -#define ReadOnlyVerified 3 +#define ReadAndWrite 0 +#define ReadAndCreate 1 +#define ReadOnly 2 +#define ReadOnlyVerified 3 -#define WeaponNoSlot 0 // dummy weapons -#define WeaponSlotPrimary 1 // primary weapons -#define WeaponSlotSecondary 16 // secondary weapons -#define WeaponSlotItem 256 // items -#define WeaponSlotBinocular 4096 // binocular -#define WeaponHardMounted 65536 +#define WeaponNoSlot 0 // dummy weapons +#define WeaponSlotPrimary 1 // primary weapons +#define WeaponSlotSecondary 16 // secondary weapons +#define WeaponSlotItem 256 // items +#define WeaponSlotBinocular 4096 // binocular +#define WeaponHardMounted 65536 #define CanSeeRadar 1 #define CanSeeRye 2 diff --git a/addons/main/script_debug.hpp b/addons/main/script_debug.hpp index 26475fb226..578d76cc91 100644 --- a/addons/main/script_debug.hpp +++ b/addons/main/script_debug.hpp @@ -32,15 +32,15 @@ PERFORMANCE COUNTERS SECTION #ifdef ENABLE_PERFORMANCE_COUNTERS #define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret } - - #define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter)); - #define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime]; - #define END_COUNTER(x) GVAR(DOUBLES(x,counter)) pushBack [(GVAR(DOUBLES(x,counter)) select 2), diag_tickTime]; + + #define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter)); + #define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime]; + #define END_COUNTER(x) GVAR(DOUBLES(x,counter)) pushBack [(GVAR(DOUBLES(x,counter)) select 2), diag_tickTime]; - #define DUMP_COUNTERS ([__FILE__, __LINE__] call ACE_DUMPCOUNTERS_FNC) + #define DUMP_COUNTERS ([__FILE__, __LINE__] call ACE_DUMPCOUNTERS_FNC) #else - #define CREATE_COUNTER(x) /* disabled */ - #define BEGIN_COUNTER(x) /* disabled */ - #define END_COUNTER(x) /* disabled */ - #define DUMP_COUNTERS /* disabled */ + #define CREATE_COUNTER(x) /* disabled */ + #define BEGIN_COUNTER(x) /* disabled */ + #define END_COUNTER(x) /* disabled */ + #define DUMP_COUNTERS /* disabled */ #endif \ No newline at end of file diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index ff2c4d615e..79f95545ca 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -43,7 +43,7 @@ #define ACE_ITEMS_CIVILIAN "ItemWatch" -#define ACE_DEFAULT_SLOTS "1 + 4 + 12* 256 + 2* 4096 + 2 + 8* 16 + 12*131072" +#define ACE_DEFAULT_SLOTS "1 + 4 + 12* 256 + 2* 4096 + 2 + 8* 16 + 12*131072" #define ACE_NOGRIP handAnim[] = {} #define ACE_DISTANCE_DEFAULT distanceZoomMin = 300; distanceZoomMax = 300 @@ -51,30 +51,30 @@ // #include "script_macros_optics.hpp" //ToDo #define ACE_NOZEROING discreteDistance[] = {}; \ - discreteDistanceInitIndex = 0; \ - weaponInfoType = "RscWeaponEmpty" + discreteDistanceInitIndex = 0; \ + weaponInfoType = "RscWeaponEmpty" #define ACE_NOTURRETZEROING discreteDistance[] = {}; \ - discreteDistanceInitIndex = 0; \ - turretInfoType = "RscWeaponEmpty" + discreteDistanceInitIndex = 0; \ + turretInfoType = "RscWeaponEmpty" #define ACE_LASER irLaserPos = "laser pos"; \ - irLaserEnd = "laser dir"; \ - irDistance = 300 + irLaserEnd = "laser dir"; \ + irDistance = 300 #define ACE_LASER_DISTANCE_VANILLA irDistance = 300 -#define ACE_NOLASER irLaserPos = "laser pos"; \ - irLaserEnd = "laser dir"; \ - irDistance = 0 +#define ACE_NOLASER irLaserPos = "laser pos"; \ + irLaserEnd = "laser dir"; \ + irDistance = 0 #define ACE_SUPPRESSED ace_suppressed = 1; \ - fireLightDuration = 0; \ - fireLightIntensity = 0 + fireLightDuration = 0; \ + fireLightIntensity = 0 // TODO: Cleanup in all the configs around -#define ACE_M_MAG(x,y) class _xx_##x {magazine = ##x; count = ##y;} -#define ACE_M_WEP(x,y) class _xx_##x {weapon = ##x; count = ##y;} +#define ACE_M_MAG(x,y) class _xx_##x {magazine = ##x; count = ##y;} +#define ACE_M_WEP(x,y) class _xx_##x {weapon = ##x; count = ##y;} #define ACE_M_ITEM(x,y) class _xx_##x {name = ##x; count = ##y;} #define ACE_M_BAG(x,y) class _xx_##x {backpack = ##x; count = ##y;} @@ -82,11 +82,11 @@ // Vehicle defines // ACE_canBeLoad = This vehicle acts as transporter, i.e you can load stuff into it // ACE_canBeCargo = This vehicle acts as cargo, i.e you can load this item into other vehicles -#define ACE_CARGO_FRONT ACE_canBeLoad = false; ACE_canBeCargo = true; ACE_canGear = false; ACE_canLoadFront = true -#define ACE_CARGO_ONLY ACE_canBeLoad = false; ACE_canBeCargo = true; ACE_canGear = false; ACE_canLoadFront = false -#define ACE_LOAD_ONLY ACE_canBeLoad = true; ACE_canBeCargo = false; ACE_canGear = false; ACE_canLoadFront = false -#define ACE_GEAR_ONLY ACE_canBeLoad = true; ACE_canBeCargo = false; ACE_canGear = true; ACE_canLoadFront = false -#define ACE_NOCARGOLOAD ACE_canBeLoad = false; ACE_canBeCargo = false; ACE_canGear = false; ACE_canLoadFront = false +#define ACE_CARGO_FRONT ACE_canBeLoad = false; ACE_canBeCargo = true; ACE_canGear = false; ACE_canLoadFront = true +#define ACE_CARGO_ONLY ACE_canBeLoad = false; ACE_canBeCargo = true; ACE_canGear = false; ACE_canLoadFront = false +#define ACE_LOAD_ONLY ACE_canBeLoad = true; ACE_canBeCargo = false; ACE_canGear = false; ACE_canLoadFront = false +#define ACE_GEAR_ONLY ACE_canBeLoad = true; ACE_canBeCargo = false; ACE_canGear = true; ACE_canLoadFront = false +#define ACE_NOCARGOLOAD ACE_canBeLoad = false; ACE_canBeCargo = false; ACE_canGear = false; ACE_canLoadFront = false // Increased FOV for tank driver // Increased Default US Tank driver optic @@ -134,32 +134,32 @@ #undef BWC_CONFIG #define BWC_CONFIG(NAME) class NAME { \ - units[] = {}; \ - weapons[] = {}; \ - requiredVersion = REQUIRED_VERSION; \ - requiredAddons[] = {}; \ - version = VERSION; \ - ACE_BWC; \ + units[] = {}; \ + weapons[] = {}; \ + requiredVersion = REQUIRED_VERSION; \ + requiredAddons[] = {}; \ + version = VERSION; \ + ACE_BWC; \ } #define ACE_FLASHLIGHT class FlashLight { \ - color[] = {0.9, 0.9, 0.7, 0.9}; \ - ambient[] = {0.1, 0.1, 0.1, 1.0}; \ - position = "flash dir"; \ - direction = "flash"; \ - angle = 30; \ - scale[] = {1, 1, 0.5}; \ - brightness = 0.1; \ - } + color[] = {0.9, 0.9, 0.7, 0.9}; \ + ambient[] = {0.1, 0.1, 0.1, 1.0}; \ + position = "flash dir"; \ + direction = "flash"; \ + angle = 30; \ + scale[] = {1, 1, 0.5}; \ + brightness = 0.1; \ + } #define ACE_SMALL_FLASHLIGHT class FlashLight { \ - color[] = {0.9, 0.9, 0.7, 0.9}; \ - ambient[] = {0.1, 0.1, 0.1, 1.0}; \ - position = "flash dir"; \ - direction = "flash"; \ - angle = 20; \ - scale[] = {0.9, 0.9, 0.4}; \ - brightness = 0.09; \ - } + color[] = {0.9, 0.9, 0.7, 0.9}; \ + ambient[] = {0.1, 0.1, 0.1, 1.0}; \ + position = "flash dir"; \ + direction = "flash"; \ + angle = 20; \ + scale[] = {0.9, 0.9, 0.4}; \ + brightness = 0.09; \ + } // Addaction defines for colored text #define ACE_TEXT_ORANGE(Text) ("" + ##Text + "") @@ -172,8 +172,8 @@ #define EGVAR(module,var) TRIPLES(PREFIX,module,var) #define QEGVAR(module,var) QUOTE(EGVAR(module,var)) -#define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName) -#define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName +#define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName) +#define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName #define DFUNC(var1) TRIPLES(ADDON,fnc,var1) #define DEFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) @@ -223,23 +223,23 @@ #ifdef DISABLE_COMPILE_CACHE - #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) + #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) #else - #define PREP(fncName) DFUNC(fncName) = QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) call SLX_XEH_COMPILE + #define PREP(fncName) DFUNC(fncName) = QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) call SLX_XEH_COMPILE #endif #define PREP_MODULE(folder) [] call compile preprocessFileLineNumbers QUOTE(PATHTOF(folder\__PREP__.sqf)) -#define HASH_CREATE ([] call EFUNC(common,hashCreate)) -#define HASH_SET(hash, key, val) ([hash, key, val, __FILE__, __LINE__] call EFUNC(common,hashSet)) -#define HASH_GET(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashGet)) -#define HASH_REM(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashRem)) -#define HASH_HASKEY(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashHasKey)) +#define HASH_CREATE ([] call EFUNC(common,hashCreate)) +#define HASH_SET(hash, key, val) ([hash, key, val, __FILE__, __LINE__] call EFUNC(common,hashSet)) +#define HASH_GET(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashGet)) +#define HASH_REM(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashRem)) +#define HASH_HASKEY(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashHasKey)) -#define HASHLIST_CREATELIST(keys) ([keys] call EFUNC(common,hashListCreateList)) -#define HASHLIST_CREATEHASH(hashList) ([hashList] call EFUNC(common,hashListCreateHash)) -#define HASHLIST_SELECT(hashList, index) ([hashList, index, __FILE__, __LINE__] call EFUNC(common,hashListSelect)) -#define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet)) -#define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) +#define HASHLIST_CREATELIST(keys) ([keys] call EFUNC(common,hashListCreateList)) +#define HASHLIST_CREATEHASH(hashList) ([hashList] call EFUNC(common,hashListCreateHash)) +#define HASHLIST_SELECT(hashList, index) ([hashList, index, __FILE__, __LINE__] call EFUNC(common,hashListSelect)) +#define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet)) +#define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) #include "script_debug.hpp" \ No newline at end of file diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index c8dfd56b4c..6ef5ec3f68 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -17,39 +17,39 @@ #define REQUIRED_VERSION 0.5 /* - #define DEBUG_ENABLED_ADDONS - #define DEBUG_ENABLED_ATTACHMENTS - #define DEBUG_ENABLED_weapons_backblast - #define DEBUG_ENABLED_BLOOD - #define DEBUG_ENABLED_CARTRIDGES - #define DEBUG_ENABLED_CRATERS - #define DEBUG_ENABLED_CREWPROTECTION - #define DEBUG_ENABLED_DUMMIES - #define DEBUG_ENABLED_EJECT - #define DEBUG_ENABLED_EXPLOSIVES - #define DEBUG_ENABLED_FLARES - #define DEBUG_ENABLED_FLASHBANG - #define DEBUG_ENABLED_GRENADETHROW - #define DEBUG_ENABLED_HUNTIR - #define DEBUG_ENABLED_INTERACTION - #define DEBUG_ENABLED_IRSTROBE - #define DEBUG_ENABLED_MULTI_BARREL - #define DEBUG_ENABLED_MUZZLEBLAST - #define DEBUG_ENABLED_NVG - #define DEBUG_ENABLED_weapons_overheating - #define DEBUG_ENABLED_RECOILDUST - #define DEBUG_ENABLED_ROCKET_BALLISTICS - #define DEBUG_ENABLED_SANDBAG - #define DEBUG_ENABLED_SHOTGUN - #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_AT - #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_GL - #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_RIFLE - #define DEBUG_ENABLED_SMAW_SPOTTINGRIFLE - #define DEBUG_ENABLED_TRACERS - #define DEBUG_ENABLED_TRACKING - #define DEBUG_ENABLED_VIEWBLOCK - #define DEBUG_ENABLED_VEHICLE - #define DEBUG_ENABLED_vehicle_damage - #define DEBUG_ENABLED_WEAPONREST - #define DEBUG_ENABLED_WOUNDS + #define DEBUG_ENABLED_ADDONS + #define DEBUG_ENABLED_ATTACHMENTS + #define DEBUG_ENABLED_weapons_backblast + #define DEBUG_ENABLED_BLOOD + #define DEBUG_ENABLED_CARTRIDGES + #define DEBUG_ENABLED_CRATERS + #define DEBUG_ENABLED_CREWPROTECTION + #define DEBUG_ENABLED_DUMMIES + #define DEBUG_ENABLED_EJECT + #define DEBUG_ENABLED_EXPLOSIVES + #define DEBUG_ENABLED_FLARES + #define DEBUG_ENABLED_FLASHBANG + #define DEBUG_ENABLED_GRENADETHROW + #define DEBUG_ENABLED_HUNTIR + #define DEBUG_ENABLED_INTERACTION + #define DEBUG_ENABLED_IRSTROBE + #define DEBUG_ENABLED_MULTI_BARREL + #define DEBUG_ENABLED_MUZZLEBLAST + #define DEBUG_ENABLED_NVG + #define DEBUG_ENABLED_weapons_overheating + #define DEBUG_ENABLED_RECOILDUST + #define DEBUG_ENABLED_ROCKET_BALLISTICS + #define DEBUG_ENABLED_SANDBAG + #define DEBUG_ENABLED_SHOTGUN + #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_AT + #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_GL + #define DEBUG_ENABLED_SIGHT_ADJUSTMENT_RIFLE + #define DEBUG_ENABLED_SMAW_SPOTTINGRIFLE + #define DEBUG_ENABLED_TRACERS + #define DEBUG_ENABLED_TRACKING + #define DEBUG_ENABLED_VIEWBLOCK + #define DEBUG_ENABLED_VEHICLE + #define DEBUG_ENABLED_vehicle_damage + #define DEBUG_ENABLED_WEAPONREST + #define DEBUG_ENABLED_WOUNDS */ diff --git a/addons/map/script_component.hpp b/addons/map/script_component.hpp index 0c8f7429ab..3f126eb653 100644 --- a/addons/map/script_component.hpp +++ b/addons/map/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MAP - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_MAP - #define DEBUG_SETTINGS DEBUG_SETTINGS_MAP + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAP #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/maptools/XEH_preInit.sqf b/addons/maptools/XEH_preInit.sqf index 20777fb118..2da38996c3 100644 --- a/addons/maptools/XEH_preInit.sqf +++ b/addons/maptools/XEH_preInit.sqf @@ -24,8 +24,8 @@ PREP(updateMapToolMarkers); PREP(updateLineMarker); if (isServer) then { - GVAR(drawing_serverLineMarkers) = []; - publicVariable QGVAR(drawing_serverLineMarkers); + GVAR(drawing_serverLineMarkers) = []; + publicVariable QGVAR(drawing_serverLineMarkers); }; //Add Event Handlers: diff --git a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf index a4d25f8157..a26a02dd34 100644 --- a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf +++ b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf @@ -4,8 +4,8 @@ #include "script_component.hpp" if ((!("ItemGPS" in assigneditems ACE_player)) || {isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])}) exitWith { - ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC - [(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler + ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC + [(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler }; disableSerialization; diff --git a/addons/maptools/script_component.hpp b/addons/maptools/script_component.hpp index a3dad97a49..df2a8d3f62 100644 --- a/addons/maptools/script_component.hpp +++ b/addons/maptools/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MAPTOOLS - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_MAPTOOLS - #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPTOOLS + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPTOOLS #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/medical/XEH_init.sqf b/addons/medical/XEH_init.sqf index 0ded7d471f..2f840fe950 100644 --- a/addons/medical/XEH_init.sqf +++ b/addons/medical/XEH_init.sqf @@ -6,5 +6,5 @@ _unit = _this select 0; _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; if (local _unit) then { - [_unit] call FUNC(init); + [_unit] call FUNC(init); }; diff --git a/addons/medical/functions/fnc_actionDropUnit.sqf b/addons/medical/functions/fnc_actionDropUnit.sqf index db1c02aced..53883c93c1 100644 --- a/addons/medical/functions/fnc_actionDropUnit.sqf +++ b/addons/medical/functions/fnc_actionDropUnit.sqf @@ -17,7 +17,7 @@ private "_caller"; _caller = _this select 0; if (!isnil QGVAR(DROP_ADDACTION)) then { - [_caller,objNull] call EFUNC(common,carryObj); - _caller removeAction GVAR(DROP_ADDACTION); + [_caller,objNull] call EFUNC(common,carryObj); + _caller removeAction GVAR(DROP_ADDACTION); GVAR(DROP_ADDACTION) = nil; }; diff --git a/addons/medical/functions/fnc_copyDeadBody.sqf b/addons/medical/functions/fnc_copyDeadBody.sqf index 68d5a356ec..8e476b8662 100644 --- a/addons/medical/functions/fnc_copyDeadBody.sqf +++ b/addons/medical/functions/fnc_copyDeadBody.sqf @@ -67,9 +67,9 @@ _newUnit selectWeapon (primaryWeapon _newUnit); // We are attaching the old unit and hiding it, so we can keep the original unit until later. _oldBody attachTo [_newUnit, [0,0,0]]; if (isMultiplayer) then { - hideObjectGlobal _oldBody; + hideObjectGlobal _oldBody; } else { - hideObject _oldBody; + hideObject _oldBody; }; _newUnit setvariable [QGVAR(copyOfUnit), _oldBody, true]; diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf index 5e763822db..6ea910b7af 100644 --- a/addons/medical/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -22,11 +22,11 @@ if (isnil "_display") exitwith {}; _pos = [0,0,0,0]; if (_show) then { - _pos = ctrlPosition (_display displayCtrl 2001); + _pos = ctrlPosition (_display displayCtrl 2001); }; for "_idc" from 2002 to 2006 step 1 do { - _pos set [1, (_pos select 1) + (_pos select 3)]; - _ctrl = (_display displayCtrl _idc); - _ctrl ctrlSetPosition _pos; - _ctrl ctrlCommit 0; + _pos set [1, (_pos select 1) + (_pos select 3)]; + _ctrl = (_display displayCtrl _idc); + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; }; diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index eb35b3e8c5..b4e40984ae 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -38,81 +38,81 @@ _reopeningMaxDelay = 200; _config = (ConfigFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Bandaging"); if (isClass (_config >> _bandage)) then { _config = (_config >> _bandage); - _reopeningChance = getNumber (_config >> "reopeningChance"); - _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); - _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; + _reopeningChance = getNumber (_config >> "reopeningChance"); + _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); + _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; }; if (isClass (_config >> _className)) then { _woundTreatmentConfig = (_config >> _className); if (isNumber (_woundTreatmentConfig >> "reopeningChance")) then { - _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); - }; + _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); + }; if (isNumber (_woundTreatmentConfig >> "reopeningMinDelay")) then { - _reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay"); - }; + _reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay"); + }; if (isNumber (_woundTreatmentConfig >> "reopeningMaxDelay")) then { - _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; - }; + _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; + }; }; _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; _exist = false; _injuryId = _injury select 0; { - if ((_x select 0) == _injuryId) exitwith { - _exist = true; - _existingInjury = _x; - _existingInjury set [3, (_existingInjury select 3) + _impact]; - _bandagedWounds set [_foreachIndex, _existingInjury]; - }; + if ((_x select 0) == _injuryId) exitwith { + _exist = true; + _existingInjury = _x; + _existingInjury set [3, (_existingInjury select 3) + _impact]; + _bandagedWounds set [_foreachIndex, _existingInjury]; + }; }foreach _bandagedWounds; if !(_exist) then { - // [ID, classID, bodypart, percentage treated, bloodloss rate] - _bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; + // [ID, classID, bodypart, percentage treated, bloodloss rate] + _bandagedWounds pushback [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; }; _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; // Check if we are ever going to reopen this if (random(1) <= _reopeningChance) then { - _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); - [{ - private ["_target", "_impact", "_part", "_injuryIndex", "_bandage", "_injury", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"]; - _target = _this select 0; - _impact = _this select 1; - _part = _this select 2; - _injuryIndex = _this select 3; - _injury = _this select 4; + _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); + [{ + private ["_target", "_impact", "_part", "_injuryIndex", "_bandage", "_injury", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"]; + _target = _this select 0; + _impact = _this select 1; + _part = _this select 2; + _injuryIndex = _this select 3; + _injury = _this select 4; - if (alive _target) then { - _openWounds = _target getvariable [QGVAR(openWounds), []]; - if ((count _openWounds)-1 < _injuryIndex) exitwith {}; - _selectedInjury = _openWounds select _injuryIndex; - if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs - _selectedInjury set [3, (_selectedInjury select 3) + _impact]; - _openWounds set [_injuryIndex, _selectedInjury]; - _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; - if (USE_WOUND_EVENT_SYNC) then { - ["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent); - }; - _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; - _exist = false; - _injuryId = _injury select 0; - { - if ((_x select 0) == _injuryId) exitwith { - _exist = true; - _existingInjury = _x; - _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; - _bandagedWounds set [_foreachIndex, _existingInjury]; - }; - }foreach _bandagedWounds; + if (alive _target) then { + _openWounds = _target getvariable [QGVAR(openWounds), []]; + if ((count _openWounds)-1 < _injuryIndex) exitwith {}; + _selectedInjury = _openWounds select _injuryIndex; + if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs + _selectedInjury set [3, (_selectedInjury select 3) + _impact]; + _openWounds set [_injuryIndex, _selectedInjury]; + _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; + if (USE_WOUND_EVENT_SYNC) then { + ["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent); + }; + _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; + _exist = false; + _injuryId = _injury select 0; + { + if ((_x select 0) == _injuryId) exitwith { + _exist = true; + _existingInjury = _x; + _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; + _bandagedWounds set [_foreachIndex, _existingInjury]; + }; + }foreach _bandagedWounds; - if (_exist) then { - _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; - }; - }; - // Otherwise something went wrong, we we don't reopen them.. - }; - }, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute); + if (_exist) then { + _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; + }; + }; + // Otherwise something went wrong, we we don't reopen them.. + }; + }, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute); }; diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 1a602bd702..ce0f087836 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -24,9 +24,9 @@ if (GVAR(level) >= 2) then { _unit setvariable [QGVAR(airwayStatus), 0]; if (USE_WOUND_EVENT_SYNC) then { - _openWounds = _unit getvariable [QGVAR(openWounds), []]; - { - ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); - }foreach _openWounds; - }; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); + }foreach _openWounds; + }; }; diff --git a/addons/medical/functions/fnc_onCarryObjectDropped.sqf b/addons/medical/functions/fnc_onCarryObjectDropped.sqf index 8f6dd57310..6a6a990d53 100644 --- a/addons/medical/functions/fnc_onCarryObjectDropped.sqf +++ b/addons/medical/functions/fnc_onCarryObjectDropped.sqf @@ -33,7 +33,7 @@ if (_carrying >= 0) then { _target setvariable [QGVAR(hasCopy), nil, true]; }; - _caller setvariable [QGVAR(isCarrying), -1, true]; + _caller setvariable [QGVAR(isCarrying), -1, true]; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; diff --git a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf index a32288d0a6..c160e47ea0 100644 --- a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf +++ b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf @@ -20,8 +20,8 @@ _lastId = _this select 1; _originOfrequest = _this select 2; if (local _unit) then { - _openWounds = _unit getvariable [QGVAR(openWounds), []]; - { - ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); - }foreach _openWounds; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); + }foreach _openWounds; }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 6584569227..b08057f615 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -27,7 +27,7 @@ _items = _this select 4; _specificSpot = if (count _this > 6) then {_this select 6} else {-1}; if !([_target] call FUNC(hasMedicalEnabled)) exitwith { - _this call FUNC(treatmentBasic_bandage); + _this call FUNC(treatmentBasic_bandage); }; [[_target, _className, _selectionName, _specificSpot], QUOTE(DFUNC(treatmentAdvanced_bandageLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index ead2bf9d52..bdfb95fb2a 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -24,5 +24,5 @@ _className = _this select 3; [_target, false] call FUNC(setUnconscious); if (_target getvariable [QGVAR(inReviveState), false]) then { - _target setvariable [QGVAR(inReviveState), nil, true]; + _target setvariable [QGVAR(inReviveState), nil, true]; }; diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index b0b5ce6a7f..66ecdf9d90 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -37,6 +37,6 @@ _varName = format["ACE_Medical_IVVolume_%1",_typeOf]; _target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded, true]; if !(_varName in GVAR(IVBags)) then { - GVAR(IVBags) pushback _varName; - publicVariable QGVAR(IVBags); + GVAR(IVBags) pushback _varName; + publicVariable QGVAR(IVBags); }; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 1a22e191fd..d4f853374c 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -30,12 +30,12 @@ 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); + [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; { - (_x select 0) addItem (_x select 1); + (_x select 0) addItem (_x select 1); }foreach _usersOfItems; // Record specific callback diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 85cfbf7e52..5910a4be86 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -28,7 +28,7 @@ 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); + [_caller, _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""], 1] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; diff --git a/addons/missionmodules/CfgVehicles.hpp b/addons/missionmodules/CfgVehicles.hpp index a38d651c75..6a1dc71705 100644 --- a/addons/missionmodules/CfgVehicles.hpp +++ b/addons/missionmodules/CfgVehicles.hpp @@ -1,68 +1,68 @@ class CfgVehicles { - class Logic; - class Module_F: Logic { - class ArgumentsBaseUnits { - }; - }; + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; - // TODO make a curator variant for this - class ACE_moduleAmbianceSound: Module_F { - scope = 2; - displayName = "Ambiance Sounds [ACE]"; - icon = QUOTE(PATHTOF(UI\Icon_Module_Ambient_Sounds_ca.paa)); - category = "ACE_missionModules"; - function = QUOTE(FUNC(moduleAmbianceSound)); - functionPriority = 1; - isGlobal = 1; - isTriggerActivated = 0; - author = "$STR_ACE_Common_ACETeam"; - class Arguments { - class soundFiles { - displayName = "Sounds"; - description = "Classnames of the ambiance sounds played. Seperated by ','. "; - typeName = "STRING"; - defaultValue = ""; - }; - class minimalDistance { - displayName = "Minimal Distance"; - description = "Minimal Distance"; - typeName = "NUMBER"; - defaultValue = 400; - }; - class maximalDistance { - displayName = "Maximal Distance"; - description = "Maximal Distance"; - typeName = "NUMBER"; - defaultValue = 900; - }; - class minimalDelay { - displayName = "Minimal Delay"; - description = "Minimal Delay between sounds played"; - typeName = "NUMBER"; - defaultValue = 10; - }; - class maximalDelay { - displayName = "Maximal Delay"; - description = "Maximal Delay between sounds played"; - typeName = "NUMBER"; - defaultValue = 170; - }; - class followPlayers { - displayName = "Follow Players"; - description = "Follow players. If set to false, loop will play sounds only nearby logic position."; - typeName = "BOOL"; - defaultValue = 0; - }; - class soundVolume { - displayName = "Volume"; - description = "The volume of the sounds played"; - typeName = "NUMBER"; - defaultValue = 1; - }; - }; - class ModuleDescription { - description = "Ambiance sounds loop (synced across MP)"; - sync[] = {}; - }; - }; + // TODO make a curator variant for this + class ACE_moduleAmbianceSound: Module_F { + scope = 2; + displayName = "Ambiance Sounds [ACE]"; + icon = QUOTE(PATHTOF(UI\Icon_Module_Ambient_Sounds_ca.paa)); + category = "ACE_missionModules"; + function = QUOTE(FUNC(moduleAmbianceSound)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "$STR_ACE_Common_ACETeam"; + class Arguments { + class soundFiles { + displayName = "Sounds"; + description = "Classnames of the ambiance sounds played. Seperated by ','. "; + typeName = "STRING"; + defaultValue = ""; + }; + class minimalDistance { + displayName = "Minimal Distance"; + description = "Minimal Distance"; + typeName = "NUMBER"; + defaultValue = 400; + }; + class maximalDistance { + displayName = "Maximal Distance"; + description = "Maximal Distance"; + typeName = "NUMBER"; + defaultValue = 900; + }; + class minimalDelay { + displayName = "Minimal Delay"; + description = "Minimal Delay between sounds played"; + typeName = "NUMBER"; + defaultValue = 10; + }; + class maximalDelay { + displayName = "Maximal Delay"; + description = "Maximal Delay between sounds played"; + typeName = "NUMBER"; + defaultValue = 170; + }; + class followPlayers { + displayName = "Follow Players"; + description = "Follow players. If set to false, loop will play sounds only nearby logic position."; + typeName = "BOOL"; + defaultValue = 0; + }; + class soundVolume { + displayName = "Volume"; + description = "The volume of the sounds played"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Ambiance sounds loop (synced across MP)"; + sync[] = {}; + }; + }; }; diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 943d795b7a..c02d19aa5f 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -25,99 +25,99 @@ _activated = [_this,2,true,[true]] call BIS_fnc_param; // We only play this on the locality of the logic, since the sounds are broadcasted across the network if (_activated && local _logic) then { - _ambianceSounds = []; - _unparsedSounds = _logic getvariable ["soundFiles", ""]; - _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1; - _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance; - _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1; - _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds; - _volume = (_logic getvariable ["soundVolume", 30]) max 1; - _followPlayers = _logic getvariable ["followPlayers", false]; + _ambianceSounds = []; + _unparsedSounds = _logic getvariable ["soundFiles", ""]; + _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1; + _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance; + _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1; + _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds; + _volume = (_logic getvariable ["soundVolume", 30]) max 1; + _followPlayers = _logic getvariable ["followPlayers", false]; - _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; + _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; - _nilCheckPassedList = ""; - { - _x = [_x] call EFUNC(common,string_removeWhiteSpace); - _splittedList set [_foreachIndex, _x]; - }foreach _splittedList; + _nilCheckPassedList = ""; + { + _x = [_x] call EFUNC(common,string_removeWhiteSpace); + _splittedList set [_foreachIndex, _x]; + }foreach _splittedList; - _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; - { - if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); - } else { - if (isclass (configFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); - }; - }; - }foreach _splittedList; + _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; + { + if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); + } else { + if (isclass (configFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); + }; + }; + }foreach _splittedList; - if (count _ambianceSounds == 0) exitwith {}; - { - if !([".", _x, true] call BIS_fnc_inString) then { - _ambianceSounds set [_foreachIndex, _x + ".wss"]; - }; - }foreach _ambianceSounds; + if (count _ambianceSounds == 0) exitwith {}; + { + if !([".", _x, true] call BIS_fnc_inString) then { + _ambianceSounds set [_foreachIndex, _x + ".wss"]; + }; + }foreach _ambianceSounds; - [{ - private ["_args", "_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers","_lastTimePlayed", "_newPos"]; - _args = _this select 0; - _logic = _args select 0; - _minDelayBetweensounds = _args select 4; - _maxDelayBetweenSounds = _args select 5; - _lastTimePlayed = _args select 8; + [{ + private ["_args", "_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers","_lastTimePlayed", "_newPos"]; + _args = _this select 0; + _logic = _args select 0; + _minDelayBetweensounds = _args select 4; + _maxDelayBetweenSounds = _args select 5; + _lastTimePlayed = _args select 8; - if (!alive _logic) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; + if (!alive _logic) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; - if (time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { - _ambianceSounds = _args select 1; - _minimalDistance = _args select 2; - _maximalDistance = _args select 3; + if (time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { + _ambianceSounds = _args select 1; + _minimalDistance = _args select 2; + _maximalDistance = _args select 3; - _volume = _args select 6; - _followPlayers = _args select 7; + _volume = _args select 6; + _followPlayers = _args select 7; - // Find all players in session. - _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; + // Find all players in session. + _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; - // Check if there are enough players to even start playing this sound. - if (count _allUnits > 0) then { + // Check if there are enough players to even start playing this sound. + if (count _allUnits > 0) then { - // Select a target unit at random. - _targetUnit = _allUnits select (round(random((count _allUnits)-1))); + // Select a target unit at random. + _targetUnit = _allUnits select (round(random((count _allUnits)-1))); - // find the position from which we are going to play this sound from. - _newPos = (getPos _targetUnit); - if (!_followPlayers) then { - _newPos = getPos _logic; - }; + // find the position from which we are going to play this sound from. + _newPos = (getPos _targetUnit); + if (!_followPlayers) then { + _newPos = getPos _logic; + }; - // Randomize this position. - if (random(1) >= 0.5) then { - if (random(1) >= 0.5) then { - _newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))]; - } else { - _newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))]; - }; - } else { - if (random(1) >= 0.5) then { - _newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))]; - } else { - _newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))]; - }; - }; + // Randomize this position. + if (random(1) >= 0.5) then { + if (random(1) >= 0.5) then { + _newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))]; + } else { + _newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))]; + }; + } else { + if (random(1) >= 0.5) then { + _newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))]; + } else { + _newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))]; + }; + }; - // If no unit is to close to this position, we will play the sound. - if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { - playSound3D [_ambianceSounds select (round(random((count _ambianceSounds)-1))), ObjNull, false, _newPos, _volume, 1, 1000]; - _args set [8, time]; - }; - }; - }; - }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, time] ] call cba_fnc_addPerFrameHandler; + // If no unit is to close to this position, we will play the sound. + if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { + playSound3D [_ambianceSounds select (round(random((count _ambianceSounds)-1))), ObjNull, false, _newPos, _volume, 1, 1000]; + _args set [8, time]; + }; + }; + }; + }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, time] ] call cba_fnc_addPerFrameHandler; }; true; diff --git a/addons/overheating/script_component.hpp b/addons/overheating/script_component.hpp index d7ce7d2d3b..46a31e6ea3 100644 --- a/addons/overheating/script_component.hpp +++ b/addons/overheating/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_OVERHEATING - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_OVERHEATING - #define DEBUG_SETTINGS DEBUG_SETTINGS_OVERHEATING + #define DEBUG_SETTINGS DEBUG_SETTINGS_OVERHEATING #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/overpressure/script_component.hpp b/addons/overpressure/script_component.hpp index 8dac72cbbf..21f4cea704 100644 --- a/addons/overpressure/script_component.hpp +++ b/addons/overpressure/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_OVERPRESSURE - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_ENABLED_OVERPRESSURE - #define DEBUG_SETTINGS DEBUG_ENABLED_OVERPRESSURE + #define DEBUG_SETTINGS DEBUG_ENABLED_OVERPRESSURE #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 2d8545a607..04732d0506 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -20,9 +20,9 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; scope = 2; displayName = "$STR_ACE_Parachute_NonSteerableParachute"; - //picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo - //model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo - // backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40 + //picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo + //model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo + // backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40 ParachuteClass = "NonSteerable_Parachute_F"; maximumLoad = 0; mass = 100; diff --git a/addons/parachute/RscTitles.hpp b/addons/parachute/RscTitles.hpp index d51bcad128..c6f41a7362 100644 --- a/addons/parachute/RscTitles.hpp +++ b/addons/parachute/RscTitles.hpp @@ -1,51 +1,51 @@ class RscText; class RscPicture; class RscTitles { - class ACE_Altimeter { - idd = 9935; - enableSimulation = 1; - movingEnable = 0; - fadeIn=0; - fadeOut=1; - duration = 10e10; - onLoad = "uiNamespace setVariable ['ACE_Altimeter', _this select 0];"; - class controls { - class AltimeterImage: RscPicture { - idc = 1200; - text = PATHTOF(UI\watch_altimeter.paa); - x = 0.118437 * safezoneW + safezoneX; - y = 0.621 * safezoneH + safezoneY; - w = 0.20625 * safezoneW; - h = 0.341 * safezoneH; - }; - class HeightText: RscText { - idc = 1100; - text = "----"; - x = 0.200937 * safezoneW + safezoneX; - y = 0.764 * safezoneH + safezoneY; - w = 0.04125 * safezoneW; - h = 0.033 * safezoneH; - colorBackground[] = {0,0,0,0}; - colorText[] = {0,0,0,1}; - }; - class DecendRate: RscText { - idc = 1000; - text = "--"; - x = 0.21125 * safezoneW + safezoneX; - y = 0.742 * safezoneH + safezoneY; - w = 0.020625 * safezoneW; - h = 0.022 * safezoneH; - colorText[] = {0,0,0,1}; - }; - class TimeText: RscText { - idc = 1001; - text = "00:00"; - x = 0.206094 * safezoneW + safezoneX; - y = 0.819 * safezoneH + safezoneY; - w = 0.0309375 * safezoneW; - h = 0.022 * safezoneH; - colorText[] = {0,0,0,1}; - }; - }; - }; + class ACE_Altimeter { + idd = 9935; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0; + fadeOut=1; + duration = 10e10; + onLoad = "uiNamespace setVariable ['ACE_Altimeter', _this select 0];"; + class controls { + class AltimeterImage: RscPicture { + idc = 1200; + text = PATHTOF(UI\watch_altimeter.paa); + x = 0.118437 * safezoneW + safezoneX; + y = 0.621 * safezoneH + safezoneY; + w = 0.20625 * safezoneW; + h = 0.341 * safezoneH; + }; + class HeightText: RscText { + idc = 1100; + text = "----"; + x = 0.200937 * safezoneW + safezoneX; + y = 0.764 * safezoneH + safezoneY; + w = 0.04125 * safezoneW; + h = 0.033 * safezoneH; + colorBackground[] = {0,0,0,0}; + colorText[] = {0,0,0,1}; + }; + class DecendRate: RscText { + idc = 1000; + text = "--"; + x = 0.21125 * safezoneW + safezoneX; + y = 0.742 * safezoneH + safezoneY; + w = 0.020625 * safezoneW; + h = 0.022 * safezoneH; + colorText[] = {0,0,0,1}; + }; + class TimeText: RscText { + idc = 1001; + text = "00:00"; + x = 0.206094 * safezoneW + safezoneX; + y = 0.819 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.022 * safezoneH; + colorText[] = {0,0,0,1}; + }; + }; + }; }; diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 134ab8a3ea..126a3b0720 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -19,8 +19,8 @@ _unit = _this select 0; GVAR(PFH) = false; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); [{ - if (time >= ((_this select 0) select 0) + 1) then { - ((_this select 0) select 1) playActionNow "Crouch"; - [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); - }; + if (time >= ((_this select 0) select 0) + 1) then { + ((_this select 0) select 1) playActionNow "Crouch"; + [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); + }; }, 1, [time,_unit]] call CALLSTACK(cba_fnc_addPerFrameHandler); diff --git a/addons/parachute/functions/fnc_onEachFrame.sqf b/addons/parachute/functions/fnc_onEachFrame.sqf index be9f0e000c..dbfab16452 100644 --- a/addons/parachute/functions/fnc_onEachFrame.sqf +++ b/addons/parachute/functions/fnc_onEachFrame.sqf @@ -25,9 +25,9 @@ private ["_pos"]; _pos = getPosASL (vehicle _player); if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then { - [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(PFH) = false; + [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(PFH) = false; // I believe this will not work for Zeus units. - deleteVehicle (vehicle _player); - [_player] call FUNC(doLanding); + deleteVehicle (vehicle _player); + [_player] call FUNC(doLanding); }; diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 8e3c3d83e3..a8200fb2ca 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -21,26 +21,26 @@ if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {} GVAR(AltimeterActive) = true; [{ - if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);}; - disableSerialization; - EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime); - if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);call FUNC(hideAltimeter);}; + if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);}; + disableSerialization; + EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime); + if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);call FUNC(hideAltimeter);}; - private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime"]; - _HeightText = _display displayCtrl 1100; - _DecendRate = _display displayCtrl 1000; - _TimeText = _display displayCtrl 1001; - _hour = floor daytime; - _minute = floor ((daytime - _hour) * 60); + private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime"]; + _HeightText = _display displayCtrl 1100; + _DecendRate = _display displayCtrl 1000; + _TimeText = _display displayCtrl 1001; + _hour = floor daytime; + _minute = floor ((daytime - _hour) * 60); - _height = (getPosASL _unit) select 2; - _curTime = time; - _descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime)); + _height = (getPosASL _unit) select 2; + _curTime = time; + _descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime)); - _TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]); - _HeightText ctrlSetText (format ["%1", floor(_height)]); - _DecendRate ctrlSetText (format ["%1", _descentRate max 0]); + _TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]); + _HeightText ctrlSetText (format ["%1", floor(_height)]); + _DecendRate ctrlSetText (format ["%1", _descentRate max 0]); - (_this select 0) set [2, _height]; - (_this select 0) set [3, _curTime]; + (_this select 0) set [2, _height]; + (_this select 0) set [3, _curTime]; }, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), time]] call CALLSTACK(cba_fnc_addPerFrameHandler); diff --git a/addons/resting/script_component.hpp b/addons/resting/script_component.hpp index f6d28bc482..8446cb9415 100644 --- a/addons/resting/script_component.hpp +++ b/addons/resting/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_RESTING - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_RESTING - #define DEBUG_SETTINGS DEBUG_SETTINGS_RESTING + #define DEBUG_SETTINGS DEBUG_SETTINGS_RESTING #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/safemode/script_component.hpp b/addons/safemode/script_component.hpp index f76396afdf..c68b265489 100644 --- a/addons/safemode/script_component.hpp +++ b/addons/safemode/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_SAFEMODE - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_SAFEMODE - #define DEBUG_SETTINGS DEBUG_SETTINGS_SAFEMODE + #define DEBUG_SETTINGS DEBUG_SETTINGS_SAFEMODE #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/smallarms/script_component.hpp b/addons/smallarms/script_component.hpp index d9c70ca5e6..589e59433f 100644 --- a/addons/smallarms/script_component.hpp +++ b/addons/smallarms/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_SMALLARMS - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_SMALLARMS - #define DEBUG_SETTINGS DEBUG_SETTINGS_SMALLARMS + #define DEBUG_SETTINGS DEBUG_SETTINGS_SMALLARMS #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/testmissions/script_component.hpp b/addons/testmissions/script_component.hpp index c6c629ff91..da17bfb7e2 100644 --- a/addons/testmissions/script_component.hpp +++ b/addons/testmissions/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_TESTMISSIONS - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_ENABLED_TESTMISSIONS - #define DEBUG_SETTINGS DEBUG_ENABLED_TESTMISSIONS + #define DEBUG_SETTINGS DEBUG_ENABLED_TESTMISSIONS #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/weather/XEH_preClientInit.sqf b/addons/weather/XEH_preClientInit.sqf index 81b6f09fe6..b979521cdd 100644 --- a/addons/weather/XEH_preClientInit.sqf +++ b/addons/weather/XEH_preClientInit.sqf @@ -2,16 +2,16 @@ FUNC(KEEPTIME) = { - if((count GVAR(WINDSPEED)) > 0) then { - private ["_wind", "_p", "_str"]; - _wind = ACE_wind; + if((count GVAR(WINDSPEED)) > 0) then { + private ["_wind", "_p", "_str"]; + _wind = ACE_wind; - _p = _wind call CBA_fnc_vect2polar; - _str = format["Wind: %1 at %2m/s (%3MPH)\n%4", floor(_p select 1), floor(_p select 0), floor((_p select 0)*2.23693629), GVAR(WINDSPEED)]; - TRACE_2("Wind",_wind,_str); - }; + _p = _wind call CBA_fnc_vect2polar; + _str = format["Wind: %1 at %2m/s (%3MPH)\n%4", floor(_p select 1), floor(_p select 0), floor((_p select 0)*2.23693629), GVAR(WINDSPEED)]; + TRACE_2("Wind",_wind,_str); + }; }; #ifdef DEBUG_MODE_FULL - [FUNC(KEEPTIME), 0.0, []] call CBA_fnc_addPerFrameHandler; + [FUNC(KEEPTIME), 0.0, []] call CBA_fnc_addPerFrameHandler; #endif diff --git a/addons/weather/script_component.hpp b/addons/weather/script_component.hpp index abfe607257..a21d8245fd 100644 --- a/addons/weather/script_component.hpp +++ b/addons/weather/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" //#define DEBUG_ENABLED_WEATHER #ifdef DEBUG_ENABLED_WEATHER - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_WEATHER - #define DEBUG_SETTINGS DEBUG_SETTINGS_WEATHER + #define DEBUG_SETTINGS DEBUG_SETTINGS_WEATHER #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/wep_javelin/CfgSounds.hpp b/addons/wep_javelin/CfgSounds.hpp index 0af40b9485..a5002409ff 100644 --- a/addons/wep_javelin/CfgSounds.hpp +++ b/addons/wep_javelin/CfgSounds.hpp @@ -1,13 +1,13 @@ class CfgSounds { class ACE_Javelin_Locking { - name = "ACE_Javelin_Locking"; - sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0}; - titles[] = {}; + name = "ACE_Javelin_Locking"; + sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0}; + titles[] = {}; }; class ACE_Javelin_Locked { - name = "ACE_Javelin_Locked"; - sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0}; - titles[] = {}; + name = "ACE_Javelin_Locked"; + sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0}; + titles[] = {}; }; }; diff --git a/addons/wep_javelin/RscInGameUI.hpp b/addons/wep_javelin/RscInGameUI.hpp index e94e4c58fd..811548a9d2 100644 --- a/addons/wep_javelin/RscInGameUI.hpp +++ b/addons/wep_javelin/RscInGameUI.hpp @@ -17,34 +17,34 @@ class RscInGameUI { onUnload = "uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];"; class CA_Distance: RscOpticsValue { - idc = 151; - sizeEx = "0"; - colorText[] = {0,0,0,0}; - x = 0; - y = 0; - w = 0; - h = 0; - }; + idc = 151; + sizeEx = "0"; + colorText[] = {0,0,0,0}; + x = 0; + y = 0; + w = 0; + h = 0; + }; class ACE_javelin_elements_group: RscControlsGroup - { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; - idc = 170; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { + { + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW"; + h = "SafezoneH"; + idc = 170; + class VScrollbar { + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + color[] = {1,1,1,0}; + width = 0.001; + }; + class HScrollbar { + color[] = {1,1,1,0}; + height = 0.001; + }; + class Controls { class JavelinLocking : RscMapControl { onDraw = QUOTE(_this call FUNC(onOpticDraw)); idc = -1; @@ -52,385 +52,385 @@ class RscInGameUI { h = 0; }; - class ACE_javelin_Day_mode_off: RscPicture { - idc = 1001; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneY+SafezoneH*0.031 - SafezoneY"; - w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.1045752"; - colorText[] = {0.2941,0.2941,0.2941,1}; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa"; - }; - class ACE_javelin_Day_mode: ACE_javelin_Day_mode_off { - idc = 160; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class ACE_javelin_WFOV_mode_off: ACE_javelin_Day_mode_off { - idc = 1004; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\wfov_co.paa"; - }; - class ACE_javelin_WFOV_mode_group: RscControlsGroup { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; - idc = 163; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { - class ACE_javelin_WFOV_mode: ACE_javelin_WFOV_mode_off { - idc = -1; - y = "0.031*SafezoneH - SafezoneY"; - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class StadiaL: RscLine { - x = "0.4899*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.049*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class StadiaR: RscLine { - x = "0.5109*SafezoneW- SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.049*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class BracketL: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX"; - y = "0.4677*SafezoneH - SafezoneY"; - w = 0; - h = "0.0646*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class BracketR: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX"; - y = "0.4677*SafezoneH - SafezoneY"; - w = 0; - h = "0.0646*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class BracketT: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; - y = "0.3535*SafezoneH - SafezoneY"; - w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = 0; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class BracketB: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; - y = "0.6465*SafezoneH - SafezoneY"; - w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = 0; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - }; - }; - class ACE_javelin_NFOV_mode_off: ACE_javelin_Day_mode_off { - idc = 1003; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\nfov_co.paa"; - }; - class ACE_javelin_NFOV_mode_group: RscControlsGroup { - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW-SafezoneX"; - h = "SafezoneH-SafezoneY"; - idc = 162; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { - class ACE_javelin_NFOV_mode: ACE_javelin_NFOV_mode_off { - idc = 699003; - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; - y = "0.031*SafezoneH - SafezoneY"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class StadiaL: RscLine { - x = "0.4788*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.049*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class StadiaR: RscLine { - x = "0.5212*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.049*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class LineHL: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneH*0.5 - SafezoneY"; - w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.0"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class LineHR: RscLine { - x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX"; - y = "SafezoneH*0.5 - SafezoneY"; - w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; - h = "SafezoneH*0.0"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class LineVT: RscLine { - x = "0.5*SafezoneW - SafezoneX"; - y = "0.171*SafezoneH - SafezoneY"; - w = 0; - h = "0.1825*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class LineVB: RscLine { - x = "0.5*SafezoneW - SafezoneX"; - y = "0.6465*SafezoneH - SafezoneY"; - w = 0; - h = "0.1895*SafezoneH"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - }; - }; + class ACE_javelin_Day_mode_off: RscPicture { + idc = 1001; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX"; + y = "SafezoneY+SafezoneH*0.031 - SafezoneY"; + w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = "SafezoneH*0.1045752"; + colorText[] = {0.2941,0.2941,0.2941,1}; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa"; + }; + class ACE_javelin_Day_mode: ACE_javelin_Day_mode_off { + idc = 160; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class ACE_javelin_WFOV_mode_off: ACE_javelin_Day_mode_off { + idc = 1004; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\wfov_co.paa"; + }; + class ACE_javelin_WFOV_mode_group: RscControlsGroup { + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW"; + h = "SafezoneH"; + idc = 163; + class VScrollbar { + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + color[] = {1,1,1,0}; + width = 0.001; + }; + class HScrollbar { + color[] = {1,1,1,0}; + height = 0.001; + }; + class Controls { + class ACE_javelin_WFOV_mode: ACE_javelin_WFOV_mode_off { + idc = -1; + y = "0.031*SafezoneH - SafezoneY"; + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class StadiaL: RscLine { + x = "0.4899*SafezoneW - SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.049*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class StadiaR: RscLine { + x = "0.5109*SafezoneW- SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.049*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class BracketL: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX"; + y = "0.4677*SafezoneH - SafezoneY"; + w = 0; + h = "0.0646*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class BracketR: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX"; + y = "0.4677*SafezoneH - SafezoneY"; + w = 0; + h = "0.0646*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class BracketT: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; + y = "0.3535*SafezoneH - SafezoneY"; + w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = 0; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class BracketB: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; + y = "0.6465*SafezoneH - SafezoneY"; + w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = 0; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + }; + }; + class ACE_javelin_NFOV_mode_off: ACE_javelin_Day_mode_off { + idc = 1003; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\nfov_co.paa"; + }; + class ACE_javelin_NFOV_mode_group: RscControlsGroup { + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW-SafezoneX"; + h = "SafezoneH-SafezoneY"; + idc = 162; + class VScrollbar { + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + color[] = {1,1,1,0}; + width = 0.001; + }; + class HScrollbar { + color[] = {1,1,1,0}; + height = 0.001; + }; + class Controls { + class ACE_javelin_NFOV_mode: ACE_javelin_NFOV_mode_off { + idc = 699003; + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; + y = "0.031*SafezoneH - SafezoneY"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class StadiaL: RscLine { + x = "0.4788*SafezoneW - SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.049*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class StadiaR: RscLine { + x = "0.5212*SafezoneW - SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.049*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class LineHL: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX"; + y = "SafezoneH*0.5 - SafezoneY"; + w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = "SafezoneH*0.0"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class LineHR: RscLine { + x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX"; + y = "SafezoneH*0.5 - SafezoneY"; + w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; + h = "SafezoneH*0.0"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class LineVT: RscLine { + x = "0.5*SafezoneW - SafezoneX"; + y = "0.171*SafezoneH - SafezoneY"; + w = 0; + h = "0.1825*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class LineVB: RscLine { + x = "0.5*SafezoneW - SafezoneX"; + y = "0.6465*SafezoneH - SafezoneY"; + w = 0; + h = "0.1895*SafezoneH"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + }; + }; /* - class TargetingConstrains: RscControlsGroup { - idc = 699100; - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW-SafezoneX"; - h = "SafezoneH-SafezoneY"; - class VScrollbar { - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - color[] = {1,1,1,0}; - width = 0.001; - }; - class HScrollbar { - color[] = {1,1,1,0}; - height = 0.001; - }; - class Controls { - class Top: RscPicture { - idc = 699101; - text = "#(argb,8,8,3)color(1,1,1,1)"; - colorText[] = {0.2941,0.2941,0.2941,1}; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH-SafezoneY"; - w = "(3/4)*SafezoneH"; - h = "0.21*SafezoneH"; - }; - class Bottom: Top { - idc = 699102; - y = "0.64*SafezoneH-SafezoneY"; - }; - class Left: Top { - idc = 699103; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.36*SafezoneH-SafezoneY"; - w = "0.31*(3/4)*SafezoneH"; - h = "0.28*SafezoneH"; - }; - class Right: Left { - idc = 699104; - x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX"; - }; - class OpticsBorders: RscPicture { - idc = 699105; - text = PATHTOF(data\javelin_ui_border_ca.paa); - colorText[] = {0,0,0,1}; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH-SafezoneY"; - w = "(3/4)*SafezoneH"; - h = "0.7*SafezoneH"; - }; - }; - }; + class TargetingConstrains: RscControlsGroup { + idc = 699100; + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW-SafezoneX"; + h = "SafezoneH-SafezoneY"; + class VScrollbar { + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + color[] = {1,1,1,0}; + width = 0.001; + }; + class HScrollbar { + color[] = {1,1,1,0}; + height = 0.001; + }; + class Controls { + class Top: RscPicture { + idc = 699101; + text = "#(argb,8,8,3)color(1,1,1,1)"; + colorText[] = {0.2941,0.2941,0.2941,1}; + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.15*SafezoneH-SafezoneY"; + w = "(3/4)*SafezoneH"; + h = "0.21*SafezoneH"; + }; + class Bottom: Top { + idc = 699102; + y = "0.64*SafezoneH-SafezoneY"; + }; + class Left: Top { + idc = 699103; + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.36*SafezoneH-SafezoneY"; + w = "0.31*(3/4)*SafezoneH"; + h = "0.28*SafezoneH"; + }; + class Right: Left { + idc = 699104; + x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX"; + }; + class OpticsBorders: RscPicture { + idc = 699105; + text = PATHTOF(data\javelin_ui_border_ca.paa); + colorText[] = {0,0,0,1}; + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.15*SafezoneH-SafezoneY"; + w = "(3/4)*SafezoneH"; + h = "0.7*SafezoneH"; + }; + }; + }; - class TargetingGate: TargetingConstrains { - idc = 699200; - class Controls { - class TargetingGateTL: TargetingConstrains { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.15*SafezoneH - SafezoneY"; - idc = 699201; - class Controls { - class LineH: RscLine { - idc = 699210; - x = "0"; - y = "0"; - w = "0.025*(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: LineH { - idc = 699211; - w = "0"; - h = "0.025*SafezoneH"; - }; - }; - }; - class TargetingGateTR: TargetingGateTL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; - y = "0.15*SafezoneH - SafezoneY"; - idc = 699202; - class Controls { - class LineH: RscLine { - idc = 699220; - x = "0"; - y = "0"; - w = "0.025*(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: LineH { - idc = 699221; - x = "0.025*(3/4)*SafezoneH"; - w = "0"; - h = "0.025*SafezoneH"; - }; - }; - }; - class TargetingGateBL: TargetingGateTL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.825*SafezoneH - SafezoneY"; - idc = 699203; - class Controls { - class LineH: RscLine { - x = "0"; - y = "0.025*SafezoneH"; - w = "0.025*(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: LineH { - y = "0"; - w = "0"; - h = "0.025*SafezoneH"; - }; - }; - }; - class TargetingGateBR: TargetingGateBL { - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; - y = "0.825*SafezoneH - SafezoneY"; - idc = 699204; - class Controls { - class LineH: RscLine { - x = "0"; - y = "0.025*SafezoneH"; - w = "0.025*(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: LineH { - x = "0.025*(3/4)*SafezoneH"; - y = "0"; - w = "0"; - h = "0.025*SafezoneH"; - }; - }; - }; - }; - }; + class TargetingGate: TargetingConstrains { + idc = 699200; + class Controls { + class TargetingGateTL: TargetingConstrains { + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.15*SafezoneH - SafezoneY"; + idc = 699201; + class Controls { + class LineH: RscLine { + idc = 699210; + x = "0"; + y = "0"; + w = "0.025*(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: LineH { + idc = 699211; + w = "0"; + h = "0.025*SafezoneH"; + }; + }; + }; + class TargetingGateTR: TargetingGateTL { + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; + y = "0.15*SafezoneH - SafezoneY"; + idc = 699202; + class Controls { + class LineH: RscLine { + idc = 699220; + x = "0"; + y = "0"; + w = "0.025*(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: LineH { + idc = 699221; + x = "0.025*(3/4)*SafezoneH"; + w = "0"; + h = "0.025*SafezoneH"; + }; + }; + }; + class TargetingGateBL: TargetingGateTL { + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.825*SafezoneH - SafezoneY"; + idc = 699203; + class Controls { + class LineH: RscLine { + x = "0"; + y = "0.025*SafezoneH"; + w = "0.025*(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: LineH { + y = "0"; + w = "0"; + h = "0.025*SafezoneH"; + }; + }; + }; + class TargetingGateBR: TargetingGateBL { + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; + y = "0.825*SafezoneH - SafezoneY"; + idc = 699204; + class Controls { + class LineH: RscLine { + x = "0"; + y = "0.025*SafezoneH"; + w = "0.025*(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: LineH { + x = "0.025*(3/4)*SafezoneH"; + y = "0"; + w = "0"; + h = "0.025*SafezoneH"; + }; + }; + }; + }; + }; - class TargetingLines: TargetingConstrains { - idc = 699300; - class Controls { - class LineH: RscLine { - idc = 699301; - x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; - y = "0.5*SafezoneH - SafezoneY"; - w = "(3/4)*SafezoneH"; - h = "0"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - class LineV: RscLine { - idc = 699302; - x = "0.5*SafezoneW - SafezoneX"; - y = "0.15*SafezoneH - SafezoneY"; - w = "0"; - h = "0.7*SafezoneH"; - colorText[] = {0.8745,0.8745,0.8745,1}; - }; - }; - }; + class TargetingLines: TargetingConstrains { + idc = 699300; + class Controls { + class LineH: RscLine { + idc = 699301; + x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; + y = "0.5*SafezoneH - SafezoneY"; + w = "(3/4)*SafezoneH"; + h = "0"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + class LineV: RscLine { + idc = 699302; + x = "0.5*SafezoneW - SafezoneX"; + y = "0.15*SafezoneH - SafezoneY"; + w = "0"; + h = "0.7*SafezoneH"; + colorText[] = {0.8745,0.8745,0.8745,1}; + }; + }; + }; */ - class ACE_javelin_SEEK_off: ACE_javelin_Day_mode_off { - idc = 699000; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.863/4)*3*SafezoneH - SafezoneX"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\seek_co.paa"; - }; - class ACE_javelin_SEEK: ACE_javelin_SEEK_off { - idc = 166; - colorText[] = {0.2941,0.8745,0.2157,0}; - }; - class ACE_javelin_Missle_off: ACE_javelin_Day_mode_off { - idc = 1032; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; - colorText[] = {0.2941,0.2941,0.2941,1}; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa"; - }; - class ACE_javelin_Missle: ACE_javelin_Missle_off { - idc = 167; - colorText[] = {0.9255,0.5216,0.1216,0}; - }; - class ACE_javelin_CLU_off: ACE_javelin_Missle_off { - idc = 1027; - y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa"; - }; - class ACE_javelin_HangFire_off: ACE_javelin_Missle_off { - idc = 1028; - y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa"; - }; - class ACE_javelin_TOP_off: ACE_javelin_Day_mode_off { - idc = 699001; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa"; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - class ACE_javelin_DIR: ACE_javelin_Day_mode { - idc = 699002; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa"; - colorText[] = {0.2941,0.2941,0.2941,1}; - }; - class ACE_javelin_FLTR_mode_off: ACE_javelin_Day_mode_off { - idc = 1002; - x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; - y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa"; - }; - class ACE_javelin_FLTR_mode: ACE_javelin_FLTR_mode_off { - idc = 161; - colorText[] = {0.2941,0.8745,0.2157,1}; - }; - }; - }; + class ACE_javelin_SEEK_off: ACE_javelin_Day_mode_off { + idc = 699000; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.863/4)*3*SafezoneH - SafezoneX"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\seek_co.paa"; + }; + class ACE_javelin_SEEK: ACE_javelin_SEEK_off { + idc = 166; + colorText[] = {0.2941,0.8745,0.2157,0}; + }; + class ACE_javelin_Missle_off: ACE_javelin_Day_mode_off { + idc = 1032; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX"; + y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; + colorText[] = {0.2941,0.2941,0.2941,1}; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa"; + }; + class ACE_javelin_Missle: ACE_javelin_Missle_off { + idc = 167; + colorText[] = {0.9255,0.5216,0.1216,0}; + }; + class ACE_javelin_CLU_off: ACE_javelin_Missle_off { + idc = 1027; + y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa"; + }; + class ACE_javelin_HangFire_off: ACE_javelin_Missle_off { + idc = 1028; + y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa"; + }; + class ACE_javelin_TOP_off: ACE_javelin_Day_mode_off { + idc = 699001; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; + y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa"; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + class ACE_javelin_DIR: ACE_javelin_Day_mode { + idc = 699002; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; + y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa"; + colorText[] = {0.2941,0.2941,0.2941,1}; + }; + class ACE_javelin_FLTR_mode_off: ACE_javelin_Day_mode_off { + idc = 1002; + x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; + y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa"; + }; + class ACE_javelin_FLTR_mode: ACE_javelin_FLTR_mode_off { + idc = 161; + colorText[] = {0.2941,0.8745,0.2157,1}; + }; + }; + }; }; }; diff --git a/addons/wep_javelin/config.cpp b/addons/wep_javelin/config.cpp index fa062944fc..3cc607f0bd 100644 --- a/addons/wep_javelin/config.cpp +++ b/addons/wep_javelin/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "ace_main", "ace_common", "ace_laser" }; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "ace_main", "ace_common", "ace_laser" }; + VERSION_CONFIG; + }; }; #include "CfgEventhandlers.hpp" diff --git a/addons/wep_javelin/functions/fnc_fired.sqf b/addons/wep_javelin/functions/fnc_fired.sqf index 4e94989677..139f8f4b7e 100644 --- a/addons/wep_javelin/functions/fnc_fired.sqf +++ b/addons/wep_javelin/functions/fnc_fired.sqf @@ -5,70 +5,70 @@ TRACE_1("Launch", _this); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); FUNC(guidance_Javelin_LOBL_DIR_PFH) = { - TRACE_1("enter", _this); - private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile", + TRACE_1("enter", _this); + private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile", "_launchPos", "_targetStartPos", "_defPitch", "_defYaw"]; - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _shooter = _args select 0; - _missile = _args select 6; - - if((count _args) > 7) then { - _saveArgs = _args select 7; - _target = _saveArgs select 0; - _targetStartPos = _saveArgs select 1; + _args = _this select 0; + //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + _shooter = _args select 0; + _missile = _args select 6; + + if((count _args) > 7) then { + _saveArgs = _args select 7; + _target = _saveArgs select 0; + _targetStartPos = _saveArgs select 1; _launchPos = _saveArgs select 2; _wentTerminal = _saveArgs select 3; - } else { + } else { _wentTerminal = false; _launchPos = getPosASL _shooter; _target = ACE_player getVariable[QGVAR(currentTarget), objNull]; _targetStartPos = ACE_player getVariable[QGVAR(currentTargetPos), [0,0,0]]; - }; - + }; + if(!alive _missile || isNull _missile || isNull _target) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; _targetPos = getPosASL _target; - _curVelocity = velocity _missile; - + _curVelocity = velocity _missile; + TRACE_4("", _target, _targetPos, _launchPos, _targetStartPos); - _addHeight = [0,0,0]; - if(!isNil "_target") then { - - _yVec = vectorDir _missile; - _zVec = vectorUp _missile; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); - - _missilePos = getPosASL _missile; - // player sideChat "G!"; + _addHeight = [0,0,0]; + if(!isNil "_target") then { + + _yVec = vectorDir _missile; + _zVec = vectorUp _missile; + _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); + + _missilePos = getPosASL _missile; + // player sideChat "G!"; - TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); - if((count _targetPos) > 0) then { - _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; + TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); + if((count _targetPos) > 0) then { + _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; - if( (_missilePos select 2) < (_targetPos select 2) + 60 && !_wentTerminal) then { - _addHeight = [0,0,(_targetPos select 2) + 120]; - + if( (_missilePos select 2) < (_targetPos select 2) + 60 && !_wentTerminal) then { + _addHeight = [0,0,(_targetPos select 2) + 120]; + _defPitch = 0.15; _defYaw = 0.035; TRACE_1("Climb phase", _addHeight); - } else { - _wentTerminal = true; - _this set[2, _wentTerminal]; - + } else { + _wentTerminal = true; + _this set[2, _wentTerminal]; + _defPitch = 0.15; _defYaw = 0.035; TRACE_1("TERMINAL", ""); - }; - _targetPos = _targetPos vectorAdd _addHeight; + }; + _targetPos = _targetPos vectorAdd _addHeight; - _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); + _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); _yaw = 0.0; _pitch = 0.0; @@ -88,37 +88,37 @@ FUNC(guidance_Javelin_LOBL_DIR_PFH) = { _pitch = _defPitch; }; }; - - TRACE_3("", _targetVectorSeeker, _pitch, _yaw); - - #ifdef DEBUG_MODE_FULL - drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; - - _light = "#lightpoint" createVehicleLocal (getPos _missile); - _light setLightBrightness 1.0; - _light setLightAmbient [1.0, 0.0, 0.0]; - _light setLightColor [1.0, 0.0, 0.0]; - - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; - drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]]; + + TRACE_3("", _targetVectorSeeker, _pitch, _yaw); + + #ifdef DEBUG_MODE_FULL + drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; + + _light = "#lightpoint" createVehicleLocal (getPos _missile); + _light setLightBrightness 1.0; + _light setLightAmbient [1.0, 0.0, 0.0]; + _light setLightColor [1.0, 0.0, 0.0]; + + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; + drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]]; - MARKERCOUNT = MARKERCOUNT + 1; - #endif - - if(accTime > 0) then { - TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); - _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - - _vectorTo = _missilePos vectorFromTo _outVector; - TRACE_3("", _missile, _outVector, _vectorTo); - _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; - }; - - #ifdef DEBUG_MODE_FULL - hintSilent format["d: %1", _distanceToTarget]; - #endif - }; - }; + MARKERCOUNT = MARKERCOUNT + 1; + #endif + + if(accTime > 0) then { + TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); + _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); + + _vectorTo = _missilePos vectorFromTo _outVector; + TRACE_3("", _missile, _outVector, _vectorTo); + _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; + }; + + #ifdef DEBUG_MODE_FULL + hintSilent format["d: %1", _distanceToTarget]; + #endif + }; + }; _saveArgs = [_target,_targetStartPos, _launchPos, _wentTerminal]; _args set[7, _saveArgs ]; @@ -126,70 +126,70 @@ FUNC(guidance_Javelin_LOBL_DIR_PFH) = { }; FUNC(guidance_Javelin_LOBL_TOP_PFH) = { - TRACE_1("enter", _this); - private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile", + TRACE_1("enter", _this); + private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile", "_launchPos", "_targetStartPos", "_defPitch", "_defYaw"]; - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _shooter = _args select 0; - _missile = _args select 6; - - if((count _args) > 7) then { - _saveArgs = _args select 7; - _target = _saveArgs select 0; - _targetStartPos = _saveArgs select 1; + _args = _this select 0; + //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + _shooter = _args select 0; + _missile = _args select 6; + + if((count _args) > 7) then { + _saveArgs = _args select 7; + _target = _saveArgs select 0; + _targetStartPos = _saveArgs select 1; _launchPos = _saveArgs select 2; _wentTerminal = _saveArgs select 3; - } else { + } else { _wentTerminal = false; _launchPos = getPosASL _shooter; _target = ACE_player getVariable[QGVAR(currentTarget), objNull]; _targetStartPos = ACE_player getVariable[QGVAR(currentTargetPos), [0,0,0]]; - }; - + }; + if(!alive _missile || isNull _missile || isNull _target) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; _targetPos = getPosASL _target; - _curVelocity = velocity _missile; - + _curVelocity = velocity _missile; + TRACE_4("", _target, _targetPos, _launchPos, _targetStartPos); - _addHeight = [0,0,0]; - if(!isNil "_target") then { - - _yVec = vectorDir _missile; - _zVec = vectorUp _missile; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); - - _missilePos = getPosASL _missile; - // player sideChat "G!"; + _addHeight = [0,0,0]; + if(!isNil "_target") then { + + _yVec = vectorDir _missile; + _zVec = vectorUp _missile; + _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); + + _missilePos = getPosASL _missile; + // player sideChat "G!"; - TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); - if((count _targetPos) > 0) then { - _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; + TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); + if((count _targetPos) > 0) then { + _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; - if( (_missilePos select 2) < (_targetPos select 2) + 200 && !_wentTerminal) then { - _addHeight = [0,0, ( (_distanceToTarget * 2) + 400)]; - + if( (_missilePos select 2) < (_targetPos select 2) + 200 && !_wentTerminal) then { + _addHeight = [0,0, ( (_distanceToTarget * 2) + 400)]; + _defPitch = 0.25; _defYaw = 0.035; TRACE_1("Climb phase", _addHeight); - } else { - _wentTerminal = true; - _this set[2, _wentTerminal]; - + } else { + _wentTerminal = true; + _this set[2, _wentTerminal]; + _defPitch = 0.25; _defYaw = 0.25; TRACE_1("TERMINAL", ""); - }; - _targetPos = _targetPos vectorAdd _addHeight; + }; + _targetPos = _targetPos vectorAdd _addHeight; - _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); + _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); _yaw = 0.0; _pitch = 0.0; @@ -215,37 +215,37 @@ FUNC(guidance_Javelin_LOBL_TOP_PFH) = { _pitch = _defPitch; }; }; - - TRACE_3("", _targetVectorSeeker, _pitch, _yaw); - - #ifdef DEBUG_MODE_FULL - drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; - - _light = "#lightpoint" createVehicleLocal (getPos _missile); - _light setLightBrightness 1.0; - _light setLightAmbient [1.0, 0.0, 0.0]; - _light setLightColor [1.0, 0.0, 0.0]; - - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; - drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]]; + + TRACE_3("", _targetVectorSeeker, _pitch, _yaw); + + #ifdef DEBUG_MODE_FULL + drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; + + _light = "#lightpoint" createVehicleLocal (getPos _missile); + _light setLightBrightness 1.0; + _light setLightAmbient [1.0, 0.0, 0.0]; + _light setLightColor [1.0, 0.0, 0.0]; + + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; + drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]]; - MARKERCOUNT = MARKERCOUNT + 1; - #endif - - if(accTime > 0) then { - TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); - _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - - _vectorTo = _missilePos vectorFromTo _outVector; - TRACE_3("", _missile, _outVector, _vectorTo); - _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; - }; - - #ifdef DEBUG_MODE_FULL - hintSilent format["d: %1", _distanceToTarget]; - #endif - }; - }; + MARKERCOUNT = MARKERCOUNT + 1; + #endif + + if(accTime > 0) then { + TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); + _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); + + _vectorTo = _missilePos vectorFromTo _outVector; + TRACE_3("", _missile, _outVector, _vectorTo); + _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; + }; + + #ifdef DEBUG_MODE_FULL + hintSilent format["d: %1", _distanceToTarget]; + #endif + }; + }; _saveArgs = [_target,_targetStartPos, _launchPos, _wentTerminal]; _args set[7, _saveArgs ]; @@ -253,24 +253,24 @@ FUNC(guidance_Javelin_LOBL_TOP_PFH) = { }; FUNC(guidance_Javelin_LOBL_TOP) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - GVAR(lastTime) = time; - [FUNC(guidance_Javelin_LOBL_TOP_PFH), 0, _this] call cba_fnc_addPerFrameHandler; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + + GVAR(lastTime) = time; + [FUNC(guidance_Javelin_LOBL_TOP_PFH), 0, _this] call cba_fnc_addPerFrameHandler; }; FUNC(guidance_Javelin_LOBL_DIR) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - GVAR(lastTime) = time; - [FUNC(guidance_Javelin_LOBL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + + GVAR(lastTime) = time; + [FUNC(guidance_Javelin_LOBL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler; }; if(!local _shooter) exitWith { false }; if(_ammo == "M_Titan_AT") then { - _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_JAV_FIREMODE_TOP]; - - switch (_fireMode) do { + _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_JAV_FIREMODE_TOP]; + + switch (_fireMode) do { // Default to FIREMODE_DIRECT_LOAL // FIREMODE_DIRECT_LOAL case ACE_JAV_FIREMODE_DIR: { diff --git a/addons/wep_javelin/functions/fnc_onOpticDraw.sqf b/addons/wep_javelin/functions/fnc_onOpticDraw.sqf index 1bc848cb04..6a74b3ed57 100644 --- a/addons/wep_javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/wep_javelin/functions/fnc_onOpticDraw.sqf @@ -2,10 +2,10 @@ #include "script_component.hpp" //TRACE_1("enter", _this); -#define __TRACKINTERVAL 0.1 // how frequent the check should be. -#define __LOCKONTIME 1.85 // Lock on won't occur sooner -#define __LOCKONTIMERANDOM 0.3 // Deviation in lock on time -#define __SENSORSQUARE 1 // Locking on sensor square side in angles +#define __TRACKINTERVAL 0.1 // how frequent the check should be. +#define __LOCKONTIME 1.85 // Lock on won't occur sooner +#define __LOCKONTIMERANDOM 0.3 // Deviation in lock on time +#define __SENSORSQUARE 1 // Locking on sensor square side in angles #define __ConstraintTop (((ctrlPosition __JavelinIGUITargetingConstrainTop) select 1) + ((ctrlPosition (__JavelinIGUITargetingConstrainTop)) select 3)) #define __ConstraintBottom ((ctrlPosition __JavelinIGUITargetingConstrainBottom) select 1) @@ -35,9 +35,9 @@ _soundTime = _args select 4; // Find a target within the optic range _newTarget = objNull; - + // Bail on fast movement -if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady. +if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady. ACE_player switchCamera "INTERNAL"; }; @@ -71,7 +71,7 @@ if (isNull _newTarget) then { ACE_player setVariable [QGVAR(currentTarget),nil, false]; // Disallow fire - //if (ACE_player ammo "Javelin" > 0 || {ACE_player ammo "ACE_Javelin_Direct" > 0}) then {ACE_player setWeaponReloadingTime //[player, "Javelin", 0.2];}; + //if (ACE_player ammo "Javelin" > 0 || {ACE_player ammo "ACE_Javelin_Direct" > 0}) then {ACE_player setWeaponReloadingTime //[player, "Javelin", 0.2];}; } else { if (_newTarget distance ACE_player < 2500 // && {(call CBA_fnc_getFoV) select 1 > 7} diff --git a/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf b/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf index afe2436e5d..8f85005d48 100644 --- a/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf @@ -18,9 +18,9 @@ _y = _offset select 1; _z = _offset select 2; _out = [ - ((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec select 2)*_z), - ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z), - ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) - ]; + ((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec select 2)*_z), + ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z), + ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) + ]; _out; \ No newline at end of file diff --git a/addons/winddeflection/functions/fnc_initalizeModule.sqf b/addons/winddeflection/functions/fnc_initalizeModule.sqf index 2833ecc54c..85d61e3bcc 100644 --- a/addons/winddeflection/functions/fnc_initalizeModule.sqf +++ b/addons/winddeflection/functions/fnc_initalizeModule.sqf @@ -15,5 +15,5 @@ if (!hasInterface) exitwith {}; // No need for this module on HC or dedicated se private ["_logic"]; _logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; if (!isNull _logic) then { - [_logic, QGVAR(EnableForAI), "EnableForAI" ] call EFUNC(common,readSettingFromModule); + [_logic, QGVAR(EnableForAI), "EnableForAI" ] call EFUNC(common,readSettingFromModule); }; \ No newline at end of file diff --git a/addons/winddeflection/functions/script_component.hpp b/addons/winddeflection/functions/script_component.hpp index 278930e4e7..eb67fc3887 100644 --- a/addons/winddeflection/functions/script_component.hpp +++ b/addons/winddeflection/functions/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_WINDDEFLECTION - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_WINDDEFLECTION - #define DEBUG_SETTINGS DEBUG_SETTINGS_WINDDEFLECTION + #define DEBUG_SETTINGS DEBUG_SETTINGS_WINDDEFLECTION #endif #include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/winddeflection/script_component.hpp b/addons/winddeflection/script_component.hpp index 047b7980e5..4af43227de 100644 --- a/addons/winddeflection/script_component.hpp +++ b/addons/winddeflection/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_WINDDEFLECTION - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_WINDDEFLECTION - #define DEBUG_SETTINGS DEBUG_SETTINGS_WINDDEFLECTION + #define DEBUG_SETTINGS DEBUG_SETTINGS_WINDDEFLECTION #endif #include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file