From 548b49c2dd6e20d6f5ba5c1d0e0ea2b498d2f8ca Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 4 May 2019 11:30:05 +0200 Subject: [PATCH 1/7] add buildingPos dummy object --- addons/ai/BuildingPos.p3d | Bin 0 -> 2300 bytes addons/ai/CfgVehicles.hpp | 11 +++++++++++ addons/ai/stringtable.xml | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 addons/ai/BuildingPos.p3d diff --git a/addons/ai/BuildingPos.p3d b/addons/ai/BuildingPos.p3d new file mode 100644 index 0000000000000000000000000000000000000000..ab25c325de232a5c6c2c9e9dd67e4bafbcb0765a GIT binary patch literal 2300 zcmajhKWGzS7{~E9MJXHw5e`Hs2_+y2f+&X|;;AjI7o;U7_78cW@6U)&Xq9iR*i#Lgm;}E-}cSH$lVneSI{v#x7BEo;WOhA{LT5 zvF&~)%5Oq&W%c#;-o++jp}JLcUQ|A8XU{v2i|xoI9m)B)(}T12#NF9_aMrt|uD-#~ Hx0~xHPIp2M literal 0 HcmV?d00001 diff --git a/addons/ai/CfgVehicles.hpp b/addons/ai/CfgVehicles.hpp index f0f9a72ee..9da98040f 100644 --- a/addons/ai/CfgVehicles.hpp +++ b/addons/ai/CfgVehicles.hpp @@ -28,4 +28,15 @@ class CfgVehicles { class HitPoints {}; }; + + class Strategic; + class CBA_BuildingPos: Strategic { + scope = 2; + scopeArsenal = 0; + displayName = CSTRING(BuildingPos); + model = QPATHTOF(BuildingPos.p3d); + icon = "iconObject_circle"; + editorCategory = "EdCat_Structures"; + editorSubcategory = "EdSubcat_Military"; + }; }; diff --git a/addons/ai/stringtable.xml b/addons/ai/stringtable.xml index 7a5b730c1..93c0042b7 100644 --- a/addons/ai/stringtable.xml +++ b/addons/ai/stringtable.xml @@ -13,5 +13,9 @@ Community Base Addons - Yapay Zeka Community Base Addons - Intelligenza Artificiale + + AI Building Position + KI Gebäudeposition + From 199cc51bdf5f6b987b278bca985480337461944e Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 4 May 2019 12:00:54 +0200 Subject: [PATCH 2/7] update model, editor group --- addons/ai/BuildingPos.p3d | Bin 2300 -> 26767 bytes addons/ai/CfgVehicles.hpp | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/ai/BuildingPos.p3d b/addons/ai/BuildingPos.p3d index ab25c325de232a5c6c2c9e9dd67e4bafbcb0765a..aaa80e91b44b572ca2f8ed5858129b0d5cb5e177 100644 GIT binary patch literal 26767 zcmds=ZERCj7{~8mIIMFhYb26oOqwhZ2#yp3Y`yI!FGDjj7$`w2qZzG?m#rJa!C+a{ zEP!wQAR0ErNH!6Sb`T6Hk+p6!A<+>bF_{`5Swuv)2p`x!z!#tYx%aGRH#5Pse0grt z-Sa&6od0uw=bn3d*WUYdby@lHv@}hdtZCXB=knD#wARRef>wAv1)G)|Ul+Nx*@u^g za_g7E-gG=&*wD{C+{I65HW5J)@cG7JBVq14{c&6~5q;`LQ^qUU-;`ct+ z_t1Vo2krWPEO14gE%Dn~pXp!GKEYo^?eY(dUN{(Oi5K?F)^U6jOEGDNJam|GsA<_O z>_@3I$+Z8t*WwgK%O9W9+vxWNYio8@2E1E*4L)zx4!^Iy(!Vpf2l}edpC@Tey6NUnX5mcE}LMOsbaVS+9R4QeXp{x`bZRoT~+INEL zaVjGm>=cJmr9q`qCK<{~fzbzfTEuLTMFoVXCD~Kh8cLN0l}ec;m6ZbL5W;C%o}ijW zCA?s#IFu?4DwQ(HP*w^7ApRKBZwjYdYbaG3R4QeXR95N4^tu_xDwPwHHIzE%rIfBpYy<0z@A-sx+ouB~xs-<#*JdeJQ}h;hNIUTn(?Y53KPZ0Q#lxXQ(~ z)PY~UsD>XGyiy-!Tuehp`qhhQ>6iMbgNtXW1Am$o$~NF|b$xKU1bnqi)7?ck_Ll6g zJCuKA`M#3**zmA(%nbM-&}X-#8gLP&+av% z{t5enuAV~Dk$&j^`u=^7)JIwBqb&8MANnXueUzm>%2HqYCxGhU2Nmue;Ri*-PiH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ai/CfgVehicles.hpp index 9da98040f..25b038c00 100644 --- a/addons/ai/CfgVehicles.hpp +++ b/addons/ai/CfgVehicles.hpp @@ -36,7 +36,7 @@ class CfgVehicles { displayName = CSTRING(BuildingPos); model = QPATHTOF(BuildingPos.p3d); icon = "iconObject_circle"; - editorCategory = "EdCat_Structures"; - editorSubcategory = "EdSubcat_Military"; + editorCategory = "EdCat_VRObjects"; + editorSubcategory = "EdSubcat_Helpers"; }; }; From acd0aaa4200db37b53c0854012d80e8323f14271 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 4 May 2019 12:13:16 +0200 Subject: [PATCH 3/7] CfgPatches and author config entry --- addons/ai/CfgVehicles.hpp | 4 ++++ addons/ai/config.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/ai/CfgVehicles.hpp b/addons/ai/CfgVehicles.hpp index 25b038c00..cd5dc4ec1 100644 --- a/addons/ai/CfgVehicles.hpp +++ b/addons/ai/CfgVehicles.hpp @@ -1,6 +1,7 @@ class CfgVehicles { class B_TargetSoldier; class CBA_B_InvisibleTarget: B_TargetSoldier { + author = "$STR_CBA_Author"; scope = 2; scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); @@ -11,6 +12,7 @@ class CfgVehicles { class O_TargetSoldier; class CBA_O_InvisibleTarget: O_TargetSoldier { + author = "$STR_CBA_Author"; scope = 2; scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); @@ -21,6 +23,7 @@ class CfgVehicles { class I_TargetSoldier; class CBA_I_InvisibleTarget: I_TargetSoldier { + author = "$STR_CBA_Author"; scope = 2; scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); @@ -31,6 +34,7 @@ class CfgVehicles { class Strategic; class CBA_BuildingPos: Strategic { + author = "$STR_CBA_Author"; scope = 2; scopeArsenal = 0; displayName = CSTRING(BuildingPos); diff --git a/addons/ai/config.cpp b/addons/ai/config.cpp index 1ad20a3ce..09a8a9425 100644 --- a/addons/ai/config.cpp +++ b/addons/ai/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { author = "$STR_CBA_Author"; name = CSTRING(component); url = "$STR_CBA_URL"; - units[] = {"CBA_B_InvisibleTarget","CBA_O_InvisibleTarget","CBA_I_InvisibleTarget"}; + units[] = {"CBA_B_InvisibleTarget","CBA_O_InvisibleTarget","CBA_I_InvisibleTarget","CBA_BuildingPos"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"cba_common"}; version = VERSION; From b39220014402bf5ac4b9359e26c792b15e4e9187 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 4 May 2019 22:41:47 +0200 Subject: [PATCH 4/7] delete animations --- addons/ai/BuildingPos.p3d | Bin 26767 -> 5285 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/addons/ai/BuildingPos.p3d b/addons/ai/BuildingPos.p3d index aaa80e91b44b572ca2f8ed5858129b0d5cb5e177..bc8e68831768ee06589601fabd55285299902718 100644 GIT binary patch delta 35 rcmeCb$hcHbF_{`5Swuv)2p`x!z!#tYx%aGRH#5Pse0grt z-Sa&6od0uw=bn3d*WUYdby@lHv@}hdtZCXB=knD#wARRef>wAv1)G)|Ul+Nx*@u^g za_g7E-gG=&*wD{C+{I65HW5J)@cG7JBVq14{c&6~5q;`LQ^qUU-;`ct+ z_t1Vo2krWPEO14gE%Dn~pXp!GKEYo^?eY(dUN{(Oi5K?F)^U6jOEGDNJam|GsA<_O z>_@3I$+Z8t*WwgK%O9W9+vxWNYio8@2E1E*4L)zx4!^Iy(!Vpf2l}edpC@Tey6NUnX5mcE}LMOsbaVS+9R4QeXp{x`bZRoT~+INEL zaVjGm>=cJmr9q`qCK<{~fzbzfTEuLTMFoVXCD~Kh8cLN0l}ec;m6ZbL5W;C%o}ijW zCA?s#IFu?4DwQ(HP*w^7ApRKBZwjYdYbaG3R4QeXR95N4^tu_xDwPwHHIzE%rIfBpYy<0z@A-sx+ouB~xs-<#*JdeJQ}h;hNIUTn(?Y53KPZ0Q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VO2WxjN6cce;n(R Date: Sat, 4 May 2019 22:57:04 +0200 Subject: [PATCH 5/7] add objects to zeus --- addons/ai/CfgAddons.hpp | 7 +++++++ addons/ai/CfgVehicles.hpp | 4 ++++ addons/ai/config.cpp | 1 + 3 files changed, 12 insertions(+) create mode 100644 addons/ai/CfgAddons.hpp diff --git a/addons/ai/CfgAddons.hpp b/addons/ai/CfgAddons.hpp new file mode 100644 index 000000000..2ec7354be --- /dev/null +++ b/addons/ai/CfgAddons.hpp @@ -0,0 +1,7 @@ +class CfgAddons { + class PreloadAddons { + class CBA { + list[] = {QUOTE(ADDON)}; + }; + }; +}; diff --git a/addons/ai/CfgVehicles.hpp b/addons/ai/CfgVehicles.hpp index cd5dc4ec1..6534b4c6b 100644 --- a/addons/ai/CfgVehicles.hpp +++ b/addons/ai/CfgVehicles.hpp @@ -3,6 +3,7 @@ class CfgVehicles { class CBA_B_InvisibleTarget: B_TargetSoldier { author = "$STR_CBA_Author"; scope = 2; + scopeCurator = 2; scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); icon = "CBA_iconInvisibleTarget"; @@ -14,6 +15,7 @@ class CfgVehicles { class CBA_O_InvisibleTarget: O_TargetSoldier { author = "$STR_CBA_Author"; scope = 2; + scopeCurator = 2; scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); icon = "CBA_iconInvisibleTarget"; @@ -25,6 +27,7 @@ class CfgVehicles { class CBA_I_InvisibleTarget: I_TargetSoldier { author = "$STR_CBA_Author"; scope = 2; + scopeCurator = 2; scopeArsenal = 0; model = QPATHTOF(InvisibleTarget.p3d); icon = "CBA_iconInvisibleTarget"; @@ -36,6 +39,7 @@ class CfgVehicles { class CBA_BuildingPos: Strategic { author = "$STR_CBA_Author"; scope = 2; + scopeCurator = 2; scopeArsenal = 0; displayName = CSTRING(BuildingPos); model = QPATHTOF(BuildingPos.p3d); diff --git a/addons/ai/config.cpp b/addons/ai/config.cpp index 09a8a9425..ff0aa30ba 100644 --- a/addons/ai/config.cpp +++ b/addons/ai/config.cpp @@ -17,3 +17,4 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgVehicleIcons.hpp" #include "CfgWaypoints.hpp" +#include "CfgAddons.hpp" From 604912c6e2624b73ea8d07ec39ce6b880401c921 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 7 May 2019 09:01:14 -0500 Subject: [PATCH 6/7] Change texture to `#(argb,8,8,3)color(0,0,0,0,co)` --- addons/ai/BuildingPos.p3d | Bin 5285 -> 5189 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/addons/ai/BuildingPos.p3d b/addons/ai/BuildingPos.p3d index bc8e68831768ee06589601fabd55285299902718..08f769f1d76f23b0eaca2e300aa3724666f54b62 100644 GIT binary patch delta 1161 zcmZ3gc~oPA0h64vMq*KVl8yxs8fzx!=j0b@80bJ?a=zx|KqfCjO7;*|qRvdvlu3k@ z{3Wa;gN2|)mkBGeVFU>obrkcZHxJiKCpWPE4Eg=~+;<-0m!5gudyM9RIPm-Ii!J$c z*;=^J@rw60%?bJ(`E5G>*WBd0wQ$EL-5%CAY9)&47ipQX)YJx8zLI(?jQrEzwJdj? zzjC&3yi%?n89Ca2uy3e5R_+@du9QdnD-T!4j@?i#m-SYPyfl;yP0-m@WT2;1D#nD0 zSSZSfUj%~|jZX~x;%e%*8aZJo85*o2mMVw|<+4DsuFx!KU-`wWsNZJfgrQ_;u#zle zLb)ukPS^?r!>rn=ha^Hy7)pi)E6Fk@l*3FWfD z?n8KLTrE1N19)n2Utt$Yh6XFiGA1jR1>PaRDV1hc*H8~X$O%Kq&|oE5#)NWNFaiG4 zq5!UU?o|`WaWmA%Ig5uD#^m+Ldlw!Fe{lLmj&bm3zG{aLjx+o9q5LZg$Pgy zzQS_WZo(3Ty6cu*yHc6GmEp?ZSY;@qHqrZ(T3Q=CHhgGgs51J0d@^_6v$ryqQS0;# zjKK7(YcFSb>i21po~}5J8x&uE$dRu-c$)W5>T#*FcN1&JhZO1U;Ux92w{eV}KB_6x z)?VsiZ}i&E9)i)~w@42xwzqcV&xIII%-_+oYG4m^_~!HUrDpv7 zuBY?TAF}j^Ed3!{{}T&a>yJ!KglEpS1@C=0SwFSE7Up|q^7G%1hKT?2{8Vsyeu_vc z^$Y39#(S1*yq=jkvZ182P2u>$Ru6IBINMerd!F0RG>*HZx!1##66R-d6VqQbjYXnc z7aGePlST2j#4j2b3K3*zz+y_&FqJq^xTEMV7`-)I=w*a*LxZ7)=c&YDg^L52QKK+^ z)@8YjP;O|f6Q)BAQ;EaM-El6$GAPEFGp$R!ea^y^-Fe^QjZ;Gs)Bx{jZC_xdc;8WhadXz zg>0X$-pcf3e8e?={B-qJh7IG`g*AQ+eI%!$D>gZW{GvRCboC`S(N=%+s%J%Bhw71| XH*uX#rEEfVy`wd8kGbjo!F&G&Sqb;c From 98b7978eded68443364119279c501b2d7d99241a Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 8 May 2019 18:05:22 +0200 Subject: [PATCH 7/7] add CBA_fnc_buildingPositions --- addons/ai/CfgFunctions.hpp | 1 + addons/ai/fnc_buildingPositions.sqf | 63 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 addons/ai/fnc_buildingPositions.sqf diff --git a/addons/ai/CfgFunctions.hpp b/addons/ai/CfgFunctions.hpp index 4fd5d9ea7..fbc73b02c 100644 --- a/addons/ai/CfgFunctions.hpp +++ b/addons/ai/CfgFunctions.hpp @@ -8,6 +8,7 @@ class CfgFunctions { PATHTO_FNC(taskDefend); PATHTO_FNC(taskPatrol); PATHTO_FNC(taskSearchArea); + PATHTO_FNC(buildingPositions); }; }; }; diff --git a/addons/ai/fnc_buildingPositions.sqf b/addons/ai/fnc_buildingPositions.sqf new file mode 100644 index 000000000..d4a434a0d --- /dev/null +++ b/addons/ai/fnc_buildingPositions.sqf @@ -0,0 +1,63 @@ +#include "script_component.hpp" +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_buildingPositions + +Description: + Reports positions of the building including nearby custom building positions. + +Parameters: + 0: _building - The building. + 1: _max - Maximum number of positions. (optional, default: all) + +Example: + (begin example) + [_building, _maxNumberOfPositions] call CBA_fnc_buildingPositions + (end) + +Returns: + Available building positions including custom positions > + +Author: + commy2 +---------------------------------------------------------------------------- */ + +params [["_building", objNull, [objNull]], ["_max", -1, [0]]]; + +private _availablePositions = _building buildingPos -1; + +// add nearby custom building positions +(0 boundingBoxReal _building) params ["_pos1", "_pos2", "_diameter"]; +_pos1 params ["_x1", "_y1", "_z1"]; +_pos2 params ["_x2", "_y2", "_z2"]; + +private _polygonTop = [ + [_x1, _y1, 0], + [_x2, _y1, 0], + [_x2, _y2, 0], + [_x1, _y2, 0] +]; + +private _polygonSide = [ + [_x1, _z1, 0], + [_x2, _z1, 0], + [_x2, _z2, 0], + [_x1, _z2, 0] +]; + +private _customPositions = nearestObjects [_building, ["CBA_buildingPos"], _diameter, true] apply { + _x buildingPos 0 +} select { + private _customPositionTop = _building worldToModel _x; + private _customPositionSide = +_customPositionTop; + _customPositionSide pushBack (_customPositionSide deleteAt 1); // swap y and z + + _customPositionTop inPolygon _polygonTop && _customPositionSide inPolygon _polygonSide +}; + +_availablePositions append _customPositions; + +if (_max >= 0) then { + _availablePositions resize (_max min count _availablePositions); +}; + +_availablePositions