diff --git a/AntistasiOfficial.Altis/CREATE/VEHdespawner.sqf b/AntistasiOfficial.Altis/CREATE/VEHdespawner.sqf index f7d55f5c..5c7bb0aa 100644 --- a/AntistasiOfficial.Altis/CREATE/VEHdespawner.sqf +++ b/AntistasiOfficial.Altis/CREATE/VEHdespawner.sqf @@ -1,3 +1,4 @@ +scriptName "VEHdespawner"; params ["_vehicle"]; private ["_isListed","_vehiclePos","_city","_data","_unit"]; diff --git a/AntistasiOfficial.Altis/CREATE/genRoadPatrol.sqf b/AntistasiOfficial.Altis/CREATE/genRoadPatrol.sqf index 8bcfdb42..c80f7939 100644 --- a/AntistasiOfficial.Altis/CREATE/genRoadPatrol.sqf +++ b/AntistasiOfficial.Altis/CREATE/genRoadPatrol.sqf @@ -1,4 +1,5 @@ #include "script_component.hpp" +scriptName "genRoadPatrol"; private ["_allVehicles","_allGroups","_allSoldiers","_base","_spawnData","_spawnPosition","_direction","_vehicleArray","_vehicleType","_arrayBases","_arrayTargets","_distance","_vehicleData","_vehicle","_groupVehicle","_beach","_group","_target","_targetPosition","_wp_v_1","_object","_knowledge"]; _allVehicles = []; diff --git a/AntistasiOfficial.Altis/REINF/postmortem.sqf b/AntistasiOfficial.Altis/REINF/postmortem.sqf index bfe99132..f0323272 100644 --- a/AntistasiOfficial.Altis/REINF/postmortem.sqf +++ b/AntistasiOfficial.Altis/REINF/postmortem.sqf @@ -1,12 +1,26 @@ -_muerto = _this select 0; -sleep cleantime; -deleteVehicle _muerto; -_grupo = group _muerto; -if (!isNull _grupo) then - { - if ({alive _x} count units _grupo == 0) then {deleteGroup _grupo}; - } -else - { - if (_muerto in staticsToSave) then {staticsToSave = staticsToSave - [_muerto]; publicVariable "staticsToSave";}; - }; + +if(isNil "postmortem_array") then { + postmortem_array = []; + [] spawn { + scriptName "postmortem_cycle"; + while {true} do { + if (postmortem_array isEqualTo []) then { + sleep 60; + }else{ + (postmortem_array deleteAt 0) params ["_what","_when"]; + _when = _when - diag_tickTime; + if ( _when > 1 ) then {sleep _when;}; + deleteVehicle _what; + private _group = group _what; + if (!isNull _group) then { + if ({alive _x} count units _group == 0) then {deleteGroup _group}; + }else{ + if (_what in staticsToSave) then {staticsToSave = staticsToSave - [_what]; publicVariable "staticsToSave";}; + }; + }; + }; + }; +}; + +params ["_dead",["_cleanTOut",cleantime]]; +postmortem_array pushBack [_dead, diag_tickTime + _cleanTOut]; diff --git a/AntistasiOfficial.Altis/Scripts/UPSMON/COMMON/Core/fnc/UPSMON_TRACK.sqf b/AntistasiOfficial.Altis/Scripts/UPSMON/COMMON/Core/fnc/UPSMON_TRACK.sqf index 6066d34f..98920062 100644 --- a/AntistasiOfficial.Altis/Scripts/UPSMON/COMMON/Core/fnc/UPSMON_TRACK.sqf +++ b/AntistasiOfficial.Altis/Scripts/UPSMON/COMMON/Core/fnc/UPSMON_TRACK.sqf @@ -10,8 +10,7 @@ Returns: ****************************************************************/ private ["_grpid","_leader","_pos","_rankshort","_lastname","_wppos","_markercolor","_grptype","_drawicon","_text","_trackername","_destname"]; - - +scriptName "UPSMON_TRACK"; While {true} do { { diff --git a/AntistasiOfficial.Altis/Scripts/UPSMON/COMMON/Group/fnc/UPSMON_ChangeFormation.sqf b/AntistasiOfficial.Altis/Scripts/UPSMON/COMMON/Group/fnc/UPSMON_ChangeFormation.sqf index 4ebfd808..35994314 100644 --- a/AntistasiOfficial.Altis/Scripts/UPSMON/COMMON/Group/fnc/UPSMON_ChangeFormation.sqf +++ b/AntistasiOfficial.Altis/Scripts/UPSMON/COMMON/Group/fnc/UPSMON_ChangeFormation.sqf @@ -9,16 +9,27 @@ Parameter(s): Returns: ****************************************************************/ +if (isNil "UPS_forCh_arr") then { + UPS_forCh_arr = []; + [] spawn { + scriptName "UPSMON_formationChanger"; + while {true} do { + if (UPS_forCh_arr isEqualTo []) then { + sleep 10; + }else{ + (UPS_forCh_arr deleteAt 0) params ["_what","_when"]; + _when = _when - diag_tickTime; + if ( _when > 1 ) then {sleep _when;}; + if (!IsNull _what) then + { + _what setvariable ["UPSMON_haschangedformation",false]; + }; + }; + }; + }; +}; -private ["_grp","_supstatus","_attackpos","_dist","_terrainscan","_haslos","_time"]; - -_grp = _this select 0; -_supstatus = _this select 1; -_attackpos = _this select 2; -_dist = _this select 3; -_terrainscan = _this select 4; -_haslos = _this select 5; -_typeofgrp = _this select 6; +params ["_grp","_supstatus","_attackpos","_dist","_terrainscan","_haslos","_typeofgrp"]; If (!(_grp getvariable ["UPSMON_haschangedformation",false])) then { @@ -157,15 +168,4 @@ If (!(_grp getvariable ["UPSMON_haschangedformation",false])) then }; }; -[_grp] spawn -{ - private ["_grp"]; - - _grp = _this select 0; - - sleep 20; - If (!IsNull _grp) then - { - _grp setvariable ["UPSMON_haschangedformation",false]; - }; -}; \ No newline at end of file +UPS_forCh_arr pushBack [_grp, diag_tickTime + 20]; diff --git a/AntistasiOfficial.Altis/Scripts/UPSMON/UPSMON_MAINLOOP.sqf b/AntistasiOfficial.Altis/Scripts/UPSMON/UPSMON_MAINLOOP.sqf index 056bd0da..8fc39e22 100644 --- a/AntistasiOfficial.Altis/Scripts/UPSMON/UPSMON_MAINLOOP.sqf +++ b/AntistasiOfficial.Altis/Scripts/UPSMON/UPSMON_MAINLOOP.sqf @@ -80,13 +80,14 @@ UPSMON_MAINLOOP_postCycle = {}; UPSMON_MAINLOOP_preItem = {}; UPSMON_MAINLOOP_postItem = {}; #endif +scriptname "UPSMON_MAINLOOP"; +UPSMON_MAINLOOP_cycle = 10; while {true} do { #ifdef PROFILE_UPSMON call UPSMON_MAINLOOP_preCycle; #endif - _cycle = ((random 1) + 10); { #ifdef PROFILE_UPSMON call UPSMON_MAINLOOP_preItem; @@ -1056,5 +1057,5 @@ while {true} do #ifdef PROFILE_UPSMON call UPSMON_MAINLOOP_postCycle; #endif - sleep _cycle; -}; \ No newline at end of file + sleep UPSMON_MAINLOOP_cycle; +}; diff --git a/AntistasiOfficial.Altis/Scripts/UPSMON/UPSMON_MAINLOOPCiv.sqf b/AntistasiOfficial.Altis/Scripts/UPSMON/UPSMON_MAINLOOPCiv.sqf index f6d4af15..ca41e9d9 100644 --- a/AntistasiOfficial.Altis/Scripts/UPSMON/UPSMON_MAINLOOPCiv.sqf +++ b/AntistasiOfficial.Altis/Scripts/UPSMON/UPSMON_MAINLOOPCiv.sqf @@ -1,11 +1,11 @@ private ["_cycle","_grp","_members","_grpmission","_grpstatus","_grpid","_Ucthis","_lastcurrpos","_lastpos","_lastattackpos","_areamarker","_npc","_driver","_buildingdist","_deadbodiesnear","_stuck","_makenewtarget","_targetpos","_attackpos","_dist","_target","_wptype","_traveldist","_targetdist","_speedmode","_behaviour","_combatmode","_currPos","_grpcomposition","_typeofgrp","_capacityofgrp","_assignedvehicle","_supstatus","_TargetSearch"]; +scriptname "UPSMON_MAINLOOPCiv"; +UPSMON_MAINLOOPCiv_cycle = 15; while {true} do { - _cycle = ((random 1) + 10); { - If (!IsNull _x) then - { + If (!IsNull _x) then{ _grp = _x; _members = (_grp getvariable "UPSMON_Origin") select 4; @@ -22,8 +22,7 @@ while {true} do _areamarker = _Ucthis select 1; - if (({alive _x && !(captive _x)} count units _grp) == 0 || _grp getvariable ["UPSMON_Removegroup",false]) exitwith - { + if (({alive _x && !(captive _x)} count units _grp) == 0 || _grp getvariable ["UPSMON_Removegroup",false]) exitwith{ [_grp,_UCthis] call UPSMON_RESPAWN; }; @@ -56,8 +55,7 @@ while {true} do // current position _currPos = getposATL _npc; - If (count(waypoints _grp) != 0) then - { + If (count(waypoints _grp) != 0) then{ _wppos = waypointPosition [_grp,count(waypoints _grp)-1]; _targetpos = _wppos; _wptype = waypointType [_grp,count(waypoints _grp)-1]; @@ -71,29 +69,28 @@ while {true} do _supstatus = [_grp] call UPSMON_supstatestatus; _nowp = [_grp,_target,_supstatus] call UPSMON_NOWP; - - If (_grp getvariable ["UPSMON_GrpHostility",0] > 0) then - { - _TargetSearch = [_grp,_areamarker] call UPSMON_TargetAcquisitionCiv; - _target = _TargetSearch select 0; - _dist = _TargetSearch select 1; - _attackpos = _TargetSearch select 2; - - If (_grp getvariable ["UPSMON_Grpmission",""] != "HARASS") then - { - If (!Isnull _target) then - { - _grp setvariable ["UPSMON_Grpmission","HARASS"] - }; - } - else - { - If (Isnull _target) then - { - [_grp] call UPSMON_BackToNormal; - }; - }; - }; + if (_grp getvariable ["UPSMON_GrpHostility",0] > 0) then + { + _TargetSearch = [_grp,_areamarker] call UPSMON_TargetAcquisitionCiv; + _target = _TargetSearch select 0; + _dist = _TargetSearch select 1; + _attackpos = _TargetSearch select 2; + + If (_grp getvariable ["UPSMON_Grpmission",""] != "HARASS") then + { + If (!Isnull _target) then + { + _grp setvariable ["UPSMON_Grpmission","HARASS"] + }; + } + else + { + If (Isnull _target) then + { + [_grp] call UPSMON_BackToNormal; + }; + }; + }; //If in safe mode if find dead bodies change behaviour { @@ -287,12 +284,10 @@ while {true} do _grp setvariable ["UPSMON_Lastinfos",[_currpos,_targetpos]]; _grp setvariable ["UPSMON_Lastattackpos",_attackpos]; _grp setvariable ["UPSMON_LastGrpmission",_grp getvariable ["UPSMON_Grpmission",""]]; - sleep 0.1; - }; } foreach UPSMON_Civs; - If (ObjNull in UPSMON_NPCs) then {UPSMON_NPCs = UPSMON_NPCs - [ObjNull]}; - sleep _cycle; -}; \ No newline at end of file + if (ObjNull in UPSMON_NPCs) then {UPSMON_NPCs = UPSMON_NPCs - [ObjNull]}; + sleep UPSMON_MAINLOOPCiv_cycle; +}; diff --git a/AntistasiOfficial.Altis/initVar.sqf b/AntistasiOfficial.Altis/initVar.sqf index 75b12ae4..f214451f 100644 --- a/AntistasiOfficial.Altis/initVar.sqf +++ b/AntistasiOfficial.Altis/initVar.sqf @@ -245,4 +245,4 @@ publicVariable "static_playerSide"; if (isMultiplayer) then {[[petros,"hint","Variables Init Completed"],"commsMP"] call BIS_fnc_MP;}; -diag_log "InitVar.sqf: end"; \ No newline at end of file +diag_log "InitVar.sqf: end";