From b4ea79a229c77703288711cb8fdc75d15a31fa4f Mon Sep 17 00:00:00 2001 From: Madin Date: Fri, 10 May 2024 17:50:39 +0200 Subject: [PATCH] change names for hiddenUnitSpawner --- addons/hiddenUnitSpawner/$PBOPREFIX$ | 2 +- addons/hiddenUnitSpawner/CfgEden.hpp | 27 +- addons/hiddenUnitSpawner/CfgEventHandlers.hpp | 10 +- .../hiddenUnitSpawner/CfgModuleCategories.hpp | 234 ------------------ addons/hiddenUnitSpawner/XEH_PREP.hpp | 28 ++- addons/hiddenUnitSpawner/config.cpp | 4 +- .../functions/fn_firstState.sqf | 12 - .../functions/fnc_EHinit.sqf | 5 + .../{fn_EHkilled.sqf => fnc_EHkilled.sqf} | 5 +- ...DeadUnit.sqf => fnc_checkNearDeadUnit.sqf} | 0 ...indHiddenPos.sqf => fnc_findHiddenPos.sqf} | 6 +- ...rame.sqf => fnc_findHiddenPosPerFrame.sqf} | 18 +- ...etAveragePos.sqf => fnc_getAveragePos.sqf} | 0 ...fn_mapPosCheck.sqf => fnc_mapPosCheck.sqf} | 4 +- ...sCheckLoop.sqf => fnc_mapPosCheckLoop.sqf} | 4 +- ...PosLoop.sqf => fnc_mapPosCheckPosLoop.sqf} | 6 +- ...apPosCleanup.sqf => fnc_mapPosCleanup.sqf} | 8 +- ...PosCompress.sqf => fnc_mapPosCompress.sqf} | 0 ..._mapPosDelete.sqf => fnc_mapPosDelete.sqf} | 0 .../{fn_mapPosInit.sqf => fnc_mapPosInit.sqf} | 0 ...PosPushback.sqf => fnc_mapPosPushback.sqf} | 4 +- ...ncompress.sqf => fnc_mapPosUncompress.sqf} | 0 ...fn_markerDebug.sqf => fnc_markerDebug.sqf} | 2 +- .../functions/script_component.hpp | 2 +- addons/hiddenUnitSpawner/script_component.hpp | 8 +- 25 files changed, 75 insertions(+), 314 deletions(-) delete mode 100644 addons/hiddenUnitSpawner/functions/fn_firstState.sqf create mode 100644 addons/hiddenUnitSpawner/functions/fnc_EHinit.sqf rename addons/hiddenUnitSpawner/functions/{fn_EHkilled.sqf => fnc_EHkilled.sqf} (77%) rename addons/hiddenUnitSpawner/functions/{fn_checkNearDeadUnit.sqf => fnc_checkNearDeadUnit.sqf} (100%) rename addons/hiddenUnitSpawner/functions/{fn_findHiddenPos.sqf => fnc_findHiddenPos.sqf} (82%) rename addons/hiddenUnitSpawner/functions/{fn_findHiddenPosPerFrame.sqf => fnc_findHiddenPosPerFrame.sqf} (82%) rename addons/hiddenUnitSpawner/functions/{fn_getAveragePos.sqf => fnc_getAveragePos.sqf} (100%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosCheck.sqf => fnc_mapPosCheck.sqf} (59%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosCheckLoop.sqf => fnc_mapPosCheckLoop.sqf} (63%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosCheckPosLoop.sqf => fnc_mapPosCheckPosLoop.sqf} (71%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosCleanup.sqf => fnc_mapPosCleanup.sqf} (77%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosCompress.sqf => fnc_mapPosCompress.sqf} (100%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosDelete.sqf => fnc_mapPosDelete.sqf} (100%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosInit.sqf => fnc_mapPosInit.sqf} (100%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosPushback.sqf => fnc_mapPosPushback.sqf} (86%) rename addons/hiddenUnitSpawner/functions/{fn_mapPosUncompress.sqf => fnc_mapPosUncompress.sqf} (100%) rename addons/hiddenUnitSpawner/functions/{fn_markerDebug.sqf => fnc_markerDebug.sqf} (85%) diff --git a/addons/hiddenUnitSpawner/$PBOPREFIX$ b/addons/hiddenUnitSpawner/$PBOPREFIX$ index 21c93aa..00c1dba 100644 --- a/addons/hiddenUnitSpawner/$PBOPREFIX$ +++ b/addons/hiddenUnitSpawner/$PBOPREFIX$ @@ -1 +1 @@ -z\afmf\addons\staticspawn \ No newline at end of file +z\afmf\addons\hiddenUnitSpawner \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/CfgEden.hpp b/addons/hiddenUnitSpawner/CfgEden.hpp index 7824763..626dbb2 100644 --- a/addons/hiddenUnitSpawner/CfgEden.hpp +++ b/addons/hiddenUnitSpawner/CfgEden.hpp @@ -1,26 +1,25 @@ - class Cfg3DEN { - class Group + class Object { class AttributeCategories { - class MAI_Attributes + class MAI_HiddenUnit_Attributes { displayName = "MAI"; collapsed = 0; class Attributes { - class MAI_AIgroupEnableAi + class MAI_HiddenUnit_tickets { //--- Mandatory properties - displayName = "$STR_MAI_AIgroupEnableAi"; - tooltip = "$STR_MAI_AIgroupEnableAiTip"; + displayName = "$STR_MAI_hiddenUnitTickets"; + tooltip = "$STR_MAI_hiddenUnitTicketsTip"; property = QGVAR(tickets); - control = "Checkbox"; + control = "EditShort"; expression = "_this setVariable ['%s',_value];"; - defaultValue = "true"; + defaultValue = "1"; condition = "objectBrain"; // https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Attributes#Condition typeName = "BOOL"; }; @@ -28,14 +27,4 @@ class Cfg3DEN }; }; }; -}; - - { - displayName = "$STR_MAI_sphereDespawnDistance"; - tooltip = "$STR_MAI_sphereDespawnDistanceShort"; - defaultValue = "50"; - property = QGVAR(sphereDespawnDistance); - expression = "_this setVariable ['%s',_value];"; - typeName = "NUMBER"; - control = "EditShort"; - }; \ No newline at end of file +}; \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/CfgEventHandlers.hpp b/addons/hiddenUnitSpawner/CfgEventHandlers.hpp index 6131c7f..21a7611 100644 --- a/addons/hiddenUnitSpawner/CfgEventHandlers.hpp +++ b/addons/hiddenUnitSpawner/CfgEventHandlers.hpp @@ -13,11 +13,17 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; - +class Extended_init_EventHandlers { + class CAManBase { + class MAI_hidden_Unit_EH_init { + init = QUOTE(call FUNC(EHinit)); + }; + }; +}; class Extended_Killed_EventHandlers { class CAManBase { class MAI_hidden_Unit_EH_killed { - killed = QUOTE(call FUNC(EH)); + killed = QUOTE(call FUNC(EHkilled)); }; }; }; \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/CfgModuleCategories.hpp b/addons/hiddenUnitSpawner/CfgModuleCategories.hpp index a833231..421c54b 100644 --- a/addons/hiddenUnitSpawner/CfgModuleCategories.hpp +++ b/addons/hiddenUnitSpawner/CfgModuleCategories.hpp @@ -1,235 +1 @@ #include "script_component.hpp" - -class CfgFactionClasses -{ - class NO_CATEGORY; - class MAI_Modules: NO_CATEGORY - { - displayName = "Armaforces - MAI"; - //side = 7; - }; -}; - -class CfgVehicles -{ - class Logic; - class Module_F: Logic - { - class AttributesBase - { - class Default; - class Edit; // Default edit box (i.e., text input field) - class Combo; // Default combo box (i.e., drop-down menu) - class Checkbox; // Default checkbox (returned value is Bool) - class CheckboxNumber; // Default checkbox (returned value is Number) - class ModuleDescription; // Module description - class Units; // Selection of units on which the module is applied - }; - // Description base classes, for more information see below - class ModuleDescription - { - class AnyBrain; - }; - }; - class MAI_Modulestaticspawn: Module_F - { - // Standard object definitions - scope = 2; // Editor visibility; 2 will show it in the menu, 1 will hide it. - displayName = "Static Spawn"; // Name displayed in the menu - category = "MAI_Modules"; - - // Name of function triggered once conditions are met - function = QFUNC(initCall); - // Execution priority, modules with lower number are executed first. 0 is used when the attribute is undefined - functionPriority = 1; - // 0 for server only execution, 1 for global execution, 2 for persistent global execution - isGlobal = 0; - // 1 for module waiting until all synced triggers are activated - isTriggerActivated = 0; - // 1 if modules is to be disabled once it's activated (i.e., repeated trigger activation won't work) - isDisposable = 1; - // // 1 to run init function in Eden Editor as well - is3DEN = 1; - - // Menu displayed when the module is placed or double-clicked on by Zeus - //curatorInfoType = "RscDisplayAttributeModuleNuke"; - - // Module attributes, uses https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Attributes#Entity_Specific - class Attributes: AttributesBase - { - // Arguments shared by specific module type (have to be mentioned in order to be present) - class GVAR(tickets): Default - { - displayName = "$STR_MAI_tickets"; - tooltip = "$STR_MAI_tickets"; - defaultValue = "1"; - property = QGVAR(tickets); - expression = "_this setVariable ['%s',_value];"; - typeName = "NUMBER"; - control = "EditShort"; - }; - class GVAR(sphereSize): Default - { - displayName = "$STR_MAI_sphereSize"; - tooltip = "$STR_MAI_sphereSizeShort"; - defaultValue = "250"; - property = QGVAR(sphereSize); - expression = "_this setVariable ['%s',_value];"; - typeName = "NUMBER"; - control = "EditShort"; - }; - class GVAR(sphereDespawnDistance): Default - { - displayName = "$STR_MAI_sphereDespawnDistance"; - tooltip = "$STR_MAI_sphereDespawnDistanceShort"; - defaultValue = "50"; - property = QGVAR(sphereDespawnDistance); - expression = "_this setVariable ['%s',_value];"; - typeName = "NUMBER"; - control = "EditShort"; - }; - class GVAR(checkVisibility): Checkbox - { - displayName = "$STR_MAI_checkVisibility"; - tooltip = "$STR_MAI_checkVisibilityShort"; - property = QGVAR(checkVisibility); - defaultValue = "true"; - expression = "_this setVariable ['%s', _value];"; - typeName = "BOOL"; - }; - class GVAR(sphereBackDistance): Default - { - displayName = "$STR_MAI_sphereBackDistance"; - tooltip = "$STR_MAI_sphereBackDistanceShort"; - defaultValue = "35"; - property = QGVAR(sphereBackDistance); - expression = "_this setVariable ['%s',_value];"; - typeName = "NUMBER"; - control = "EditShort"; - }; - class GVAR(forceSpawnDistance): Default - { - displayName = "$STR_MAI_sphereBackDistance"; - tooltip = "$STR_MAI_sphereBackDistanceShort"; - defaultValue = "0.35"; - property = QGVAR(forceSpawnDistance); - expression = "_this setVariable ['%s',_value max 0 min 1];"; - typeName = "NUMBER"; - control = "EditShort"; - }; - class GVAR(interval): Default - { - displayName = "$STR_MAI_interval"; - tooltip = "$STR_MAI_intervalShort"; - defaultValue = "0.1"; - property = QGVAR(interval); - expression = "_this setVariable ['%s',_value max 0];"; - typeName = "NUMBER"; - control = "EditShort"; - }; - class GVAR(unitsPerInterval): Default - { - displayName = "$STR_MAI_unitsPerInterval"; - tooltip = "$STR_MAI_unitsPerIntervalShort"; - defaultValue = "1"; - property = QGVAR(unitsPerInterval); - expression = "_this setVariable ['%s',_value max 0];"; - typeName = "NUMBER"; - control = "EditShort"; - }; - class GVAR(deleteVehicles): Checkbox - { - displayName = "$STR_MAI_deleteVehicles"; - tooltip = "$STR_MAI_deleteVehiclesShort"; - property = QGVAR(deleteVehicles); - defaultValue = "false"; - expression = "_this setVariable ['%s', _value];"; - typeName = "BOOL"; - }; - class GVAR(checkBuildings): Checkbox - { - displayName = "$STR_MAI_checkBuildings"; - tooltip = "$STR_MAI_checkBuildingsShort"; - property = QGVAR(checkBuildings); - defaultValue = "true"; - expression = "_this setVariable ['%s', _value];"; - typeName = "BOOL"; - }; - class GVAR(activateCondition) - { - displayName = "$STR_MAI_activateCondition"; - tooltip = "$STR_MAI_activateConditionShort"; - property = QGVAR(activateCondition); - control = "EditCodeMulti5"; - expression = "_this setVariable ['%s',compile _value];"; - defaultValue = "'true'"; - value = 0; - validate = "none"; - wikiType = "[[String]]"; - }; - class GVAR(deleteTrigger): Checkbox - { - displayName = "$STR_MAI_deleteTrigger"; - tooltip = "$STR_MAI_deleteTriggerShort"; - property = QGVAR(deleteTrigger); - defaultValue = "false"; - expression = "_this setVariable ['%s', _value];"; - typeName = "BOOL"; - }; - class GVAR(forceActivate): Checkbox - { - displayName = "$STR_MAI_forceActivate"; - tooltip = "$STR_MAI_forceActivateShort"; - property = QGVAR(forceActivate); - defaultValue = "false"; - expression = "_this setVariable ['%s', _value];"; - typeName = "BOOL"; - }; - class GVAR(executionCodeUnit) - { - displayName = "$STR_MAI_executionCodeUnit"; - tooltip = "$STR_MAI_executionCodeUnitShort"; - property = QGVAR(executionCodeUnit); - control = "EditCodeMulti5"; - expression = "_this setVariable ['%s',compile _value];"; - defaultValue = "''"; - value = 0; - validate = "none"; - wikiType = "[[String]]"; - }; - class GVAR(executionCodeGroup) - { - displayName = "$STR_MAI_executionCodePatrol"; - tooltip = "$STR_MAI_executionCodePatrolShort"; - property = QGVAR(executionCodeGroup); - control = "EditCodeMulti5"; - expression = "_this setVariable ['%s',compile _value];"; - defaultValue = "''"; - value = 0; - validate = "none"; - wikiType = "[[String]]"; - }; - class ModuleDescription: ModuleDescription{}; // Module description should be shown last - }; - - // Module description. Must inherit from base class, otherwise pre-defined entities won't be available - class ModuleDescription: ModuleDescription - { - description = "Simple spawn for AI. AI will be only spawned when AI will be closer than set distance. Only one unit from group need to be synchronized. Supports vehicles – Vehicle will stay, but crew will be spawned. Synchronize vehicle or unit."; // Short description, will be formatted as structured text - sync[] = {"LocationArea_F"}; // Array of synced entities (can contain base classes) - - class LocationArea_F - { - description[] = { // Multi-line descriptions are supported - "First line", - "Second line" - }; - position = 1; // Position is taken into effect - direction = 0; // Direction is taken into effect - optional = 0; // Synced entity is optional - duplicate = 0; // Multiple entities of this type can be synced - synced[] = {"AnyBrain"}; // Pre-define entities like "AnyBrain" can be used. See the list below - }; - }; - }; -}; diff --git a/addons/hiddenUnitSpawner/XEH_PREP.hpp b/addons/hiddenUnitSpawner/XEH_PREP.hpp index 8b100e4..fd75abe 100644 --- a/addons/hiddenUnitSpawner/XEH_PREP.hpp +++ b/addons/hiddenUnitSpawner/XEH_PREP.hpp @@ -1,12 +1,16 @@ -PREP(despawn); -PREP(despawnLoop); -PREP(firstState); -PREP(getGroups); -PREP(init); -PREP(initCall); -PREP(loop); -PREP(waitUntil); -PREP(spawnUnit); -PREP(checkSpawnConditions); -PREP(addEH); -PREP(despawnAddToLogic); \ No newline at end of file +PREP(markerDebug); +PREP(mapPosUncompress); +PREP(mapPosPushback); +PREP(mapPosInit); +PREP(mapPosDelete); +PREP(mapPosCompress); +PREP(mapPosCleanup); +PREP(mapPosCheckPosLoop); +PREP(mapPosCheckLoop); +PREP(mapPosCheck); +PREP(getAveragePos); +PREP(findHiddenPosPerFrame); +PREP(findHiddenPos); +PREP(EHinit); +PREP(EHkilled); +PREP(checkNearDeadUnit); \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/config.cpp b/addons/hiddenUnitSpawner/config.cpp index 22b789a..fcbc2c5 100644 --- a/addons/hiddenUnitSpawner/config.cpp +++ b/addons/hiddenUnitSpawner/config.cpp @@ -14,4 +14,6 @@ #include "CfgEventHandlers.hpp" -#include "CfgModuleCategories.hpp" \ No newline at end of file +#include "CfgModuleCategories.hpp" + +#include "CfgEden.hpp" \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fn_firstState.sqf b/addons/hiddenUnitSpawner/functions/fn_firstState.sqf deleted file mode 100644 index 3e8920c..0000000 --- a/addons/hiddenUnitSpawner/functions/fn_firstState.sqf +++ /dev/null @@ -1,12 +0,0 @@ -#include "script_component.hpp" - -[ - { - params [["_unit", objNull], ["_tickets", 3]]; - { - [_x, _tickets] call AF_fnc_hiddenPosEH; - } forEach units group _unit; - }, - _this, - 1 -] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fnc_EHinit.sqf b/addons/hiddenUnitSpawner/functions/fnc_EHinit.sqf new file mode 100644 index 0000000..3f70004 --- /dev/null +++ b/addons/hiddenUnitSpawner/functions/fnc_EHinit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +params [["_unit", objNull]]; +systemChat str _this; +_unit setVariable [QGVAR(unitLoadout), getUnitLoadout _unit]; \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fn_EHkilled.sqf b/addons/hiddenUnitSpawner/functions/fnc_EHkilled.sqf similarity index 77% rename from addons/hiddenUnitSpawner/functions/fn_EHkilled.sqf rename to addons/hiddenUnitSpawner/functions/fnc_EHkilled.sqf index 52ad256..c9e1ff0 100644 --- a/addons/hiddenUnitSpawner/functions/fn_EHkilled.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_EHkilled.sqf @@ -1,8 +1,9 @@ #include "script_component.hpp" +systemChat "test EHkilled"; params ["_unit", "_killer", "_instigator", "_useEffects"]; private _tickets = _unit getVariable [QGVAR(tickets), 1]; +systemChat str _tickets; if (_tickets <= 1) exitWith {}; - private _unitLoadout = _unit getVariable [QGVAR(unitLoadout), []]; -[getposATL _unit, group _unit, typeOf _unit, _unitLoadout, _tickets, 5000] call AF_fnc_findHiddenPos; \ No newline at end of file +[getposATL _unit, group _unit, typeOf _unit, _unitLoadout, _tickets, 5000] call FUNC(findHiddenPos); \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fn_checkNearDeadUnit.sqf b/addons/hiddenUnitSpawner/functions/fnc_checkNearDeadUnit.sqf similarity index 100% rename from addons/hiddenUnitSpawner/functions/fn_checkNearDeadUnit.sqf rename to addons/hiddenUnitSpawner/functions/fnc_checkNearDeadUnit.sqf diff --git a/addons/hiddenUnitSpawner/functions/fn_findHiddenPos.sqf b/addons/hiddenUnitSpawner/functions/fnc_findHiddenPos.sqf similarity index 82% rename from addons/hiddenUnitSpawner/functions/fn_findHiddenPos.sqf rename to addons/hiddenUnitSpawner/functions/fnc_findHiddenPos.sqf index 457f9df..d80244b 100644 --- a/addons/hiddenUnitSpawner/functions/fn_findHiddenPos.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_findHiddenPos.sqf @@ -6,12 +6,12 @@ if (units _group isEqualTo []) exitWith { }; private _players = allPlayers select {_x distance _pos < _maxDistance}; if (_players isEqualTo []) then {_players = allPlayers}; -private _averagePosUnitGroup = [units _group] call AF_fnc_getAveragePos; +private _averagePosUnitGroup = [units _group] call FUNC(getAveragePos); if (_averagePosUnitGroup isEqualTo [0,0,0]) then {_averagePosUnitGroup = _pos}; -private _averagePosPlayers = [_players] call AF_fnc_getAveragePos; +private _averagePosPlayers = [_players] call FUNC(getAveragePos); private _dirToUnit = _averagePosPlayers getDir _averagePosUnitGroup; private _centerPos = _averagePosUnitGroup getPos [_minDistance , _dirToUnit]; _centerPos = _centerPos vectorAdd [_minDistance/2 - random _minDistance, _minDistance/2 - random _minDistance, 0]; _nearObjects = nearestTerrainObjects [_centerPos, ["Tree", "Bush", "ROCK"], 75, false]; // if (_nearObjects isEqualTo []) exitWith {}; -[_pos, _group, _type, _loadout, _tickets, _maxDistance, _minDistance, _nearObjects, _players] call AF_fnc_findHiddenPosPerFrame; +[_pos, _group, _type, _loadout, _tickets, _maxDistance, _minDistance, _nearObjects, _players] call FUNC(findHiddenPosPerFrame); diff --git a/addons/hiddenUnitSpawner/functions/fn_findHiddenPosPerFrame.sqf b/addons/hiddenUnitSpawner/functions/fnc_findHiddenPosPerFrame.sqf similarity index 82% rename from addons/hiddenUnitSpawner/functions/fn_findHiddenPosPerFrame.sqf rename to addons/hiddenUnitSpawner/functions/fnc_findHiddenPosPerFrame.sqf index ad4915d..02b4c8f 100644 --- a/addons/hiddenUnitSpawner/functions/fn_findHiddenPosPerFrame.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_findHiddenPosPerFrame.sqf @@ -5,39 +5,39 @@ params [["_pos", [0,0,0]], ["_group", grpNull], ["_type", "B_Soldier_F"], ["_loa if (_players isEqualTo [] || _nearObjects isEqualTo []) exitWith { //systemChat format ["retry, %1", _minDistance]; [ - {_this call AF_fnc_findHiddenPos}, + {_this call FUNC(findHiddenPos)}, [_pos, _group, _type, _loadout, _tickets, _maxDistance, _minDistance + 50] ] call CBA_fnc_execNextFrame; }; private _objPos = getposATL (_nearObjects deleteAt floor random count _nearObjects); -private _posInBlacklist = [_objPos] call AF_fnc_mapPosCheck; +private _posInBlacklist = [_objPos]call FUNC(mapPosCheck); if (_posInBlacklist) exitWith { [ - {_this call AF_fnc_findHiddenPosPerFrame}, + {_this call FUNC(findHiddenPosPerFrame)}, [_pos, _group, _type, _loadout, _tickets, _maxDistance, _minDistance, _nearObjects, _players] ] call CBA_fnc_execNextFrame; }; // check if there is dead unit from group nearby, if true check another locationNull private _deadUnitsNearby = false; { - if ([_x] call AF_fnc_checkNearDeadUnit) exitWith { + if ([_x]call FUNC(checkNearDeadUnit)) exitWith { _deadUnitsNearby = true; }; } forEach units _group; if (_deadUnitsNearby) exitWith { [ - {_this call AF_fnc_findHiddenPosPerFrame}, + {_this call FUNC(findHiddenPosPerFrame)}, [_pos, _group, _type, _loadout, _tickets, _maxDistance, _minDistance, _nearObjects, _players] ] call CBA_fnc_execNextFrame; }; // check pos -private _averagePos = [_players] call AF_fnc_getAveragePos; +private _averagePos = [_players]call FUNC(getAveragePos); private _dirToUnit = _averagePos getDir _objPos; _objPos = _objPos getPos [1, _dirToUnit]; private _position = _objPos findEmptyPosition [1,5,"B_Soldier_F"]; if (_position isEqualTo []) exitWith { [ - {_this call AF_fnc_findHiddenPosPerFrame}, + {_this call FUNC(findHiddenPosPerFrame)}, [_pos, _group, _type, _loadout, _tickets, _maxDistance, _minDistance, _nearObjects, _players] ] call CBA_fnc_execNextFrame; }; @@ -51,7 +51,7 @@ private _posVisible = false; } forEach _players; if (_posVisible) exitWith { [ - {_this call AF_fnc_findHiddenPosPerFrame}, + {_this call FUNC(findHiddenPosPerFrame)}, [_pos, _group, _type, _loadout, _tickets, _maxDistance, _minDistance, _nearObjects, _players] ] call CBA_fnc_execNextFrame; }; @@ -60,4 +60,4 @@ private _newUnit = [_group, _type, _position, _position getDir _averagePos] call if !(_loadout isEqualTo []) then { _newUnit setUnitLoadout _loadout; }; -[_newUnit, _tickets - 1] call AF_fnc_hiddenPosEH; \ No newline at end of file +[_newUnit, _tickets - 1]call FUNC(hiddenPosEH); \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fn_getAveragePos.sqf b/addons/hiddenUnitSpawner/functions/fnc_getAveragePos.sqf similarity index 100% rename from addons/hiddenUnitSpawner/functions/fn_getAveragePos.sqf rename to addons/hiddenUnitSpawner/functions/fnc_getAveragePos.sqf diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosCheck.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosCheck.sqf similarity index 59% rename from addons/hiddenUnitSpawner/functions/fn_mapPosCheck.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosCheck.sqf index 5bec3ac..4fad49e 100644 --- a/addons/hiddenUnitSpawner/functions/fn_mapPosCheck.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_mapPosCheck.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" params [["_pos", [0,0,0]], ["_pushback", false]]; -private _posCompressed = [_pos] call AF_fnc_mapPosCompress; +private _posCompressed = [_pos] call FUNC(mapPosCompress); private _posX = _posCompressed select 0; private _posY = _posCompressed select 1; -[_posX, _posY, _pushback] call AF_fnc_mapPosPushback; \ No newline at end of file +[_posX, _posY, _pushback] call FUNC(mapPosPushback); \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosCheckLoop.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosCheckLoop.sqf similarity index 63% rename from addons/hiddenUnitSpawner/functions/fn_mapPosCheckLoop.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosCheckLoop.sqf index f32b1f3..723f513 100644 --- a/addons/hiddenUnitSpawner/functions/fn_mapPosCheckLoop.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_mapPosCheckLoop.sqf @@ -6,7 +6,7 @@ if (_players isEqualTo []) then { }; private _player = _players deleteAt 0; -private _posCompressed = [getposATL _player] call AF_fnc_mapPosCompress; +private _posCompressed = [getposATL _player] call FUNC(mapPosCompress); private _posX = _posCompressed select 0; private _posY = _posCompressed select 1; -[_posX, _posY, -1, -1, _players] call AF_fnc_mapPosCheckPosLoop; \ No newline at end of file +[_posX, _posY, -1, -1, _players] call FUNC(mapPosCheckPosLoop); \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosCheckPosLoop.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosCheckPosLoop.sqf similarity index 71% rename from addons/hiddenUnitSpawner/functions/fn_mapPosCheckPosLoop.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosCheckPosLoop.sqf index bff8dc3..44cc09e 100644 --- a/addons/hiddenUnitSpawner/functions/fn_mapPosCheckPosLoop.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_mapPosCheckPosLoop.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" params [["_posX", 0], ["_posY", 0], ["_offsetX", -1], ["_offsetY", -1], ["_players", []]]; -[_posX + _offsetX, _posY + _offsetY, true] call AF_fnc_mapPosPushback; +[_posX + _offsetX, _posY + _offsetY, true] call FUNC(mapPosPushback); _offsetY = _offsetY + 1; if (_offsetY > 1) then { _offsetY = -1; @@ -9,11 +9,11 @@ if (_offsetY > 1) then { }; if (_offsetX > 1) exitWith { [ - {_this call AF_fnc_mapPosCheckLoop}, + {_this call FUNC(mapPosCheckLoop)}, [_players] ] call CBA_fnc_execNextFrame; }; [ - {_this call AF_fnc_mapPosCheckPosLoop}, + {_this call FUNC(mapPosCheckPosLoop)}, [_posX, _posY, _offsetX, _offsetY, _players] ] call CBA_fnc_execNextFrame; \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosCleanup.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosCleanup.sqf similarity index 77% rename from addons/hiddenUnitSpawner/functions/fn_mapPosCleanup.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosCleanup.sqf index 3d2c57d..cc3c36c 100644 --- a/addons/hiddenUnitSpawner/functions/fn_mapPosCleanup.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_mapPosCleanup.sqf @@ -4,7 +4,7 @@ params [["_mapBlacklist", []], ["_distance", 750]]; if (_mapBlacklist isEqualTo []) exitWith { _mapBlacklist = + AF_mapBlacklist; [ - {_this call AF_fnc_mapPosCleanup}, + {_this call FUNC(mapPosCleanup)}, [_mapBlacklist, _distance] ] call CBA_fnc_execNextFrame; }; @@ -15,12 +15,12 @@ private _posY = _posYArray deleteAt 0; if (count _posYArray <= 0) then { _mapBlacklist deleteAt 0; }; -private _posCenter = [[_posX, _posY]] call AF_fnc_mapPosUncompress; +private _posCenter = [[_posX, _posY]] call FUNC(mapPosUncompress); private _nearPlayers = _posCenter nearEntities ["allVehicles", 750] select {isPlayer _x}; if (_nearPlayers isEqualTo []) then { - [_posX, _posY] call AF_fnc_mapPosDelete; + [_posX, _posY] call FUNC(mapPosDelete); }; [ - {_this call AF_fnc_mapPosCleanup}, + {_this call FUNC(mapPosCleanup)}, [_mapBlacklist, _distance] ] call CBA_fnc_execNextFrame; \ No newline at end of file diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosCompress.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosCompress.sqf similarity index 100% rename from addons/hiddenUnitSpawner/functions/fn_mapPosCompress.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosCompress.sqf diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosDelete.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosDelete.sqf similarity index 100% rename from addons/hiddenUnitSpawner/functions/fn_mapPosDelete.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosDelete.sqf diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosInit.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosInit.sqf similarity index 100% rename from addons/hiddenUnitSpawner/functions/fn_mapPosInit.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosInit.sqf diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosPushback.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosPushback.sqf similarity index 86% rename from addons/hiddenUnitSpawner/functions/fn_mapPosPushback.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosPushback.sqf index 68dd558..f53a6ab 100644 --- a/addons/hiddenUnitSpawner/functions/fn_mapPosPushback.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_mapPosPushback.sqf @@ -7,7 +7,7 @@ if (_findX == -1) exitWith { AF_mapBlacklist pushBack [_posX, [_posY]]; if (AF_debug) then { - [_posX, _posY] call AF_fnc_markerDebug; + [_posX, _posY] call FUNC(markerDebug); }; }; false @@ -20,7 +20,7 @@ if (_findY == -1) exitWith { _posYarray pushBack _posY; if (AF_debug) then { - [_posX, _posY] call AF_fnc_markerDebug; + [_posX, _posY] call FUNC(markerDebug); }; }; false diff --git a/addons/hiddenUnitSpawner/functions/fn_mapPosUncompress.sqf b/addons/hiddenUnitSpawner/functions/fnc_mapPosUncompress.sqf similarity index 100% rename from addons/hiddenUnitSpawner/functions/fn_mapPosUncompress.sqf rename to addons/hiddenUnitSpawner/functions/fnc_mapPosUncompress.sqf diff --git a/addons/hiddenUnitSpawner/functions/fn_markerDebug.sqf b/addons/hiddenUnitSpawner/functions/fnc_markerDebug.sqf similarity index 85% rename from addons/hiddenUnitSpawner/functions/fn_markerDebug.sqf rename to addons/hiddenUnitSpawner/functions/fnc_markerDebug.sqf index f41eda7..730a7cb 100644 --- a/addons/hiddenUnitSpawner/functions/fn_markerDebug.sqf +++ b/addons/hiddenUnitSpawner/functions/fnc_markerDebug.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" params [["_posX", 0], ["_posY", 0]]; -private _markerPos = [[_posX, _posY]] call AF_fnc_mapPosUncompress; +private _markerPos = [[_posX, _posY]] call FUNC(mapPosUncompress); //_markerPos = _markerPos vectorAdd [25,25,0]; private _marker = createMarkerLocal [format ["%1-%2", _posX, _posY], _markerPos]; _marker setMarkerColorLocal "ColorBlack"; diff --git a/addons/hiddenUnitSpawner/functions/script_component.hpp b/addons/hiddenUnitSpawner/functions/script_component.hpp index 2ed524c..47db9b9 100644 --- a/addons/hiddenUnitSpawner/functions/script_component.hpp +++ b/addons/hiddenUnitSpawner/functions/script_component.hpp @@ -1 +1 @@ -#include "\z\afmf\addons\staticspawn\script_component.hpp" +#include "\z\afmf\addons\hiddenUnitSpawner\script_component.hpp" diff --git a/addons/hiddenUnitSpawner/script_component.hpp b/addons/hiddenUnitSpawner/script_component.hpp index 38686d5..41566e2 100644 --- a/addons/hiddenUnitSpawner/script_component.hpp +++ b/addons/hiddenUnitSpawner/script_component.hpp @@ -1,14 +1,14 @@ -#define COMPONENT staticspawn +#define COMPONENT hiddenUnitSpawner #include "\z\afmf\addons\main\script_mod.hpp" #define DEBUG_MODE_FULL #define DISABLE_COMPILE_CACHE -#ifdef DEBUG_ENABLED_STATICSPAWN +#ifdef DEBUG_ENABLED_hiddenUnitSpawner #define DEBUG_MODE_FULL #endif - #ifdef DEBUG_SETTINGS_STATICSPAWN - #define DEBUG_SETTINGS DEBUG_SETTINGS_STATICSPAWN + #ifdef DEBUG_SETTINGS_hiddenUnitSpawner + #define DEBUG_SETTINGS DEBUG_SETTINGS_hiddenUnitSpawner #endif #include "\z\afmf\addons\main\script_macros.hpp"