diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..3b4247f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2014 Benedikt Lang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/e12_amf_dac/$PBOPREFIX$ b/e12_amf_dac/$PBOPREFIX$ new file mode 100755 index 0000000..6c0a715 --- /dev/null +++ b/e12_amf_dac/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_dac \ No newline at end of file diff --git a/e12_amf_dac/XEH_PostClientInit.sqf b/e12_amf_dac/XEH_PostClientInit.sqf new file mode 100755 index 0000000..a88e412 --- /dev/null +++ b/e12_amf_dac/XEH_PostClientInit.sqf @@ -0,0 +1,30 @@ +#include "script_component.hpp" +TRACE_1("Process","PostInitClient"); +waitUntil{!isNull player}; + +if(isMultiplayer) then { + LOG("Multiplayer"); + + //Only executed on hc client + if (!hasInterface && !isServer) then{ + if(isNil "paramsArray") then{ paramsArray=[0,0,0]}; + + //HC should be used + if(paramsArray select 0 == 1) then{ + if(!isNil QGVAR(DELAYED_START)) then { + waitUntil{!isNil QGVAR(DELAYED_START_GO)}; + }; + LOG("HC present and activated"); + HCName = name player; + publicVariable "HCName"; + HCPresent = true; + publicVariable "HCPresent"; + [] call FUNC(callUserScripts); + }else{ + LOG("HC present but not activated"); + }; + }; +}else{ + LOG("No Multiplayer - nothing to do for the client"); +}; + diff --git a/e12_amf_dac/XEH_PostServerInit.sqf b/e12_amf_dac/XEH_PostServerInit.sqf new file mode 100755 index 0000000..0ef3690 --- /dev/null +++ b/e12_amf_dac/XEH_PostServerInit.sqf @@ -0,0 +1,35 @@ +#include "script_component.hpp" +TRACE_1("Process","PostInitServer"); + +if(isMultiplayer) then { + LOG("Multiplayer - Check if server should run AI"); + if(isNil "paramsArray") then{ paramsArray=[0,0,0]}; + + //HC should be used + if(paramsArray select 0 == 0) then{ + if(!isNil QGVAR(DELAYED_START)) then { + waitUntil{!isNil QGVAR(DELAYED_START_GO)}; + }; + LOG("Server should run AI"); + HCPresent = false; + HCName = "NONE"; + publicVariable "HCPresent"; + publicVariable "HCName"; + [] call FUNC(callUserScripts); + LOG("Server runs AI"); + }else{ + LOG("Server will not run AI"); + }; +}else{ + if(!isNil QGVAR(DELAYED_START)) then { + waitUntil{!isNil QGVAR(DELAYED_START_GO)}; + }; + LOG("No Multiplayer - Server/Client is starting DAC"); + HCPresent = false; + HCName = "NONE"; + publicVariable "HCPresent"; + publicVariable "HCName"; + [] call FUNC(callUserScripts); +}; + + diff --git a/e12_amf_dac/XEH_PreClientInit.sqf b/e12_amf_dac/XEH_PreClientInit.sqf new file mode 100755 index 0000000..f7efd22 --- /dev/null +++ b/e12_amf_dac/XEH_PreClientInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInitClient"); + +PREP(callUserScripts); \ No newline at end of file diff --git a/e12_amf_dac/XEH_PreServerInit.sqf b/e12_amf_dac/XEH_PreServerInit.sqf new file mode 100755 index 0000000..f7efd22 --- /dev/null +++ b/e12_amf_dac/XEH_PreServerInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInitClient"); + +PREP(callUserScripts); \ No newline at end of file diff --git a/e12_amf_dac/config.cpp b/e12_amf_dac/config.cpp new file mode 100755 index 0000000..dae5c10 --- /dev/null +++ b/e12_amf_dac/config.cpp @@ -0,0 +1,37 @@ +class CfgPatches +{ + class e12_amf_dac + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + + + +class Extended_PreInit_EventHandlers +{ + class e12_amf_dac { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_dac\XEH_PreClientInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_dac\XEH_PreServerInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_dac { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_dac\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_dac\XEH_PostServerInit.sqf'"; + }; +}; + + + + + diff --git a/e12_amf_dac/fnc_callUserScripts.sqf b/e12_amf_dac/fnc_callUserScripts.sqf new file mode 100755 index 0000000..11f9314 --- /dev/null +++ b/e12_amf_dac/fnc_callUserScripts.sqf @@ -0,0 +1,17 @@ +#include "script_component.hpp" +LOG("Userscripts called"); +if(!isNil QGVAR(userscripts)) then { + LOG("Userscripts not nil"); + TRACE_1("Userscripts", GVAR(userscripts)); + if(IS_ARRAY(GVAR(userscripts))) then { + { + TRACE_1("Userscript foreach", _x); + if(IS_CODE(_x)) then { + LOG("Userscript is code and is called"); + [isServer] call _x; + }; + + } foreach GVAR(userscripts); + + }; +}; \ No newline at end of file diff --git a/e12_amf_dac/script_component.hpp b/e12_amf_dac/script_component.hpp new file mode 100755 index 0000000..243cd6a --- /dev/null +++ b/e12_amf_dac/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_dac +#define PREFIX e12 + +#include "script_macros.hpp" \ No newline at end of file diff --git a/e12_amf_dac/script_macros.hpp b/e12_amf_dac/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_dac/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_debugging/$PBOPREFIX$ b/e12_amf_debugging/$PBOPREFIX$ new file mode 100755 index 0000000..cac70a1 --- /dev/null +++ b/e12_amf_debugging/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_debugging \ No newline at end of file diff --git a/e12_amf_debugging/XEH_PostServerInit.sqf b/e12_amf_debugging/XEH_PostServerInit.sqf new file mode 100755 index 0000000..47dff75 --- /dev/null +++ b/e12_amf_debugging/XEH_PostServerInit.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" +TRACE_1("Process","PostInitServer"); + +//Activate Debug in Singleplayer/Editor +if(!isMultiplayer && (!isNil "e12_amf_debug") && e12_amf_debug) then { + LOG("Debug is active"); + [] spawn FUNC(missionDebug); +}else{ + LOG("Debug is NOT active"); +}; diff --git a/e12_amf_debugging/XEH_PreServerInit.sqf b/e12_amf_debugging/XEH_PreServerInit.sqf new file mode 100755 index 0000000..2c959f8 --- /dev/null +++ b/e12_amf_debugging/XEH_PreServerInit.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInitServer"); + +//Only prepare checks in singleplayer +if(!isMultiplayer) then { + PREP(checkMarkers); + PREP(checkMedics); + PREP(checkHC); + PREP(checkACE); + PREP(checkDAC); + PREP(checkDescription); + PREP(checkLoadout); + PREP(checkLoadoutPreInit); + PREP(checkTools); + PREP(checkAMFSettings); + PREP(debugMsg); + PREP(missionDebug); + + [] call FUNC(checkLoadoutPreInit); +}; diff --git a/e12_amf_debugging/config.cpp b/e12_amf_debugging/config.cpp new file mode 100755 index 0000000..9308c83 --- /dev/null +++ b/e12_amf_debugging/config.cpp @@ -0,0 +1,47 @@ +class CfgPatches +{ + class e12_amf_debugging + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main","ace_sys_ruck"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Logic; +class E12_AMF_Logic; +class CfgVehicles { + class E12_AMF_Debug_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_DEBUGGING"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "if (isServer) then {e12_amf_debug = true;publicVariable 'e12_amf_debug'};"; + }; + }; +}; + +class Extended_PreInit_EventHandlers +{ + class e12_amf_debugging { + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_debugging\XEH_PreServerInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_debugging { + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_debugging\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_debugging/fnc_checkACE.sqf b/e12_amf_debugging/fnc_checkACE.sqf new file mode 100755 index 0000000..69aa28e --- /dev/null +++ b/e12_amf_debugging/fnc_checkACE.sqf @@ -0,0 +1,63 @@ +#include "script_component.hpp" +LOG("ACE Check init"); + +TRACE_2("Grass viewblock",(isNil "ace_sys_viewblock_blockgrass"), ace_sys_viewblock_blockgrass); +_errorgrass = { + ["ace settings", "ACE AI Viewblock not activated"] call FUNC(debugMsg); +}; + +_errorwounds = { + ["ace settings", "ACE Wounding System not activated"] call FUNC(debugMsg); +}; + +_errormarkers = { + ["ace settings", "ACE Force-Group-Markers-Off not activated"] call FUNC(debugMsg); +}; + +_errorstamina = { + ["ace settings", "ACE NoStamina activated, Rucks will be disabled!"] call FUNC(debugMsg); +}; + +_errormapsystem = { + ["ace settings", "ACE MapSystem activated, GPS will not work properly!"] call FUNC(debugMsg); +}; + +//isNil "ace_sys_viewblock_blockgrass" || !ace_sys_viewblock_blockgrass DOES NOT WORK, ANSWER TO info@echo12.de plz + +if(isNil "ace_sys_viewblock_blockgrass") then { + [] call _errorgrass; +}else{ + if(!ace_sys_viewblock_blockgrass) then { + [] call _errorgrass; + }; +}; + +if(isNil "ace_sys_wounds_enabled") then { + [] call _errorwounds; +}else{ + if(!ace_sys_wounds_enabled) then { + [] call _errorwounds; + }; +}; + +if(isNil "ace_sys_tracking_markers_enabled") then { + [] call _errormarkers; +}else{ + if(ace_sys_tracking_markers_enabled) then { + [] call _errormarkers; + }; +}; + +if(!isNil "ACE_NoStaminaEffects") then { + if(ACE_NoStaminaEffects) then { + [] call _errorstamina; + }; +}; + +if(!isNil "ace_sys_map_enabled") then { + if(ace_sys_map_enabled) then { + [] call _errormapsystem; + }; +}; + + diff --git a/e12_amf_debugging/fnc_checkAMFSettings.sqf b/e12_amf_debugging/fnc_checkAMFSettings.sqf new file mode 100755 index 0000000..fa14df9 --- /dev/null +++ b/e12_amf_debugging/fnc_checkAMFSettings.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +LOG("AMF Settings Check init"); +if((!isNil "e12_amf_settings_internal") && (!isNil "e12_amf_settings_external")) then { + ["e12 amf settings", "Internal _AND_ External Settings Modules are set, only use one of them"] call FUNC(debugMsg); +}; diff --git a/e12_amf_debugging/fnc_checkDAC.sqf b/e12_amf_debugging/fnc_checkDAC.sqf new file mode 100755 index 0000000..6d6bc91 --- /dev/null +++ b/e12_amf_debugging/fnc_checkDAC.sqf @@ -0,0 +1,49 @@ +#include "script_component.hpp" + +LOG("DAC Check init"); +if(!isNil "e12_amf_dac_userscripts") then { + if(!IS_ARRAY(e12_amf_dac_userscripts)) then { + ["e12 amf dac settings", "Userscripts 'e12_amf_dac_userscripts' is set but not an array, Recommendation:e12_amf_dac_userscripts=[{script1},{script2}]"] call FUNC(debugMsg); + }else{ + { + if(!IS_CODE(_x)) then { + ["e12 amf dac settings", format["Userscripts 'e12_amf_dac_userscripts' has an entry which is not executable code: '%1', Recommendation:e12_amf_dac_userscripts=[{[_this] execVM ""script.sqf""},{script2}]",_x]] call FUNC(debugMsg); + }; + + } foreach e12_amf_dac_userscripts; + + }; +}; +if(!(isNil "DAC_Basic_Value")) then { + if(!isNil "DAC_Marker" && DAC_Marker != 0) then { + ["dac settings", "DAC_Markers are visible, Recommendation: DAC_Marker=0"] call FUNC(debugMsg); + }; + + if(!isNil "DAC_Com_Values" && (DAC_Com_Values select 0 != 0) || (DAC_Com_Values select 1 != 1) || (DAC_Com_Values select 2 != 0)) then { + ["dac settings", "DAC_Com_Values are changed, Recommendation: DAC_Com_Values=[0,1,0]"] call FUNC(debugMsg); + }; + + if(!isNil "DAC_STRPlayers" && IS_ARRAY(DAC_STRPlayers)) then { + //DAC_STRPlayers = + _missingunits = []; + _noname = 0; + { + TRACE_1("Unit name: ",vehicleVarName _x); + if(vehicleVarName _x != "" && !((vehicleVarName _x) in DAC_STRPlayers)) then { + PUSH(_missingunits, vehicleVarName _x); + }; + if(vehicleVarName _x == "") then { + INC(_noname); + }; + } foreach switchableUnits; + + if(_noname > 0) then { + ["dac settings", format["There are %1 Playable Units without a variable name needed for DAC",_noname]] call FUNC(debugMsg); + }; + if(count _missingunits > 0) then { + ["dac settings", format["There are %1 Playable Units without a valid variable name inside DAC_STRPlayers: %2", count _missingunits, str(_missingunits)]] call FUNC(debugMsg); + }; + }; +}else{ + LOG("DAC not activated"); +}; \ No newline at end of file diff --git a/e12_amf_debugging/fnc_checkDescription.sqf b/e12_amf_debugging/fnc_checkDescription.sqf new file mode 100755 index 0000000..9cc9f1e --- /dev/null +++ b/e12_amf_debugging/fnc_checkDescription.sqf @@ -0,0 +1,38 @@ +#include "script_component.hpp" +if(isNumber(missionConfigFile >> "Header" >> "maxPlayers")) then { + _maxPlayers = getNumber(missionConfigFile >> "Header" >> "maxPlayers"); + if(_maxPlayers != count switchableUnits) then { + ["description.ext", format["Number of players does not match 'maxPlayers' in description.ext (%1 != maxPlayers %2)",count switchableUnits, _maxPlayers]] call FUNC(debugMsg); + }; + +}else{ + ["description.ext", "Number of 'maxPlayers' in description.ext not correct or not defined"] call FUNC(debugMsg); +}; + +if(isNumber(missionConfigFile >> "Header" >> "minPlayers")) then { + _minPlayers = getNumber(missionConfigFile >> "Header" >> "minPlayers"); + if(_minPlayers != 1) then { + ["description.ext", "Number of 'minPlayers' in description.ext not 1"] call FUNC(debugMsg); + }; + +}else{ + ["description.ext", "Number of 'minPlayers' in description.ext not correct or not defined"] call FUNC(debugMsg); +}; + + +if(isText(missionConfigFile >> "respawn")) then { + _respawn = getText(missionConfigFile >> "respawn"); + if((tolower _respawn) != "base") then { + ["description.ext", "Respawn not set to 'Base'"] call FUNC(debugMsg); + }; + +}else{ + ["description.ext", "Respawn not set to 'Base'"] call FUNC(debugMsg); +}; + +// Check if paramsArray is set +if(!(isNil "DAC_Basic_Value")) then { + if(!isClass(missionConfigFile >> "Params")) then { + ["description.ext", "DAC activated but no Params in description.ext found"] call FUNC(debugMsg); + }; +}; diff --git a/e12_amf_debugging/fnc_checkHC.sqf b/e12_amf_debugging/fnc_checkHC.sqf new file mode 100755 index 0000000..f5b2e04 --- /dev/null +++ b/e12_amf_debugging/fnc_checkHC.sqf @@ -0,0 +1,35 @@ +#include "script_component.hpp" +private["_hcunitscount","_hcunits","_hc","_distance"]; +LOG("HC check init"); +_hcunitscount = 0; +_hcunits = []; +{ + if([configFile >> "CfgVehicles" >> typeof _x, configFile >> "CfgVehicles" >> "CAAnimalBase"] call CBA_fnc_inheritsFrom) then { + INC(_hcunitscount); + PUSH(_hcunits,_x); + TRACE_2("HCUnit found: ", _x, typeof _x); + }; + +} foreach switchableUnits; + +if(_hcunitscount == 0 && !(isNil "DAC_Basic_Value")) then { + ["hcconf", "No HC Player found"] call FUNC(debugMsg); +}; +if(_hcunitscount > 1) then { + ["hcconf", format["More than one HC Player found (%1)",_hcunitscount]] call FUNC(debugMsg); +}; +if(count _hcunits > 0) then { + _hc = _hcunits select 0; + if((_hc getVariable ["ace_w_eh",-1]) != 0) then { + ["hcconf", "HC Player has activated ace woundings, try disable using ace_w_eh"] call FUNC(debugMsg); + }; + _distance = 99999; + { + if(_x != _hc) then { + _distance = _distance min (_hc distance (getPos _x)); + }; + } foreach switchableUnits; + if(_distance < 1000) then { + ["hcconf", format["HC Player is to close to playable units, distance = %1m",ceil _distance]] call FUNC(debugMsg); + }; +}; \ No newline at end of file diff --git a/e12_amf_debugging/fnc_checkLoadout.sqf b/e12_amf_debugging/fnc_checkLoadout.sqf new file mode 100755 index 0000000..cfeae2d --- /dev/null +++ b/e12_amf_debugging/fnc_checkLoadout.sqf @@ -0,0 +1,61 @@ +#include "script_component.hpp" +private["_hasOversize", "_oversizeUnits","_woRuckUnits"]; +LOG("Loadout check"); + +//---------------------Check Oversize +_hasOversize = { + private["_unit","_ret"]; + _ret = _this call ace_sys_ruck_fnc_RuckInventorySize; + (_ret < -1); +}; + +_oversizeUnits = []; +{ + if(_x call _hasOversize) then { + PUSH(_oversizeUnits, vehicleVarName _x); + }; +}foreach switchableUnits; + +if((count _oversizeUnits) > 0) then { + ["loadout", format["%1 Units has oversize rucksacks: %2", count _oversizeUnits, _oversizeUnits]] call FUNC(debugMsg); +}; + +//---------------------Check Rucksack Packs +//Restore original functions +ACE_fnc_PackMagazine = FUNC(packMagazineOrig); +ACE_fnc_PackWeapon = FUNC(packWeaponOrig); +LOG("Restored hooked ruck functions"); +TRACE_1("Failed wep packs", GVAR(failedWepPacks)); +TRACE_1("Failed mag packs", GVAR(failedMagPacks)); +if((count GVAR(failedWepPacks)) > 0) then { + ["loadout", format["%1 Weapons could not be packed in rucks: %2", count GVAR(failedWepPacks), GVAR(failedWepPacks)]] call FUNC(debugMsg); +}; +if((count GVAR(failedMagPacks)) > 0) then { + ["loadout", format["%1 Magazines could not be packed in rucks: %2", count GVAR(failedMagPacks), GVAR(failedMagPacks)]] call FUNC(debugMsg); +}; + +//---------------------Check Has Ruck +_woRuckUnits = []; +{ + if(!([configFile >> "CfgVehicles" >> typeof _x, configFile >> "CfgVehicles" >> "CAAnimalBase"] call CBA_fnc_inheritsFrom)) then { + if(!(_x call ACE_fnc_HasRuck)) then { + PUSH(_woRuckUnits, _x); + }; + }; +}foreach switchableUnits; +if((count _woRuckUnits) > 0) then { + ["loadout", format["%1 Units have no rucks: %2", count _woRuckUnits, _woRuckUnits]] call FUNC(debugMsg); +}; + +//---------------------Check Basic Equip +_woCompassUnits = []; +{ + if(!([configFile >> "CfgVehicles" >> typeof _x, configFile >> "CfgVehicles" >> "CAAnimalBase"] call CBA_fnc_inheritsFrom)) then { + if(!([_x, "ItemCompass"] call ACE_fnc_HasWeapon)) then { + PUSH(_woCompassUnits, _x); + }; + }; +}foreach switchableUnits; +if((count _woCompassUnits) > 0) then { + ["loadout", format["%1 Units have no compass: %2", count _woCompassUnits, _woCompassUnits]] call FUNC(debugMsg); +}; \ No newline at end of file diff --git a/e12_amf_debugging/fnc_checkLoadoutPreInit.sqf b/e12_amf_debugging/fnc_checkLoadoutPreInit.sqf new file mode 100755 index 0000000..b32d11d --- /dev/null +++ b/e12_amf_debugging/fnc_checkLoadoutPreInit.sqf @@ -0,0 +1,32 @@ +#include "script_component.hpp" + +waitUntil{!isNil "ACE_fnc_PackMagazine"}; +LOG("Install Ruck Hook"); +GVAR(failedMagPacks)=[]; +FUNC(packMagazineOrig)=ACE_fnc_PackMagazine; +FUNC(packMagazineHook)={ + private["_ret"]; + TRACE_1("Mag pack",_this select 0); + _ret=_this call FUNC(packMagazineOrig); + if(!_ret) then { + TRACE_2("Failed mag pack",_this select 0,_this select 1); + //PUSH(GVAR(failedMagPacks),[ vehicleVarName (_this select 0),_this select 1]); + PUSH(GVAR(failedMagPacks),_this); + }; + _ret; +}; +ACE_fnc_PackMagazine=FUNC(packMagazineHook); + +GVAR(failedWepPacks)=[]; +FUNC(packWeaponOrig)=ACE_fnc_PackWeapon; +FUNC(packWeaponHook)={ + private["_ret"]; + TRACE_1("Weapon pack",_this select 0); + _ret=_this call FUNC(packWeaponOrig); + if(!_ret) then { + TRACE_2("Failed weapon pack",_this select 0,_this select 1); + PUSH(GVAR(failedWepPacks),_this); + }; + _ret; +}; +ACE_fnc_PackWeapon = FUNC(packWeaponHook); \ No newline at end of file diff --git a/e12_amf_debugging/fnc_checkMarkers.sqf b/e12_amf_debugging/fnc_checkMarkers.sqf new file mode 100755 index 0000000..0d7a674 --- /dev/null +++ b/e12_amf_debugging/fnc_checkMarkers.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" +#define __isValidMarker(MARKER) (!(((getMarkerPos MARKER) select 0) == 0 && ((getMarkerPos MARKER) select 1) == 0 && ((getMarkerPos MARKER) select 2) == 0)) + + + +//Check respawn_west +_posWest = getMarkerPos "respawn_west"; +_posEast = getMarkerPos "respawn_east"; + +if(!__isValidMarker("respawn_west") && !__isValidMarker("respawn_east")) then { + ["markers", "No respawnmarker 'respawn_west' or 'respawn_east' found"] call FUNC(debugMsg); +}; \ No newline at end of file diff --git a/e12_amf_debugging/fnc_checkMedics.sqf b/e12_amf_debugging/fnc_checkMedics.sqf new file mode 100755 index 0000000..27e27f4 --- /dev/null +++ b/e12_amf_debugging/fnc_checkMedics.sqf @@ -0,0 +1,18 @@ +#include "script_component.hpp" +private["_medics","_units"]; +LOG("Medic check init"); + +waitUntil{!isNil "ace_sys_wounds_fnc_isMedic"}; +_medics = 0; +TRACE_1("Playable units", count switchableUnits); +{ + if(_x call ace_sys_wounds_fnc_isMedic) then { + TRACE_1("Medic found",_x); + INC(_medics); + }; +} foreach switchableUnits; +TRACE_1("Medic check result",_medics); +_units = count switchableUnits; +if((_medics == 0) || ((_units / _medics) > 7)) then { + ["unitconf", format["Only %1 Medics found",_medics]] call FUNC(debugMsg); +}; \ No newline at end of file diff --git a/e12_amf_debugging/fnc_checkTools.sqf b/e12_amf_debugging/fnc_checkTools.sqf new file mode 100755 index 0000000..3e0d806 --- /dev/null +++ b/e12_amf_debugging/fnc_checkTools.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" +private["_hasAdmin"]; +_hasAdmin = false; + + +if(!isNil "e12_tools_settings_admins") then { + if(e12_tools_settings_admins) then { + _hasAdmin = true; + }; +}; + +{ + if( _x getvariable["e12_tools_isadmin",false] ) then { + _hasAdmin = true; + }; +}foreach switchableUnits; + +if(!_hasAdmin) then { + ["e12 tools", "No admin available, check manual"] call FUNC(debugMsg); +}; diff --git a/e12_amf_debugging/fnc_debugMsg.sqf b/e12_amf_debugging/fnc_debugMsg.sqf new file mode 100755 index 0000000..88a0926 --- /dev/null +++ b/e12_amf_debugging/fnc_debugMsg.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" +private["_msg","_sys"]; +_sys = _this select 0; +_msg = _this select 1; +hintc format["Error (%1): %2",_sys,_msg]; +sleep 0.1; + diff --git a/e12_amf_debugging/fnc_missionDebug.sqf b/e12_amf_debugging/fnc_missionDebug.sqf new file mode 100755 index 0000000..54e8035 --- /dev/null +++ b/e12_amf_debugging/fnc_missionDebug.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +[] call FUNC(checkMarkers); +[] call FUNC(checkMedics); +[] call FUNC(checkHC); +[] call FUNC(checkACE); +[] call FUNC(checkDAC); +[] call FUNC(checkDescription); +[] call FUNC(checkLoadout); +[] call FUNC(checkAMFSettings); \ No newline at end of file diff --git a/e12_amf_debugging/script_component.hpp b/e12_amf_debugging/script_component.hpp new file mode 100755 index 0000000..5fad148 --- /dev/null +++ b/e12_amf_debugging/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_debugging +#define PREFIX e12 + +#include "script_macros.hpp" \ No newline at end of file diff --git a/e12_amf_debugging/script_macros.hpp b/e12_amf_debugging/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_debugging/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_interact/$PBOPREFIX$ b/e12_amf_interact/$PBOPREFIX$ new file mode 100755 index 0000000..3cc7816 --- /dev/null +++ b/e12_amf_interact/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_interact \ No newline at end of file diff --git a/e12_amf_interact/XEH_PostClientInit.sqf b/e12_amf_interact/XEH_PostClientInit.sqf new file mode 100755 index 0000000..5e9c566 --- /dev/null +++ b/e12_amf_interact/XEH_PostClientInit.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +[QGVAR(interact_text), { _this spawn { + private["_showText"]; + TRACE_1("Interaction on client",_this); + _showText = ((_this select 0) select 0) getVariable [QGVAR(showText), nil]; + _actionId = ((_this select 0) select 0) getVariable [QGVAR(actionId), nil]; + if(!isNil "_actionId") then { + ((_this select 0) select 0) removeAction _actionId; + }; + + if(!isNil "_showText") then { + if(IS_ARRAY(_showText)) then { + { + titleText [_x,"PLAIN"]; + sleep 4; + }foreach _showText; + }; + }; +};}] call CBA_fnc_addEventHandler; diff --git a/e12_amf_interact/XEH_PostServerInit.sqf b/e12_amf_interact/XEH_PostServerInit.sqf new file mode 100755 index 0000000..fdb65e9 --- /dev/null +++ b/e12_amf_interact/XEH_PostServerInit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +[QGVAR(interact_text),{_this spawn { + TRACE_1("Interaction on server",_this); + if(((_this select 0) select 0) getVariable [QGVAR(deleteAfter), false]) then { + deleteVehicle ((_this select 0) select 0); + }; +};}] call CBA_fnc_addEventHandler; \ No newline at end of file diff --git a/e12_amf_interact/XEH_PreInit.sqf b/e12_amf_interact/XEH_PreInit.sqf new file mode 100755 index 0000000..7279dc6 --- /dev/null +++ b/e12_amf_interact/XEH_PreInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +PREP(addEvent); +PREP(addUserActionText); + diff --git a/e12_amf_interact/config.cpp b/e12_amf_interact/config.cpp new file mode 100755 index 0000000..dff9c8d --- /dev/null +++ b/e12_amf_interact/config.cpp @@ -0,0 +1,37 @@ +class CfgPatches +{ + class e12_amf_interact + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Extended_PreInit_EventHandlers +{ + class e12_amf_interact { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_interact\XEH_PreInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_interact\XEH_PreInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_interact { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_interact\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_interact\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_interact/fnc_addEvent.sqf b/e12_amf_interact/fnc_addEvent.sqf new file mode 100755 index 0000000..fee0ccf --- /dev/null +++ b/e12_amf_interact/fnc_addEvent.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +TRACE_1("AddUserAction", _this); +// In Event get Target: _this select 0 select 0 +[(_this select 3) select 0,[_this, _this select 3]] call CBA_fnc_globalEvent; \ No newline at end of file diff --git a/e12_amf_interact/fnc_addUserActionText.sqf b/e12_amf_interact/fnc_addUserActionText.sqf new file mode 100755 index 0000000..3200e89 --- /dev/null +++ b/e12_amf_interact/fnc_addUserActionText.sqf @@ -0,0 +1,27 @@ +#include "script_component.hpp" +LOG("AddUserAction"); + +PARAMS_2(_obj,_actiontext); +DEFAULT_PARAM(2,_showText,nil); +DEFAULT_PARAM(3,_deleteAfter,true); +DEFAULT_PARAM(4,_removeAction,true); + +//For all clients +_actionId = _obj addAction [_actiontext,QPATHTO_F(fnc_addEvent),[QGVAR(interact_text),_obj]]; + +TRACE_3("Object added interaction",_obj,str(_obj),typeof _obj); + +if(!isNil "_showtext") then { + _obj setVariable [QGVAR(showText), _showText]; +}; + +if(!isNil "_actionId") then { + _obj setVariable [QGVAR(actionId), _actionId]; +}; + + + +//For server +if (!isServer) exitWith {}; +_obj setVariable [QGVAR(deleteAfter), _deleteAfter]; + diff --git a/e12_amf_interact/script_component.hpp b/e12_amf_interact/script_component.hpp new file mode 100755 index 0000000..26f4f29 --- /dev/null +++ b/e12_amf_interact/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_interact +#define PREFIX e12 + +#include "script_macros.hpp" diff --git a/e12_amf_interact/script_macros.hpp b/e12_amf_interact/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_interact/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_main/$PBOPREFIX$ b/e12_amf_main/$PBOPREFIX$ new file mode 100755 index 0000000..89266e1 --- /dev/null +++ b/e12_amf_main/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_main \ No newline at end of file diff --git a/e12_amf_main/XEH_PostClientInit.sqf b/e12_amf_main/XEH_PostClientInit.sqf new file mode 100755 index 0000000..caca630 --- /dev/null +++ b/e12_amf_main/XEH_PostClientInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" +//waitUntil {!isNil "CBA_ui_fnc_add"}; +TRACE_1("Process","PostInitClient"); diff --git a/e12_amf_main/XEH_PostServerInit.sqf b/e12_amf_main/XEH_PostServerInit.sqf new file mode 100755 index 0000000..aa91142 --- /dev/null +++ b/e12_amf_main/XEH_PostServerInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" +TRACE_1("Process","PostInitServer"); + diff --git a/e12_amf_main/XEH_PreClientInit.sqf b/e12_amf_main/XEH_PreClientInit.sqf new file mode 100755 index 0000000..0bf2b37 --- /dev/null +++ b/e12_amf_main/XEH_PreClientInit.sqf @@ -0,0 +1,2 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInitClient"); diff --git a/e12_amf_main/XEH_PreServerInit.sqf b/e12_amf_main/XEH_PreServerInit.sqf new file mode 100755 index 0000000..b4a065f --- /dev/null +++ b/e12_amf_main/XEH_PreServerInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInitServer"); + + diff --git a/e12_amf_main/config.cpp b/e12_amf_main/config.cpp new file mode 100755 index 0000000..a534141 --- /dev/null +++ b/e12_amf_main/config.cpp @@ -0,0 +1,62 @@ +class CfgPatches +{ + class e12_amf_main + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"CBA_MAIN","CA_Modules"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "1.0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; +class CfgMods +{ + class e12_amf_main + { + dir = "@e12_amf"; + name = "E12 Advanced Mission Framework"; + hidePicture = "true"; + hideName = "true"; + actionName = "Website"; + action = "http://www.echo12.de"; + description = "Echo12"; + }; +}; + +/*extern*/ class Logic; +class CfgVehicles { + class E12_AMF_Logic: Logic { + displayname = "E12 AMF Logic"; + }; + + class E12_AMF_Required_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_REQUIRE"; + vehicleClass = "Modules"; + }; +}; + + +class Extended_PreInit_EventHandlers +{ + class e12_amf { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_main\XEH_PreClientInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_main\XEH_PreServerInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_main\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_main\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_main/script_component.hpp b/e12_amf_main/script_component.hpp new file mode 100755 index 0000000..11f81eb --- /dev/null +++ b/e12_amf_main/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf +#define PREFIX e12 + +#include "script_macros.hpp" \ No newline at end of file diff --git a/e12_amf_main/script_macros.hpp b/e12_amf_main/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_main/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_main/stringtable.xml b/e12_amf_main/stringtable.xml new file mode 100755 index 0000000..4cf1cec --- /dev/null +++ b/e12_amf_main/stringtable.xml @@ -0,0 +1,65 @@ + + + + +(E¹² AMF) Enable Debugging +(E¹² AMF) Aktiviere Debugging + + + +(E¹² AMF) Require E12 AMF +(E¹² AMF) Benoetigt E12 AMF + + + +(E¹² AMF) Enable Position Helper +(E¹² AMF) Aktiviere Positionshelfer + + + +(E¹² AMF) Disable Performance Log +(E¹² AMF) Deaktiviere Performance Log + + + +(E¹² AMF) Enable Civilians +(E¹² AMF) Aktiviere Zivilisten + + + +(E¹² AMF) Enable Settings Internal +(E¹² AMF) Aktiviere Settings Intern + + + +(E¹² AMF) Enable Settings External +(E¹² AMF) Aktiviere Settings Extern + + + +(E¹² AMF) Disable Timesync +(E¹² AMF) Deaktiviere Timesync + + + +(E¹² AMF) Disable Teamviewer +(E¹² AMF) Deaktiviere Teamviewer + + + +(E¹² AMF) Enable Logistic +(E¹² AMF) Aktiviere Logistik + + + +(E¹² AMF) Enable NobodyIsMad +(E¹² AMF) Aktiviere NobodyIsMad + + + +(E¹² AMF) Enable Warmup +(E¹² AMF) Aktiviere Warmup + + + + diff --git a/e12_amf_perflog/$PBOPREFIX$ b/e12_amf_perflog/$PBOPREFIX$ new file mode 100755 index 0000000..64e0e37 --- /dev/null +++ b/e12_amf_perflog/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_perflog \ No newline at end of file diff --git a/e12_amf_perflog/XEH_PostClientInit.sqf b/e12_amf_perflog/XEH_PostClientInit.sqf new file mode 100755 index 0000000..26b416f --- /dev/null +++ b/e12_amf_perflog/XEH_PostClientInit.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +if(!(isNil "e12_amf_perflog_disable")) exitWith {}; + +//Execute on HC +if (!hasInterface && !isServer) then{ + [] spawn FUNC(perfLogHC); +}; + + diff --git a/e12_amf_perflog/XEH_PostServerInit.sqf b/e12_amf_perflog/XEH_PostServerInit.sqf new file mode 100755 index 0000000..5e19eb1 --- /dev/null +++ b/e12_amf_perflog/XEH_PostServerInit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +if(!(isNil "e12_amf_perflog_disable")) exitWith {}; + +// Activate Server debug +if (isServer) then{ + [] spawn FUNC(perfLogServer); +}; \ No newline at end of file diff --git a/e12_amf_perflog/XEH_PreInit.sqf b/e12_amf_perflog/XEH_PreInit.sqf new file mode 100755 index 0000000..128af4d --- /dev/null +++ b/e12_amf_perflog/XEH_PreInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInit"); + +GVAR(perfLogServer)=[0, 0, 0, 0]; +GVAR(perfLogHC)=[0, 0, 0, 0]; + +PREP(perfLogHC); +PREP(perfLogServer); + diff --git a/e12_amf_perflog/config.cpp b/e12_amf_perflog/config.cpp new file mode 100755 index 0000000..96c4cd2 --- /dev/null +++ b/e12_amf_perflog/config.cpp @@ -0,0 +1,49 @@ +class CfgPatches +{ + class e12_amf_perflog + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Logic; +class E12_AMF_Logic; +class CfgVehicles { + class E12_amf_perflog_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_PERFLOG_DISABLE"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "if (isServer) then {e12_amf_perflog_disable = true;publicVariable 'e12_amf_perflog_disable'};"; + }; + }; +}; + +class Extended_PreInit_EventHandlers +{ + class e12_amf_perflog { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_perflog\XEH_PreInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_perflog\XEH_PreInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_perflog { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_perflog\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_perflog\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_perflog/fnc_perfLogHC.sqf b/e12_amf_perflog/fnc_perfLogHC.sqf new file mode 100755 index 0000000..b264e06 --- /dev/null +++ b/e12_amf_perflog/fnc_perfLogHC.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" +private["_localUnits"]; +LOG("Performance HC Log starting up"); +while {true} do { + _localUnits = 0; + { + if(local _x) then { + INC(_localUnits); + }; + } foreach allunits; + GVAR(perfLogHC)=[ceil diag_fps, ceil diag_fpsmin, _localUnits, (count allunits) - _localUnits]; + publicVariable QGVAR(perfLogHC); + sleep 10; +}; diff --git a/e12_amf_perflog/fnc_perfLogServer.sqf b/e12_amf_perflog/fnc_perfLogServer.sqf new file mode 100755 index 0000000..b5b57d2 --- /dev/null +++ b/e12_amf_perflog/fnc_perfLogServer.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" +private["_localUnits"]; +LOG("Performance Server Log starting up"); +while {true} do { + _localUnits = 0; + { + if(local _x) then { + INC(_localUnits); + }; + } foreach allunits; + GVAR(perfLogServer)=[ceil diag_fps, ceil diag_fpsmin, _localUnits, (count allunits) - _localUnits]; + publicVariable QGVAR(perfLogServer); + sleep 10; +}; diff --git a/e12_amf_perflog/script_component.hpp b/e12_amf_perflog/script_component.hpp new file mode 100755 index 0000000..272a439 --- /dev/null +++ b/e12_amf_perflog/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_perflog +#define PREFIX e12 + +#include "script_macros.hpp" diff --git a/e12_amf_perflog/script_macros.hpp b/e12_amf_perflog/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_perflog/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_poshelp/$PBOPREFIX$ b/e12_amf_poshelp/$PBOPREFIX$ new file mode 100755 index 0000000..c9b3b20 --- /dev/null +++ b/e12_amf_poshelp/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_poshelp \ No newline at end of file diff --git a/e12_amf_poshelp/XEH_PostClientInit.sqf b/e12_amf_poshelp/XEH_PostClientInit.sqf new file mode 100755 index 0000000..00c4fd6 --- /dev/null +++ b/e12_amf_poshelp/XEH_PostClientInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" +TRACE_1("Process","PostInitClient"); + +//Activate Debug in Singleplayer/Editor +if(!isMultiplayer && (!isNil "e12_amf_poshelp") && e12_amf_poshelp) then { + LOG("Poshelp is active"); + [] spawn FUNC(posHelpLoop); + [] call FUNC(posHelpAction); +}else{ + LOG("Poshelp is NOT active"); +}; diff --git a/e12_amf_poshelp/XEH_PreClientInit.sqf b/e12_amf_poshelp/XEH_PreClientInit.sqf new file mode 100755 index 0000000..11330c8 --- /dev/null +++ b/e12_amf_poshelp/XEH_PreClientInit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInitClient"); + +//Only prepare checks in singleplayer +if(!isMultiplayer) then { + PREP(posHelpLoop); + PREP(posHelpAction); +}; diff --git a/e12_amf_poshelp/config.cpp b/e12_amf_poshelp/config.cpp new file mode 100755 index 0000000..fb1f424 --- /dev/null +++ b/e12_amf_poshelp/config.cpp @@ -0,0 +1,47 @@ +class CfgPatches +{ + class e12_amf_poshelp + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Logic; +class E12_AMF_Logic; +class CfgVehicles { + class E12_AMF_Poshelp_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_POSHELP"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "if (isServer) then {e12_amf_poshelp = true;publicVariable 'e12_amf_poshelp'};"; + }; + }; +}; + +class Extended_PreInit_EventHandlers +{ + class e12_amf_poshelp { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_poshelp\XEH_PreClientInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_poshelp { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_poshelp\XEH_PostClientInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_poshelp/fnc_posHelpAction.sqf b/e12_amf_poshelp/fnc_posHelpAction.sqf new file mode 100755 index 0000000..4e0f4a6 --- /dev/null +++ b/e12_amf_poshelp/fnc_posHelpAction.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" +LOG("PosHelpAction"); + +player addAction ["Save POS ASL",QUOTE(PATHTO(fnc_posHelpAction_ASL))]; +player addAction ["Save POS",QUOTE(PATHTO(fnc_posHelpAction_Pos))]; +player addAction ["Save POS ATL",QUOTE(PATHTO(fnc_posHelpAction_ATL))]; +player addAction ["Save Cursor Classname",QUOTE(PATHTO(fnc_posHelpAction_Cursor))]; \ No newline at end of file diff --git a/e12_amf_poshelp/fnc_posHelpAction_ASL.sqf b/e12_amf_poshelp/fnc_posHelpAction_ASL.sqf new file mode 100755 index 0000000..d6c9fee --- /dev/null +++ b/e12_amf_poshelp/fnc_posHelpAction_ASL.sqf @@ -0,0 +1,2 @@ +#include "script_component.hpp" +copyToClipboard (format["%1",getposasl player]); diff --git a/e12_amf_poshelp/fnc_posHelpAction_ATL.sqf b/e12_amf_poshelp/fnc_posHelpAction_ATL.sqf new file mode 100755 index 0000000..b3eb40a --- /dev/null +++ b/e12_amf_poshelp/fnc_posHelpAction_ATL.sqf @@ -0,0 +1,2 @@ +#include "script_component.hpp" +copyToClipboard (format["%1",getposatl player]); diff --git a/e12_amf_poshelp/fnc_posHelpAction_Cursor.sqf b/e12_amf_poshelp/fnc_posHelpAction_Cursor.sqf new file mode 100755 index 0000000..771c276 --- /dev/null +++ b/e12_amf_poshelp/fnc_posHelpAction_Cursor.sqf @@ -0,0 +1,2 @@ +#include "script_component.hpp" +copyToClipboard (str(format["%1",typeOf cursorTarget])); diff --git a/e12_amf_poshelp/fnc_posHelpAction_Pos.sqf b/e12_amf_poshelp/fnc_posHelpAction_Pos.sqf new file mode 100755 index 0000000..5b65cb4 --- /dev/null +++ b/e12_amf_poshelp/fnc_posHelpAction_Pos.sqf @@ -0,0 +1,2 @@ +#include "script_component.hpp" +copyToClipboard (format["%1",getpos player]); diff --git a/e12_amf_poshelp/fnc_posHelpLoop.sqf b/e12_amf_poshelp/fnc_posHelpLoop.sqf new file mode 100755 index 0000000..5165b30 --- /dev/null +++ b/e12_amf_poshelp/fnc_posHelpLoop.sqf @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +LOG("PosHelpLoop"); + +while {true} do { + _hint = "Current Position:
"; + _hintasl = format["ASL:
%1
", getPosASL player]; + _hintpos = format["POS:
%1
", getPos player]; + _hintatl = format["ATL:
%1
", getPosATL player]; + _objType = typeOf cursorTarget; + _hintcursor = format["Cursor:
%1
", _objType]; + + hintSilent parseText (_hint + _hintasl + _hintpos + _hintatl + _hintcursor); + sleep 0.5; +}; \ No newline at end of file diff --git a/e12_amf_poshelp/script_component.hpp b/e12_amf_poshelp/script_component.hpp new file mode 100755 index 0000000..a342ba2 --- /dev/null +++ b/e12_amf_poshelp/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_poshelp +#define PREFIX e12 + +#include "script_macros.hpp" \ No newline at end of file diff --git a/e12_amf_poshelp/script_macros.hpp b/e12_amf_poshelp/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_poshelp/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_scripts/$PBOPREFIX$ b/e12_amf_scripts/$PBOPREFIX$ new file mode 100755 index 0000000..4be3e1d --- /dev/null +++ b/e12_amf_scripts/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_scripts \ No newline at end of file diff --git a/e12_amf_scripts/XEH_PostClientInit.sqf b/e12_amf_scripts/XEH_PostClientInit.sqf new file mode 100755 index 0000000..2420a77 --- /dev/null +++ b/e12_amf_scripts/XEH_PostClientInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + + + diff --git a/e12_amf_scripts/XEH_PostServerInit.sqf b/e12_amf_scripts/XEH_PostServerInit.sqf new file mode 100755 index 0000000..0e97506 --- /dev/null +++ b/e12_amf_scripts/XEH_PostServerInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +if(!isNil "e12_amf_nobodyismad_enable") then { + LOG("Start nobodys mad"); + [] spawn FUNC(nobodyIsMad); +}; diff --git a/e12_amf_scripts/XEH_PreInit.sqf b/e12_amf_scripts/XEH_PreInit.sqf new file mode 100755 index 0000000..f42c53c --- /dev/null +++ b/e12_amf_scripts/XEH_PreInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInit"); + +PREP(vehicleRespawn); +PREP(nobodyIsMad); \ No newline at end of file diff --git a/e12_amf_scripts/config.cpp b/e12_amf_scripts/config.cpp new file mode 100755 index 0000000..8dbc01b --- /dev/null +++ b/e12_amf_scripts/config.cpp @@ -0,0 +1,48 @@ +class CfgPatches +{ + class e12_amf_scripts + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + +class Logic; +class E12_AMF_Logic; +class CfgVehicles { + class E12_AMF_NOBODYISMAD_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_NOBODYISMAD_ENABLE"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "if (isServer) then {e12_amf_nobodyismad_enable = true;};"; + }; + }; +}; + +class Extended_PreInit_EventHandlers +{ + class e12_amf_scripts { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_scripts\XEH_PreInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_scripts\XEH_PreInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_scripts { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_scripts\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_scripts\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_scripts/fnc_nobodyIsMad.sqf b/e12_amf_scripts/fnc_nobodyIsMad.sqf new file mode 100755 index 0000000..461998e --- /dev/null +++ b/e12_amf_scripts/fnc_nobodyIsMad.sqf @@ -0,0 +1,21 @@ +#include "script_component.hpp" +if(isServer) then { + if(isMultiplayer) then { + #define __ALLPLAYERS playableunits + }else{ + #define __ALLPLAYERS switchableunits + }; + + [] spawn { + while{true} do { + { + while {(rating _x) < 2000} do { + _x addRating 6000; + //player globalChat format ["Rating added, now:%1", str(rating _x)]; + }; + }foreach __ALLPLAYERS; + + sleep 60; + }; + }; +}; \ No newline at end of file diff --git a/e12_amf_scripts/fnc_vehicleRespawn.sqf b/e12_amf_scripts/fnc_vehicleRespawn.sqf new file mode 100755 index 0000000..5a5b4fc --- /dev/null +++ b/e12_amf_scripts/fnc_vehicleRespawn.sqf @@ -0,0 +1,147 @@ +/* +========================================================= +Simple Vehicle Respawn Script v1.6 +by Tophe of �stg�ta Ops [OOPS] + +Put this in the vehicles init line: +veh = [this] execVM "vehicle.sqf" + + +Options: +There are some optional settings. The format for these are: +veh = [this, Delay, Deserted timer, Respawns, Effect, Static] execVM "vehicle.sqf" + + +Default respawn delay is 30 seconds, to set a custom +respawn delay time, put that in the init as well. +Like this: +veh = [this, 15] execVM "vehicle.sqf" + +Default respawn time when vehicle is deserted, but not +destroyed is 120 seconds. To set a custom timer for this +first put the respawn delay, then the deserted vehicle timer- +Like this: +veh = [this, 15, 10] execVM "vehicle.sqf" + +By default the number of respawns is infinite. To set a limit +First set the other values then the number of respawns you want (0 = infinite). +Like this: +veh = [this, 15, 10, 5] execVM "vehicle.sqf" + + +Set this value to TRUE to add a special explosion effect to the wreck when respawning. +Default value is FALSE, which will simply have the wreck disappear. +Like this: +veh = [this, 15, 10, 5, TRUE] execVM "vehicle.sqf" + +By default the vehicle will respawn to the point where it first +was when the mission started (static). This can be changed to +dynamic. Then the vehicle will respawn to the position where it was destroyed. +First set all the other values then set TRUE for dynamic or FALSE for static. +Like this: +veh = [this, 15, 10, 5, TRUE, TRUE] execVM "vehicle.sqf" + +If you you want to set the INIT field of the respawned vehicle, first set all other +values, then set init commands. Those must be inside quotations. +Like this: +veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf" + +Default values of all settings are: +veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf" + + + + +Contact & Bugreport: harlechin@hotmail.com + +========================================================= +*/ + +private ["_hasname","_delay","_deserted","_respawns","_noend","_dead","_nodelay","_timeout","_position","_dir","_effect","_rounds","_run","_unit","_explode","_dynamic","_unitinit","_haveinit","_unitname","_type","_weapons","_mags","_max"]; +if (!isServer) exitWith {}; + +// Define variables +_unit = _this select 0; +_delay = if (count _this > 1) then {_this select 1} else {30}; +_deserted = if (count _this > 2) then {_this select 2} else {120}; +_respawns = if (count _this > 3) then {_this select 3} else {0}; +_explode = if (count _this > 4) then {_this select 4} else {false}; +_dynamic = if (count _this > 5) then {_this select 5} else {false}; +_unitinit = if (count _this > 6) then {_this select 6} else {}; +_haveinit = if (count _this > 6) then {true} else {false}; + +_hasname = false; +_unitname = vehicleVarName _unit; +if (_unitname == "") then {_hasname = false;} else {_hasname = true;}; +_noend = true; +_run = true; +_rounds = 0; + +if (_delay < 0) then {_delay = 0}; +if (_deserted < 0) then {_deserted = 0}; +if (_respawns <= 0) then {_respawns= 0; _noend = true;}; +if (_respawns > 0) then {_noend = false}; + +_dir = getDir _unit; +_position = getPosASL _unit; +_type = typeOf _unit; +_dead = false; +_nodelay = false; + +_weapons = getWeaponCargo _unit; +_mags = getMagazineCargo _unit; + +// Start monitoring the vehicle +while {_run} do +{ + sleep (2 + random 10); + if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true}; + + // Check if the vehicle is deserted. + if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8)) then { + _timeout = time + _deserted; + sleep 0.1; + waitUntil {sleep 5;_timeout < time or !alive _unit or {alive _x} count crew _unit > 0}; + if ({alive _x} count crew _unit > 0) then {_dead = false}; + if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; + if !(alive _unit) then {_dead = true; _nodelay = false}; + }; + + + // Respawn vehicle + if (_dead) then { + if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;}; + if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;}; + if (_explode) then {_effect = "M_TOW_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;}; + sleep 0.1; + + deleteVehicle _unit; + sleep 2; + _unit = _type createVehicle _position; + _unit setPosASL _position; + _unit setDir _dir; + + clearWeaponCargo _unit; + clearMagazineCargo _unit; + + _max = count(_weapons select 0); + for "_i" from 0 to _max do { + _unit addWeaponCargo [(_weapons select 0) select _i, (_weapons select 1) select _i]; + }; + + _max = count(_mags select 0); + for "_i" from 0 to _max do { + _unit addMagazineCargo [(_mags select 0) select _i, (_mags select 1) select _i]; + }; + + if (_haveinit) then + {_unit setVehicleInit format ["%1;", _unitinit]; + processInitCommands;}; + if (_hasname) then {_unit setVehicleVarName _unitname;}; + _dead = false; + + // Check respawn amount + if !(_noend) then {_rounds = _rounds + 1}; + if ((_rounds == _respawns) and !(_noend)) then {_run = false;}; + }; +}; \ No newline at end of file diff --git a/e12_amf_scripts/script_component.hpp b/e12_amf_scripts/script_component.hpp new file mode 100755 index 0000000..1aca0ef --- /dev/null +++ b/e12_amf_scripts/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_scripts +#define PREFIX e12 + +#include "script_macros.hpp" diff --git a/e12_amf_scripts/script_macros.hpp b/e12_amf_scripts/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_scripts/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_settings/$PBOPREFIX$ b/e12_amf_settings/$PBOPREFIX$ new file mode 100755 index 0000000..2584e59 --- /dev/null +++ b/e12_amf_settings/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_settings \ No newline at end of file diff --git a/e12_amf_settings/config.cpp b/e12_amf_settings/config.cpp new file mode 100755 index 0000000..7704e8a --- /dev/null +++ b/e12_amf_settings/config.cpp @@ -0,0 +1,40 @@ +class CfgPatches +{ + class e12_amf_settings + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Logic; +class E12_AMF_Logic; +class CfgVehicles { + class E12_AMF_SETTINGS_INTERNAL_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_SETTINGS_INTERNAL"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "if (isServer) then {e12_amf_settings_internal = true;publicVariable 'e12_amf_settings_internal';call compile preprocessFileLineNumbers 'x\e12\addons\amf_settings\e12_amf_settings.sqf'};"; + }; + }; + class E12_AMF_SETTINGS_EXTERNAL_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_SETTINGS_EXTERNAL"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "if (isServer) then {e12_amf_settings_external = true;publicVariable 'e12_amf_settings_external';call compile preprocessFileLineNumbers 'e12_amf_settings.sqf'};"; + }; + }; +}; + + + + + + + diff --git a/e12_amf_settings/e12_amf_settings.sqf b/e12_amf_settings/e12_amf_settings.sqf new file mode 100755 index 0000000..e6257a4 --- /dev/null +++ b/e12_amf_settings/e12_amf_settings.sqf @@ -0,0 +1,34 @@ +#define PVAR(var1, value) var1 = value;publicVariable #var1 + +PVAR(ace_sys_eject_dont_drop_shit,true); +PVAR(ace_sys_eject_fnc_weaponcheck,{}); //Disable geardrop in vehicles +PVAR(ACE_NO_RECOGNIZE, false); //Disable recognize + +PVAR(ace_sys_tracking_markers_enabled, false); +PVAR(ace_sys_tracking_markers_enabled_override, true); //force off +PVAR(ace_sys_tracking_radio_required, true); +PVAR(ace_sys_tracking_gps_required, true); + +PVAR(ace_sys_wounds_enabled, true); //Enable wounding system (true, nil) +PVAR(ace_sys_wounds_medics_only, nil); //Epi, Morph only medics (true, nil) +PVAR(ace_sys_wounds_all_medics, nil); //Everyone is medic (true, nil) +PVAR(ace_wounds_prevtime, 900); //Revive time +PVAR(ace_sys_wounds_withSpect, nil); //Nil = Disable spectator +PVAR(ace_sys_wounds_noai, true); //Disable wounding system for AI (true, nil) +PVAR(ace_sys_wounds_leftdam, 0); //Left damage Values recomended 0.01-0.08 +PVAR(ace_sys_spectator_RevShowButtonTime, 9999); //Time to appear the respawn buttons when you are wounded, in seconds +PVAR(ace_sys_wounds_no_rpunish, true); //No respawn punish (true, nil) +PVAR(ace_sys_wounds_auto_assist, false); //(default true) Should (non medic) AI units automatically assist unconscious units in their group? (true, false) +PVAR(ace_sys_wounds_auto_assist_any, false); //(default false) Should (non medic) AI units assist any unconscious friendly units (not just in their group)? Civilians will heal OpFor if enabled! (true, false) +PVAR(ace_sys_wounds_no_medical_vehicles, false); //(default false) Should medical vehicles _not_ be usable as medical facilities? (true, false) +PVAR(ACE_IFAK_Capacity, 3); // Size of IFAK slots + +PVAR(ace_sys_viewblock_blockgrass, true); //Enable grass viewblock (true, nil) + +PVAR(acre_sys_signal_terrainScaling, 1); //Default 1.0, No Loss 0 + +PVAR(ace_sys_aitalk_enabled, nil); // AI Talk (true, nil) +PVAR(ace_sys_aitalk_radio_enabled, nil); // Vehicle Radiosounds (true, nil) +PVAR(ace_sys_aitalk_talkforplayer, nil); // AI Talk (true, nil) + +PVAR(ace_sys_destruction_enable_cookoff, true); //Ammo cookoff (true, false) \ No newline at end of file diff --git a/e12_amf_settings/internal_init.sqf b/e12_amf_settings/internal_init.sqf new file mode 100755 index 0000000..fc37a73 --- /dev/null +++ b/e12_amf_settings/internal_init.sqf @@ -0,0 +1,61 @@ +#include "script_component.hpp" + +ace_sys_eject_fnc_weaponcheck = {}; //Disable geardrop in vehicles +ACE_NO_RECOGNIZE = false; //Disable recognize + +ace_sys_tracking_markers_enabled = false; +ace_sys_tracking_markers_enabled_override = true; //force off +ace_sys_tracking_radio_required = true; +ace_sys_tracking_gps_required = true; + +ace_sys_wounds_enabled=true; //Enable wounding system (true, nil) +ace_sys_wounds_medics_only = nil; //Epi, Morph only medics (true, nil) +ace_sys_wounds_all_medics = nil; //Everyone is medic (true, nil) +ace_wounds_prevtime = 900; //Revive time +ace_sys_wounds_withSpect=nil; //Nil = Disable spectator +ace_sys_wounds_noai= true; //Disable wounding system for AI (true, nil) +ace_sys_wounds_leftdam=0; //Left damage Values recomended 0.01-0.08 +ace_sys_spectator_RevShowButtonTime = 9999; //Time to appear the respawn buttons when you are wounded, in seconds +ace_sys_wounds_no_rpunish=true; //No respawn punish (true, nil) +ace_sys_wounds_auto_assist=true; //(default true) Should (non medic) AI units automatically assist unconscious units in their group? (true, false) +ace_sys_wounds_auto_assist_any=false; //(default false) Should (non medic) AI units assist any unconscious friendly units (not just in their group)? Civilians will heal OpFor if enabled! (true, false) +ace_sys_wounds_no_medical_vehicles=false; //(default false) Should medical vehicles _not_ be usable as medical facilities? (true, false) +ACE_IFAK_Capacity = 3; // Size of IFAK slots + +ace_sys_viewblock_blockgrass = true; //Enable grass viewblock (true, nil) + +acre_sys_signal_terrainScaling = 1.0; //Default 1.0, No Loss 0 + +ace_sys_aitalk_enabled = nil; // AI Talk (true, nil) +ace_sys_aitalk_radio_enabled = nil; // Vehicle Radiosounds (true, nil) +ace_sys_aitalk_talkforplayer = nil; // AI Talk (true, nil) + +ace_sys_destruction_enable_cookoff = true; //Ammo cookoff (true, false) + +//Make everything public +publicVariable "ace_sys_eject_fnc_weaponcheck"; +publicVariable "ACE_NO_RECOGNIZE"; +publicVariable "ace_sys_tracking_markers_enabled"; +publicVariable "ace_sys_tracking_markers_enabled_override"; +publicVariable "ace_sys_tracking_radio_required"; +publicVariable "ace_sys_tracking_gps_required"; +publicVariable "ace_sys_wounds_enabled"; +publicVariable "ace_sys_wounds_medics_only"; +publicVariable "ace_sys_wounds_all_medics"; +publicVariable "ace_wounds_prevtime"; +publicVariable "ace_sys_wounds_withSpect"; +publicVariable "ace_sys_wounds_noai"; +publicVariable "ace_sys_wounds_leftdam"; +publicVariable "ace_sys_spectator_RevShowButtonTime"; +publicVariable "ace_sys_wounds_no_rpunish"; +publicVariable "ace_sys_wounds_auto_assist"; +publicVariable "ace_sys_wounds_auto_assist_any"; +publicVariable "ace_sys_wounds_no_medical_vehicles"; +publicVariable "ACE_IFAK_Capacity"; +publicVariable "ace_sys_viewblock_blockgrass"; +publicVariable "acre_sys_signal_terrainScaling"; +publicVariable "ace_sys_aitalk_enabled"; +publicVariable "ace_sys_aitalk_radio_enabled"; +publicVariable "ace_sys_aitalk_talkforplayer"; +publicVariable "ace_sys_destruction_enable_cookoff"; + diff --git a/e12_amf_settings/script_component.hpp b/e12_amf_settings/script_component.hpp new file mode 100755 index 0000000..10d2ab8 --- /dev/null +++ b/e12_amf_settings/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_settings +#define PREFIX e12 + +#include "script_macros.hpp" \ No newline at end of file diff --git a/e12_amf_settings/script_macros.hpp b/e12_amf_settings/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_settings/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_timesync/$PBOPREFIX$ b/e12_amf_timesync/$PBOPREFIX$ new file mode 100755 index 0000000..ae771de --- /dev/null +++ b/e12_amf_timesync/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_timesync \ No newline at end of file diff --git a/e12_amf_timesync/XEH_PostClientInit.sqf b/e12_amf_timesync/XEH_PostClientInit.sqf new file mode 100755 index 0000000..bf93e42 --- /dev/null +++ b/e12_amf_timesync/XEH_PostClientInit.sqf @@ -0,0 +1,13 @@ +#include "script_component.hpp" +TRACE_1("Process","ClientPostInit"); + +if(!(isNil "e12_amf_timesync_disable")) exitWith {}; + +LOG("Client add timesync event handler"); +[QGVAR(timesync), +{ + TRACE_1("Time Sync Event", _this); + _this spawn FUNC(timeSync); + +}] call CBA_fnc_addEventHandler; +LOG("Client added timesync event handler"); \ No newline at end of file diff --git a/e12_amf_timesync/XEH_PostServerInit.sqf b/e12_amf_timesync/XEH_PostServerInit.sqf new file mode 100755 index 0000000..b2368c6 --- /dev/null +++ b/e12_amf_timesync/XEH_PostServerInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +TRACE_1("Process","ServerPostInit"); +if(!(isNil "e12_amf_timesync_disable")) exitWith {}; + +LOG("Spawn servertime loop"); +[] spawn FUNC(serverTimeLoop); \ No newline at end of file diff --git a/e12_amf_timesync/XEH_PreClientInit.sqf b/e12_amf_timesync/XEH_PreClientInit.sqf new file mode 100755 index 0000000..273ffd8 --- /dev/null +++ b/e12_amf_timesync/XEH_PreClientInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInit"); + +PREP(timeSync); \ No newline at end of file diff --git a/e12_amf_timesync/XEH_PreServerInit.sqf b/e12_amf_timesync/XEH_PreServerInit.sqf new file mode 100755 index 0000000..15d8cc3 --- /dev/null +++ b/e12_amf_timesync/XEH_PreServerInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInit"); + +PREP(serverTimeLoop); \ No newline at end of file diff --git a/e12_amf_timesync/config.cpp b/e12_amf_timesync/config.cpp new file mode 100755 index 0000000..1267662 --- /dev/null +++ b/e12_amf_timesync/config.cpp @@ -0,0 +1,49 @@ +class CfgPatches +{ + class e12_amf_timesync + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Logic; +class E12_AMF_Logic; +class CfgVehicles { + class E12_AMF_TIMESYNC_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_TIMESYNC_DISABLE"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "if (isServer) then {e12_amf_timesync_disable = true;publicVariable 'e12_amf_timesync_disable'};"; + }; + }; +}; + +class Extended_PreInit_EventHandlers +{ + class e12_amf_timesync { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_timesync\XEH_PreClientInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_timesync\XEH_PreServerInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_timesync { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_timesync\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_timesync\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_timesync/fnc_serverTimeLoop.sqf b/e12_amf_timesync/fnc_serverTimeLoop.sqf new file mode 100755 index 0000000..27488f2 --- /dev/null +++ b/e12_amf_timesync/fnc_serverTimeLoop.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" +TRACE_1("Server start loop",date); +private ["_delay"]; +_delay = 30; +waitUntil{ + [QGVAR(timesync), date] call CBA_fnc_globalEvent;//CBA_fnc_remoteEvent; + TRACE_1("Server sent time sync",date); + sleep _delay; + false; +}; \ No newline at end of file diff --git a/e12_amf_timesync/fnc_timeSync.sqf b/e12_amf_timesync/fnc_timeSync.sqf new file mode 100755 index 0000000..bcde972 --- /dev/null +++ b/e12_amf_timesync/fnc_timeSync.sqf @@ -0,0 +1,60 @@ +#include "script_component.hpp" +private ["_timeSync","_update","_sdate","_cdate","_syr","_smt","_sdy","_shr","_smn","_cyr","_cmt","_cdy","_chr","_cmn"]; +LOG("Client sync"); +_sdate = _this; +_cdate = date; +TRACE_3("Time Sync received", time, _sdate, _cdate); +_syr = _sdate select 0; +_smt = _sdate select 1; +_sdy = _sdate select 2; +_shr = _sdate select 3; +_smn = _sdate select 4; + +_cyr = _cdate select 0; +_cmt = _cdate select 1; +_cdy = _cdate select 2; +_chr = _cdate select 3; +_cmn = _cdate select 4; + +_update = false; +_timeSync = 2; + + +// Do any of the MAJOR date values differ? +if( + _syr != _cyr || + _smt != _cmt || + _sdy != _cdy || + _shr != _chr +) then { + // We'll need setDate to sync + _timeSync = 2; + _update = true; +}; + +// Do just the minutes differ? +if(_smn != _cmn) then { + _update = true; +}; + +// Do we need to sync? +if(_update) then { + switch (_timeSync) do { + // Monitor only + case 0: { + TRACE_3("Time Sync monitor", time, _sdate, _cdate); + //LOG(format["Time Sync: Monitor S %2 C %3", time, _sdate, _cdate]); + }; + // Use skipTime if possible + case 1: { + skipTime ((_smn - _cmn) / 60); + TRACE_4("Time Sync skiptime", time, _sdate, _cdate, date); + }; + // Use setDate + case 2: { + setDate _sdate; + TRACE_4("Time Sync setDate", time, _sdate, _cdate, date); + + }; + }; +}; \ No newline at end of file diff --git a/e12_amf_timesync/script_component.hpp b/e12_amf_timesync/script_component.hpp new file mode 100755 index 0000000..e21945e --- /dev/null +++ b/e12_amf_timesync/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_timesync +#define PREFIX e12 + +#include "script_macros.hpp" diff --git a/e12_amf_timesync/script_macros.hpp b/e12_amf_timesync/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_timesync/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_tracking/$PBOPREFIX$ b/e12_amf_tracking/$PBOPREFIX$ new file mode 100755 index 0000000..f91dc1b --- /dev/null +++ b/e12_amf_tracking/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_tracking \ No newline at end of file diff --git a/e12_amf_tracking/XEH_PostClientInit.sqf b/e12_amf_tracking/XEH_PostClientInit.sqf new file mode 100755 index 0000000..5cf26ac --- /dev/null +++ b/e12_amf_tracking/XEH_PostClientInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +TRACE_1("Process","ClientPostInit"); + +if(isNil "e12_amf_tracking_enabled") exitWith {}; + +[] spawn FUNC(markerLoop); \ No newline at end of file diff --git a/e12_amf_tracking/XEH_PostServerInit.sqf b/e12_amf_tracking/XEH_PostServerInit.sqf new file mode 100755 index 0000000..406c6fd --- /dev/null +++ b/e12_amf_tracking/XEH_PostServerInit.sqf @@ -0,0 +1 @@ +#include "script_component.hpp" diff --git a/e12_amf_tracking/XEH_PreClientInit.sqf b/e12_amf_tracking/XEH_PreClientInit.sqf new file mode 100755 index 0000000..5f2ec0e --- /dev/null +++ b/e12_amf_tracking/XEH_PreClientInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInit"); + +PREP(markerLoop); \ No newline at end of file diff --git a/e12_amf_tracking/XEH_PreServerInit.sqf b/e12_amf_tracking/XEH_PreServerInit.sqf new file mode 100755 index 0000000..bca2202 --- /dev/null +++ b/e12_amf_tracking/XEH_PreServerInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +TRACE_1("Process","PreInit"); + +PREP(createMarker); \ No newline at end of file diff --git a/e12_amf_tracking/config.cpp b/e12_amf_tracking/config.cpp new file mode 100755 index 0000000..f5b933b --- /dev/null +++ b/e12_amf_tracking/config.cpp @@ -0,0 +1,49 @@ +class CfgPatches +{ + class e12_amf_tracking + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Logic; +class E12_AMF_Logic; +class CfgVehicles { + class E12_AMF_TRACKING_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_TRACKING_ENABLE"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "if (isServer) then {e12_amf_tracking_enabled = true;publicVariable 'e12_amf_tracking_enabled'};"; + }; + }; +}; + +class Extended_PreInit_EventHandlers +{ + class e12_amf_tracking { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_tracking\XEH_PreClientInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_tracking\XEH_PreServerInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_tracking { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_tracking\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_tracking\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_tracking/fnc_createMarker.sqf b/e12_amf_tracking/fnc_createMarker.sqf new file mode 100755 index 0000000..d653f26 --- /dev/null +++ b/e12_amf_tracking/fnc_createMarker.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +if(!isServer) exitWith{}; +_group = _this select 0; +_group setVariable [QGVAR(data),_this select 1,true]; \ No newline at end of file diff --git a/e12_amf_tracking/fnc_markerLoop.sqf b/e12_amf_tracking/fnc_markerLoop.sqf new file mode 100755 index 0000000..9910d7b --- /dev/null +++ b/e12_amf_tracking/fnc_markerLoop.sqf @@ -0,0 +1,128 @@ +#include "script_component.hpp" +private["_markerCount","_createMarkerName","_handleGroup","_markers","_markersRun"]; +LOG('Marker loop init'); +_markerCount = 0; + +_createMarkerName = { + _marker = format["e12_amf_tracking_marker_%1", _markerCount]; + _markerCount=_markerCount + 1; + _marker +}; + +_handleGroup = { + if(side player != side _x) exitWith{}; + private ["_marker", "_pos", "_leader", "_data"]; + //[format ["Handle Group %1",_x], "com"] call CBA_fnc_debug; + LOG('Handle Group'); + if(count (units _x) > 0 && (count (_x getVariable [QGVAR(data),[]]) > 0)) then { + _leader = leader _x; + _pos = getPosASL _leader; + _marker = _x getVariable QGVAR(marker); + TRACE_3('Group should be tracked',_x,_pos,_marker); + + //missing Marker workaround + if(!isNil "_marker") then { + if((markerColor _marker) == "") then { + _marker = nil; + }; + }; + + if(isNil "_marker") then { + + _marker = call _createMarkerName; + TRACE_2('Create Marker',_marker,_group); + createMarkerLocal [_marker, _pos]; + _x setVariable[QGVAR(marker), _marker]; + _marker setMarkerShapeLocal "ICON"; + + //Set Marker details + _data = _x getVariable QGVAR(data); + TRACE_2('Create marker with data',_x,_data); + _marker setMarkerTextLocal (_data select 0); + + //symbol and size + switch(_data select 1) do { + case "cy":{ + _marker setMarkerTypeLocal "b_hq"; + _marker setMarkerSizeLocal [0.9, 0.9]; + }; + case "pl":{ + _marker setMarkerTypeLocal "b_hq"; + _marker setMarkerSizeLocal [0.9, 0.9]; + }; + case "ft":{ + _marker setMarkerTypeLocal "b_inf"; + _marker setMarkerSizeLocal [0.6, 0.6]; + }; + case "sl":{ + _marker setMarkerTypeLocal "b_hq"; + _marker setMarkerSizeLocal [0.6, 0.6]; + }; + case "mo":{ + _marker setMarkerTypeLocal "b_motor_inf"; + _marker setMarkerSizeLocal [0.6, 0.6]; + }; + case "me":{ + _marker setMarkerTypeLocal "b_mech_inf"; + _marker setMarkerSizeLocal [0.8, 0.8]; + }; + case "ma":{ + _marker setMarkerTypeLocal "b_maint"; + _marker setMarkerSizeLocal [0.8, 0.8]; + }; + case "ar":{ + _marker setMarkerTypeLocal "b_armor"; + _marker setMarkerSizeLocal [0.8, 0.8]; + }; + case "ch":{ + _marker setMarkerTypeLocal "b_air"; + _marker setMarkerSizeLocal [0.8, 0.8]; + }; + case "su":{ + _marker setMarkerTypeLocal "b_support"; + _marker setMarkerSizeLocal [0.8, 0.8]; + }; + case "se":{ + _marker setMarkerTypeLocal "b_service"; + _marker setMarkerSizeLocal [0.8, 0.8]; + }; + case "ay":{ + _marker setMarkerTypeLocal "b_art"; + _marker setMarkerSizeLocal [0.6, 0.6]; + }; + case "fx":{ + _marker setMarkerTypeLocal "b_plane"; + _marker setMarkerSizeLocal [0.6, 0.6]; + }; + default { + _marker setMarkerTypeLocal "b_inf"; + _marker setMarkerSizeLocal [0.6, 0.6]; + }; + }; + //color + _marker setMarkerColorLocal (_data select 2); + + }else{ + TRACE_2('Marker already exists, move',_marker,_pos); + //player sideChat format["Move Marker %1",_marker]; + _marker setMarkerPosLocal _pos; + }; + + + _markersRun = _markersRun + [_marker]; + }; +}; +LOG('Start marker loop'); + +_markers = []; +_markersRun = []; +while{true} do{ + _markersRun = []; + { + call _handleGroup; + } foreach allGroups; + { deleteMarkerLocal _x } forEach (_markers - _markersRun); + TRACE_2('Markers vs markersrun',_markers,_markersRun); + _markers = _markersRun; + sleep 1; +}; diff --git a/e12_amf_tracking/script_component.hpp b/e12_amf_tracking/script_component.hpp new file mode 100755 index 0000000..3a8d9e9 --- /dev/null +++ b/e12_amf_tracking/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_tracking +#define PREFIX e12 + +#include "script_macros.hpp" diff --git a/e12_amf_tracking/script_macros.hpp b/e12_amf_tracking/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_tracking/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_tracking/stringtable.xml b/e12_amf_tracking/stringtable.xml new file mode 100755 index 0000000..5fc1455 --- /dev/null +++ b/e12_amf_tracking/stringtable.xml @@ -0,0 +1,10 @@ + + + + +(E¹² AMF) Enable tracking +(E¹² AMF) Aktiviere Tracking + + + + diff --git a/e12_amf_trigger/$PBOPREFIX$ b/e12_amf_trigger/$PBOPREFIX$ new file mode 100755 index 0000000..6d0187e --- /dev/null +++ b/e12_amf_trigger/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_trigger \ No newline at end of file diff --git a/e12_amf_trigger/XEH_PostClientInit.sqf b/e12_amf_trigger/XEH_PostClientInit.sqf new file mode 100755 index 0000000..3ac27bc --- /dev/null +++ b/e12_amf_trigger/XEH_PostClientInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +LOG("Client Pre Init"); + + + + diff --git a/e12_amf_trigger/XEH_PostServerInit.sqf b/e12_amf_trigger/XEH_PostServerInit.sqf new file mode 100755 index 0000000..39778c1 --- /dev/null +++ b/e12_amf_trigger/XEH_PostServerInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" +LOG("Server Post Init"); + diff --git a/e12_amf_trigger/XEH_PreInit.sqf b/e12_amf_trigger/XEH_PreInit.sqf new file mode 100755 index 0000000..ccddece --- /dev/null +++ b/e12_amf_trigger/XEH_PreInit.sqf @@ -0,0 +1,78 @@ +#include "script_component.hpp" +LOG("Server Pre Init"); + +//Nonai +if(isMultiplayer) then { + LOG("is Multiplayer"); + FUNC(NonAi) = { + { + if(_x in playableunits) exitWith{true}; + + } foreach _this; + }; +}else{ + LOG("Non Multiplayer"); + FUNC(NonAi) = { + { + if(_x in switchableunits) exitWith{true}; + + } foreach _this; + }; +}; + +//aliveNonai +if(isMultiplayer) then { + LOG("is Multiplayer"); + FUNC(AliveNonAi) = { + { + if((_x in playableunits) && alive _x) exitWith{true}; + + } foreach _this; + }; +}else{ + LOG("Non Multiplayer"); + FUNC(AliveNonAi) = { + { + if((_x in switchableunits) && alive _x) exitWith{true}; + + } foreach _this; + }; +}; + +//Nonai onground +if(isMultiplayer) then { + LOG("is Multiplayer"); + FUNC(NonAiOnGround) = { + { + if((_x in playableunits) && (((getPos _x) select 2) < 3)) exitWith{true}; + + } foreach _this; + }; +}else{ + LOG("Non Multiplayer"); + FUNC(NonAiOnGround) = { + { + if((_x in switchableunits) && (((getPos _x) select 2) < 3)) exitWith{true}; + + } foreach _this; + }; +}; + +//Alive Nonai onground +if(isMultiplayer) then { + LOG("is Multiplayer"); + FUNC(AliveNonAiOnGround) = { + { + if((_x in playableunits) && alive _x && (((getPos _x) select 2) < 3)) exitWith{true}; + + } foreach _this; + }; +}else{ + LOG("Non Multiplayer"); + FUNC(AliveNonAiOnGround) = { + { + if((_x in switchableunits) && alive _x && (((getPos _x) select 2) < 3)) exitWith{true}; + + } foreach _this; + }; +}; \ No newline at end of file diff --git a/e12_amf_trigger/config.cpp b/e12_amf_trigger/config.cpp new file mode 100755 index 0000000..b198797 --- /dev/null +++ b/e12_amf_trigger/config.cpp @@ -0,0 +1,37 @@ +class CfgPatches +{ + class e12_amf_trigger + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Extended_PreInit_EventHandlers +{ + class e12_amf_trigger { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_trigger\XEH_PreInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_trigger\XEH_PreInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_trigger { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_trigger\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_trigger\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_trigger/script_component.hpp b/e12_amf_trigger/script_component.hpp new file mode 100755 index 0000000..a1c2887 --- /dev/null +++ b/e12_amf_trigger/script_component.hpp @@ -0,0 +1,7 @@ +#define COMPONENT amf_trigger +#define PREFIX e12 + + + + +#include "script_macros.hpp" diff --git a/e12_amf_trigger/script_macros.hpp b/e12_amf_trigger/script_macros.hpp new file mode 100755 index 0000000..547c9fd --- /dev/null +++ b/e12_amf_trigger/script_macros.hpp @@ -0,0 +1,2 @@ +//#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp" diff --git a/e12_amf_warmup/$PBOPREFIX$ b/e12_amf_warmup/$PBOPREFIX$ new file mode 100755 index 0000000..f2dec07 --- /dev/null +++ b/e12_amf_warmup/$PBOPREFIX$ @@ -0,0 +1 @@ +x\e12\addons\amf_warmup \ No newline at end of file diff --git a/e12_amf_warmup/XEH_PostClientInit.sqf b/e12_amf_warmup/XEH_PostClientInit.sqf new file mode 100755 index 0000000..c1904bc --- /dev/null +++ b/e12_amf_warmup/XEH_PostClientInit.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +if(isNil QGVAR(enabled)) exitWith {}; +LOG('Client warmup enabled'); + +//Support jip - mission already started +if(!isNil QGVAR(finished)) exitWith {}; +LOG('Client warmup not yet finished'); + +[] spawn FUNC(clientloop); diff --git a/e12_amf_warmup/XEH_PostServerInit.sqf b/e12_amf_warmup/XEH_PostServerInit.sqf new file mode 100755 index 0000000..671c04e --- /dev/null +++ b/e12_amf_warmup/XEH_PostServerInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +if(isNil "e12_amf_warmup_enabled") exitWith {}; +LOG('Server warmup enabled'); + +GVAR(startDate) = date; +publicVariable QGVAR(startDate); + +[] spawn FUNC(serverloop); \ No newline at end of file diff --git a/e12_amf_warmup/XEH_PreClientInit.sqf b/e12_amf_warmup/XEH_PreClientInit.sqf new file mode 100755 index 0000000..fa906f5 --- /dev/null +++ b/e12_amf_warmup/XEH_PreClientInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +PREP(clientloop); +PREP(startMission); + diff --git a/e12_amf_warmup/XEH_PreServerInit.sqf b/e12_amf_warmup/XEH_PreServerInit.sqf new file mode 100755 index 0000000..cde90b9 --- /dev/null +++ b/e12_amf_warmup/XEH_PreServerInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" +PREP(serverloop); +PREP(startMission); \ No newline at end of file diff --git a/e12_amf_warmup/config.cpp b/e12_amf_warmup/config.cpp new file mode 100755 index 0000000..3f882a1 --- /dev/null +++ b/e12_amf_warmup/config.cpp @@ -0,0 +1,49 @@ +class CfgPatches +{ + class e12_amf_warmup + { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.62; + requiredAddons[] = {"e12_amf_main"}; + author[] = {"Coati - Echo12 Development Team"}; + version = "0.1"; + authorUrl = "http://www.echo12.de"; + }; +}; + + +class Logic; +class E12_AMF_Logic; +class CfgVehicles { + class E12_amf_warmup_Logic: E12_AMF_Logic { + displayName = "$STR_E12AMF_MOD_WARMUP_ENABLE"; + vehicleClass = "Modules"; + class Eventhandlers { + init = "e12_amf_dac_DELAYED_START = true;if (isServer) then {e12_amf_warmup_enabled = true;publicVariable 'e12_amf_warmup_enabled'};"; + }; + }; +}; + +class Extended_PreInit_EventHandlers +{ + class e12_amf_warmup { + clientInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_warmup\XEH_PreClientInit.sqf'"; + serverInit = "call compile preprocessFileLineNumbers 'x\e12\addons\amf_warmup\XEH_PreServerInit.sqf'"; + }; +}; + +class Extended_PostInit_EventHandlers +{ + class e12_amf_warmup { + clientInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_warmup\XEH_PostClientInit.sqf'"; + serverInit = "e12retnull = [] spawn compile preprocessFileLineNumbers 'x\e12\addons\amf_warmup\XEH_PostServerInit.sqf'"; + }; + +}; + + + + + + diff --git a/e12_amf_warmup/fnc_clientloop.sqf b/e12_amf_warmup/fnc_clientloop.sqf new file mode 100755 index 0000000..d17843f --- /dev/null +++ b/e12_amf_warmup/fnc_clientloop.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +waitUntil{!isNil QGVAR(finished)}; +LOG("Clientloop finished"); + +//Set date back +setDate GVAR(startDate); + +player sideChat "Mission wurde gestartet!"; \ No newline at end of file diff --git a/e12_amf_warmup/fnc_serverloop.sqf b/e12_amf_warmup/fnc_serverloop.sqf new file mode 100755 index 0000000..859dd76 --- /dev/null +++ b/e12_amf_warmup/fnc_serverloop.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +waitUntil{!isNil QGVAR(finished)}; +LOG("Serverloop finished"); + +//Set date back +setDate GVAR(startDate); + +//activate DAC +e12_amf_dac_DELAYED_START_GO=true; +publicVariable "e12_amf_dac_DELAYED_START_GO"; \ No newline at end of file diff --git a/e12_amf_warmup/fnc_startMission.sqf b/e12_amf_warmup/fnc_startMission.sqf new file mode 100755 index 0000000..11a112c --- /dev/null +++ b/e12_amf_warmup/fnc_startMission.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +GVAR(finished) = true; +publicVariable QGVAR(finished); \ No newline at end of file diff --git a/e12_amf_warmup/script_component.hpp b/e12_amf_warmup/script_component.hpp new file mode 100755 index 0000000..405578b --- /dev/null +++ b/e12_amf_warmup/script_component.hpp @@ -0,0 +1,4 @@ +#define COMPONENT amf_warmup +#define PREFIX e12 + +#include "script_macros.hpp" diff --git a/e12_amf_warmup/script_macros.hpp b/e12_amf_warmup/script_macros.hpp new file mode 100755 index 0000000..c761fa6 --- /dev/null +++ b/e12_amf_warmup/script_macros.hpp @@ -0,0 +1,2 @@ +#define DEBUG_MODE_FULL +#include "\x\cba\addons\main\script_macros_common.hpp"