From 5bd1ee7ecd09525a204647c01136578e551bfb13 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Wed, 8 Apr 2015 07:21:34 +0200 Subject: [PATCH 01/55] Do not use a treshold for unassigned damage. --- addons/medical/functions/fnc_handleDamage_basic.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index 2986e1b2f7..6472c4af81 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -120,7 +120,7 @@ if (_selectionName == "") then { (_unit getHitPointDamage "HitRightArm") + (_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg"); - if (_damagesum < 0.06 and damage _unit > 0.06 and alive _unit) then { + if (damage _unit > _damagesum and alive _unit) then { _unit setHitPointDamage ["HitBody", damage _unit]; }; }, [_unit], 2, 0.1] call EFUNC(common,waitAndExecute); From 1dcff94ec73a046050cd8eddd2d45510f49be16c Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Wed, 8 Apr 2015 07:35:31 +0200 Subject: [PATCH 02/55] Remove hitpart from bandage action name Since the context of the interaction menu makes it clear what body part you mean anyways, this is unnecessary. --- addons/medical/ACE_Medical_Actions.hpp | 12 ++-- addons/medical/ACE_Medical_SelfActions.hpp | 14 ++-- addons/medical/stringtable.xml | 74 +--------------------- 3 files changed, 14 insertions(+), 86 deletions(-) diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp index 1fd6a99252..8a8c2adcca 100644 --- a/addons/medical/ACE_Medical_Actions.hpp +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -6,7 +6,7 @@ icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitHead"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); @@ -77,7 +77,7 @@ icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitBody"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); @@ -177,7 +177,7 @@ distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); @@ -333,7 +333,7 @@ distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); @@ -486,7 +486,7 @@ distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); @@ -627,7 +627,7 @@ distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); diff --git a/addons/medical/ACE_Medical_SelfActions.hpp b/addons/medical/ACE_Medical_SelfActions.hpp index e77e276af2..c2a60898f4 100644 --- a/addons/medical/ACE_Medical_SelfActions.hpp +++ b/addons/medical/ACE_Medical_SelfActions.hpp @@ -14,7 +14,7 @@ class Medical { runOnHover = 1; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitHead"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -84,7 +84,7 @@ class Medical { icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitBody"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -149,7 +149,7 @@ class Medical { icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -249,7 +249,7 @@ class Medical { icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -345,7 +345,7 @@ class Medical { icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -430,7 +430,7 @@ class Medical { icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -506,4 +506,4 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; -}; \ No newline at end of file +}; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 70506fa3e0..5121b6e452 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -63,78 +63,6 @@ Atadura Перевязать - - Bandage Head - Kopf verbinden - Vendar la cabeza - Bandażuj głowę - Obvázat hlavu - Перевязать голову - Pansement Tête - Fej kötözése - Atar Cabeça - Benda la testa - - - Bandage Torso - Torso verbinden - Vendar el torso - Bandażuj tors - Obvázat hruď - Перевязать торс - Pansement Torse - Felsőtest kötözése - Atar Tronco - Benda il torso - - - Bandage Left Arm - Arm links verbinden - Vendar el brazo izquierdo - Bandażuj lewe ramię - Obvázat levou ruku - Перевязать левую руку - Pansement Bras Gauche - Bal kar kötözése - Atar Braço Esquerdo - Benda il braccio sinistro - - - Bandage Right Arm - Arm rechts verbinden - Vendar el brazo derecho - Bandażuj prawe ramię - Obvázat pravou ruku - Перевязать правую руку - Pansement Bras Droit - Jobb kar kötözése - Atar Braço Direito - Benda il braccio destro - - - Bandage Left Leg - Bein links verbinden - Vendar la pierna izquierda - Bandażuj lewą nogę - Obvázat levou nohu - Перевязать левую ногу - Pansement Jambe Gauche - Bal láb kötözése - Atar Perna Esquerda - Benda la gamba sinistra - - - Bandage Right Leg - Bein rechts verbinden - Vendar la pierna derecha - Bandażuj prawą nogę - Obvázat pravou nohu - Перевязать правую ногу - Pansement Jambe Droite - Jobb láb kötözése - Atar Perna Direita - Benda la gamba destra - Injecting Morphine ... Morphin injizieren ... @@ -898,4 +826,4 @@ - \ No newline at end of file + From a209e49f1cba97ff82936a93711a4da5087cf4ac Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Wed, 8 Apr 2015 07:39:16 +0200 Subject: [PATCH 03/55] Remove partname from patientInfoDisplay for basic. --- addons/medical/functions/fnc_displayPatientInformation.sqf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 2e0525f1a3..fb374f8631 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -47,8 +47,10 @@ if (_show) then { _allInjuryTexts = []; _genericMessages = []; - _partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select _selectionN; - _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; + if (GVAR(level) >= 2) then { + _partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select _selectionN; + _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; + }; if (_target getvariable[QGVAR(isBleeding), false]) then { _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_BLEEDING", [1, 0.1, 0.1, 1]]; From e7f9245d7e9ed15a75072a40d85c7c228bf16cea Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sun, 12 Apr 2015 10:54:18 -0300 Subject: [PATCH 04/55] ACE_Main major cleanup --- addons/main/About.hpp | 35 ----- addons/main/CfgModuleCategories.hpp | 8 - addons/main/about.sqf | 210 -------------------------- addons/main/config.cpp | 2 - addons/main/license.sqf | 92 ----------- addons/main/license.txt | 92 ----------- addons/main/script_common.hpp | 3 - addons/main/script_config.hpp | 43 ------ addons/main/script_macros.hpp | 165 -------------------- addons/main/script_macros_menudef.hpp | 27 ---- addons/main/script_mod.hpp | 38 ----- 11 files changed, 715 deletions(-) delete mode 100644 addons/main/About.hpp delete mode 100644 addons/main/CfgModuleCategories.hpp delete mode 100644 addons/main/about.sqf delete mode 100644 addons/main/license.sqf delete mode 100644 addons/main/license.txt delete mode 100644 addons/main/script_common.hpp delete mode 100644 addons/main/script_config.hpp delete mode 100644 addons/main/script_macros_menudef.hpp diff --git a/addons/main/About.hpp b/addons/main/About.hpp deleted file mode 100644 index c455c43cc3..0000000000 --- a/addons/main/About.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#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 -}; diff --git a/addons/main/CfgModuleCategories.hpp b/addons/main/CfgModuleCategories.hpp deleted file mode 100644 index 1f86959585..0000000000 --- a/addons/main/CfgModuleCategories.hpp +++ /dev/null @@ -1,8 +0,0 @@ -class CfgFactionClasses { - 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 deleted file mode 100644 index c9004edfe1..0000000000 --- a/addons/main/about.sqf +++ /dev/null @@ -1,210 +0,0 @@ -#include "script_component.hpp" -#include "\z\ace\addons\main\script_common.hpp" - -if (!isNil "ACE_ABOUT_RUN") exitWith {ACE_ABOUT_RUN = false;}; -ACE_ABOUT_RUN = true; - -disableSerialization; - -PARAMS_2(_menu,_data); - -private ["_pcredits", "_pkeynam", "_shift", "_ctrl", "_alt", "_keys", "_key", "_keystrg", "_mod", "_knaml", "_knam", "_k", "_pkeys", "_pary", "_tpages", "_cEvents", "_i", "_cSys", "_tSys", "_aSys", "_tS", "_j", "_c", "_tC", "_keyn", "_fadet", "_page1", "_color", "_bcolor", "_newpages", "_pstart", "_pcount", "_pnext", "_display", "_control", "_pnames", "_pnam", "_page", "_pages", "_run", "_disp", "_next", "_input", "_nesc", "_unset", "_p", "_text", "_curPage", "_time", "_faded"]; - -_pcredits = [ -"", -"Advanced Combat Environment 2", -"http://dev-heaven.net/projects/ace-mod2", -"", -__cr_managers, -"", -__cr_devs, -"", -__cr_testers, -"", -"For a full list of acknowledgements, please visit our Wiki:", -"http://ace.dev-heaven.net" -]; - -_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 -}; -_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 -}; - -//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 {}; -}; - -//main menu display -if (typeName(_data select 0) == "DISPLAY") then { - _display = _data select 0; -}; - -if (typeName(_data select 0) == "CONTROL") then { - _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); -}; -private _pnames; -for "_x" from 0 to _pcount - 1 do { - 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}; -}; - -if (_pages > 0) then { - //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"}; - - _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}; - }; - - //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}; - - _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}; - - _text = ""; - _page = call compile format ["_page%1",_curPage]; - {_text = _text + _x + "
"} forEach _page; - _ctrl ctrlSetStructuredText parseText _text; - - _ctrl ctrlSetFade 1; - _ctrl ctrlCommit _fadet; - - _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; -closeDialog 0; \ No newline at end of file diff --git a/addons/main/config.cpp b/addons/main/config.cpp index eb136f84cf..59398052c4 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -585,5 +585,3 @@ class CfgSettings { */ }; }; - -#include "CfgModuleCategories.hpp" diff --git a/addons/main/license.sqf b/addons/main/license.sqf deleted file mode 100644 index d078710247..0000000000 --- a/addons/main/license.sqf +++ /dev/null @@ -1,92 +0,0 @@ -License (short) -=============== - -You are free: -- to Share to copy, distribute and transmit the work - -Under the following conditions: -- Attribution You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). -- Noncommercial You may not use this work for commercial purposes. -- No Derivative Works You may not alter, transform, or build upon this work. - -With the understanding that: - -Waiver Any of the above conditions can be waived if you get permission from the copyright holder. - -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. - -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. - - -Full license text -================= - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. - -1. Definitions - -"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. -"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. -"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership. -"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. -"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. -"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. -"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. -"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. -"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. - -2. Fair Dealing Rights. - -Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. - -3. License Grant. - -Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: - -to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and, to Distribute and Publicly Perform the Work including as incorporated in Collections. -The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d). - -4. Restrictions. - -The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: - -You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. -You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works. -If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. - -For the avoidance of doubt: - -Non-waivable Compulsory License Schemes. - -In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; -Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and, -Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b). -Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. - -5. Representations, Warranties and Disclaimer. - -UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. - -6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. Termination. - -This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. -Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). - -Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. - -8. Miscellaneous. - -Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. -If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. -This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. -The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. diff --git a/addons/main/license.txt b/addons/main/license.txt deleted file mode 100644 index e97d9c51a3..0000000000 --- a/addons/main/license.txt +++ /dev/null @@ -1,92 +0,0 @@ -License (short) -=============== - -You are free: -- to Share to copy, distribute and transmit the work - -Under the following conditions: -- Attribution You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). -- Noncommercial You may not use this work for commercial purposes. -- No Derivative Works You may not alter, transform, or build upon this work. - -With the understanding that: - -Waiver Any of the above conditions can be waived if you get permission from the copyright holder. - -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. - -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. - - -Full license text -================= - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. - -1. Definitions - -"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. -"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. -"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership. -"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. -"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. -"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. -"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. -"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. -"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. - -2. Fair Dealing Rights. - -Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. - -3. License Grant. - -Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: - -to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and, to Distribute and Publicly Perform the Work including as incorporated in Collections. -The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d). - -4. Restrictions. - -The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: - -You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. -You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works. -If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. - -For the avoidance of doubt: - -Non-waivable Compulsory License Schemes. - -In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; -Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and, -Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b). -Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. - -5. Representations, Warranties and Disclaimer. - -UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. - -6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. Termination. - -This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. -Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). - -Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. - -8. Miscellaneous. - -Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. -If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. -No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. -This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. -The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. diff --git a/addons/main/script_common.hpp b/addons/main/script_common.hpp deleted file mode 100644 index b3f6863d49..0000000000 --- a/addons/main/script_common.hpp +++ /dev/null @@ -1,3 +0,0 @@ -#define __cr_managers "Manager: " -#define __cr_devs "Developer:" -#define __cr_testers "Contributor: " diff --git a/addons/main/script_config.hpp b/addons/main/script_config.hpp deleted file mode 100644 index e39240286e..0000000000 --- a/addons/main/script_config.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#define true 1 -#define false 0 - -#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 VSoft 0 -#define VArmor 1 -#define VAir 2 - -#define LockNo 0 -#define LockCadet 1 -#define LockYes 2 - -#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 CanSeeRadar 1 -#define CanSeeRye 2 -#define CanSeeOptics 4 -#define CanSeeEar 4 -#define CanSeeCompass 16 -#define CanSeeRadarC CanSeeRadar+CanSeeCompass -#define CanSeeAll 31 diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 79f95545ca..fce9ec526a 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -4,171 +4,6 @@ // Default versioning level #define DEFAULT_VERSIONING_LEVEL 2 -// RGB Colors -#define RGB_GREEN 0, 0.5, 0, 1 -#define RGB_BLUE 0, 0, 1, 1 -#define RGB_ORANGE 0.5, 0.5, 0, 1 -#define RGB_RED 1, 0, 0, 1 -#define RGB_YELLOW 1, 1, 0, 1 -#define RGB_WHITE 1, 1, 1, 1 -#define RGB_GRAY 0.5, 0.5, 0.5, 1 -#define RGB_BLACK 0, 0, 0, 1 -#define RGB_MAROON 0.5, 0, 0, 1 -#define RGB_OLIVE 0.5, 0.5, 0, 1 -#define RGB_NAVY 0, 0, 0.5, 1 -#define RGB_PURPLE 0.5, 0, 0.5, 1 -#define RGB_FUCHSIA 1, 0, 1, 1 -#define RGB_AQUA 0, 1, 1, 1 -#define RGB_TEAL 0, 0.5, 0.5, 1 -#define RGB_LIME 0, 1, 0, 1 -#define RGB_SILVER 0.75, 0.75, 0.75, 1 - -#include "script_macros_menudef.hpp" - -#define ACE_NOARMORY class Armory { disabled = 1; } -#define ACE_ARMORY class Armory { disabled = 0; } -#define ACE_ACEARMORY class Armory { disabled = 0; author = "A.C.E."; } - - -// Weapon defaults -// NOTE !!!! - Do not forget to dummy-update the configs that use these defines, or the changes won't activate due to binarization! -#define ACE_DEFAULT_WEAPONS "Throw", "Put" - -// Item defaults -// NOTE !!!! - Do not forget to dummy-update the configs that use these defines, or the changes won't activate due to binarization! -#define ACE_ITEMS_TEAMLEADER_B "ItemMap","ItemCompass","ItemWatch","ItemRadio" -#define ACE_ITEMS_SQUADLEADER_B "ItemMap","ItemCompass","ItemWatch","ItemRadio","ACE_DAGR" -#define ACE_ITEMS_SPECIAL "ItemMap","ItemCompass","ItemWatch","ItemRadio" -#define ACE_ITEMS "ItemWatch","ItemRadio" -#define ACE_ITEMS_CIVILIAN "ItemWatch" - - -#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 - -// #include "script_macros_optics.hpp" //ToDo - -#define ACE_NOZEROING discreteDistance[] = {}; \ - discreteDistanceInitIndex = 0; \ - weaponInfoType = "RscWeaponEmpty" - -#define ACE_NOTURRETZEROING discreteDistance[] = {}; \ - discreteDistanceInitIndex = 0; \ - turretInfoType = "RscWeaponEmpty" - -#define ACE_LASER irLaserPos = "laser pos"; \ - 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_SUPPRESSED ace_suppressed = 1; \ - 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_ITEM(x,y) class _xx_##x {name = ##x; count = ##y;} -#define ACE_M_BAG(x,y) class _xx_##x {backpack = ##x; count = ##y;} - - -// 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 - -// Increased FOV for tank driver -// Increased Default US Tank driver optic -#define ACE_DRIVEROPTIC_TANK_US driverOpticsModel = "\z\ace\addons\m_veh_optics\driver\optika_tank_driver_west.p3d" -// Increased Default RU Tank driver optic -#define ACE_DRIVEROPTIC_TANK_RU driverOpticsModel = "\z\ace\addons\m_veh_optics\driver\optika_tank_driver_east.p3d" -// Increased Default NON Specified driver optic -#define ACE_DRIVEROPTIC_TANK driverOpticsModel = "\z\ace\addons\m_veh_optics\driver\optika_tank_driver.p3d" -// Increased Default EP1 NON Specified driver optic -// Default black border thing needs finish -#define ACE_DRIVEROPTIC_TANK_EP1 driverOpticsModel = "\z\ace\addons\m_veh_optics\driver\optika_tank_driver.p3d" - -#define ACE_BWC ace_bwc = 1 - -// SCRIPTING MACROS - -// Items -#define inITEMS(x,y) (##x in (y call ACE_fnc_getGear)) -#define remITEMS(x,y) ([##x,y] call ACE_fnc_removeItem) -//#define addITEMS(x,y) (y addItem ##x) - -// Interaction/ Put anims -#define canANIM(x) (x call ACE_fnc_CanPutDown) -#define playANIM(x) (if (x call ACE_fnc_CanPutDown) then { x call ACE_fnc_PutDown }) - -// In vehicle or on foot -#define ONFOOT(x) (x == vehicle x) -#define INVEHICLE(x) (x != vehicle x) - -// FX -#define COUGH ace_common_fx_fnc_cough -#define BLURRY ace_common_fx_fnc_blurry -#define BLIND ace_common_fx_fnc_blind_view -#define DEAF ace_common_fx_fnc_deaf -#define DIZZY ace_common_fx_fnc_dizzy -#define FLASH ace_common_fx_fnc_flash -#define KICK ace_common_fx_fnc_kick -#define KNOCKOUT ace_common_fx_fnc_knockout -#define RING ace_common_fx_fnc_ring - -// Stamina -#define INC_MASS ace_stamina_fnc_inc_mass - -// Does this work, due to BWC_CONFIG(NAME) ? -#undef BWC_CONFIG - -#define BWC_CONFIG(NAME) class NAME { \ - 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; \ - } -#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; \ - } - -// Addaction defines for colored text -#define ACE_TEXT_ORANGE(Text) ("" + ##Text + "") -#define ACE_TEXT_RED(Text) ("" + ##Text + "") -#define ACE_TEXT_GREEN(Text) ("" + ##Text + "") -#define ACE_TEXT_YELLOW(Text) ("" + ##Text + "") - - - #define EGVAR(module,var) TRIPLES(PREFIX,module,var) #define QEGVAR(module,var) QUOTE(EGVAR(module,var)) diff --git a/addons/main/script_macros_menudef.hpp b/addons/main/script_macros_menudef.hpp deleted file mode 100644 index 35a8e2be45..0000000000 --- a/addons/main/script_macros_menudef.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// ACE Self Interaction Conditions - -// Self Interaction Menu not available if player is unconscious -#define ACE_INTERACT_ALIVE (alive player) -#define ACE_INTERACT_UNCON (player call ace_wounds_fnc_isUncon) - -// Player is Player Vehicle -#define ACE_INTERACT_PLAYER (player == vehicle player || (player != vehicle player && player in assignedCargo vehicle player)) - -// Player is climbing up a ladder -#define ACE_INTERACT_LADDER (animationState player in ["ladderriflestatic","laddercivilstatic"]) - -// Possible = Self interaction opens only if player is alive and conscious (can be in a vehicle) -#define ACE_SELFINTERACTION_POSSIBLE (!ACE_INTERACT_LADDER && {ACE_INTERACT_ALIVE} && {!ACE_INTERACT_UNCON}) - -// Restricted = Self interaction opens only if player is alive and conscious (can NOT be in a vehicle, i.e Groundmarker, explosives ...) -#define ACE_SELFINTERACTION_RESTRICTED (ACE_SELFINTERACTION_POSSIBLE && {ACE_INTERACT_PLAYER}) - -// Close interaction menu if unconscious -#define ACE_INTERACT_FNC_EXIT if (ACE_INTERACT_UNCON) exitWith {} -#define ACE_ASSEMBLE (getNumber(configFile >> "CfgActions" >> "Assemble" >> "show") == 0) -#define ACE_DISASSEMBLE (getNumber(configFile >> "CfgActions" >> "DisAssemble" >> "show") == 0) -#define ACE_PIPEDEFAULT (getNumber(configFile >> "CfgMagazines" >> "PipeBomb" >> "useAction") == 0) -#define ACE_IDENTITYDEFAULT (isClass(configFile >> "CfgPatches" >> "ace_combatdeaf")) -#define ACE_RUCKDEFAULT (isClass(configFile >> "CfgPatches" >> "ace_stamina")) - -#define ACE_KNOWN2PLAYER (if (name _target in (player getVariable ["ace_recognize_knownnames",[]])) then { name _target } else { " " }) \ No newline at end of file diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 6ef5ec3f68..25a18e8dc2 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -15,41 +15,3 @@ // MINIMAL required version for the Mod. Components can specify others.. #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 -*/ From 3ee18f9a3a5083f890ccc0c85799d48142f983be Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sun, 12 Apr 2015 11:06:25 -0300 Subject: [PATCH 05/55] Readd CfgModuleCategories.hpp --- addons/main/CfgModuleCategories.hpp | 8 ++++++++ addons/main/config.cpp | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 addons/main/CfgModuleCategories.hpp diff --git a/addons/main/CfgModuleCategories.hpp b/addons/main/CfgModuleCategories.hpp new file mode 100644 index 0000000000..5297ec1e99 --- /dev/null +++ b/addons/main/CfgModuleCategories.hpp @@ -0,0 +1,8 @@ +class CfgFactionClasses { + class NO_CATEGORY; + class ACE: NO_CATEGORY { + displayName = "ACE"; + priority = 2; + side = 7; + }; +}; diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 59398052c4..eb136f84cf 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -585,3 +585,5 @@ class CfgSettings { */ }; }; + +#include "CfgModuleCategories.hpp" From 6062128436bde5488151815f5106862ff42fb69b Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sun, 12 Apr 2015 18:01:29 +0200 Subject: [PATCH 06/55] Remove tourniquet option, add check pulse/response --- addons/medical/ACE_Medical_Treatments.hpp | 30 ++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 097292d9cc..5b5e0b6abd 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -55,15 +55,6 @@ class ACE_Medical_Actions { animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; litter[] = {}; }; - class Tourniquet: Bandage { - displayName = "$STR_ACE_Medical_Apply_Tourniquet"; - displayNameProgress = "$STR_ACE_Medical_Applying_Tourniquet"; - items[] = {"ACE_tourniquet"}; - treatmentTime = 6; - callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); - condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo))); - litter[] = {}; - }; class BodyBag: Bandage { displayName = "$STR_ACE_MEDICAL_PlaceInBodyBag"; displayNameProgress = "$STR_ACE_MEDICAL_PlacingInBodyBag"; @@ -80,6 +71,27 @@ class ACE_Medical_Actions { itemConsumed = 1; litter[] = {}; }; + class CheckPulse: Bandage { + displayName = ""; + displayNameProgress = ""; + treatmentLocations[] = {"All"}; + requiredMedic = 0; + treatmentTime = 2; + items[] = {}; + callbackSuccess = QUOTE(DFUNC(actionCheckPulse)); + callbackFailure = ""; + callbackProgress = ""; + animationPatient = ""; + animationCaller = ""; // TODO + itemConsumed = 0; + litter[] = {}; + }; + class CheckBloodPressure: CheckPulse { + callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure)); + }; + class CheckResponse: CheckPulse { + callbackSuccess = QUOTE(DFUNC(actionCheckResponse)); + }; }; class Advanced { From 664cc7077d2b4389339886e78992687479fdce7c Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Sun, 12 Apr 2015 18:06:57 +0200 Subject: [PATCH 07/55] Reduce blood loss rate --- addons/medical/functions/fnc_getBloodLoss.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index 6418d425e8..fb5a6d9e36 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -#define BLOODLOSSRATE_BASIC 0.4 +#define BLOODLOSSRATE_BASIC 0.08 private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"]; // TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical). From dc5028275a159e4b3768a599a04612e7c38620e4 Mon Sep 17 00:00:00 2001 From: Nou Date: Sun, 12 Apr 2015 19:16:58 -0700 Subject: [PATCH 08/55] Seeker FOV implemented, fast FOV check. --- .../functions/fnc_seekerFindLaserSpot.sqf | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 421748a681..41ea877739 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -4,8 +4,10 @@ * * Arguments: * 0: Position of seeker (ASL) - * 1: Seeker wavelength sensitivity range, [1550,1550] is common eye safe. - * 2: Seeker laser code. + * 1: Direction vector (will be normalized) + * 2: Seeker FOV in degrees + * 3: Seeker wavelength sensitivity range, [1550,1550] is common eye safe. + * 4: Seeker laser code. * * Return value: * Array, [Strongest compatible laser spot ASL pos, owner object] Nil array values if nothing found. @@ -17,9 +19,14 @@ private ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_ex "_emitterWavelength", "_laserCode", "_divergence", "_laser", "_laserPos", "_laserDir", "_res", "_bucketPos", "_bucketList", "_c", "_forEachIndex", "_index", "_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; -_pos = _this select 0; -_seekerWavelengths = _this select 1; -_seekerCode = _this select 2; +_pos = _this select 0; +_dir = vectorNormalized (_this select 1); +_seekerFov = _this select 2; +_seekerWavelengths = _this select 3; +_seekerCode = _this select 4; + + +_seekerCos = cos _seekerFov; _spots = []; _buckets = []; @@ -57,8 +64,13 @@ _finalOwner = nil; _laserPos = _laser select 0; _laserDir = _laser select 1; _res = [_laserPos, _laserDir, _divergence] call FUNC(shootCone); - { - _spots pushBack [_x select 0, _owner]; + { + _testPoint = _x select 0; + _testPointVector = vectorNormalized (_testPoint vectorDiff _pos); + _testDotProduct = _dir vectorDotProduct _testPointVector; + if(_testDotProduct > _seekerCos) then { + _spots pushBack [_testPoint, _owner]; + }; } forEach (_res select 2); }; } forEach (GVAR(laserEmitters) select 1); From 4c74ff8717bebe98831cd18dc0ec4396674d2f47 Mon Sep 17 00:00:00 2001 From: Nou Date: Sun, 12 Apr 2015 19:49:14 -0700 Subject: [PATCH 09/55] FOV check made faster. --- .../functions/fnc_checkSeekerAngle.sqf | 29 ++++--------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf index 7308ce1723..c649319af2 100644 --- a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf +++ b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf @@ -11,39 +11,20 @@ * Return value: * Boolean */ - - #define DEBUG_MODE_FULL + #include "script_component.hpp" -private["_seeker", "_targetPos", "_seekerMaxAngle", "_vectorTo", "_sensorPos", "_vertOk", "_horzOk", "_dir", "_headingPitch"]; +private["_seeker", "_targetPos", "_seekerMaxAngle", "_sensorPos", "_testPointVector", "_testDotProduct"]; _seeker = _this select 0; _targetPos = _this select 1; _seekerMaxAngle = _this select 2; -_vertOk = false; -_horzOk = false; - _sensorPos = getPosASL _seeker; -_vectorTo = _sensorPos vectorFromTo _targetPos; -_headingPitch = (vectorDir _seeker) call CBA_fnc_vect2polar; -_polarTo = _vectorTo call CBA_fnc_vect2polar; +_testPointVector = vectorNormalized (_targetPos vectorDiff _sensorPos); +_testDotProduct = (vectorNormalized (velocity _seeker)) vectorDotProduct _testPointVector; -_dir = _polarTo select 1; -_dir = _dir - (_headingPitch select 1); - -if (_dir < 0) then {_dir = _dir + 360}; -if (_dir > 360) then {_dir = _dir - 360}; - _vertOk = false; - _horzOk = false; -if(_dir < _angleFov || {_dir > (360-_angleFov)}) then { - _horzOk = true; -}; -if(abs((abs(_polarTo select 2))-(abs(_headingPitch select 2))) < _angleFov) then { - _vertOk = true; -}; - -if(!_vertOk || !_horzOk ) exitWith { +if(_testDotProduct < (cos _seekerMaxAngle) exitWith { false }; From b58598c6aace956a76fd3f79897e7115d9b02708 Mon Sep 17 00:00:00 2001 From: Nou Date: Sun, 12 Apr 2015 21:47:27 -0700 Subject: [PATCH 10/55] Woops, missing ) --- addons/missileguidance/functions/fnc_checkSeekerAngle.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf index c649319af2..e8bc1a16f5 100644 --- a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf +++ b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf @@ -24,7 +24,7 @@ _sensorPos = getPosASL _seeker; _testPointVector = vectorNormalized (_targetPos vectorDiff _sensorPos); _testDotProduct = (vectorNormalized (velocity _seeker)) vectorDotProduct _testPointVector; -if(_testDotProduct < (cos _seekerMaxAngle) exitWith { +if(_testDotProduct < (cos _seekerMaxAngle)) exitWith { false }; From 2d6b2f9a1a3b3ace5aa6ad80b2b1506a6e4aa6b6 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 13 Apr 2015 08:33:03 -0700 Subject: [PATCH 11/55] I had accidently commented out seeker FOV on the Titan rockets. --- addons/missileguidance/functions/fnc_seekerType_Optic.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index 9539c2c8f6..74d3b0fc71 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -19,7 +19,7 @@ if(!isNil "_target") then { _foundTargetPos = getPosASL _target; }; -/* @TODO: This is seeker LOS and angle checks for LOAL only; LOBL does not need visual +// @TODO: This is seeker LOS and angle checks for LOAL only; LOBL does not need visual _angleFov = _seekerParams select 0; _angleOkay = [_projectile, _foundTargetPos, _angleFov] call FUNC(checkSeekerAngle); @@ -34,7 +34,7 @@ if(!_angleOkay || !_losOkay) then { _foundTargetPos = _sensorPos vectorAdd ((velocity _projectile) vectorMultiply 5); } else { TRACE_2("", _target, _foundTargetPos); - + private["_projectileSpeed", "_distanceToTarget", "_eta", "_adjustVelocity"]; // @TODO: Configurable lead for seekers _projectileSpeed = (vectorMagnitude velocity _projectile); _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetPos; @@ -45,5 +45,5 @@ if(!_angleOkay || !_losOkay) then { _foundTargetPos = _foundTargetPos vectorAdd _adjustVelocity; }; -*/ + _foundTargetPos; \ No newline at end of file From c66f99faac445ccfa63e13861f454291ae665393 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 13 Apr 2015 08:59:36 -0700 Subject: [PATCH 12/55] Fixed: Locking reticles would lock out-of-order. Fixed: Locking was hard. Fixes #539 --- addons/javelin/functions/fnc_onOpticDraw.sqf | 41 +++++++++++--------- addons/javelin/script_component.hpp | 1 + addons/missileguidance/CfgAmmo.hpp | 4 +- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 2412c2d5a1..e88310c6af 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -53,9 +53,11 @@ if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && [] call FUNC(showFireMode); _range = parseNumber (ctrlText __JavelinIGUIRangefinder); +TRACE_1("Viewing range", _range); if (_range > 50 && {_range < 2500}) then { _pos = positionCameraToWorld [0,0,_range]; _targetArray = _pos nearEntities ["AllVehicles", _range/25]; + TRACE_1("Searching at range", _targetArray); if (count (_targetArray) > 0) then { _newTarget = _targetArray select 0; }; @@ -77,6 +79,21 @@ _offsetY = __OffsetY; __JavelinIGUITargeting ctrlShow true; __JavelinIGUITargetingConstrains ctrlShow true; +_zamerny = if (_currentTarget isKindOf "CAManBase") then {_currentTarget selectionPosition "body"} else {_currentTarget selectionPosition "zamerny"}; +_randomPosWithinBounds = [(_zamerny select 0) + 1 - (random 2.0),(_zamerny select 1) + 1 - (random 2.0),(_zamerny select 2) + 0.5 - (random 1.0)]; + +_apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds); + +_aposX = 0; +_aposY = 0; +if (count _apos < 2) then { + _aposX = 1; + _aposY = 0; +} else { + _aposX = (_apos select 0) + _offsetX; + _aposY = (_apos select 1) + _offsetY; +}; + if (isNull _newTarget) then { // No targets found _currentTarget = objNull; @@ -117,26 +134,11 @@ if (isNull _newTarget) then { __JavelinIGUITargetingConstrains ctrlShow false; __JavelinIGUITargetingGate ctrlShow true; __JavelinIGUITargetingLines ctrlShow true; - - _zamerny = if (_currentTarget isKindOf "CAManBase") then {_currentTarget selectionPosition "body"} else {_currentTarget selectionPosition "zamerny"}; - _randomPosWithinBounds = [(_zamerny select 0) + 1 - (random 2.0),(_zamerny select 1) + 1 - (random 2.0),(_zamerny select 2) + 0.5 - (random 1.0)]; - _apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds); - - _aposX = 0; - _aposY = 0; - if (count _apos < 2) then { - _aposX = 1; - _aposY = 0; - } else { - _aposX = (_apos select 0) + _offsetX; - _aposY = (_apos select 1) + _offsetY; - }; - // Move target marker to coords. - __JavelinIGUITargetingLineV ctrlSetPosition [_aposX,ctrlPosition __JavelinIGUITargetingLineV select 1]; - __JavelinIGUITargetingLineH ctrlSetPosition [ctrlPosition __JavelinIGUITargetingLineH select 0,_aposY]; - {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingLineH,__JavelinIGUITargetingLineV]; + //__JavelinIGUITargetingLineV ctrlSetPosition [_aposX,ctrlPosition __JavelinIGUITargetingLineV select 1]; + //__JavelinIGUITargetingLineH ctrlSetPosition [ctrlPosition __JavelinIGUITargetingLineH select 0,_aposY]; + //{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingLineH,__JavelinIGUITargetingLineV]; _boundsInput = if (_currentTarget isKindOf "CAManBase") then { [_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "body"]; @@ -169,6 +171,7 @@ if (isNull _newTarget) then { } else { __JavelinIGUITargeting ctrlShow true; __JavelinIGUITargetingGate ctrlShow true; + __JavelinIGUITargetingConstrains ctrlShow true; __JavelinIGUITargetingLines ctrlShow false; ACE_player setVariable["ace_missileguidance_target", nil, false]; @@ -186,6 +189,8 @@ if (isNull _newTarget) then { _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH); _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH); + TRACE_4("", _boundsInput, _bpos, _minX, _minY); + __JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY]; __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY]; __JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY]; diff --git a/addons/javelin/script_component.hpp b/addons/javelin/script_component.hpp index 6aa34b6bc8..7f3f345837 100644 --- a/addons/javelin/script_component.hpp +++ b/addons/javelin/script_component.hpp @@ -25,6 +25,7 @@ #define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001) #define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002) #define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 699003) +#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151) // Constrains #define __JavelinIGUITargetingConstrains (__JavelinIGUI displayCtrl 699100) diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 5aaee5ff2f..3a9e5e0e16 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -127,10 +127,10 @@ class CfgAmmo { defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; - seekerAngle = 90; // Angle in front of the missile which can be searched + seekerAngle = 180; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier - seekerMinRange = 1; + seekerMinRange = 0; seekerMaxRange = 2500; // Range from the missile which the seeker can visually search // Attack profile type selection From 6aa9f5bcbceba8fd98a5879969628f3d2a42f836 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 13 Apr 2015 09:01:18 -0700 Subject: [PATCH 13/55] NFOV/WFOV --- addons/javelin/functions/fnc_onOpticDraw.sqf | 13 +++++++++---- addons/javelin/script_component.hpp | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index e88310c6af..59f8d4faac 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -1,4 +1,4 @@ -//#define DEBUG_MODE_FULL +#define DEBUG_MODE_FULL #include "script_component.hpp" TRACE_1("enter", _this); @@ -94,13 +94,20 @@ if (count _apos < 2) then { _aposY = (_apos select 1) + _offsetY; }; +if((call CBA_fnc_getFoV) select 1 > 9) then { + __JavelinIGUINFOV ctrlSetTextColor __ColorGreen; + __JavelinIGUIWFOV ctrlSetTextColor __ColorGray; +} else { + __JavelinIGUINFOV ctrlSetTextColor __ColorGray; + __JavelinIGUIWFOV ctrlSetTextColor __ColorGreen; +}; + if (isNull _newTarget) then { // No targets found _currentTarget = objNull; _lockTime = 0; __JavelinIGUISeek ctrlSetTextColor __ColorGray; - __JavelinIGUINFOV ctrlSetTextColor __ColorGreen; __JavelinIGUITargeting ctrlShow false; __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; @@ -128,7 +135,6 @@ if (isNull _newTarget) then { TRACE_2("LOCKED!", _currentTarget, _lockTime); __JavelinIGUISeek ctrlSetTextColor __ColorGreen; - __JavelinIGUINFOV ctrlSetTextColor __ColorNull; __JavelinIGUITargeting ctrlShow true; __JavelinIGUITargetingConstrains ctrlShow false; @@ -210,7 +216,6 @@ if (isNull _newTarget) then { ACE_player setVariable["ace_missileguidance_target", nil, false]; __JavelinIGUISeek ctrlSetTextColor __ColorGray; - __JavelinIGUINFOV ctrlSetTextColor __ColorGray; __JavelinIGUITargeting ctrlShow false; __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; diff --git a/addons/javelin/script_component.hpp b/addons/javelin/script_component.hpp index 7f3f345837..e313bf8347 100644 --- a/addons/javelin/script_component.hpp +++ b/addons/javelin/script_component.hpp @@ -25,6 +25,7 @@ #define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001) #define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002) #define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 699003) +#define __JavelinIGUIWFOV (__JavelinIGUI displayCtrl 1004) #define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151) // Constrains From 3e7c8ca6346684a904b1b89c71297c7bfe50e7dd Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 13 Apr 2015 09:03:19 -0700 Subject: [PATCH 14/55] remove optic debug. --- addons/javelin/functions/fnc_onOpticDraw.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 59f8d4faac..1694702f98 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -1,4 +1,4 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" TRACE_1("enter", _this); From e5d8fe2634edf1dec17592140bd14c713024ad22 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 13 Apr 2015 09:24:28 -0700 Subject: [PATCH 15/55] Guidance timing per FPS fixes. --- .../functions/fnc_attackProfile_TOP.sqf | 4 +++- .../functions/fnc_guidancePFH.sqf | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf index 767f5df351..472d874519 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf @@ -26,16 +26,18 @@ if( ((ASLtoATL _projectilePos) select 2) < 140 && _distanceToShooter < 50) then _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; } else { // If we are below the target, increase the climbing arc - if((_projectilePos select 2) < (_seekerTargetPos select 2) + 140 && _distanceToTarget > 100) then { + if((_projectilePos select 2) < (_seekerTargetPos select 2) + 140 && _distanceToTarget > 140) then { _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))+50]; }; }; // Handle arcing terminal low for high decent if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 140) then { + _addHeight = [0,0,0]; _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.5]; } else { if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 140) then { + _addHeight = [0,0,0]; _addHeight = _addHeight vectorAdd [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.02]; }; }; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 7041201ded..fb9f206be9 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -19,7 +19,11 @@ _seekerParams = _args select 3; _stateParams = _args select 4; _lastRunTime = _stateParams select 0; + _runtimeDelta = diag_tickTime - _lastRunTime; +_adjustTime = 1/accTime; +_adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); +TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, (_runtimeDelta / TIMESTEP_FACTOR) ); _config = configFile >> "CfgAmmo" >> _ammo >> "ACE_MissileGuidance"; @@ -33,8 +37,8 @@ if(!isNil "_seekerTargetPos") then { _profileAdjustedTargetPos = [_seekerTargetPos,_args] call FUNC(doAttackProfile); - _minDeflection = _flightParams select 0; - _maxDeflection = _flightParams select 1; + _minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; + _maxDeflection = (_flightParams select 1) * _adjustTime; _incDeflection = _flightParams select 2; _yVec = vectorDir _projectile; @@ -72,15 +76,12 @@ if(!isNil "_seekerTargetPos") then { #endif if(accTime > 0) then { - private["_adjustTime", "_outVector", "_vectorTo"]; - _adjustTime = 1/accTime; - _adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); - TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, (_runtimeDelta / TIMESTEP_FACTOR) ); - + private["_outVector", "_vectorTo"]; + // @TODO: Apply velocity multiplier to yaw/pitch. Basically, it can adjust faster at lower speeds //_adjustDeflection = (vectorMagnitude velocity _projectile); - _outVector = [_projectile, [_xVec, _yVec, _zVec], [_yaw, _adjustTime, _pitch]] call EFUNC(common,translateToModelSpace); + _outVector = [_projectile, [_xVec, _yVec, _zVec], [_yaw, 1, _pitch]] call EFUNC(common,translateToModelSpace); _vectorTo = _projectilePos vectorFromTo _outVector; _projectile setVectorDirAndUp [_vectorTo, vectorUp _projectile]; From ff858c1194790c96f0e9257f32895e9ee8098484 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 13 Apr 2015 09:56:15 -0700 Subject: [PATCH 16/55] Begin stateful guidance. Re-write of TOP down because it wasnt even running. LIN was default. but it was broken anyways. --- addons/missileguidance/CfgAmmo.hpp | 2 +- .../functions/fnc_attackProfile_TOP.sqf | 25 +++---------------- .../missileguidance/functions/fnc_fired.sqf | 2 +- .../functions/fnc_guidancePFH.sqf | 4 +-- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 3a9e5e0e16..050a23f5fd 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -134,7 +134,7 @@ class CfgAmmo { seekerMaxRange = 2500; // Range from the missile which the seeker can visually search // Attack profile type selection - defaultAttackProfile = "LIN"; + defaultAttackProfile = "TOP"; attackProfiles[] = { "TOP", "LIN" }; }; }; diff --git a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf index 472d874519..ef59890b99 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf @@ -1,15 +1,17 @@ -//#define DEBUG_MODE_FULL +#define DEBUG_MODE_FULL #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos"]; +private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; _target = _launchParams select 0; _targetLaunchParams = _launchParams select 1; +_state = _this select 2; + _shooterPos = getPosASL _shooter; _projectilePos = getPosASL _projectile; @@ -21,26 +23,7 @@ TRACE_2("", _distanceToTarget, _distanceToShooter); // Add height depending on distance for compensate _addHeight = [0,0,0]; -// Always climb an arc on initial launch if we are close to the round -if( ((ASLtoATL _projectilePos) select 2) < 140 && _distanceToShooter < 50) then { - _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; -} else { - // If we are below the target, increase the climbing arc - if((_projectilePos select 2) < (_seekerTargetPos select 2) + 140 && _distanceToTarget > 140) then { - _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))+50]; - }; -}; -// Handle arcing terminal low for high decent -if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 140) then { - _addHeight = [0,0,0]; - _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.5]; -} else { - if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 140) then { - _addHeight = [0,0,0]; - _addHeight = _addHeight vectorAdd [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.02]; - }; -}; TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight); diff --git a/addons/missileguidance/functions/fnc_fired.sqf b/addons/missileguidance/functions/fnc_fired.sqf index bb162e1f09..0622ac9342 100644 --- a/addons/missileguidance/functions/fnc_fired.sqf +++ b/addons/missileguidance/functions/fnc_fired.sqf @@ -68,7 +68,7 @@ TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile getNumber ( _config >> "seekerAccuracy" ), getNumber ( _config >> "seekerMaxRange" ) ], - [ diag_tickTime ] + [ diag_tickTime, [], [] ] ] ] call cba_fnc_addPerFrameHandler; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index fb9f206be9..8596e81924 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -32,10 +32,10 @@ if(!alive _projectile || isNull _projectile || isNull _shooter) exitWith { }; // TODO: placeholder for "last seek target position" -_seekerTargetPos = [ [0,0,0], _args] call FUNC(doSeekerSearch); +_seekerTargetPos = [ [0,0,0], _args, (_stateParams select 1)] call FUNC(doSeekerSearch); if(!isNil "_seekerTargetPos") then { - _profileAdjustedTargetPos = [_seekerTargetPos,_args] call FUNC(doAttackProfile); + _profileAdjustedTargetPos = [_seekerTargetPos,_args, (_stateParams select 2)] call FUNC(doAttackProfile); _minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; _maxDeflection = (_flightParams select 1) * _adjustTime; From b72366f0f6ff15db1ce59623dc23a2aa1bb022bd Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 13 Apr 2015 22:34:43 +0200 Subject: [PATCH 17/55] hide laser beam during day --- addons/laserpointer/functions/fnc_drawLaserpoint.sqf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 31be95099a..82b989e470 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -97,11 +97,13 @@ if (!surfaceIsWater _pL) then { _pL = ASLtoATL _pL; }; -drawLine3D [ - _p0Pos, - _pL, - [[1,0,0,1], [0,1,0,1]] select _isGreen -]; +if (call EFUNC(common,ambientBrightness) < 0.2) then { + drawLine3D [ + _p0Pos, + _pL, + [[1,0,0,1], [0,1,0,1]] select _isGreen + ]; +}; _size = 2 * (_range - (positionCameraToWorld [0,0,0] distance _pL)) / _range; From 3da3543381b4e94a9c428098d73cd05717efd097 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 14 Apr 2015 00:32:09 +0200 Subject: [PATCH 18/55] toggle laser vs ir laser --- addons/laserpointer/CfgVehicles.hpp | 5 +- addons/laserpointer/CfgWeapons.hpp | 31 +++++++++- addons/laserpointer/XEH_postInit.sqf | 15 ++++- addons/laserpointer/XEH_preInit.sqf | 1 + addons/laserpointer/config.cpp | 2 +- .../functions/fnc_switchLaserLightMode.sqf | 58 +++++++++++++++++++ addons/laserpointer/stringtable.xml | 12 ++++ 7 files changed, 116 insertions(+), 8 deletions(-) create mode 100644 addons/laserpointer/functions/fnc_switchLaserLightMode.sqf diff --git a/addons/laserpointer/CfgVehicles.hpp b/addons/laserpointer/CfgVehicles.hpp index 8c81837fe2..5a0ece1b1f 100644 --- a/addons/laserpointer/CfgVehicles.hpp +++ b/addons/laserpointer/CfgVehicles.hpp @@ -2,7 +2,7 @@ class CfgVehicles { class NATO_Box_Base; class Box_NATO_Support_F: NATO_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_acc_pointer_red,4); + MACRO_ADDITEM(ACE_acc_pointer_green,4); }; }; @@ -23,13 +23,12 @@ class CfgVehicles { class FIA_Box_Base_F; class Box_FIA_Support_F: FIA_Box_Base_F { class TransportItems { - MACRO_ADDITEM(ACE_acc_pointer_red,4); + MACRO_ADDITEM(ACE_acc_pointer_green,4); }; }; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { - MACRO_ADDITEM(ACE_acc_pointer_red,4); MACRO_ADDITEM(ACE_acc_pointer_green,4); }; }; diff --git a/addons/laserpointer/CfgWeapons.hpp b/addons/laserpointer/CfgWeapons.hpp index 364f4b2168..4f6a61c83a 100644 --- a/addons/laserpointer/CfgWeapons.hpp +++ b/addons/laserpointer/CfgWeapons.hpp @@ -1,17 +1,28 @@ class SlotInfo; class PointerSlot: SlotInfo { - compatibleItems[] += {"ACE_acc_pointer_red","ACE_acc_pointer_green"}; + compatibleItems[] += {"ACE_acc_pointer_red","ACE_acc_pointer_green_IR","ACE_acc_pointer_green"}; }; class CfgWeapons { class ItemCore; class InventoryFlashLightItem_Base_F; + class acc_pointer_IR: ItemCore { + ACE_nextModeClass = "ACE_acc_pointer_red"; + ACE_modeDescription = "$STR_ACE_Laserpointer_IRLaser"; + + displayName = "$STR_ACE_Laserpointer_red"; + descriptionUse = "$STR_ACE_Laserpointer_useLaser"; + }; + class ACE_acc_pointer_red: ItemCore { + ACE_nextModeClass = "acc_pointer_IR"; + ACE_modeDescription = "$STR_ACE_Laserpointer_Laser"; + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_acc_pointer_red"; - scope = 2; + scope = 1; displayName = "$STR_ACE_Laserpointer_red"; descriptionUse = "$STR_ACE_Laserpointer_useLaser"; picture = "\A3\weapons_F\Data\UI\gear_accv_pointer_CA.paa"; @@ -54,9 +65,23 @@ class CfgWeapons { inertia = 0.1; }; - class ACE_acc_pointer_green: ACE_acc_pointer_red { + class ACE_acc_pointer_green_IR: acc_pointer_IR { + ACE_nextModeClass = "ACE_acc_pointer_green"; + ACE_modeDescription = "$STR_ACE_Laserpointer_IRLaser"; + author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_acc_pointer_green"; + scope = 1; + displayName = "$STR_ACE_Laserpointer_green"; + }; + + class ACE_acc_pointer_green: ACE_acc_pointer_red { + ACE_nextModeClass = "ACE_acc_pointer_green_IR"; + ACE_modeDescription = "$STR_ACE_Laserpointer_Laser"; + + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_acc_pointer_green"; + scope = 2; displayName = "$STR_ACE_Laserpointer_green"; }; }; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index 14e4c384d8..eade50d670 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -11,7 +11,7 @@ GVAR(nearUnits) = []; // @todo. Maybe move to common? [{ private "_nearUnits"; - _nearUnits = nearestObjects [positionCameraToWorld [0,0,0], ["CAManBase"], 50]; + _nearUnits = nearestObjects [positionCameraToWorld [0,0,0], ["CAManBase"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV if (count _nearUnits > 10) then { _nearUnits resize 10; @@ -24,3 +24,16 @@ GVAR(nearUnits) = []; addMissionEventHandler ["Draw3D", { call FUNC(onDraw); }]; + +// init keybinds +["ACE3", QGVAR(switchLaserLightMode), localize "STR_ACE_Laserpointer_switchLaserLight", +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + [ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode); + true +}, +{false}, [38, [false, true, false]], false] call CBA_fnc_addKeybind; diff --git a/addons/laserpointer/XEH_preInit.sqf b/addons/laserpointer/XEH_preInit.sqf index e7c74d3445..1460abda36 100644 --- a/addons/laserpointer/XEH_preInit.sqf +++ b/addons/laserpointer/XEH_preInit.sqf @@ -4,5 +4,6 @@ ADDON = false; PREP(drawLaserpoint); PREP(onDraw); +PREP(switchLaserLightMode); ADDON = true; diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp index b97587dac6..5ca5ce3470 100644 --- a/addons/laserpointer/config.cpp +++ b/addons/laserpointer/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {"ACE_acc_pointer_red","ACE_acc_pointer_green"}; + weapons[] = {"ACE_acc_pointer_red","ACE_acc_pointer_green","ACE_acc_pointer_green_IR"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"commy2"}; diff --git a/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf new file mode 100644 index 0000000000..f996d6b270 --- /dev/null +++ b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf @@ -0,0 +1,58 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_weapon"]; + +_unit = _this select 0; +_weapon = _this select 1; + +// 1 = primary, 2 = secondary, 3 = handgun +private "_currentWeaponType"; +_currentWeaponType = 0; + +private "_pointer"; +_pointer = switch (_weapon) do { + case (primaryWeapon _unit): { + _currentWeaponType = 1; + primaryWeaponItems _unit select 1 + }; + case (secondaryWeapon _unit): { + _currentWeaponType = 2; + secondaryWeaponItems _unit select 1 + }; + case (handgunWeapon _unit): { + _currentWeaponType = 3; + handgunItems _unit select 1 + }; + default {""}; +}; + +if (_pointer == "") exitWith {}; + +private "_nextPointer"; +_nextPointer = getText (configFile >> "CfgWeapons" >> _pointer >> "ACE_nextModeClass"); + +if (_nextPointer == "") exitWith {}; + +private ["_description", "_picture"]; + +_description = getText (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_modeDescription"); +_picture = getText (configFile >> "CfgWeapons" >> _nextPointer >> "picture"); + +switch (_currentWeaponType) do { + case 1: { + _unit removePrimaryWeaponItem _pointer; + _unit addPrimaryWeaponItem _nextPointer; + }; + case 2: { + _unit removeSecondaryWeaponItem _pointer; + _unit addSecondaryWeaponItem _nextPointer; + }; + case 3: { + _unit removeHandgunItem _pointer; + _unit addHandgunItem _nextPointer; + }; +}; + +[_description, _picture] call EFUNC(common,displayTextPicture); +playSound "ACE_Sound_Click"; diff --git a/addons/laserpointer/stringtable.xml b/addons/laserpointer/stringtable.xml index a5a153aca4..169b5bb059 100644 --- a/addons/laserpointer/stringtable.xml +++ b/addons/laserpointer/stringtable.xml @@ -36,5 +36,17 @@ <t color='#9cf953'>Использовать: </t>вкл/выкл лазер <t color='#9cf953'>Usar: </t>encender/apagar láser + + Laser + Laser + + + IR Laser + IR-Laser + + + Switch Laser / IR Laser + Umschalten Laser / IR-Laser + From 761fef39c8db08b3ab73f15b5794bca05e3455cc Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 13 Apr 2015 15:34:51 -0700 Subject: [PATCH 19/55] working save. --- .../functions/fnc_attackProfile_TOP.sqf | 53 ++++++++++++++++--- .../functions/fnc_guidancePFH.sqf | 14 +++-- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf index ef59890b99..fc9afed104 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf @@ -1,6 +1,11 @@ #define DEBUG_MODE_FULL #include "script_component.hpp" +#define STAGE_LAUNCH 1 +#define STAGE_CLIMB 2 +#define STAGE_COAST 3 +#define STAGE_TERMINAL 4 + EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; @@ -11,26 +16,60 @@ _target = _launchParams select 0; _targetLaunchParams = _launchParams select 1; _state = _this select 2; +if( (count _state) < 1) then { + _state set[0, STAGE_LAUNCH]; +}; _shooterPos = getPosASL _shooter; _projectilePos = getPosASL _projectile; _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; _distanceToShooter = _projectilePos vectorDistance _shooterPos; +_distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; TRACE_2("", _distanceToTarget, _distanceToShooter); // Add height depending on distance for compensate -_addHeight = [0,0,0]; +_returnTargetPos = _seekerTargetPos; - - -TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight); - - _returnTargetPos = _seekerTargetPos vectorAdd _addHeight; +switch( (_state select 0) ) do { + case STAGE_LAUNCH: { + TRACE_1("STAGE_LAUNCH",""); + if(_distanceToShooter < 10) then { + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + } else { + _state set[0, STAGE_CLIMB]; + }; + }; + case STAGE_CLIMB: { + TRACE_1("STAGE_CLIMB",""); + _cruisAlt = 140; + if(_distanceShooterToTarget < 1250) then { + _cruisAlt = 140 * (_distanceShooterToTarget/1250); + TRACE_1("_cruisAlt", _cruisAlt); + }; + + if( ((ASLToATL _projectilePos) select 2) - ((ASLToATL _seekerTargetPos) select 2) >= _cruisAlt) then { + _state set[0, STAGE_COAST]; + } else { + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + }; + }; + case STAGE_COAST: { + TRACE_1("STAGE_COAST",""); + if(_distanceShooterToTarget < 1250 || _distanceToTarget < ( ((ASLToATL _projectilePos) select 2) - (( ASLToATL _seekerTargetPos) select 2) )) then { + _state set[0, STAGE_TERMINAL]; + }; + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,(_projectilePos select 2)]; + }; + case STAGE_TERMINAL: { + TRACE_1("STAGE_TERMINAL",""); + + }; +}; #ifdef DEBUG_MODE_FULL -drawLine3D [(ASLtoATL _returnTargetPos) vectorAdd _addHeight, ASLtoATL _returnTargetPos, [0,1,0,1]]; +drawLine3D [(ASLtoATL _returnTargetPos), (ASLtoATL _seekerTargetPos), [0,1,0,1]]; #endif TRACE_1("Adjusted target position", _returnTargetPos); diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 8596e81924..7bba35ab71 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -5,7 +5,7 @@ private["_args", "_stateParams", "_launchParams", "_targetLaunchParams", "_config", "_flightParams", "_seekerParams", "_seekerTargetPos"]; private["_lastRunTime", "_runtimeDelta", "_profileAdjustedTargetPos", "_targetVectorSeeker", "_targetVector"]; -private["_minDeflection", "_maxDeflection", "_incDeflection"]; +private["_minDeflection", "_maxDeflection", "_incDeflection", "_adjustTime"]; private["_yVec", "_zVec", "_xVec"]; _args = _this select 0; @@ -21,10 +21,14 @@ _stateParams = _args select 4; _lastRunTime = _stateParams select 0; _runtimeDelta = diag_tickTime - _lastRunTime; -_adjustTime = 1/accTime; -_adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); -TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, (_runtimeDelta / TIMESTEP_FACTOR) ); - +_adjustTime = 1; +if(accTime > 0) then { + _adjustTime = 1/accTime; + _adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); + TRACE_4("Adjust timing", 1/accTime, _adjustTime, _runtimeDelta, (_runtimeDelta / TIMESTEP_FACTOR) ); +} else { + _adjustTime = 0; +}; _config = configFile >> "CfgAmmo" >> _ammo >> "ACE_MissileGuidance"; if(!alive _projectile || isNull _projectile || isNull _shooter) exitWith { From 22d90fee9a4a4b91c6789b3fc1e34e9bbdc5725b Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 13 Apr 2015 16:47:09 -0700 Subject: [PATCH 20/55] Begin modelToWorld work. --- .../functions/fnc_guidancePFH.sqf | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 7bba35ab71..5b69b2fd8c 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -1,4 +1,4 @@ -//#define DEBUG_MODE_FULL +#define DEBUG_MODE_FULL #include "script_component.hpp" #define TIMESTEP_FACTOR 0.01 @@ -44,15 +44,11 @@ if(!isNil "_seekerTargetPos") then { _minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; _maxDeflection = (_flightParams select 1) * _adjustTime; _incDeflection = _flightParams select 2; - - _yVec = vectorDir _projectile; - _zVec = vectorUp _projectile; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); _projectilePos = getPosASL _projectile; - _targetVectorSeeker = [_projectile, [_xVec, _yVec, _zVec], _profileAdjustedTargetPos] call EFUNC(common,translateToWeaponSpace); - _targetVector = [0,0,0] vectorFromTo _targetVectorSeeker; + _targetVector = _projectile worldToModelVisual _profileAdjustedTargetPos; + _targetVectorSeeker = [0,0,0] vectorFromTo _targetVector; TRACE_1("", _targetVectorSeeker, _targetVector); private["_yaw", "_pitch"]; @@ -73,25 +69,17 @@ if(!isNil "_seekerTargetPos") then { _pitch = ( (_minDeflection max ((_targetVector select 2) min _maxDeflection) ) ); }; }; - -#ifdef DEBUG_MODE_FULL - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _projectilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; - drawLine3D [ASLtoATL _projectilePos, ASLtoATL _profileAdjustedTargetPos, [1,0,0,1]]; -#endif - + if(accTime > 0) then { private["_outVector", "_vectorTo"]; - - // @TODO: Apply velocity multiplier to yaw/pitch. Basically, it can adjust faster at lower speeds - //_adjustDeflection = (vectorMagnitude velocity _projectile); - - _outVector = [_projectile, [_xVec, _yVec, _zVec], [_yaw, 1, _pitch]] call EFUNC(common,translateToModelSpace); - _vectorTo = _projectilePos vectorFromTo _outVector; - - _projectile setVectorDirAndUp [_vectorTo, vectorUp _projectile]; + _finalVector = _projectilePos vectorFromTo _profileAdjustedTargetPos; + _projectile setVectorDirAndUp [_finalVector, vectorUp _projectile]; }; #ifdef DEBUG_MODE_FULL + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _projectilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; + drawLine3D [ASLtoATL _projectilePos, ASLtoATL _profileAdjustedTargetPos, [1,0,0,1]]; + hintSilent format["d: %1", _distanceToTarget]; #endif }; From 83ce3fa2bda08c8a7fe0342a40a611292046483b Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 14 Apr 2015 13:14:37 +0200 Subject: [PATCH 21/55] remove drawline3d --- .../functions/fnc_drawLaserpoint.sqf | 31 ++++++++++++++----- addons/laserpointer/functions/fnc_onDraw.sqf | 2 +- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 82b989e470..93a421a094 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -1,6 +1,19 @@ // by commy2 and esteldunedain #include "script_component.hpp" +// init object +/*if (isNil QGVAR(laserdot)) then { + _light = "#lightpoint" createVehicleLocal [0,0,0]; + _light setLightBrightness 10; + _light setLightColor [1,0,0]; + _light setLightAmbient [1,0,0]; + _light setLightDayLight true; + //_light lightAttachObject [GVAR(laserdot), [0,0,0]]; + _light setLightAttenuation [0.04,4,4,0,0.04,0.08]; + + GVAR(laserdot) = _light; +};*/ + EXPLODE_3_PVT(_this,_unit,_range,_isGreen); _p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand"); @@ -97,15 +110,15 @@ if (!surfaceIsWater _pL) then { _pL = ASLtoATL _pL; }; -if (call EFUNC(common,ambientBrightness) < 0.2) then { - drawLine3D [ - _p0Pos, - _pL, - [[1,0,0,1], [0,1,0,1]] select _isGreen - ]; -}; +/* +drawLine3D [ + _p0Pos, + _pL, + [[1,0,0,1], [0,1,0,1]] select _isGreen +]; +*/ -_size = 2 * (_range - (positionCameraToWorld [0,0,0] distance _pL)) / _range; +_size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range; _camPos = positionCameraToWorld [0,0,0.2]; if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; @@ -116,6 +129,8 @@ if (!surfaceIsWater _camPos) then { _camPos = ATLtoASL _camPos; }; if ( terrainIntersectASL [_camPos, _pL2]) exitWith {}; if ( lineIntersects [_camPos, _pL2]) exitWith {}; +//GVAR(laserdot) setPos _pL; + drawIcon3D [ format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], [[1,0.25,0.25,0.5*_brightness], [0.25,1,0.25,0.5*_brightness]] select _isGreen, diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index 6fa7275531..0e4ddf981a 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -28,7 +28,7 @@ _isIR = _isIR == 1; _laserID = ["ACE_acc_pointer_red", "ACE_acc_pointer_green"] find _laser; if (_laserID > -1 && {_x isFlashlightOn _weapon}) then { - [_x, 30, _laserID == 1 || _isIR] call FUNC(drawLaserpoint); + [_x, 50, _laserID == 1 || _isIR] call FUNC(drawLaserpoint); }; } forEach GVAR(nearUnits); From f89e02a5ca15b9ea2aba1e9c008357c389d78c9c Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 14 Apr 2015 13:24:17 +0200 Subject: [PATCH 22/55] fix no laser in ffv slots --- addons/laserpointer/XEH_postInit.sqf | 26 ++++++++++---------------- addons/laserpointer/initKeybinds.sqf | 13 +++++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 addons/laserpointer/initKeybinds.sqf diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index eade50d670..38fc35f262 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -11,11 +11,16 @@ GVAR(nearUnits) = []; // @todo. Maybe move to common? [{ private "_nearUnits"; - _nearUnits = nearestObjects [positionCameraToWorld [0,0,0], ["CAManBase"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV + _nearUnits = []; - if (count _nearUnits > 10) then { - _nearUnits resize 10; - }; + { + _nearUnits append crew _x; + + if (count _nearUnits > 10) exitWith { + _nearUnits resize 10; + }; + + } forEach nearestObjects [positionCameraToWorld [0,0,0], ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV GVAR(nearUnits) = _nearUnits; @@ -25,15 +30,4 @@ addMissionEventHandler ["Draw3D", { call FUNC(onDraw); }]; -// init keybinds -["ACE3", QGVAR(switchLaserLightMode), localize "STR_ACE_Laserpointer_switchLaserLight", -{ - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; - - [ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode); - true -}, -{false}, [38, [false, true, false]], false] call CBA_fnc_addKeybind; +#include "initKeybinds.sqf" diff --git a/addons/laserpointer/initKeybinds.sqf b/addons/laserpointer/initKeybinds.sqf new file mode 100644 index 0000000000..04516f0757 --- /dev/null +++ b/addons/laserpointer/initKeybinds.sqf @@ -0,0 +1,13 @@ +// by commy2 + +["ACE3", QGVAR(switchLaserLightMode), localize "STR_ACE_Laserpointer_switchLaserLight", +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + [ACE_player, currentWeapon ACE_player] call FUNC(switchLaserLightMode); + true +}, +{false}, [38, [false, true, false]], false] call CBA_fnc_addKeybind; From 376f9249990c3308892ec2523e7f8ec1a0da949f Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 08:24:13 -0700 Subject: [PATCH 23/55] Finish guidance rewrite. --- addons/missileguidance/CfgAmmo.hpp | 10 +- .../functions/fnc_attackProfile_DIR.sqf | 52 +++++++- .../missileguidance/functions/fnc_fired.sqf | 2 +- .../functions/fnc_guidancePFH.sqf | 124 ++++++++++-------- 4 files changed, 125 insertions(+), 63 deletions(-) diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 050a23f5fd..7ad1be1fd5 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -40,12 +40,12 @@ class CfgAmmo { trackLead = 0; // Begin ACE guidance Configs - class ACE_MissileGuidance { + class ADDON { enabled = 1; - minDeflection = 0.005; // Minium flap deflection for guidance - maxDeflection = 0.025; // Maximum flap deflection for guidance - incDeflection = 0.005; // The incrmeent in which deflection adjusts. + minDeflection = 0.0005; // Minium flap deflection for guidance + maxDeflection = 0.0025; // Maximum flap deflection for guidance + incDeflection = 0.0005; // The incrmeent in which deflection adjusts. //minDeflection = 0.005; //maxDeflection = 0.5; //incDeflection = 0.005; @@ -110,7 +110,7 @@ class CfgAmmo { //trackLead = 0; // Begin ACE guidance Configs - class ACE_MissileGuidance { + class ADDON { enabled = 1; minDeflection = 0.005; // Minium flap deflection for guidance diff --git a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf index 498b754287..90ec75ad7f 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf @@ -1,4 +1,54 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -_this call FUNC(attackProfile_LIN); \ No newline at end of file +EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; +private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos"]; +_seekerTargetPos = _this select 0; +_launchParams = _this select 1; + +_target = _launchParams select 0; +_targetLaunchParams = _launchParams select 1; + +_shooterPos = getPosASL _shooter; +_projectilePos = getPosASL _projectile; + +_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; +_distanceToShooter = _projectilePos vectorDistance _shooterPos; + +TRACE_2("", _distanceToTarget, _distanceToShooter); + +// Add height depending on distance for compensate +_addHeight = [0,0,0]; + +// Always climb an arc on initial launch if we are close to the round +if( ((ASLtoATL _projectilePos) select 2) < 5 && _distanceToShooter < 15) then { + _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; +} else { + // If we are below the target, increase the climbing arc + if((_projectilePos select 2) < (_seekerTargetPos select 2) && _distanceToTarget > 100) then { + _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; + }; +}; + +// Handle arcing terminal low for high decent +if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 100) then { + _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.5]; +} else { + if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 100) then { + _addHeight = _addHeight vectorAdd [0,0, _distanceToTarget*0.02]; + }; +}; + + + +TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight); + + _returnTargetPos = _seekerTargetPos vectorAdd _addHeight; + +#ifdef DEBUG_MODE_FULL +drawLine3D [(ASLtoATL _returnTargetPos) vectorAdd _addHeight, ASLtoATL _returnTargetPos, [0,1,0,1]]; +#endif + +TRACE_1("Adjusted target position", _returnTargetPos); +_returnTargetPos; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_fired.sqf b/addons/missileguidance/functions/fnc_fired.sqf index 0622ac9342..8b90b2353f 100644 --- a/addons/missileguidance/functions/fnc_fired.sqf +++ b/addons/missileguidance/functions/fnc_fired.sqf @@ -13,7 +13,7 @@ PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); // Bail on not missile if(! (_ammo isKindOf "MissileBase") ) exitWith { false }; -_config = configFile >> "CfgAmmo" >> _ammo >> "ACE_MissileGuidance"; +_config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON); _enabled = getNumber ( _config >> "enabled"); // Bail if guidance is not enabled diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 5b69b2fd8c..a461cf9163 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -1,16 +1,20 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" #define TIMESTEP_FACTOR 0.01 -private["_args", "_stateParams", "_launchParams", "_targetLaunchParams", "_config", "_flightParams", "_seekerParams", "_seekerTargetPos"]; -private["_lastRunTime", "_runtimeDelta", "_profileAdjustedTargetPos", "_targetVectorSeeker", "_targetVector"]; -private["_minDeflection", "_maxDeflection", "_incDeflection", "_adjustTime"]; -private["_yVec", "_zVec", "_xVec"]; - +private["_launchParams", "_targetLaunchParams", "_flightParams", "_seekerParams", "_stateParams"]; +private["_lastRunTime", "_runtimeDelta", "_adjustTime", "_args", "_seekerTargetPos", "_projectilePos"]; +private["_profileAdjustedTargetPos", "_incDeflection", "_minDeflection", "_maxDeflection"]; +private["_targetVector", "_adjustVector", "_finalAdjustVector", "_changeVector", "_pitch", "_yaw", "_roll"]; + _args = _this select 0; EXPLODE_7_PVT((_args select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +if(!alive _projectile || isNull _projectile || isNull _shooter) exitWith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; +}; + _launchParams = _args select 1; _targetLaunchParams = _launchParams select 1; _flightParams = _args select 2; @@ -19,9 +23,9 @@ _seekerParams = _args select 3; _stateParams = _args select 4; _lastRunTime = _stateParams select 0; - _runtimeDelta = diag_tickTime - _lastRunTime; _adjustTime = 1; + if(accTime > 0) then { _adjustTime = 1/accTime; _adjustTime = _adjustTime * (_runtimeDelta / TIMESTEP_FACTOR); @@ -29,61 +33,69 @@ if(accTime > 0) then { } else { _adjustTime = 0; }; -_config = configFile >> "CfgAmmo" >> _ammo >> "ACE_MissileGuidance"; -if(!alive _projectile || isNull _projectile || isNull _shooter) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; -}; +_minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; +_maxDeflection = (_flightParams select 1) * _adjustTime; +_incDeflection = _flightParams select 2; -// TODO: placeholder for "last seek target position" +_projectilePos = getPosASL _projectile; + +// @TODO: placeholder for "last seek target position" +// Last target pos should be optional based on the seeker unit _seekerTargetPos = [ [0,0,0], _args, (_stateParams select 1)] call FUNC(doSeekerSearch); -if(!isNil "_seekerTargetPos") then { - - _profileAdjustedTargetPos = [_seekerTargetPos,_args, (_stateParams select 2)] call FUNC(doAttackProfile); - - _minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0; - _maxDeflection = (_flightParams select 1) * _adjustTime; - _incDeflection = _flightParams select 2; - - _projectilePos = getPosASL _projectile; - - _targetVector = _projectile worldToModelVisual _profileAdjustedTargetPos; - _targetVectorSeeker = [0,0,0] vectorFromTo _targetVector; - TRACE_1("", _targetVectorSeeker, _targetVector); - - private["_yaw", "_pitch"]; - _yaw = 0; - _pitch = 0; - - if((_targetVectorSeeker select 0) < 0) then { - _yaw = - ( (_minDeflection max (abs(_targetVector select 0) min _maxDeflection) ) ); - } else { - if((_targetVectorSeeker select 0) > 0) then { - _yaw = ( (_minDeflection max ((_targetVector select 0) min _maxDeflection) ) ); - }; +if(isNil "_seekerTargetPos") then { + _seekerTargetPos = _seekerTargetPos vectorAdd ((velocity _projectile) vectorMultiply 5); +} else { + if( (vectorMagnitude _seekerTargetPos) == 0) then { + _seekerTargetPos = _seekerTargetPos vectorAdd ((velocity _projectile) vectorMultiply 5); }; - if((_targetVectorSeeker select 2) < 0) then { - _pitch = - ( (_minDeflection max (abs(_targetVector select 2) min _maxDeflection) ) ); - } else { - if((_targetVectorSeeker select 2) > 0) then { - _pitch = ( (_minDeflection max ((_targetVector select 2) min _maxDeflection) ) ); - }; - }; - - if(accTime > 0) then { - private["_outVector", "_vectorTo"]; - _finalVector = _projectilePos vectorFromTo _profileAdjustedTargetPos; - _projectile setVectorDirAndUp [_finalVector, vectorUp _projectile]; - }; - -#ifdef DEBUG_MODE_FULL - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _projectilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; - drawLine3D [ASLtoATL _projectilePos, ASLtoATL _profileAdjustedTargetPos, [1,0,0,1]]; - - hintSilent format["d: %1", _distanceToTarget]; -#endif }; +_profileAdjustedTargetPos = [_seekerTargetPos,_args, (_stateParams select 2)] call FUNC(doAttackProfile); +_targetVector = _projectilePos vectorFromTo _profileAdjustedTargetPos; +_adjustVector = _targetVector vectorDiff (vectorDir _projectile); + +_yaw = 0; +_pitch = 0; +_roll = 0; +if((_adjustVector select 0) < 0) then { + _yaw = - ( (_minDeflection max (abs(_adjustVector select 0) min _maxDeflection) ) ); +} else { + if((_adjustVector select 0) > 0) then { + _yaw = ( (_minDeflection max ((_adjustVector select 0) min _maxDeflection) ) ); + }; +}; +if((_adjustVector select 1) < 0) then { + _roll = - ( (_minDeflection max (abs(_adjustVector select 1) min _maxDeflection) ) ); +} else { + if((_adjustVector select 1) > 0) then { + _roll = ( (_minDeflection max ((_adjustVector select 1) min _maxDeflection) ) ); + }; +}; +if((_adjustVector select 2) < 0) then { + _pitch = - ( (_minDeflection max (abs(_adjustVector select 2) min _maxDeflection) ) ); +} else { + if((_adjustVector select 2) > 0) then { + _pitch = ( (_minDeflection max ((_adjustVector select 2) min _maxDeflection) ) ); + }; +}; +_finalAdjustVector = [_yaw, _roll, _pitch]; +TRACE_2("", _pitch, _yaw); +TRACE_4("", _targetVector, _targetRelativeVector, _adjustVector, _finalAdjustVector); + +if(accTime > 0) then { + _changeVector = (vectorDir _projectile) vectorAdd _finalAdjustVector; + //_changeVector = (vectorDir _projectile) vectorAdd _adjustVector; // Test direct to target + _projectile setVectorDirAndUp [_changeVector, vectorUp _projectile]; +}; + +#ifdef DEBUG_MODE_FULL +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _projectilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; +drawLine3D [ASLtoATL _projectilePos, ASLtoATL _profileAdjustedTargetPos, [1,0,0,1]]; + +hintSilent format["d: %1", _distanceToTarget]; +#endif + _stateParams set[0, diag_tickTime]; _args set[4, _stateParams]; From c436541f1c163eaca68380cf007e01b805dc74a7 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 09:36:39 -0700 Subject: [PATCH 24/55] Reworked, fun fun. --- addons/missileguidance/CfgAmmo.hpp | 10 +++++----- addons/missileguidance/XEH_pre_init.sqf | 1 + .../functions/fnc_attackProfile_TOP.sqf | 4 ++-- .../functions/fnc_changeMissileDirection.sqf | 11 +++++++++++ addons/missileguidance/functions/fnc_guidancePFH.sqf | 3 +-- 5 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 addons/missileguidance/functions/fnc_changeMissileDirection.sqf diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 7ad1be1fd5..ebff1a65ae 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -43,8 +43,8 @@ class CfgAmmo { class ADDON { enabled = 1; - minDeflection = 0.0005; // Minium flap deflection for guidance - maxDeflection = 0.0025; // Maximum flap deflection for guidance + minDeflection = 0.00025; // Minium flap deflection for guidance + maxDeflection = 0.00025; // Maximum flap deflection for guidance incDeflection = 0.0005; // The incrmeent in which deflection adjusts. //minDeflection = 0.005; //maxDeflection = 0.5; @@ -113,9 +113,9 @@ class CfgAmmo { class ADDON { enabled = 1; - minDeflection = 0.005; // Minium flap deflection for guidance - maxDeflection = 0.25; // Maximum flap deflection for guidance - incDeflection = 0.005; // The incrmeent in which deflection adjusts. + minDeflection = 0.00005; // Minium flap deflection for guidance + maxDeflection = 0.025; // Maximum flap deflection for guidance + incDeflection = 0.00005; // The incrmeent in which deflection adjusts. //minDeflection = 0.005; //maxDeflection = 0.5; //incDeflection = 0.005; diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index 403d6245ca..4a5beaa329 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -2,6 +2,7 @@ PREP(rotateVectLineGetMap); PREP(rotateVectLine); +PREP(changeMissileDirection); PREP(checkSeekerAngle); PREP(checkLos); diff --git a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf index fc9afed104..4e83e046ff 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf @@ -1,4 +1,4 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" #define STAGE_LAUNCH 1 @@ -64,7 +64,7 @@ switch( (_state select 0) ) do { }; case STAGE_TERMINAL: { TRACE_1("STAGE_TERMINAL",""); - + //_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.02]; }; }; diff --git a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf new file mode 100644 index 0000000000..fda7ba9d07 --- /dev/null +++ b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" +private ["_projectile", "_v", "_l", "_r"]; + +_projectile = _this select 0; +_v = _this select 1; + +_l = sqrt ((_v select 0) ^ 2 + (_v select 1) ^ 2); +_r = -(_v select 2) / _l; + +_projectile setVectorDirAndUp [ _v, [(_v select 0) * _r,(_v select 1) * _r, _l] ]; +_projectile setVelocity (_v vectorMultiply (vectorMagnitude (velocity _projectile))); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index a461cf9163..f7fd56c164 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -85,8 +85,7 @@ TRACE_4("", _targetVector, _targetRelativeVector, _adjustVector, _finalAdjustVec if(accTime > 0) then { _changeVector = (vectorDir _projectile) vectorAdd _finalAdjustVector; - //_changeVector = (vectorDir _projectile) vectorAdd _adjustVector; // Test direct to target - _projectile setVectorDirAndUp [_changeVector, vectorUp _projectile]; + [_projectile, _changeVector] call FUNC(changeMissileDirection); }; #ifdef DEBUG_MODE_FULL From 6f3ce278942a40cfa80f6ab007e03427f6bf6605 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 10:25:08 -0700 Subject: [PATCH 25/55] Javelin refined, working, locking fixes, UI fixes, missile guidance rewrite --- addons/javelin/RscInGameUI.hpp | 44 ++++-------- .../javelin/functions/fnc_cycleFireMode.sqf | 8 +-- addons/javelin/functions/fnc_onOpticDraw.sqf | 30 +++++--- addons/javelin/script_component.hpp | 2 +- addons/missileguidance/ACE_GuidanceConfig.hpp | 8 +-- addons/missileguidance/CfgAmmo.hpp | 4 +- addons/missileguidance/XEH_pre_init.sqf | 6 +- .../functions/fnc_attackProfile_AIR.sqf | 52 +------------- .../functions/fnc_attackProfile_DIR.sqf | 52 +------------- .../functions/fnc_attackProfile_JAV_DIR.sqf | 69 +++++++++++++++++++ ..._TOP.sqf => fnc_attackProfile_JAV_TOP.sqf} | 0 .../functions/fnc_attackProfile_LIN.sqf | 6 -- .../functions/fnc_attackProfile_PYM.sqf | 4 -- .../functions/fnc_checkSeekerAngle.sqf | 2 +- 14 files changed, 121 insertions(+), 166 deletions(-) create mode 100644 addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf rename addons/missileguidance/functions/{fnc_attackProfile_TOP.sqf => fnc_attackProfile_JAV_TOP.sqf} (100%) delete mode 100644 addons/missileguidance/functions/fnc_attackProfile_PYM.sqf diff --git a/addons/javelin/RscInGameUI.hpp b/addons/javelin/RscInGameUI.hpp index 8c73f3d8d1..8b33c95c01 100644 --- a/addons/javelin/RscInGameUI.hpp +++ b/addons/javelin/RscInGameUI.hpp @@ -12,20 +12,10 @@ class RscLine; class RscInGameUI { class ACE_RscOptics_javelin { idd = 300; - controls[] = { "ACE_javelin_elements_group", "CA_Distance", "ACE_Targeting" }; //, "ACE_TargetingConstrains", "ACE_TargetingGate", "ACE_TargetingLines"}; + controls[] = { "ACE_javelin_elements_group", "ACE_Targeting" }; //, "ACE_TargetingConstrains", "ACE_TargetingGate", "ACE_TargetingLines"}; onLoad = QUOTE(_this call FUNC(onOpticLoad)); onUnload = "uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];uiNameSpace setVariable ['ACE_RscOptics_javelin_PFH',nil];"; - class CA_Distance: RscOpticsValue { - 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"; @@ -45,6 +35,16 @@ class RscInGameUI { height = 0.001; }; class Controls { + class CA_Distance: RscOpticsValue { + idc = 151; + sizeEx = "0"; + colorText[] = {0,0,0,0}; + x = 0; + y = 0; + w = 0; + h = 0; + }; + class ACE_javelin_Day_mode_off: RscPicture { idc = 1001; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX"; @@ -58,7 +58,7 @@ class RscInGameUI { idc = 160; colorText[] = {0.2941,0.8745,0.2157,1}; }; - class ACE_javelin_WFOV_mode_off: ACE_javelin_Day_mode_off { + class CA_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"; @@ -81,13 +81,6 @@ class RscInGameUI { 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"; @@ -130,10 +123,10 @@ class RscInGameUI { h = 0; colorText[] = {0.2941,0.8745,0.2157,1}; }; - */ + }; }; - class ACE_javelin_NFOV_mode_off: ACE_javelin_Day_mode_off { + class CA_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"; @@ -156,13 +149,6 @@ class RscInGameUI { 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"; @@ -205,7 +191,7 @@ class RscInGameUI { h = "0.1895*SafezoneH"; colorText[] = {0.2941,0.8745,0.2157,1}; }; - */ + }; }; diff --git a/addons/javelin/functions/fnc_cycleFireMode.sqf b/addons/javelin/functions/fnc_cycleFireMode.sqf index 4fed8e05cc..2245bb71e5 100644 --- a/addons/javelin/functions/fnc_cycleFireMode.sqf +++ b/addons/javelin/functions/fnc_cycleFireMode.sqf @@ -4,10 +4,10 @@ TRACE_1("enter", _this); private["_player", "_currentFireMode"]; -_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "TOP"]; -if(_currentFireMode == "LIN") then { - _currentFireMode = "TOP"; +_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"]; +if(_currentFireMode == "JAV_DIR") then { + _currentFireMode = "JAV_TOP"; } else { - _currentFireMode = "LIN"; + _currentFireMode = "JAV_DIR"; }; ACE_player setVariable["ace_missileguidance_attackProfile", _currentFireMode, false]; diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 1694702f98..049a3f8843 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -3,9 +3,8 @@ TRACE_1("enter", _this); #define __TRACKINTERVAL 0 // how frequent the check should be. -#define __LOCKONTIME 3.0 // 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 __LOCKONTIME 3 // Lock on won't occur sooner +#define __LOCKONTIMERANDOM 2 // Deviation in lock on time #define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5 #define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5 @@ -113,10 +112,11 @@ if (isNull _newTarget) then { __JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false; - ACE_player setVariable ["ace_missileguidance_target",nil, false]; + ACE_player setVariable ["ace_missileguidance_target",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 (currentWeapon ACE_player) > 0) then { ACE_player setWeaponReloadingTime [player, (currentWeapon ACE_player), 0.2]; }; + } else { if (_newTarget distance ACE_player < 2500 && {(call CBA_fnc_getFoV) select 1 > 9} @@ -131,7 +131,7 @@ if (isNull _newTarget) then { playSound "ACE_Javelin_Locking"; } else { - if(diag_tickTime - _lockTime > __LOCKONTIME) then { + if(diag_tickTime - _lockTime > __LOCKONTIME + (random __LOCKONTIMERANDOM)) then { TRACE_2("LOCKED!", _currentTarget, _lockTime); __JavelinIGUISeek ctrlSetTextColor __ColorGreen; @@ -170,6 +170,9 @@ if (isNull _newTarget) then { ACE_player setVariable["ace_missileguidance_target", _currentTarget, false]; + // Allow fire + ACE_player setWeaponReloadingTime [player, (currentWeapon ACE_player), 0]; + if(diag_tickTime > _soundTime) then { playSound "ACE_Javelin_Locked"; _soundTime = diag_tickTime + 0.25; @@ -208,21 +211,26 @@ if (isNull _newTarget) then { playSound "ACE_Javelin_Locking"; _soundTime = diag_tickTime + 0.25; }; + // Disallow fire + if (ACE_player ammo (currentWeapon ACE_player) > 0) then { ACE_player setWeaponReloadingTime [player, (currentWeapon ACE_player), 0.2]; }; }; }; } else { - // Something is wrong with our seek + // No targets found _currentTarget = objNull; - ACE_player setVariable["ace_missileguidance_target", nil, false]; + _lockTime = 0; __JavelinIGUISeek ctrlSetTextColor __ColorGray; __JavelinIGUITargeting ctrlShow false; __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; - + __JavelinIGUITargetingConstraints ctrlShow false; + ACE_player setVariable ["ace_missileguidance_target",nil, false]; - }; - + + // Disallow fire + if (ACE_player ammo (currentWeapon ACE_player) > 0) then { ACE_player setWeaponReloadingTime [player, (currentWeapon ACE_player), 0.2]; }; + }; }; //TRACE_2("", _newTarget, _currentTarget); diff --git a/addons/javelin/script_component.hpp b/addons/javelin/script_component.hpp index e313bf8347..7234a1e3d4 100644 --- a/addons/javelin/script_component.hpp +++ b/addons/javelin/script_component.hpp @@ -24,7 +24,7 @@ #define __JavelinIGUISeek (__JavelinIGUI displayCtrl 699000) #define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001) #define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002) -#define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 699003) +#define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 1003) #define __JavelinIGUIWFOV (__JavelinIGUI displayCtrl 1004) #define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151) diff --git a/addons/missileguidance/ACE_GuidanceConfig.hpp b/addons/missileguidance/ACE_GuidanceConfig.hpp index 4c0122c8e4..f3434fef9b 100644 --- a/addons/missileguidance/ACE_GuidanceConfig.hpp +++ b/addons/missileguidance/ACE_GuidanceConfig.hpp @@ -27,19 +27,19 @@ class GVAR(AttackProfiles) { functionName = QFUNC(attackProfile_HI); }; - class TOP { + class JAV_DIR { name = ""; visualName = ""; description = ""; - functionName = QFUNC(attackProfile_TOP); + functionName = QFUNC(attackProfile_JAV_DIR); }; - class PYM { + class JAV_TOP { name = ""; visualName = ""; description = ""; - functionName = QFUNC(attackProfile_PYM); + functionName = QFUNC(attackProfile_JAV_TOP); }; }; diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index ebff1a65ae..15782c0c49 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -134,8 +134,8 @@ class CfgAmmo { seekerMaxRange = 2500; // Range from the missile which the seeker can visually search // Attack profile type selection - defaultAttackProfile = "TOP"; - attackProfiles[] = { "TOP", "LIN" }; + defaultAttackProfile = "JAV_TOP"; + attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; }; }; }; \ No newline at end of file diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index 4a5beaa329..8d277bc3b0 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -18,10 +18,12 @@ PREP(attackProfile_LIN); PREP(attackProfile_DIR); PREP(attackProfile_MID); PREP(attackProfile_HI); -PREP(attackProfile_TOP); -PREP(attackprofile_PYM); PREP(attackProfile_AIR); +// Javelin profiles +PREP(attackProfile_JAV_DIR); +PREP(attackProfile_JAV_TOP); + // Seeker search functions PREP(seekerType_SALH); PREP(seekerType_Optic); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_AIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_AIR.sqf index d416b6a9e2..498b754287 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_AIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_AIR.sqf @@ -1,54 +1,4 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos"]; -_seekerTargetPos = _this select 0; -_launchParams = _this select 1; - -_target = _launchParams select 0; -_targetLaunchParams = _launchParams select 1; - -_shooterPos = getPosASL _shooter; -_projectilePos = getPosASL _projectile; - -_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; -_distanceToShooter = _projectilePos vectorDistance _shooterPos; - -TRACE_2("", _distanceToTarget, _distanceToShooter); - -// Add height depending on distance for compensate -_addHeight = [0,0,0]; - -// Always climb an arc on initial launch if we are close to the round -if( ((ASLtoATL _projectilePos) select 2) < 5 && _distanceToShooter < 15) then { - _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; -} else { - // If we are below the target, increase the climbing arc - if((_projectilePos select 2) < (_seekerTargetPos select 2) && _distanceToTarget > 100) then { - _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; - }; -}; - -// Handle arcing terminal low for high decent -if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 100) then { - _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2))]; -} else { - if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 100) then { - _addHeight = _addHeight vectorAdd [0,0, _distanceToTarget]; - }; -}; - - - -TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight); - - _returnTargetPos = _seekerTargetPos vectorAdd _addHeight; - -#ifdef DEBUG_MODE_FULL -drawLine3D [(ASLtoATL _returnTargetPos) vectorAdd _addHeight, ASLtoATL _returnTargetPos, [0,1,0,1]]; -#endif - -TRACE_1("Adjusted target position", _returnTargetPos); -_returnTargetPos; \ No newline at end of file +_this call FUNC(attackProfile_LIN); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf index 90ec75ad7f..498b754287 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf @@ -1,54 +1,4 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos"]; -_seekerTargetPos = _this select 0; -_launchParams = _this select 1; - -_target = _launchParams select 0; -_targetLaunchParams = _launchParams select 1; - -_shooterPos = getPosASL _shooter; -_projectilePos = getPosASL _projectile; - -_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; -_distanceToShooter = _projectilePos vectorDistance _shooterPos; - -TRACE_2("", _distanceToTarget, _distanceToShooter); - -// Add height depending on distance for compensate -_addHeight = [0,0,0]; - -// Always climb an arc on initial launch if we are close to the round -if( ((ASLtoATL _projectilePos) select 2) < 5 && _distanceToShooter < 15) then { - _addHeight = _addHeight vectorAdd [0,0,_distanceToTarget]; -} else { - // If we are below the target, increase the climbing arc - if((_projectilePos select 2) < (_seekerTargetPos select 2) && _distanceToTarget > 100) then { - _addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))]; - }; -}; - -// Handle arcing terminal low for high decent -if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 100) then { - _addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.5]; -} else { - if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 100) then { - _addHeight = _addHeight vectorAdd [0,0, _distanceToTarget*0.02]; - }; -}; - - - -TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight); - - _returnTargetPos = _seekerTargetPos vectorAdd _addHeight; - -#ifdef DEBUG_MODE_FULL -drawLine3D [(ASLtoATL _returnTargetPos) vectorAdd _addHeight, ASLtoATL _returnTargetPos, [0,1,0,1]]; -#endif - -TRACE_1("Adjusted target position", _returnTargetPos); -_returnTargetPos; \ No newline at end of file +_this call FUNC(attackProfile_LIN); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf new file mode 100644 index 0000000000..da01b7d900 --- /dev/null +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -0,0 +1,69 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +#define STAGE_LAUNCH 1 +#define STAGE_CLIMB 2 +#define STAGE_COAST 3 +#define STAGE_TERMINAL 4 + +EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; +private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; +_seekerTargetPos = _this select 0; +_launchParams = _this select 1; + +_target = _launchParams select 0; +_targetLaunchParams = _launchParams select 1; + +_state = _this select 2; +if( (count _state) < 1) then { + _state set[0, STAGE_LAUNCH]; +}; + +_shooterPos = getPosASL _shooter; +_projectilePos = getPosASL _projectile; + +_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; +_distanceToShooter = _projectilePos vectorDistance _shooterPos; +_distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; + +TRACE_2("", _distanceToTarget, _distanceToShooter); + +// Add height depending on distance for compensate +_returnTargetPos = _seekerTargetPos; + +switch( (_state select 0) ) do { + case STAGE_LAUNCH: { + TRACE_1("STAGE_LAUNCH",""); + if(_distanceToShooter < 10) then { + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + } else { + _state set[0, STAGE_CLIMB]; + }; + }; + case STAGE_CLIMB: { + TRACE_1("STAGE_CLIMB",""); + _cruisAlt = 60; + if(_distanceShooterToTarget < w) then { + _cruisAlt = 60 * (_distanceShooterToTarget/2000); + TRACE_1("_cruisAlt", _cruisAlt); + }; + + if( ((ASLToATL _projectilePos) select 2) - ((ASLToATL _seekerTargetPos) select 2) >= _cruisAlt) then { + _state set[0, STAGE_TERMINAL]; + } else { + _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; + }; + }; + case STAGE_TERMINAL: { + TRACE_1("STAGE_TERMINAL",""); + //_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.02]; + }; +}; + +#ifdef DEBUG_MODE_FULL +drawLine3D [(ASLtoATL _returnTargetPos), (ASLtoATL _seekerTargetPos), [0,1,0,1]]; +#endif + +TRACE_1("Adjusted target position", _returnTargetPos); +_returnTargetPos; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf similarity index 100% rename from addons/missileguidance/functions/fnc_attackProfile_TOP.sqf rename to addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index 90ec75ad7f..bd2998995f 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -40,12 +40,6 @@ if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget }; }; - - -TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight); - - _returnTargetPos = _seekerTargetPos vectorAdd _addHeight; - #ifdef DEBUG_MODE_FULL drawLine3D [(ASLtoATL _returnTargetPos) vectorAdd _addHeight, ASLtoATL _returnTargetPos, [0,1,0,1]]; #endif diff --git a/addons/missileguidance/functions/fnc_attackProfile_PYM.sqf b/addons/missileguidance/functions/fnc_attackProfile_PYM.sqf deleted file mode 100644 index 498b754287..0000000000 --- a/addons/missileguidance/functions/fnc_attackProfile_PYM.sqf +++ /dev/null @@ -1,4 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" - -_this call FUNC(attackProfile_LIN); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf index 7308ce1723..d85cb01fcd 100644 --- a/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf +++ b/addons/missileguidance/functions/fnc_checkSeekerAngle.sqf @@ -12,7 +12,7 @@ * Boolean */ - #define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" private["_seeker", "_targetPos", "_seekerMaxAngle", "_vectorTo", "_sensorPos", "_vertOk", "_horzOk", "_dir", "_headingPitch"]; From f0940707be43ace67d411de333c1c90c904b5db3 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 10:27:37 -0700 Subject: [PATCH 26/55] Disable locking on unloaded. Closes #539 --- addons/javelin/functions/fnc_onOpticDraw.sqf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 049a3f8843..e9d3e304ad 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -51,6 +51,10 @@ if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && // Refresh the firemode [] call FUNC(showFireMode); + +// bail on not loaded +if (ACE_player ammo (currentWeapon ACE_player) == 0) exitWith { }; + _range = parseNumber (ctrlText __JavelinIGUIRangefinder); TRACE_1("Viewing range", _range); if (_range > 50 && {_range < 2500}) then { From fb5b524023294814365ef072fbb88594628c50e3 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 10:39:00 -0700 Subject: [PATCH 27/55] Loosen DAGR curve --- addons/missileguidance/CfgAmmo.hpp | 4 ++-- addons/missileguidance/functions/fnc_attackProfile_LIN.sqf | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 15782c0c49..a05ecee9bc 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -44,7 +44,7 @@ class CfgAmmo { enabled = 1; minDeflection = 0.00025; // Minium flap deflection for guidance - maxDeflection = 0.00025; // Maximum flap deflection for guidance + maxDeflection = 0.001; // Maximum flap deflection for guidance incDeflection = 0.0005; // The incrmeent in which deflection adjusts. //minDeflection = 0.005; //maxDeflection = 0.5; @@ -65,7 +65,7 @@ class CfgAmmo { // Attack profile type selection defaultAttackProfile = "LIN"; - attackProfiles[] = { "LIN", "DIR", "MID", "HI", "TOP", "PYM" }; + attackProfiles[] = { "LIN", "DIR", "MID", "HI" }; }; }; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index bd2998995f..032ae51791 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -16,7 +16,7 @@ _projectilePos = getPosASL _projectile; _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; _distanceToShooter = _projectilePos vectorDistance _shooterPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_3("", _distanceToTarget, _distanceToShooter, _seekerTargetPos); // Add height depending on distance for compensate _addHeight = [0,0,0]; @@ -40,6 +40,8 @@ if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget }; }; +_returnTargetPos = _seekerTargetPos vectorAdd _addHeight; + #ifdef DEBUG_MODE_FULL drawLine3D [(ASLtoATL _returnTargetPos) vectorAdd _addHeight, ASLtoATL _returnTargetPos, [0,1,0,1]]; #endif From 1dd41a00ba1e57134719d20d14ccd6429243dcde Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 10:51:53 -0700 Subject: [PATCH 28/55] integration. --- addons/missileguidance/functions/fnc_seekerType_SALH.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index 828550aeeb..b6ed8d65a4 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -6,15 +6,15 @@ _seekerTargetPos = _this select 0; _launchParams = _this select 1; _seekerParams = _launchParams select 3; +_angleFov = _seekerParams select 0; -_laserResult = [(getPosASL _projectile), [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], ACE_DEFAULT_LASER_CODE] call EFUNC(laser,seekerFindLaserSpot); +_laserResult = [(getPosASL _projectile), (velocity _projectile), _angleFov, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], ACE_DEFAULT_LASER_CODE] call EFUNC(laser,seekerFindLaserSpot); _foundTargetPos = _laserResult select 0; TRACE_1("Search", _laserResult); if(!isNil "_foundTargetPos") then { - _angleFov = _seekerParams select 0; - _canSeeTarget = [_projectile, _foundTargetPos, _angleFov] call FUNC(checkSeekerAngle); + //_canSeeTarget = [_projectile, _foundTargetPos, _angleFov] call FUNC(checkSeekerAngle); // If we got here, it was an invalid target, just return a spot 5m in front of the missile if(!_canSeeTarget) then { From db890f3b48861598def2f0025cb472a816606298 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Tue, 14 Apr 2015 10:52:30 -0700 Subject: [PATCH 29/55] #576 - Obsolete PBO removal support added to build.py --- tools/build.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/build.py b/tools/build.py index 2b792f77dc..c6a425975e 100644 --- a/tools/build.py +++ b/tools/build.py @@ -19,6 +19,11 @@ def check_for_changes(addonspath, module): return True return mod_time(os.path.join(addonspath, module)) > mod_time(os.path.join(addonspath, "ace_{}.pbo".format(module))) +def check_for_obsolete_pbos(addonspath, file): + module = file[4:-4] + if not os.path.exists(os.path.join(addonspath, module)): + return True + return False def main(): print(""" @@ -36,6 +41,16 @@ def main(): made = 0 failed = 0 skipped = 0 + removed = 0 + + for file in os.listdir(addonspath): + if os.path.isfile(file): + if check_for_obsolete_pbos(addonspath, file): + removed += 1 + print(" Removing obsolete file => " + file) + os.remove(file) + print("") + for p in os.listdir(addonspath): path = os.path.join(addonspath, p) if not os.path.isdir(path): @@ -65,7 +80,7 @@ def main(): print(" Successfully made {}.".format(p)) print("\n# Done.") - print(" Made {}, skipped {}, failed to make {}.".format(made, skipped, failed)) + print(" Made {}, skipped {}, removed {}, failed to make {}.".format(made, skipped, removed, failed)) if __name__ == "__main__": From c76abbe98aa2a8a56df5927365b51cb745d90af2 Mon Sep 17 00:00:00 2001 From: "Pierre (meat)" Date: Tue, 14 Apr 2015 19:57:23 +0200 Subject: [PATCH 30/55] Update AUTHORS.txt blackpixxel was twice listed --- AUTHORS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 906fc706a4..1932ff017b 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -76,4 +76,4 @@ ruPaladin BlackPixxel Asgar Serran Kavinsky -BlackPixxel + From 837f155ad73d225b63afc5c9b31073904962dd58 Mon Sep 17 00:00:00 2001 From: ulteq Date: Tue, 14 Apr 2015 20:17:54 +0200 Subject: [PATCH 31/55] Fixed incorrect key handler return value --- addons/scopes/XEH_postInit.sqf | 8 -------- addons/scopes/functions/fnc_adjustScope.sqf | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index f9d44cb5fa..ca4017222a 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -42,7 +42,6 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, ELEVATION_UP, MINOR_INCREMENT] call FUNC(adjustScope); - true }, {false}, [201, [false, false, false]], true] call cba_fnc_addKeybind; @@ -56,7 +55,6 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, ELEVATION_DOWN, MINOR_INCREMENT] call FUNC(adjustScope); - true }, {false}, [209, [false, false, false]], true] call cba_fnc_addKeybind; @@ -70,7 +68,6 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, WINDAGE_LEFT, MINOR_INCREMENT] call FUNC(adjustScope); - true }, {false}, [209, [false, true, false]], true] call cba_fnc_addKeybind; @@ -84,7 +81,6 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, WINDAGE_RIGHT, MINOR_INCREMENT] call FUNC(adjustScope); - true }, {false}, [201, [false, true, false]], true] call cba_fnc_addKeybind; @@ -98,7 +94,6 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, ELEVATION_UP, MAJOR_INCREMENT] call FUNC(adjustScope); - true }, {false}, [201, [true, false, false]], true] call cba_fnc_addKeybind; @@ -112,7 +107,6 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, ELEVATION_DOWN, MAJOR_INCREMENT] call FUNC(adjustScope); - true }, {false}, [209, [true, false, false]], true] call cba_fnc_addKeybind; @@ -126,7 +120,6 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, WINDAGE_LEFT, MAJOR_INCREMENT] call FUNC(adjustScope); - true }, {false}, [209, [true, true, false]], true] call cba_fnc_addKeybind; @@ -140,7 +133,6 @@ if !(hasInterface) exitWith {}; // Statement [ACE_player, WINDAGE_RIGHT, MAJOR_INCREMENT] call FUNC(adjustScope); - true }, {false}, [201, [true, true, false]], true] call cba_fnc_addKeybind; diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index 301b166559..76c62a4688 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -69,3 +69,5 @@ if ((_elevation + _zero) < _maxVertical select 0 or (_elevation + _zero) > _maxV if (_windage < _maxHorizontal select 0 or _windage > _maxHorizontal select 1) exitWith {false}; [_unit, _elevation, _windage, _zero] call FUNC(applyScopeAdjustment); + +true From 24830f815fba6aa7c8e21e96fe688d1bd98570fa Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 11:18:16 -0700 Subject: [PATCH 32/55] random lock interval was causing phasing. --- addons/javelin/functions/fnc_onOpticDraw.sqf | 5 +++-- addons/javelin/functions/fnc_onOpticLoad.sqf | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index e9d3e304ad..85877f1f16 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -4,7 +4,7 @@ TRACE_1("enter", _this); #define __TRACKINTERVAL 0 // how frequent the check should be. #define __LOCKONTIME 3 // Lock on won't occur sooner -#define __LOCKONTIMERANDOM 2 // Deviation in lock on time + #define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5 #define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5 @@ -39,6 +39,7 @@ _currentTarget = _args select 1; _runTime = _args select 2; _lockTime = _args select 3; _soundTime = _args select 4; +_randomLockInterval = _args select 5; // Find a target within the optic range _newTarget = objNull; @@ -135,7 +136,7 @@ if (isNull _newTarget) then { playSound "ACE_Javelin_Locking"; } else { - if(diag_tickTime - _lockTime > __LOCKONTIME + (random __LOCKONTIMERANDOM)) then { + if(diag_tickTime - _lockTime > __LOCKONTIME + _randomLockInterval) then { TRACE_2("LOCKED!", _currentTarget, _lockTime); __JavelinIGUISeek ctrlSetTextColor __ColorGreen; diff --git a/addons/javelin/functions/fnc_onOpticLoad.sqf b/addons/javelin/functions/fnc_onOpticLoad.sqf index a12d0ef176..d38e1c3305 100644 --- a/addons/javelin/functions/fnc_onOpticLoad.sqf +++ b/addons/javelin/functions/fnc_onOpticLoad.sqf @@ -2,6 +2,8 @@ #include "script_component.hpp" TRACE_1("enter", _this); +#define __LOCKONTIMERANDOM 2 // Deviation in lock on time + if((count _this) > 0) then { uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0]; }; @@ -22,10 +24,13 @@ uiNameSpace setVariable [QGVAR(arguments), objNull, // currentTargetObject 0, // Run Time 0, // Lock Time - 0 // Sound timer + 0, // Sound timer + (random __LOCKONTIMERANDOM) // random lock time addition ] ]; + + _pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil]; if(isNil "_pfh_handle") then { _pfh_handle = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler; From c379f2775eb2cb9494999f7985206e0c11ad4d55 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 20:27:42 +0200 Subject: [PATCH 33/55] Style fixes --- addons/medical/CfgVehicles.hpp | 86 ++++++++++++---------------------- 1 file changed, 29 insertions(+), 57 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 4d7b23463a..18455b034d 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -645,7 +645,7 @@ class CfgVehicles { EGVAR(dragging,dragPosition[]) = {0,1.2,0}; EGVAR(dragging,dragDirection) = 0; class ACE_Actions { - class ACE_MainActions { + class ACE_MainActions { displayName = "$STR_ACE_Interaction_MainAction"; distance = 5; condition = QUOTE(true); @@ -696,10 +696,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_fieldDressing - { + class TransportItems { + class ACE_fieldDressing { name = "ACE_fieldDressing"; count = 1; }; @@ -711,10 +709,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_PACKING_BANDAGE_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_packingBandage - { + class TransportItems { + class ACE_packingBandage { name = "ACE_packingBandage"; count = 1; }; @@ -726,10 +722,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_elasticBandage - { + class TransportItems { + class ACE_elasticBandage { name = "ACE_elasticBandage"; count = 1; }; @@ -741,10 +735,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_TOURNIQUET_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_tourniquet - { + class TransportItems { + class ACE_tourniquet { name = "ACE_tourniquet"; count = 1; }; @@ -756,10 +748,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_MORPHINE_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_morphine - { + class TransportItems { + class ACE_morphine { name = "ACE_morphine"; count = 1; }; @@ -771,10 +761,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_ATROPINE_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_atropine - { + class TransportItems { + class ACE_atropine { name = "ACE_atropine"; count = 1; }; @@ -786,10 +774,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_EPINEPHRINE_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_epinephrine - { + class TransportItems { + class ACE_epinephrine { name = "ACE_epinephrine"; count = 1; }; @@ -801,10 +787,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_PLASMA_IV; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_plasmaIV - { + class TransportItems { + class ACE_plasmaIV { name = "ACE_plasmaIV"; count = 1; }; @@ -817,10 +801,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_BLOOD_IV; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_bloodIV - { + class TransportItems { + class ACE_bloodIV { name = "ACE_bloodIV"; count = 1; }; @@ -832,10 +814,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_SALINE_IV; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_salineIV - { + class TransportItems { + class ACE_salineIV { name = "ACE_salineIV"; count = 1; }; @@ -847,10 +827,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_QUIKCLOT_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_quikClot - { + class TransportItems { + class ACE_quikClot { name = "ACE_quikclot"; count = 1; }; @@ -862,10 +840,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_personalAidKit - { + class TransportItems { + class ACE_personalAidKit { name = "ACE_personalAidKit"; count = 1; }; @@ -877,10 +853,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_surgicalKit - { + class TransportItems { + class ACE_surgicalKit { name = "ACE_surgicalKit"; count = 1; }; @@ -892,10 +866,8 @@ class CfgVehicles { displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY; author = "$STR_ACE_Common_ACETeam"; vehicleClass = "Items"; - class TransportItems - { - class ACE_bodyBag - { + class TransportItems { + class ACE_bodyBag { name = "ACE_bodyBag"; count = 1; }; From a4c93ab2e20272d6b9943299d75f008a7e84c1c3 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 20:28:00 +0200 Subject: [PATCH 34/55] Add seperate crates for basic and advanced --- addons/medical/CfgVehicles.hpp | 35 +++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 18455b034d..dc13964752 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -878,9 +878,42 @@ class CfgVehicles { class ACE_medicalSupplyCrate: NATO_Box_Base { scope = 2; accuracy = 1000; - displayName = "[ACE] Medical Supply Crate"; + displayName = "[ACE] Medical Supply Crate (basic)"; model = PATHTOF(data\ace_medcrate.p3d); author = "$STR_ACE_Common_ACETeam"; + class TransportItems { + class ACE_fieldDressing { + name = "ACE_fieldDressing"; + count = 50; + }; + class ACE_morphine { + name = "ACE_morphine"; + count = 25; + }; + class ACE_epinephrine { + name = "ACE_epinephrine"; + count = 25; + }; + class ACE_bloodIV { + name = "ACE_bloodIV"; + count = 15; + }; + class ACE_bloodIV_500 { + name = "ACE_bloodIV_500"; + count = 15; + }; + class ACE_bloodIV_250 { + name = "ACE_bloodIV_250"; + count = 15; + }; + class ACE_bodyBag { + name = "ACE_bodyBag"; + count = 10; + }; + }; + }; + class ACE_medicalSupplyCrate_advanced: ACE_medicalSupplyCrate { + displayName = "[ACE] Medical Supply Crate (advanced)"; class TransportItems { class ACE_fieldDressing { name = "ACE_fieldDressing"; From 7ca36cdb6597ae8da36611684a9c17a166ca0635 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 20:28:19 +0200 Subject: [PATCH 35/55] Always show wounds, even for very low damage --- addons/medical/functions/fnc_displayPatientInformation.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index fb374f8631..7952a41ec0 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -128,7 +128,7 @@ if (_show) then { { _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; - if (_target getHitPointDamage _x > 0.1 && {_forEachIndex == _selectionN}) then { + if (_target getHitPointDamage _x > 0 && {_forEachIndex == _selectionN}) then { // @todo localize _allInjuryTexts pushBack [format ["%1 %2", ["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5), From ba377dfd3a382ca58e155ca9236961f8df8fec63 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 20:40:17 +0200 Subject: [PATCH 36/55] Show seperate message for "scratches"; localize --- .../fnc_displayPatientInformation.sqf | 20 ++++++++++++---- addons/medical/stringtable.xml | 24 +++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 7952a41ec0..ecd2218c2b 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -129,11 +129,21 @@ if (_show) then { _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; if (_target getHitPointDamage _x > 0 && {_forEachIndex == _selectionN}) then { - // @todo localize - _allInjuryTexts pushBack [format ["%1 %2", - ["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5), - ["head", "torso", "left arm", "right arm", "left leg", "right leg"] select _forEachIndex - ], [1,1,1,1]]; + _pointDamage = _target getHitPointDamage _x; + _severity = switch (true) do { + case (_pointDamage > 0.5): {localize "STR_ACE_Medical_HeavilyWounded"}; + case (_pointDamage > 0.1): {localize "STR_ACE_Medical_LightlyWounded"}; + default {localize "STR_ACE_Medical_VeryLightlyWounded"}; + }; + _part = localize ([ + "STR_ACE_Medical_Head", + "STR_ACE_Medical_Torso", + "STR_ACE_Medical_LeftArm", + "STR_ACE_Medical_RightArm", + "STR_ACE_Medical_LeftLeg", + "STR_ACE_Medical_RightLeg" + ] select _forEachIndex); + _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; }; } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; }; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 145c14b264..d423ae3204 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1284,5 +1284,29 @@ %1 założył stazę %1 a appliqué un garrot + + Head + Kopf + + + Torso + Torso + + + Left Arm + Linker Arm + + + Right Arm + Rechter Arm + + + Left Leg + Linkes Bein + + + Right Leg + Rechtes Bein + From 71b19b46214a9b47cc3aa583ebb0a9c781815248 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 20:40:38 +0200 Subject: [PATCH 37/55] Remove duplicate bleeding code --- addons/medical/functions/fnc_getBloodLoss.sqf | 2 +- .../functions/fnc_handleUnitVitals.sqf | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index fb5a6d9e36..f6b26f7686 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -#define BLOODLOSSRATE_BASIC 0.08 +#define BLOODLOSSRATE_BASIC 0.2 private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"]; // TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical). diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index fc13e19d29..81c9ffea40 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -28,9 +28,8 @@ if (_syncValues) then { }; _bloodVolume = (_unit getvariable [QGVAR(bloodVolume), 0]) + ([_unit] call FUNC(getBloodVolumeChange)); -if (_bloodVolume <= 0) then { - _bloodVolume = 0; -}; +_bloodVolume = _bloodVolume max 0; + _unit setvariable [QGVAR(bloodVolume), _bloodVolume, _syncValues]; // Set variables for synchronizing information across the net @@ -78,15 +77,11 @@ if (GVAR(level) == 1) then { // bleeding _blood = _unit getVariable [QGVAR(bloodVolume), 100]; - _blood = (_blood - 0.4 * (damage _unit) * _interval) max 0; - if (_blood != (_unit getVariable [QGVAR(bloodVolume), 100])) then { - _unit setVariable [QGVAR(bloodVolume), _blood, _syncValues]; - if (_blood <= 35 and !(_unit getVariable ["ACE_isUnconscious", false])) then { - [_unit, true] call FUNC(setUnconscious); - }; - if (_blood == 0) then { - [_unit] call FUNC(setDead); - }; + if (_blood <= 35 and !(_unit getVariable ["ACE_isUnconscious", false])) then { + [_unit, true] call FUNC(setUnconscious); + }; + if (_blood == 0) then { + [_unit] call FUNC(setDead); }; }; From 739807303b6cdb1ff15c488f6dce45df0c39272e Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 11:42:26 -0700 Subject: [PATCH 38/55] Fix script error for canceling designation and dying while designating. --- .../functions/fnc_laserHudDesignateOff.sqf | 5 +++++ .../functions/fnc_laserHudDesignateOn.sqf | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf index 17e7fcb76e..f8ff2ca0f5 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf @@ -22,4 +22,9 @@ if( (count _this) > 2) then { GVAR(active) = false; +if(!isNil QGVAR(selfDesignateHandle)) then { + [GVAR(selfDesignateHandle)] call CBA_fnc_removePerFrameHandler; + GVAR(selfDesignateHandle) = nil; +}; + true \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index c480c051bb..400bf21756 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -83,7 +83,7 @@ if(!GVAR(active)) then { // @TODO: Nou gets to field all tickets about missing lasers. //_localLaserTarget = "LaserTargetW" createVehicleLocal (getpos ACE_player); - _handle = [FUNC(laserHudDesignatePFH), 0.1, [ACE_player, _laserUuid, nil]] call cba_fnc_addPerFrameHandler; + GVAR(selfDesignateHandle) = [FUNC(laserHudDesignatePFH), 0.1, [ACE_player, _laserUuid, nil]] call cba_fnc_addPerFrameHandler; } else { [] call FUNC(laserHudDesignateOff); [] call FUNC(laserHudDesignateOn); From e7807c009f301f835a98d00b981aee32e8e3033a Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 21:28:18 +0200 Subject: [PATCH 39/55] Use playerInventoryChanged instead of Take This makes sure to also fire when other mods, like TFAR (when adding backpacks) add items via script. --- addons/medical/CfgEventHandlers.hpp | 8 -------- addons/medical/XEH_postInit.sqf | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/addons/medical/CfgEventHandlers.hpp b/addons/medical/CfgEventHandlers.hpp index bf96b6a239..2fe5d0a9e5 100644 --- a/addons/medical/CfgEventHandlers.hpp +++ b/addons/medical/CfgEventHandlers.hpp @@ -47,11 +47,3 @@ class Extended_Local_EventHandlers { }; }; }; - -class Extended_Take_EventHandlers { - class CAManBase { - class ADDON { - take = QUOTE(call FUNC(itemCheck)); - }; - }; -}; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 1b0a38f1af..f5cd793b13 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -266,3 +266,8 @@ if (USE_WOUND_EVENT_SYNC) then { // Prevent all types of interaction while unconscious // @todo: probably remove this when CBA keybind hold key works properly ["isNotUnconscious", {!((_this select 0) getVariable ["ACE_isUnconscious", false])}] call EFUNC(common,addCanInteractWithCondition); + +// Item Event Handler +["playerInventoryChanged", { + [ACE_player] call FUNC(itemCheck); +}] call EFUNC(common,addEventHandler); From ebcdafe6109c2a17ac673fae7b70a347d9d30708 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 21:43:19 +0200 Subject: [PATCH 40/55] Fix spelling of "isClientSetable" --- addons/common/config.cpp | 14 +++++++------- .../functions/fnc_setSettingFromConfig.sqf | 4 ++-- addons/goggles/config.cpp | 2 +- addons/hearing/config.cpp | 2 +- addons/interact_menu/config.cpp | 2 +- addons/inventory/config.cpp | 2 +- addons/microdagr/config.cpp | 2 +- addons/movement/config.cpp | 2 +- addons/nametags/config.cpp | 18 +++++++++--------- addons/overheating/config.cpp | 2 +- addons/reload/config.cpp | 2 +- addons/weaponselect/config.cpp | 2 +- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 90309af612..769ba37de1 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -69,9 +69,9 @@ class ACE_Settings { * force = 0; * * Does it appear on the options menu? - * isClientSetable = 1; + * isClientSettable = 1; * - * The following settings only apply when isClientSetable == 1 + * The following settings only apply when isClientSettable == 1 * Stringtable entry with the setting name * displayName = "$STR_ACE_Common_SettingName"; * @@ -90,14 +90,14 @@ class ACE_Settings { /*class GVAR(enableNumberHotkeys) { value = 1; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_EnableNumberHotkeys"; };*/ class GVAR(settingFeedbackIcons) { value = 1; typeName = "SCALAR"; force = 0; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_SettingFeedbackIconsName"; description = "$STR_ACE_Common_SettingFeedbackIconsDesc"; values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"}; @@ -106,7 +106,7 @@ class ACE_Settings { value = 0; typeName = "SCALAR"; force = 0; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_SettingProgressbarLocationName"; description = "$STR_ACE_Common_SettingProgressbarLocationDesc"; values[] = {"Top", "Bottom"}; @@ -114,14 +114,14 @@ class ACE_Settings { class GVAR(displayTextColor) { value[] = {0,0,0,0.1}; typeName = "COLOR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; }; class GVAR(displayTextFontColor) { value[] = {1,1,1,1}; typeName = "COLOR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; }; diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 9d93b9e62d..4d81ef3535 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -58,7 +58,7 @@ if (isNil _name) then { /*_settingData = [ _name, _typeName, - _isClientSetable, + _isClientSettable, _localizedName, _localizedDescription, _possibleValues, @@ -68,7 +68,7 @@ if (isNil _name) then { _settingData = [ _name, _typeName, - (getNumber (_optionEntry >> "isClientSetable")) > 0, + (getNumber (_optionEntry >> "isClientSettable")) > 0, getText (_optionEntry >> "displayName"), getText (_optionEntry >> "description"), getArray (_optionEntry >> "values"), diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index efda9b5436..7e8afe4d3d 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -247,7 +247,7 @@ class ACE_Settings { class GVAR(showInThirdPerson) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; }; }; diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 6aab92b9bf..0813d0648e 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -38,7 +38,7 @@ class ACE_Settings { class GVAR(DisableEarRinging) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Hearing_DisableEarRinging"; }; }; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 17900c2f6b..aaeb6db3e0 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -20,7 +20,7 @@ class ACE_Settings { class GVAR(AlwaysUseCursorSelfInteraction) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction"; }; }; diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index c7b6649be6..1268f8b886 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -18,7 +18,7 @@ class ACE_Settings { class GVAR(inventoryDisplaySize) { value = 0; typeName = "SCALAR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Inventory_SettingName"; description = "$STR_ACE_Inventory_SettingDescription"; values[] = {"Normal (Default Size)", "Medium", "Bigger"}; diff --git a/addons/microdagr/config.cpp b/addons/microdagr/config.cpp index e337aa96d5..4e459c126c 100644 --- a/addons/microdagr/config.cpp +++ b/addons/microdagr/config.cpp @@ -21,6 +21,6 @@ class ACE_Settings { class GVAR(MapDataAvailable) { value = 2; typeName = "SCALAR"; - isClientSetable = 0; + isClientSettable = 0; }; }; diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp index 51ab97b80a..6cf2c9470c 100644 --- a/addons/movement/config.cpp +++ b/addons/movement/config.cpp @@ -21,7 +21,7 @@ class ACE_Settings { class GVAR(useImperial) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_Movement_UseImperial"; }; }; diff --git a/addons/nametags/config.cpp b/addons/nametags/config.cpp index e67703e147..dce054a9ec 100644 --- a/addons/nametags/config.cpp +++ b/addons/nametags/config.cpp @@ -19,55 +19,55 @@ class ACE_Settings { class GVAR(defaultNametagColor) { value[] = {0.77, 0.51, 0.08, 1}; typeName = "COLOR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_DefaultNametagColor"; }; class GVAR(showPlayerNames) { value = 1; typeName = "SCALAR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowPlayerNames"; values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; }; class GVAR(showPlayerRanks) { value = 1; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowPlayerRanks"; }; class GVAR(showVehicleCrewInfo) { value = 1; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowVehicleCrewInfo"; }; class GVAR(showNamesForAI) { value = 0; typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowNamesForAI"; }; class GVAR(showCursorTagForVehicles) { value = 0; typeName = "BOOL"; - isClientSetable = 0; + isClientSettable = 0; }; class GVAR(showSoundWaves) { value = 1; typeName = "SCALAR"; - isClientSetable = 1; + isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowSoundWaves"; values[] = {"Disabled", "Use Nametag settings", "Always Show All"}; }; class GVAR(PlayerNamesViewDistance) { value = 5; typeName = "SCALAR"; - isClientSetable = 0; + isClientSettable = 0; }; class GVAR(PlayerNamesMaxAlpha) { value = 0.8; typeName = "SCALAR"; - isClientSetable = 0; + isClientSettable = 0; }; }; diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index 3ccc8ee603..bd6cdbbdd3 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -23,7 +23,7 @@ class CfgPatches { class ACE_Settings { class GVAR(DisplayTextOnJam) { typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; value = 1; displayName = "$STR_ACE_overheating_SettingDisplayTextName"; description = "$STR_ACE_overheating_SettingDisplayTextDesc"; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 372292de89..02f5014379 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -25,7 +25,7 @@ class CfgPatches { class ACE_Settings { class GVAR(DisplayText) { typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; value = 1; displayName = "$STR_ACE_reload_SettingDisplayTextName"; description = "$STR_ACE_reload_SettingDisplayTextDesc"; diff --git a/addons/weaponselect/config.cpp b/addons/weaponselect/config.cpp index 80be936e98..68d0fe842d 100644 --- a/addons/weaponselect/config.cpp +++ b/addons/weaponselect/config.cpp @@ -17,7 +17,7 @@ class CfgPatches { class ACE_Settings { class GVAR(DisplayText) { typeName = "BOOL"; - isClientSetable = 1; + isClientSettable = 1; value = 1; displayName = "$STR_ACE_Weaponselect_SettingDisplayTextName"; description = "$STR_ACE_Weaponselect_SettingDisplayTextDesc"; From 684c36f8a5f215dcffb239ad215f874aec1bd775 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 21:49:56 +0200 Subject: [PATCH 41/55] Add pain effect option --- addons/medical/ACE_Settings.hpp | 6 ++++++ addons/medical/XEH_postInit.sqf | 3 +-- addons/medical/stringtable.xml | 8 ++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 4d2f2db9be..bd243b2d3f 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -117,4 +117,10 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(painEffectType) { + typeName = "SCALAR"; + value = 0; + values[] = {"$STR_ACE_Medical_PainEffect_Flash", "$STR_ACE_Medical_PainEffect_Chroma"} + isClientSettable = 1; + }; }; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index f5cd793b13..7bcb536cd3 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -172,8 +172,7 @@ if (isNil QGVAR(level)) then { // Pain effect _strength = ACE_player getVariable [QGVAR(pain), 0]; // _strength = _strength * (ACE_player getVariable [QGVAR(coefPain), GVAR(coefPain)]); @todo - GVAR(alternativePainEffect) = false; // @todo - if (GVAR(alternativePainEffect)) then { + if (GVAR(painEffectType) == 1) then { GVAR(effectPainCC) ppEffectEnable false; if ((ACE_player getVariable [QGVAR(pain), 0]) > 0 && {alive ACE_player}) then { _strength = _strength * 0.15; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index d423ae3204..8e8d428b8f 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1308,5 +1308,13 @@ Right Leg Rechtes Bein + + Colour Flashing + Farbblinken + + + Chromatic Aberration + Chromatische Aberration + From 7af6ea36a6f0458389d7e6f0d04309ebed8c3b94 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 22:07:43 +0200 Subject: [PATCH 42/55] Fix missing pain effect option name --- addons/medical/ACE_Settings.hpp | 3 ++- addons/medical/stringtable.xml | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index bd243b2d3f..56e5a531ec 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -118,9 +118,10 @@ class ACE_Settings { value = 1; }; class GVAR(painEffectType) { + displayName = "$STR_ACE_Medical_painEffectType"; typeName = "SCALAR"; value = 0; - values[] = {"$STR_ACE_Medical_PainEffect_Flash", "$STR_ACE_Medical_PainEffect_Chroma"} + values[] = {"$STR_ACE_Medical_painEffect_Flash", "$STR_ACE_Medical_painEffect_Chroma"}; isClientSettable = 1; }; }; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 8e8d428b8f..391e277083 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1308,11 +1308,15 @@ Right Leg Rechtes Bein - + + Pain Effect Type + Schmerzeffekt-Typ + + Colour Flashing Farbblinken - + Chromatic Aberration Chromatische Aberration From f0a716fee8a513d0e942b56d9069f3ece94afb2c Mon Sep 17 00:00:00 2001 From: ulteq Date: Tue, 14 Apr 2015 22:17:27 +0200 Subject: [PATCH 43/55] Added new ammo classes: *762x67mm Mk248 Mod 0 *762x67mm Mk248 Mod 1 *762x67mm Berger Hybrid OTM *65x47mm Scenar --- addons/ballistics/CfgAmmo.hpp | 80 ++++++++++++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp index 620484950d..cea249cb4f 100644 --- a/addons/ballistics/CfgAmmo.hpp +++ b/addons/ballistics/CfgAmmo.hpp @@ -90,7 +90,8 @@ class CfgAmmo { ACE_muzzleVelocities[]={780, 880, 920}; ACE_barrelLengths[]={10, 16.3, 20}; }; - class ACE_545x39_Ball_7T3M : B_556x45_Ball_Tracer_Red { + class B_556x45_Ball_Tracer_Yellow; + class ACE_545x39_Ball_7T3M : B_556x45_Ball_Tracer_Yellow { airFriction=-0.001162; caliber=0.5; deflecting=18; @@ -122,9 +123,24 @@ class CfgAmmo { ACE_barrelLengths[]={10, 16, 20, 24, 26, 30}; }; class B_65x39_Case_yellow; - class ACE_B_65x39_Caseless_Tracer_Dim : B_65x39_Case_yellow { + class ACE_65x39_Caseless_Tracer_Dim : B_65x39_Case_yellow { nvgOnly = 1; }; + class ACE_65x47_Ball_Scenar: B_65x39_Caseless + { + airFriction=-0.00078; + typicalSpeed=820 ; + ACE_caliber=0.264; + ACE_bulletLength=1.364; + ACE_bulletMass=139; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.290}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={760, 790, 820, 830}; + ACE_barrelLengths[]={16, 20, 24, 26}; + }; class B_762x51_Ball : BulletBase { airFriction=-0.001035; typicalSpeed=833; @@ -140,8 +156,8 @@ class CfgAmmo { ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; ACE_barrelLengths[]={10, 16, 20, 24, 26}; }; - class B_762x51_Tracer_Red; - class ACE_B_762x51_Tracer_Dim: B_762x51_Tracer_Red { + class B_762x51_Tracer_Yellow; + class ACE_B_762x51_Tracer_Dim: B_762x51_Tracer_Yellow { nvgOnly = 1; }; class ACE_762x51_Ball_M118LR : B_762x51_Ball { @@ -160,6 +176,57 @@ class CfgAmmo { ACE_muzzleVelocities[]={750, 780, 790, 794}; ACE_barrelLengths[]={16, 20, 24, 26}; }; + class ACE_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball + { + airFriction=-0.000830; + caliber=1.08; + hit=17; + typicalSpeed=900; + ACE_caliber=0.308; + ACE_bulletLength=1.353; + ACE_bulletMass=190; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.268}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={865, 900, 924}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class ACE_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball + { + airFriction=-0.000815; + caliber=1.12; + hit=18; + typicalSpeed=867; + ACE_caliber=0.308; + ACE_bulletLength=1.489; + ACE_bulletMass=220; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.310}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={847, 867, 877}; + ACE_barrelLengths[]={20, 24, 26}; + }; + class ACE_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball + { + airFriction=-0.00076; + caliber=1.15; + hit=19; + typicalSpeed=853; + ACE_caliber=0.308; + ACE_bulletLength=1.602; + ACE_bulletMass=230; + ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + ACE_ballisticCoefficients[]={0.368}; + ACE_velocityBoundaries[]={}; + ACE_standardAtmosphere="ICAO"; + ACE_dragModel=7; + ACE_muzzleVelocities[]={800, 853, 884}; + ACE_barrelLengths[]={20, 24, 26}; + }; class ACE_762x51_Ball_Subsonic : B_762x51_Ball { airFriction=-0.000535; caliber=0.5; @@ -204,7 +271,8 @@ class CfgAmmo { ACE_muzzleVelocities[]={700, 800, 820, 833}; ACE_barrelLengths[]={16, 20, 24, 26}; }; - class ACE_762x54_Ball_7T2 : B_762x51_Tracer_Red { + class B_762x54_Tracer_Green; + class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green { airFriction=-0.001023; caliber=0.9; hit=15; @@ -251,7 +319,7 @@ class CfgAmmo { ACE_muzzleVelocities[]={650, 716, 750}; ACE_barrelLengths[]={10, 16.3, 20}; }; - class ACE_762x39_Ball_57N231P : B_762x51_Tracer_Red { + class ACE_762x39_Ball_57N231P : B_762x51_Tracer_Yellow { airFriction=-0.0015168; hit=12; typicalSpeed=716; From e214511e36c65442ffc88dd795e6488dfd59a0ec Mon Sep 17 00:00:00 2001 From: ulteq Date: Tue, 14 Apr 2015 22:19:51 +0200 Subject: [PATCH 44/55] Added new magazine classes: *ACE_100Rnd_65x39_caseless_mag_Tracer_Dim *ACE_200Rnd_65x39_cased_Box_Tracer_Dim *ACE_30Rnd_556x45_Stanag_Mk262_mag *ACE_30Rnd_556x45_Stanag_Mk318_mag *ACE_10Rnd_762x51_M118LR_Mag *ACE_20Rnd_762x51_M118LR_Mag *ACE_20Rnd_762x67_Mk248_Mod_0_Mag *ACE_20Rnd_762x67_Mk248_Mod_1_Mag *ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag *ACE_30Rnd_65x47_Scenar_mag *ACE_10Rnd_762x54_Tracer_mag --- addons/ballistics/CfgMagazines.hpp | 103 +++++++++++++- addons/ballistics/stringtable.xml | 209 +++++++++++++---------------- 2 files changed, 195 insertions(+), 117 deletions(-) diff --git a/addons/ballistics/CfgMagazines.hpp b/addons/ballistics/CfgMagazines.hpp index 6e6f5a11e8..f9e936dc04 100644 --- a/addons/ballistics/CfgMagazines.hpp +++ b/addons/ballistics/CfgMagazines.hpp @@ -11,22 +11,54 @@ class CfgMagazines { class 100Rnd_65x39_caseless_mag_Tracer: 100Rnd_65x39_caseless_mag { initSpeed = 760; }; + class ACE_100Rnd_65x39_caseless_mag_Tracer_Dim: 100Rnd_65x39_caseless_mag_Tracer { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_65x39_Caseless_Tracer_Dim"; + displayName = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimName"; + displayNameShort = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimDescription"; + picture = "\A3\weapons_f\data\ui\m_100rnd_65x39_yellow_ca.paa"; + }; class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag { initSpeed = 760; }; + class ACE_200Rnd_65x39_cased_Box_Tracer_Dim: 200Rnd_65x39_cased_Box { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_65x39_Caseless_Tracer_Dim"; + displayName = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimName"; + displayNameShort = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimDescription"; + picture = "\A3\weapons_f\data\ui\m_200rnd_65x39_yellow_ca.paa"; + }; class 30Rnd_65x39_caseless_mag_Tracer: 30Rnd_65x39_caseless_mag { }; class ACE_30Rnd_65x39_caseless_mag_Tracer_Dim: 30Rnd_65x39_caseless_mag_Tracer { author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_65x39_Caseless_Tracer_Dim"; + ammo = "ACE_65x39_Caseless_Tracer_Dim"; displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimName"; displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimNameShort"; descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimDescription"; - picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_yellow_CA.paa"; + picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_yellow_ca.paa"; }; class 30Rnd_556x45_Stanag: CA_Magazine { }; + class ACE_30Rnd_556x45_Stanag_Mk262_mag: 30Rnd_556x45_Stanag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_556x45_Ball_Mk262"; + displayName = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_Name"; + displayNameShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_NameShort"; + descriptionShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_Description"; + initSpeed = 832; + }; + class ACE_30Rnd_556x45_Stanag_Mk318_mag: 30Rnd_556x45_Stanag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_556x45_Ball_Mk318"; + displayName = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_Name"; + displayNameShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_NameShort"; + descriptionShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_Description"; + initSpeed = 922; + }; class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag { }; class ACE_30Rnd_556x45_Stanag_Tracer_Dim: 30Rnd_556x45_Stanag_Tracer_Red { @@ -35,7 +67,7 @@ class CfgMagazines { displayName = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimName"; displayNameShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimNameShort"; descriptionShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimDescription"; - picture = "\A3\weapons_f\data\ui\m_30stanag_yellow_ca.paa"; + picture = "\A3\weapons_f\data\ui\m_20stanag_red_ca.paa"; }; class 20Rnd_762x51_Mag: CA_Magazine { @@ -50,7 +82,7 @@ class CfgMagazines { class 150Rnd_762x51_Box_Tracer: 150Rnd_762x51_Box { initSpeed = 833; }; - class ACE_20Rnd_762x51_Mag_Tracer: 20Rnd_762x51_Mag { //@todo Green tracers for opfor and yellow tracers for independent + class ACE_20Rnd_762x51_Mag_Tracer: 20Rnd_762x51_Mag { author = "$STR_ACE_Common_ACETeam"; ammo = "B_762x51_Tracer_Red"; displayName = "$STR_ACE_20Rnd_762x51_mag_TracerName"; @@ -76,6 +108,61 @@ class CfgMagazines { initSpeed = 325; }; + class ACE_10Rnd_762x51_M118LR_Mag: 10Rnd_762x51_Mag + { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_M118LR"; + count=10; + displayName = "$STR_ACE_10Rnd_762x51_M118LR_Mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_762x51_M118LR_Mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_762x51_M118LR_Mag_Description"; + initSpeed = 780; + }; + class ACE_20Rnd_762x51_M118LR_Mag: 20Rnd_762x51_Mag + { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x51_Ball_M118LR"; + displayName = "$STR_ACE_20Rnd_762x51_M118LR_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x51_M118LR_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_M118LR_Mag_Description"; + initSpeed = 780; + }; + class ACE_20Rnd_762x67_Mk248_Mod_0_Mag: 20Rnd_762x51_Mag + { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x67_Ball_Mk248_Mod_0"; + displayName = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_Description"; + initSpeed = 865; + }; + class ACE_20Rnd_762x67_Mk248_Mod_1_Mag: 20Rnd_762x51_Mag + { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x67_Ball_Mk248_Mod_1"; + displayName = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_Description"; + initSpeed = 847; + }; + class ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag: 20Rnd_762x51_Mag + { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x67_Ball_Berger_Hybrid_OTM"; + displayName = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_Name"; + displayNameShort = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_NameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_Description"; + initSpeed = 800; + }; + class ACE_30Rnd_65x47_Scenar_mag: 30Rnd_65x39_caseless_mag + { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_65x47_Ball_Scenar"; + count=30; + displayName = "30rnd 6.5mm Mag (HPBT Scenar)"; + descriptionshort = "Caliber: 65x47 mm (HPBT Scenar)
Rounds: 30
Used in: MXM"; + }; + class 30Rnd_9x21_Mag: CA_Magazine { initSpeed = 450; }; @@ -123,6 +210,14 @@ class CfgMagazines { class 10Rnd_762x54_Mag: 10Rnd_762x51_Mag { initSpeed = 800; }; + class ACE_10Rnd_762x54_Tracer_mag: 16Rnd_9x21_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_762x54_Ball_7T2"; + displayName = "$STR_ACE_10Rnd_762x54_Tracer_mag_Name"; + displayNameShort = "$STR_ACE_10Rnd_762x54_Tracer_mag_NameShort"; + descriptionShort = "$STR_ACE_10Rnd_762x54_Tracer_mag_Description"; + initSpeed = 800; + }; class 150Rnd_762x54_Box: 150Rnd_762x51_Box { initSpeed = 750; diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index 261a6a8ea1..721e561f83 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -257,42 +257,6 @@ Calibro: 5.56x45 mm Traccianti IR-DIM<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Калибр: 5.56x45 мм трассирующие под ПНВ<br />Патронов: 30<br />Применимы в: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR
- - 5.56mm 30Rnd SD Mag - 5,56 mm Hangtompítós 30-as Tár - 5,56 mm 30-Schuss-Magazin SD - Cargador de 30 balas SD de 5,56 mm - Ch. 5,56mm 30Cps SD - Magazynek 5,56mm 30rd SD - 5.56mm 30ks SD Zásobník - Carregador de 30 projéteis SD de 5,56mm - Caricatore 5.56mm 30Rnd Sil. - Магазин из 30-ти 5.56 мм дозвуковых - - - 5.56mm SD - 5,56 mm Hangtompítós - 5,56mm SD - 5,56 mm SD - 5,56mm SD - 5,56mm SD - 5.56mm SD - 5,56mm SD - 5.56 Sil. - 5.56 мм дозвуковые - - - Caliber: 5.56x45 mm SD<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56x45 mm Hangtompítós<br />Lőszerek: 30<br />Használható: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56x45 mm SD<br />Patronen: 30<br />Eingesetzt von: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm SD<br />Balas: 30<br />Se usa en: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5.56x45 mm SD<br />Cartouches: 30<br />Utilisé dans: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Kaliber: 5,56 x 45 mm SD<br />Pociski: 30<br />Używane w: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Ráže: 5.56x45 mm SD<br />Munice: 30<br />Použití: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibre: 5,56x45 mm SD<br />Projéteis: 30<br />Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Calibro: 5.56x45 mm Sil.<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Калибр: 5.56x45 мм дозвуковые<br />Патронов: 30<br />Применимы в: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - 5.56mm 30Rnd AP Mag 5,56 mm Páncéltörő 30-as Tár @@ -474,52 +438,7 @@ Calibro: 7.62x51 mm AP<br />Munizioni: 20<br />In uso su: Mk18 ABR Калибр: 7.62x51 мм дозвуковые<br />Патронов: 20<br />Применимы в: Mk18 ABR - - Caliber: 7.62x51mm M118LR<br />Rounds: 20<br />Type: M14 - Kaliber: 7,62x51 mm M118LR<br />Lőszerek: 20<br />Típus: M14 - Kaliber: 7,62x51mm M118LR<br />Schuss: 20<br />Typ: M14 - Calibre: 7,62x51mm M118LR<br />Balas: 20<br />Tipo: M14 - Kaliber: 7,62 x 51 mm M118LR<br />Pociski: 20<br />Typ: M14 - Kalibr: 7.62x51mm M118LR<br />Náboje: 20<br />Typ: M14 - Calibre : 7,62x51mm M118LR<br />Cartouches: 20<br />Type: M14 - Calibre: 7,62x51mm M118LR<br />Projéteis: 20<br />Tipo: M14 - Калибр: 7.62x51mm M118LR<br />Патронов: 20<br />Тип: M14 - Calibro: 7.62x51mm M118LR<br />Munizioni:20<br />In uso su: M14 - - - .338 LM 10Rnd Tracer Mag - .338 LM 10-Schuss-Magazin Leuchtspur - Magazynek .338 LM 10rd Smugacz - .338 LM 10Rnd Svítící Zásobník - - - .338 LM Tracer - .338 LM Leuchtspur - .338 LM Smugacz - .338 LM Svítící - - - Caliber: .338 Lapua Magnum Tracer<br />Rounds: 10<br />Used in: MAR-10 - Kaliber: .338 Lapua Magnum Leuchtspur<br />Schuss: 10<br />Verwendet für: MAR-10 - Kaliber: .338 Lapua Magnum Smugacz<br />Pociski: 10<br />Używane w: MAR-10 - - - .338 LM 10Rnd IR-DIM Mag - .338 LM 10-Schuss-Magazin Leuchtspur IR-DIM - Magazynek .338 LM 10rd IR-DIM - - - .338 LM IR-DIM - .338 LM IR-DIM - .338 LM IR-DIM - .338 LM IR-DIM - - - Caliber: .338 Lapua Magnum Tracer IR-DIM<br />Rounds: 10<br />Used in: MAR-10 - Kaliber: .338 Lapua Magnum Leuchtspur IR-DIM<br />Schuss: 10<br />Verwendet für: MAR-10 - Kaliber: .338 Lapua Magnum Smugacz IR-DIM<br />Pociski: 10<br />Używane w: MAR-10 - .338 LM 10Rnd AP Mag .338 LM 10-Schuss-Magazin Hartkern @@ -536,22 +455,6 @@ Kaliber: .338 Lapua Magnum Hartkern<br />Schuss: 10<br />Verwendet für: MAR-10 Kaliber: .338 Lapua Magnum AP<br />Pociski: 10<br />Używany w: MAR-10 - - .338 LM 10Rnd SD Mag - .338 LM 10-Schuss-Magazin Unterschall - Magazynek .338 LM 10rd SD - - - .338 LM SD - .338 LM SD - .338 LM SD - .338 LM SD - - - Caliber: .338 Lapua Magnum SD<br />Rounds: 10<br />Used in: MAR-10 - Kaliber: .338 Lapua Magnum Unterschall<br />Schuss: 10<br />Verwendet für: MAR-10 - Kaliber: .338 Lapua Magnum SD<br />Pociski: 10<br />Używany w: MAR-10 - .338 NM 130Rnd Tracer Belt @@ -650,22 +553,6 @@ Kaliber: 9,3x64mm Hartkern<br />Schuss: 10<br />Verwendet für: Cyrus Kaliber: 9,3 x 64 mm AP<br />Pociski: 10<br />Używany w: Cyrus - - 9.3mm 10Rnd SD Mag - 9,3mm 10-Schuss-Magazin Unterschall - Magazynek 9,3mm 10rd SD - - - 9.3mm SD - 9,3mm SD - 9,3mm SD - 9.3mm SD - - - Caliber: 9.3x64mm SD<br />Rounds: 10<br />Used in: Cyrus - Kaliber: 9,3x64mm Unterschall<br />Schuss: 10<br />Verwendet für: Cyrus - Kaliber: 9,3 x 64 mm SD<br />Pociski: 10<br />Używany w: Cyrus - 9.3mm 150Rnd Tracer Belt @@ -716,16 +603,112 @@ Kaliber: 9,3 x 64 mm AP<br />Pociski: 150<br />Używane w: Navid + 9x19mm 16Rnd Mag + 9x19mm + 9x19mm 16Rnd Mag + 9x19mm 30Rnd Mag + 9x19mm + 9x19mm 30Rnd Mag + + + 7.62x54mm 10Rnd Tracer IR-DIM Mag + + + 7.62mm IR-DIM + + + 7.62x54mm 10Rnd Tracer IR-DIM Mag + + + 6.5mm 100Rnd Tracer IR-DIM Mag + + + 6.5mm IR-DIM + + + 6.5mm 100Rnd Tracer IR-DIM Mag + + + 6.5mm 200Rnd Tracer IR-DIM Belt + + + 6.5mm IR-DIM + + + 6.5mm 200Rnd Tracer IR-DIM Belt + + + 5.56mm 30Rnd Mag (Mk262) + + + 5.56mm (Mk262) + + + Caliber: 5.56x45 mm NATO (Mk262)<br />Rounds: 30 + + + 5.56mm 30Rnd Mag (Mk318) + + + 5.56mm (Mk318) + + + Caliber: 5.56x45 mm NATO (Mk318)<br />Rounds: 30 + + + 7.62mm 10Rnd Mag (M118LR) + + + 7.62mm (M118LR) + + + Caliber: 7.62x51 mm NATO (M118LR)<br />Rounds: 10 + + + 7.62mm 20Rnd Mag (M118LR) + + + 7.62mm (M118LR) + + + Caliber: 7.62x51 mm NATO (M118LR)<br />Rounds: 20 + + + 7.62mm 20Rnd Mag (Mk248 Mod 0) + + + 7.62mm (Mk248 Mod 0) + + + Caliber: 7.62x67 mm NATO (Mk248 Mod 0)<br />Rounds: 20 + + + 7.62mm 20Rnd Mag (Mk248 Mod 1) + + + 7.62mm (Mk248 Mod 1) + + + Caliber: 7.62x67 mm NATO (Mk248 Mod 1)<br />Rounds: 20 + + + 7.62mm 20Rnd Mag (Berger Hybrid OTM) + + + 7.62mm (OTM) + + + Caliber: 7.62x67 mm NATO (Berger Hybrid OTM)<br />Rounds: 20 \ No newline at end of file From 1d64b8c36ee8ed8bb5dcca9d2fd62912fa40c037 Mon Sep 17 00:00:00 2001 From: ulteq Date: Tue, 14 Apr 2015 22:22:36 +0200 Subject: [PATCH 45/55] Added the new magazines into various ammo boxes --- addons/ballistics/CfgVehicles.hpp | 150 ++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/addons/ballistics/CfgVehicles.hpp b/addons/ballistics/CfgVehicles.hpp index efd2132d95..e114bef671 100644 --- a/addons/ballistics/CfgVehicles.hpp +++ b/addons/ballistics/CfgVehicles.hpp @@ -9,4 +9,154 @@ class CfgVehicles { //hitPart = "systemChat str _this"; }; }; + + class NATO_Box_Base; + class Box_NATO_Wps_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + }; + }; + + class Box_NATO_WpsSpecial_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_100Rnd_65x39_caseless_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_200Rnd_65x39_cased_Box_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); + }; + }; + + class Box_NATO_Ammo_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); + }; + }; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,6); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_SD,3); + }; + }; + + class ReammoBox_F; + class B_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); + }; + }; + + class EAST_Box_Base; + class Box_East_Wps_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + }; + }; + + class Box_East_WpsSpecial_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + }; + }; + + class Box_East_Ammo_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,6); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_SD,3); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + }; + }; + + class IND_Box_Base; + class Box_IND_Wps_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class Box_IND_WpsSpecial_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,4); + }; + }; + + class Box_IND_Ammo_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class FIA_Box_Base_F; + class Box_FIA_Wps_F: FIA_Box_Base_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class Box_FIA_Ammo_F: FIA_Box_Base_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class I_supplyCrate_F: B_supplyCrate_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class IG_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + }; + }; + + class C_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_SD,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_M118LR_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x67_Mk248_Mod_0_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x67_Mk248_Mod_1_Mag,4); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag,4); + MACRO_ADDMAGAZINE(ACE_10Rnd_762x54_Tracer_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk262_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Mk318_mag,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_100Rnd_65x39_caseless_mag_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_200Rnd_65x39_cased_Box_Tracer_Dim,4); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x47_Scenar_mag,4); + }; + }; }; From 035ed573b8b255877c85378e3f48933f56677334 Mon Sep 17 00:00:00 2001 From: ulteq Date: Tue, 14 Apr 2015 22:23:36 +0200 Subject: [PATCH 46/55] Reworked the magazine configs --- addons/ballistics/CfgWeapons.hpp | 143 ++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 4 deletions(-) diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index 513829130f..7944215c29 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -56,6 +56,14 @@ class CfgWeapons { }; }; class arifle_MX_SW_F: arifle_MX_Base_F { + magazines[] = { + "100Rnd_65x39_caseless_mag_Tracer", + "100Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_100Rnd_65x39_caseless_mag_Tracer_Dim", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -1.0; ACE_barrelTwist=9; ACE_barrelLength=16.0; @@ -76,6 +84,12 @@ class CfgWeapons { }; }; class arifle_MXM_F: arifle_MX_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim", + "ACE_30Rnd_65x47_Scenar_mag" + }; initSpeed = -1.018; ACE_barrelTwist=9; ACE_barrelLength=18; @@ -111,6 +125,11 @@ class CfgWeapons { /* Other */ class LMG_Mk200_F: Rifle_Long_Base_F { + magazines[] = { + "200Rnd_65x39_cased_Box", + "200Rnd_65x39_cased_Box_Tracer", + "ACE_200Rnd_65x39_cased_Box_Tracer_Dim" + }; initSpeed = -0.9763; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { @@ -180,7 +199,7 @@ class CfgWeapons { /* SMGs */ class SDAR_base_F: Rifle_Base_F { - initSpeed = -0.9723; + initSpeed = -0.989; class Single: Mode_SemiAuto { dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus // some extra because Kel-Tec. @@ -284,26 +303,51 @@ class CfgWeapons { ACE_barrelLength=7; }; class arifle_Katiba_F: arifle_katiba_Base_F { - initSpeed = -1.09; + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; + initSpeed = -1.08; ACE_barrelTwist=8; ACE_barrelLength=28.7; }; class arifle_Katiba_C_F: arifle_katiba_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -1.07; ACE_barrelTwist=8; ACE_barrelLength=26.8; }; class arifle_Katiba_GL_F: arifle_katiba_Base_F { - initSpeed = -1.09; + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; + initSpeed = -1.08; ACE_barrelTwist=8; ACE_barrelLength=28.7; }; class arifle_MX_F: arifle_MX_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -0.99; ACE_barrelTwist=9; ACE_barrelLength=14.5; }; class arifle_MX_GL_F: arifle_MX_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -0.99; ACE_barrelTwist=9; ACE_barrelLength=14.5; @@ -315,6 +359,11 @@ class CfgWeapons { }; */ class arifle_MXC_F: arifle_MX_Base_F { + magazines[] = { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer", + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" + }; initSpeed = -0.965; ACE_barrelTwist=8; ACE_barrelLength=10.5; @@ -326,7 +375,17 @@ class CfgWeapons { }; */ class arifle_SDAR_F: SDAR_base_F { - initSpeed = -0.9723; + magazines[] = { + "20Rnd_556x45_UW_mag", + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; + initSpeed = -0.989; ACE_barrelTwist=11.25; ACE_barrelLength=18; }; @@ -336,16 +395,43 @@ class CfgWeapons { ACE_barrelLength=7.7; }; class arifle_TRG20_F: Tavor_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.95; ACE_barrelTwist=7; ACE_barrelLength=15; }; class arifle_TRG21_F: Tavor_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.989; ACE_barrelTwist=7; ACE_barrelLength=18.1; }; class arifle_TRG21_GL_F: Tavor_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.989; ACE_barrelTwist=7; ACE_barrelLength=18.1; @@ -357,16 +443,43 @@ class CfgWeapons { }; */ class arifle_Mk20_F: mk20_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.98; ACE_barrelTwist=7; ACE_barrelLength=17.4; }; class arifle_Mk20C_F: mk20_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.956; ACE_barrelTwist=7; ACE_barrelLength=16; }; class arifle_Mk20_GL_F: mk20_base_F { + magazines[] = { + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red", + "30Rnd_556x45_Stanag_Tracer_Green", + "30Rnd_556x45_Stanag_Tracer_Yellow", + "ACE_30Rnd_556x45_Stanag_Mk262_mag", + "ACE_30Rnd_556x45_Stanag_Mk318_mag", + "ACE_30Rnd_556x45_Stanag_Tracer_Dim" + }; initSpeed = -0.956; ACE_barrelTwist=7; ACE_barrelLength=16; @@ -377,11 +490,21 @@ class CfgWeapons { ACE_barrelLength=5.5; }; class srifle_DMR_01_F: DMR_01_base_F { + magazines[] = { + "10Rnd_762x54_Mag", + "ACE_10Rnd_762x54_Tracer_mag" + }; initSpeed = -1.025; ACE_barrelTwist=9.5; ACE_barrelLength=24; }; class srifle_EBR_F: EBR_base_F { + magazines[] = { + "20Rnd_762x51_Mag", + "ACE_20Rnd_762x51_Mag_Tracer_Dim", + "ACE_20Rnd_762x51_M118LR_Mag", + "ACE_20Rnd_762x51_Mag_SD" + }; initSpeed = -0.9724; ACE_barrelTwist=12; ACE_barrelLength=18; @@ -409,6 +532,12 @@ class CfgWeapons { ACE_barrelLength=26; }; class srifle_DMR_03_F: DMR_03_base_F { + magazines[] = { + "20Rnd_762x51_Mag", + "ACE_20Rnd_762x51_Mag_Tracer_Dim", + "ACE_20Rnd_762x51_M118LR_Mag", + "ACE_20Rnd_762x51_Mag_SD" + }; initSpeed = -0.9843; ACE_barrelTwist=10; ACE_barrelLength=20; @@ -424,6 +553,12 @@ class CfgWeapons { ACE_barrelLength=24.41; }; class srifle_DMR_06_camo_F: DMR_06_base_F { + magazines[] = { + "20Rnd_762x51_Mag", + "ACE_20Rnd_762x51_Mag_Tracer_Dim", + "ACE_20Rnd_762x51_M118LR_Mag", + "ACE_20Rnd_762x51_Mag_SD" + }; initSpeed = -0.9916; ACE_barrelTwist=12; ACE_barrelLength=22; From 91e25dc215df2340bae62b2a03fc502857ce5a2c Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 22:34:08 +0200 Subject: [PATCH 47/55] Missing stringtable entries --- addons/medical/stringtable.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 391e277083..5704fd0bb9 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1284,6 +1284,18 @@ %1 założył stazę %1 a appliqué un garrot
+ + Heavily wounded + Schwer verwundet: + + + Lightly wounded + Leicht verwundet: + + + Very lightly wounded + Sehr leicht verwundet: + Head Kopf From 2391c5e6d6264df1423df7670ba7e5ba6bd411c0 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 22:34:19 +0200 Subject: [PATCH 48/55] Tweak crate names --- addons/medical/CfgVehicles.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index dc13964752..2b1f7c9468 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -878,7 +878,7 @@ class CfgVehicles { class ACE_medicalSupplyCrate: NATO_Box_Base { scope = 2; accuracy = 1000; - displayName = "[ACE] Medical Supply Crate (basic)"; + displayName = "[ACE] Medical Supply Crate (Basic)"; model = PATHTOF(data\ace_medcrate.p3d); author = "$STR_ACE_Common_ACETeam"; class TransportItems { @@ -913,7 +913,7 @@ class CfgVehicles { }; }; class ACE_medicalSupplyCrate_advanced: ACE_medicalSupplyCrate { - displayName = "[ACE] Medical Supply Crate (advanced)"; + displayName = "[ACE] Medical Supply Crate (Advanced)"; class TransportItems { class ACE_fieldDressing { name = "ACE_fieldDressing"; From 13d7649c4a5957365cac9a698f9321564c9e04dd Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 22:49:26 +0200 Subject: [PATCH 49/55] Buff colour flashing effect --- addons/medical/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 7bcb536cd3..296673ea5a 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -197,7 +197,7 @@ if (isNil QGVAR(level)) then { } else { GVAR(effectPainCA) ppEffectEnable false; if ((ACE_player getVariable [QGVAR(pain), 0]) > 0 && {alive ACE_player}) then { - _strength = _strength * 0.6; + _strength = _strength * 0.9; GVAR(effectPainCC) ppEffectEnable true; GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - _strength,1 - _strength,0,0,0,0.2,2]]; GVAR(effectPainCC) ppEffectCommit 0.01; From 676f7c8732508b1bce2e7ef746d492b6bbd4b7e1 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 22:49:39 +0200 Subject: [PATCH 50/55] Remove hitpart from action names for non-self --- addons/medical/ACE_Medical_Actions.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp index 72263c0b45..036dd5e9d9 100644 --- a/addons/medical/ACE_Medical_Actions.hpp +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -7,7 +7,7 @@ class ACE_Head { icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitHead"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); @@ -78,7 +78,7 @@ class ACE_Torso { icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitBody"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); @@ -178,7 +178,7 @@ class ACE_ArmLeft { distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); @@ -334,7 +334,7 @@ class ACE_ArmRight { distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightArm"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); @@ -487,7 +487,7 @@ class ACE_LegLeft { distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitLeftLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); @@ -628,7 +628,7 @@ class ACE_LegRight { distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage_HitRightLeg"; + displayName = "$STR_ACE_Medical_Bandage"; distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); From f07949cf193a6daf188bad6cacd83585901d2831 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 22:57:18 +0200 Subject: [PATCH 51/55] Remove some old todos --- addons/medical/CfgWeapons.hpp | 1 - addons/medical/XEH_postInit.sqf | 5 ----- 2 files changed, 6 deletions(-) diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index 51795d266c..8fd58e2571 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -19,7 +19,6 @@ class CfgWeapons { }; }; - // @todo localize class ACE_ItemCore; class ACE_fieldDressing: ACE_ItemCore { scope = 2; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 296673ea5a..12adad4210 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -153,11 +153,6 @@ GVAR(effectTimeBlood) = time; GVAR(lastHeartBeat) = time; GVAR(lastHeartBeatSound) = time; -// @todo, remove once parameters are set up -if (isNil QGVAR(level)) then { - GVAR(level) = 0; -}; - // HEARTRATE BASED EFFECTS [{ _heartRate = ACE_player getVariable [QGVAR(heartRate), 70]; From 9e64538bc7f1b89572a3fca3a97c3613487fb8b4 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 23:00:17 +0200 Subject: [PATCH 52/55] Fix minor adjustment strings --- addons/scopes/stringtable.xml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index c04a4e79dc..9e070efa73 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -1,21 +1,20 @@  - - "Minor adjustment up + Minor adjustment up Zerowanie powoli w górę - "Minor adjustment down + Minor adjustment down Zerowanie powoli w dół - "Minor adjustment right + Minor adjustment right Zerowanie powoli w prawo - "Minor adjustment left + Minor adjustment left Zerowanie powoli w lewo @@ -39,4 +38,4 @@ Zresetuj wyzerowanie - \ No newline at end of file + From 9b80245479f32a9fbb358c84a5a1004016c5937d Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Tue, 14 Apr 2015 23:13:02 +0200 Subject: [PATCH 53/55] Fix speed limiter not working --- addons/vehicles/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index 8f714105b6..c7665cf2aa 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -7,7 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter", { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isnotinside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player == driver vehicle ACE_player && {vehicle ACE_player isKindOf 'Car' || From c6943fbdaf2b73b84c0134970168be5c72043b78 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 14:45:21 -0700 Subject: [PATCH 54/55] fixes to ACRE volume, and this transform should really be in set/get global volume. Closes #588 --- addons/common/functions/fnc_setHearingCapability.sqf | 2 +- addons/common/functions/fnc_setVolume.sqf | 6 +++--- addons/hearing/functions/fnc_updateVolume.sqf | 2 +- addons/medical/XEH_postInit.sqf | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index 26d8ca98ac..c90a5448ae 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -52,4 +52,4 @@ _lowestVolume = 1; // Set Radio mod variables. player setVariable ["tf_globalVolume", _lowestVolume]; -player setVariable ["acre_sys_core_globalVolume", _lowestVolume]; +[_lowestVolume] call acre_api_fnc_setGlobalVolume; diff --git a/addons/common/functions/fnc_setVolume.sqf b/addons/common/functions/fnc_setVolume.sqf index ee2c42e39c..133a09bd24 100644 --- a/addons/common/functions/fnc_setVolume.sqf +++ b/addons/common/functions/fnc_setVolume.sqf @@ -27,8 +27,8 @@ if (_setVolume) then { player setVariable ["tf_unable_to_use_radio", false]; // ACRE2 - [NORMAL_LEVEL] call acre_api_fnc_setGlobalVolume; - player setVariable ["acre_sys_core_isDisabled", false, true]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [NORMAL_LEVEL^0.33] call acre_api_fnc_setGlobalVolume; }; + player setVariable ["acre_sys_core_isDisabled", false, true]; } else { // Vanilla Game @@ -40,7 +40,7 @@ if (_setVolume) then { player setVariable ["tf_unable_to_use_radio", true]; // ACRE2 - [MUTED_LEVEL] call acre_api_fnc_setGlobalVolume; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [MUTED_LEVEL^0.33] call acre_api_fnc_setGlobalVolume; }; player setVariable ["acre_sys_core_isDisabled", true, true]; }; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 1aa38848a5..dd51f30e19 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -56,7 +56,7 @@ if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then { 0.1 fadeSound _volume; 0.1 fadeSpeech _volume; ACE_player setVariable ["tf_globalVolume", _volume]; - if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume] call acre_api_fnc_setGlobalVolume;}; + if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume^(0.33)] call acre_api_fnc_setGlobalVolume;}; }; //hintSilent format ["GVAR(currentDeafness), _Volume = %1, %2", GVAR(currentDeafness), _volume]; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 1b0a38f1af..905c34cd48 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -21,14 +21,14 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; _unit setVariable ["tf_unable_to_use_radio", true, true]; _unit setVariable ["acre_sys_core_isDisabled", true, true]; - _unit setVariable ["acre_sys_core_globalVolume", 0.4]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [0.4] call acre_api_fnc_setGlobalVolume; }; } else { _unit setVariable ["tf_globalVolume", 1]; _unit setVariable ["tf_voiceVolume", 1, true]; _unit setVariable ["tf_unable_to_use_radio", false, true]; _unit setVariable ["acre_sys_core_isDisabled", false, true]; - _unit setVariable ["acre_sys_core_globalVolume", 1]; + if (!isNil "acre_api_fnc_setGlobalVolume") then { [1] call acre_api_fnc_setGlobalVolume; }; }; }; }] call ace_common_fnc_addEventHandler; From 85c10328ae27d28230ea9b3e15a418cb4d39d5e2 Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 14 Apr 2015 14:58:19 -0700 Subject: [PATCH 55/55] missed one. --- addons/common/functions/fnc_setHearingCapability.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index c90a5448ae..76837b4433 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -52,4 +52,4 @@ _lowestVolume = 1; // Set Radio mod variables. player setVariable ["tf_globalVolume", _lowestVolume]; -[_lowestVolume] call acre_api_fnc_setGlobalVolume; +if (!isNil "acre_api_fnc_setGlobalVolume") then { [_lowestVolume^0.33] call acre_api_fnc_setGlobalVolume; };