Jump to content
phronk

Garbage Collection Script Needed

Recommended Posts

I don't usually post threads that pose a request, but, I'm making a slight exception since I've been unable to find the answers on my own. So, does anyone know of any good working garbage collection scripts that work in the current stable build of ArmA III? All the ones I've looked at on ArmAholic seem to be designed for the [Alpha] or [beta], which I'm assuming means they are now obsolete. Maybe I've continuously missed the script, but I've triple-checked for a script and could not find one that immediately convinced me that it's worth using.

Hopefully some of you scripters and mission makers out there know of one and can send me a link to it either here in this thread or via Private Message. Thank you very much in advance!

Share this post


Link to post
Share on other sites

Oh wow, I must have skimmed passed this one because of the "PVP" acronym :P

Will test it out tonight or tomorrow!

Share this post


Link to post
Share on other sites

This one does the trick for me:

/*
   .....               ...     ..           ...     ..      
.H8888888h.  ~-.    .=*8888x <"?88h.     .=*8888x <"?88h.  
888888888888x  `>  X>  '8888H> '8888    X>  '8888H> '8888  
X~     `?888888hx~ '88h. `8888   8888   '88h. `8888   8888  
'      x8.^"*88*"  '8888 '8888    "88>  '8888 '8888    "88>  
`-:- X8888x        `888 '8888.xH888x.   `888 '8888.xH888x.  
     488888>         X" :88*~  `*8888>    X" :88*~  `*8888>
   .. `"88*        ~"   !"`      "888>  ~"   !"`      "888>
 x88888nX"      .   .H8888h.      ?88    .H8888h.      ?88  
!"*8888888n..  :   :"^"88888h.    '!    :"^"88888h.    '!  
'    "*88888888*    ^    "88888hx.+"     ^    "88888hx.+"    
       ^"***"`            ^"**""               ^"**""    

   | TheButcherBay | ARMA 3 ALPHA | ANJAN DELETE ALL |
*/


if (!isServer) exitWith {};

TBB_Included = [];

TBB_Excluded = ["B_soldier_AR_F","B_soldier_exp_F","B_Soldier_GL_F",
               "B_Helipilot_F","B_soldier_M_F","B_medic_F","B_Soldier_F",
               "B_soldier_repair_F","B_soldier_LAT_F","B_Soldier_SL_F",
               "B_Soldier_lite_F","B_Soldier_TL_F","B_Lifeboat",
               "B_Assaultboat","B_SpeedBoat","B_Quadbike_F",
               "B_Hunter_F","B_Hunter_HMG_F","B_Hunter_RCWS_F",
               "B_MH9_F","B_AH9_F","O_Ka60_Unarmed_F","O_Ka60_F","B_Mk6"];

// true/false = on/off.
_canMove = true;          // if vehicles should be deleted when they are to damaged to move and empty, NOTE empty fuel also means it cannot move.
_abandoned = false;      // if vehicles should be deleted after being x time un manned, if 1 unit enters in the time period, time is reset, and vehicle is processed again when empty or destroyed.
_groupDel = true;          // if empty groups should be deleted, to avoid reaching 144 group limit in long missions.
_viewDist = 0;            // min distance in meter from a player unit to allow delete, if you dont care if player sees the delete, set it to 0.
_manTimer = 30;          // x seconds until delete of dead man units.
_vehTimer = 30;          // x seconds until delete of dead vehicles, for destroyed and heavy damaged vehicles.
_abaTimer = 30;          // x seconds a vehicle must be unmanned to be deleted, for _abandoned option.
_incTimer = 30;            // x seconds any object put inside the TBB_Included will be deleted no matter condition.

// DO NOT EDIT PAST THIS LINE //

// delete function.
_delete = {
   _del = _this select 0;
   _dis = _this select 1;
   _tim = _this select 2;
   _aba = _this select 3;
   _abt = _this select 4;
   _cnm = _this select 5;
   if (isPlayer _del) exitWith {};

   _abort = true;
   if ("veh" in _this AND (_aba OR _cnm)) then {
       _sec = _abt;
       while {_sec != 0} do {
           sleep 1;
           if (_aba AND (getDammage _del) < 1 AND ({alive _x} count (crew _del)) == 0) then {_sec = _sec - 1};
           if (_aba AND _sec == 0) then {_abort = false};
           if (((_cnm AND canMove _del) OR _aba) AND ({alive _x} count (crew _del)) != 0) then {
               _sec = 0; _abort = true;
               _del setVariable ["TBB_delete_readd", true, true];
           };
           if ((getDammage _del) >= 1) then {
               _sec = 0; _abort = false;
               sleep _tim;
           };
           if (isNull _del) then {_sec = 0; _abort = true};
       };
   } else {
       _abort = false;
       sleep _tim;
   };
   // fail safe for excluded and included.
   if (isNull _del OR _abort OR _del in TBB_Excluded) exitWith {};
   {
       _arr = _x; _obj = ""; _timer = _tim; _dist = _dis;
       if ((typeName _arr) == "ARRAY") then {
           _obj = _arr select 0; _timer = _arr select 1;
           if ((count _arr) == 3) then {_dist = _arr select 2} else {_dist = _viewDist};
       } else {
           _obj = _arr; _timer = _tim; _dist = _dis;
       };
       if (_del == _obj) then {
           _del = _obj;
           _dis = _dist;
           if ((_timer - _tim) > 0) then {sleep (_timer - _tim)};
           // clean up the TBB_Included array of deleted objects.
           TBB_Included = TBB_Included - [_x];
       };
   } foreach TBB_Included;

   if (!isNull _del) then {
       _arr = [];
       waitUntil {sleep 1; ({isPlayer _x AND (_del distance (vehicle _x)) < _dis} count playableUnits) == 0};
       waitUntil {sleep 1; ({isPlayer _x AND (_del distance (vehicle _x)) < _dis} count switchableUnits) == 0};
       if ("veh" in _this OR "incVeh" in _this) then {{_arr = _arr + [_x]; _x setPos (getPos _del); deleteVehicle _x} foreach crew _del} else {
           if (_del isKindOf "man") then {hideBody _del; sleep 10};
       };
       _arr = _arr + [_del];
       deleteVehicle _del;
       //{_x = objNull; waitUntil {sleep 1; isNull _x}; _x = nil} foreach _arr;

       {if (_x in TBB_delete_respawned) then {_arr = _arr - [_x]}} foreach _arr;
       TBB_delete_respawned = TBB_delete_respawned + _arr;
   };
};

_processed = []; _todo = []; _types = []; _included = []; TBB_delete_respawned = [];
while {true} do {
   // check TBB_Excluded array for changes.
   {if ((typeName _x) == "STRING" AND !(_x in _types)) then {_types = _types + [_x]}} foreach TBB_Excluded;
   // update types/classnames if changed.
   {if (!(_x in TBB_Excluded)) then {_types = _types - [_x]}} foreach _types;
   // clean the processed list of all objects that have been deleted.
   {if (isNull _x) then {_processed = _processed - [_x]}} foreach _processed;
   // clean the included list of all objects that have been deleted.
   {if (isNull _x) then {_included = _included - [_x]}} foreach _included;

   // process TBB_Included array.
   {
       _arr = _x; _obj = ""; _timer = 0; _dist = 0;
       if ((typeName _arr) == "ARRAY") then {
           _obj = _arr select 0; _timer = _arr select 1;
           if ((count _arr) == 3) then {_dist = _arr select 2} else {_dist = _viewDist};
       } else {
           _obj = _arr; _timer = _incTimer; _dist = _viewDist;
       };
       if (_x in _included) exitWith {};
       _included = _included + [_obj];
       if (_obj isKindOf "AllVehicles" AND !(_obj isKindOf "Man")) then {
           _null = [_obj,_dist,_timer,false,0,false,"incVeh"] spawn _delete;
       } else {
           _null = [_obj,_dist,_timer,false,0,false,"inc"] spawn _delete;
       };
   } foreach TBB_Included;

   // gather all dead.
   _allD = allDead;
   {if (_x in TBB_delete_respawned AND _x in _processed) then {_processed = _processed - [_x]}} foreach _allD;
   {
       _unit = _x;
       if (_x in _included) exitWith {};
       if ((vehicle _x) == _x AND !(_x in _processed) AND ({_unit isKindOf _x} count _types) == 0 AND !(_x in TBB_Excluded)) then {
           if (!(_x in _todo)) then {_todo = _todo + [_x]};
       };
   } foreach _allD;

   // gather all vehicles and process depending on options used.
   _allV = vehicles;
   {if (_x in TBB_delete_respawned AND _x in _processed) then {_processed = _processed - [_x]}} foreach _allV;
   {
       _veh = _x;
       if (_x in _included) exitWith {};
       if (_x getVariable ["TBB_delete_readd", false]) then {
           _processed = _processed - [_x];
           _x setVariable ["TBB_delete_readd", false, true];
       };
       if (!(_x in _processed) AND ({_veh isKindOf _x} count _types) == 0 AND !(_x in TBB_Excluded)) then {
           if ((getDammage _x) >= 1 OR (_canMove AND !canMove _x AND ({alive _x} count (crew _x)) == 0) OR (_abandoned AND ({alive _x} count (crew _x)) == 0)) then {
               if (!(_x in _todo)) then {_todo = _todo + [_x]};
           };
       };
   } foreach _allV;

   // run the delete script for todo list.
   {
       if (!(_x in _processed)) then {
           if (_x isKindOf "Man") then {
               _null = [_x,_viewDist,_manTimer,_abandoned,_abaTimer,_canMove] spawn _delete;
           } else {
               _null = [_x,_viewDist,_vehTimer,_abandoned,_abaTimer,_canMove,"veh"] spawn _delete;
           };
           _todo = _todo - [_x]; _processed = _processed + [_x];
       };
   } foreach _todo;

   // delete empty groups.
   if (_groupDel) then {{if ((count (units _x)) == 0) then {deleteGroup _x; _x = grpNull; _x = nil}} foreach allGroups};

   // sleep 10 seconds, then check if there are any changes to dead or vehicles that are not processed.
   sleep 10;
};

Share this post


Link to post
Share on other sites
On 6/11/2014 at 5:00 PM, whiztler said:

This one does the trick for me:

 


/*
   .....               ...     ..           ...     ..      
.H8888888h.  ~-.    .=*8888x <"?88h.     .=*8888x <"?88h.  
888888888888x  `>  X>  '8888H> '8888    X>  '8888H> '8888  
X~     `?888888hx~ '88h. `8888   8888   '88h. `8888   8888  
'      x8.^"*88*"  '8888 '8888    "88>  '8888 '8888    "88>  
`-:- X8888x        `888 '8888.xH888x.   `888 '8888.xH888x.  
     488888>         X" :88*~  `*8888>    X" :88*~  `*8888>
   .. `"88*        ~"   !"`      "888>  ~"   !"`      "888>
 x88888nX"      .   .H8888h.      ?88    .H8888h.      ?88  
!"*8888888n..  :   :"^"88888h.    '!    :"^"88888h.    '!  
'    "*88888888*    ^    "88888hx.+"     ^    "88888hx.+"    
       ^"***"`            ^"**""               ^"**""    

   | TheButcherBay | ARMA 3 ALPHA | ANJAN DELETE ALL |
*/


if (!isServer) exitWith {};

TBB_Included = [];

TBB_Excluded = ["B_soldier_AR_F","B_soldier_exp_F","B_Soldier_GL_F",
               "B_Helipilot_F","B_soldier_M_F","B_medic_F","B_Soldier_F",
               "B_soldier_repair_F","B_soldier_LAT_F","B_Soldier_SL_F",
               "B_Soldier_lite_F","B_Soldier_TL_F","B_Lifeboat",
               "B_Assaultboat","B_SpeedBoat","B_Quadbike_F",
               "B_Hunter_F","B_Hunter_HMG_F","B_Hunter_RCWS_F",
               "B_MH9_F","B_AH9_F","O_Ka60_Unarmed_F","O_Ka60_F","B_Mk6"];

// true/false = on/off.
_canMove = true;          // if vehicles should be deleted when they are to damaged to move and empty, NOTE empty fuel also means it cannot move.
_abandoned = false;      // if vehicles should be deleted after being x time un manned, if 1 unit enters in the time period, time is reset, and vehicle is processed again when empty or destroyed.
_groupDel = true;          // if empty groups should be deleted, to avoid reaching 144 group limit in long missions.
_viewDist = 0;            // min distance in meter from a player unit to allow delete, if you dont care if player sees the delete, set it to 0.
_manTimer = 30;          // x seconds until delete of dead man units.
_vehTimer = 30;          // x seconds until delete of dead vehicles, for destroyed and heavy damaged vehicles.
_abaTimer = 30;          // x seconds a vehicle must be unmanned to be deleted, for _abandoned option.
_incTimer = 30;            // x seconds any object put inside the TBB_Included will be deleted no matter condition.

// DO NOT EDIT PAST THIS LINE //

// delete function.
_delete = {
   _del = _this select 0;
   _dis = _this select 1;
   _tim = _this select 2;
   _aba = _this select 3;
   _abt = _this select 4;
   _cnm = _this select 5;
   if (isPlayer _del) exitWith {};

   _abort = true;
   if ("veh" in _this AND (_aba OR _cnm)) then {
       _sec = _abt;
       while {_sec != 0} do {
           sleep 1;
           if (_aba AND (getDammage _del) < 1 AND ({alive _x} count (crew _del)) == 0) then {_sec = _sec - 1};
           if (_aba AND _sec == 0) then {_abort = false};
           if (((_cnm AND canMove _del) OR _aba) AND ({alive _x} count (crew _del)) != 0) then {
               _sec = 0; _abort = true;
               _del setVariable ["TBB_delete_readd", true, true];
           };
           if ((getDammage _del) >= 1) then {
               _sec = 0; _abort = false;
               sleep _tim;
           };
           if (isNull _del) then {_sec = 0; _abort = true};
       };
   } else {
       _abort = false;
       sleep _tim;
   };
   // fail safe for excluded and included.
   if (isNull _del OR _abort OR _del in TBB_Excluded) exitWith {};
   {
       _arr = _x; _obj = ""; _timer = _tim; _dist = _dis;
       if ((typeName _arr) == "ARRAY") then {
           _obj = _arr select 0; _timer = _arr select 1;
           if ((count _arr) == 3) then {_dist = _arr select 2} else {_dist = _viewDist};
       } else {
           _obj = _arr; _timer = _tim; _dist = _dis;
       };
       if (_del == _obj) then {
           _del = _obj;
           _dis = _dist;
           if ((_timer - _tim) > 0) then {sleep (_timer - _tim)};
           // clean up the TBB_Included array of deleted objects.
           TBB_Included = TBB_Included - [_x];
       };
   } foreach TBB_Included;

   if (!isNull _del) then {
       _arr = [];
       waitUntil {sleep 1; ({isPlayer _x AND (_del distance (vehicle _x)) < _dis} count playableUnits) == 0};
       waitUntil {sleep 1; ({isPlayer _x AND (_del distance (vehicle _x)) < _dis} count switchableUnits) == 0};
       if ("veh" in _this OR "incVeh" in _this) then {{_arr = _arr + [_x]; _x setPos (getPos _del); deleteVehicle _x} foreach crew _del} else {
           if (_del isKindOf "man") then {hideBody _del; sleep 10};
       };
       _arr = _arr + [_del];
       deleteVehicle _del;
       //{_x = objNull; waitUntil {sleep 1; isNull _x}; _x = nil} foreach _arr;

       {if (_x in TBB_delete_respawned) then {_arr = _arr - [_x]}} foreach _arr;
       TBB_delete_respawned = TBB_delete_respawned + _arr;
   };
};

_processed = []; _todo = []; _types = []; _included = []; TBB_delete_respawned = [];
while {true} do {
   // check TBB_Excluded array for changes.
   {if ((typeName _x) == "STRING" AND !(_x in _types)) then {_types = _types + [_x]}} foreach TBB_Excluded;
   // update types/classnames if changed.
   {if (!(_x in TBB_Excluded)) then {_types = _types - [_x]}} foreach _types;
   // clean the processed list of all objects that have been deleted.
   {if (isNull _x) then {_processed = _processed - [_x]}} foreach _processed;
   // clean the included list of all objects that have been deleted.
   {if (isNull _x) then {_included = _included - [_x]}} foreach _included;

   // process TBB_Included array.
   {
       _arr = _x; _obj = ""; _timer = 0; _dist = 0;
       if ((typeName _arr) == "ARRAY") then {
           _obj = _arr select 0; _timer = _arr select 1;
           if ((count _arr) == 3) then {_dist = _arr select 2} else {_dist = _viewDist};
       } else {
           _obj = _arr; _timer = _incTimer; _dist = _viewDist;
       };
       if (_x in _included) exitWith {};
       _included = _included + [_obj];
       if (_obj isKindOf "AllVehicles" AND !(_obj isKindOf "Man")) then {
           _null = [_obj,_dist,_timer,false,0,false,"incVeh"] spawn _delete;
       } else {
           _null = [_obj,_dist,_timer,false,0,false,"inc"] spawn _delete;
       };
   } foreach TBB_Included;

   // gather all dead.
   _allD = allDead;
   {if (_x in TBB_delete_respawned AND _x in _processed) then {_processed = _processed - [_x]}} foreach _allD;
   {
       _unit = _x;
       if (_x in _included) exitWith {};
       if ((vehicle _x) == _x AND !(_x in _processed) AND ({_unit isKindOf _x} count _types) == 0 AND !(_x in TBB_Excluded)) then {
           if (!(_x in _todo)) then {_todo = _todo + [_x]};
       };
   } foreach _allD;

   // gather all vehicles and process depending on options used.
   _allV = vehicles;
   {if (_x in TBB_delete_respawned AND _x in _processed) then {_processed = _processed - [_x]}} foreach _allV;
   {
       _veh = _x;
       if (_x in _included) exitWith {};
       if (_x getVariable ["TBB_delete_readd", false]) then {
           _processed = _processed - [_x];
           _x setVariable ["TBB_delete_readd", false, true];
       };
       if (!(_x in _processed) AND ({_veh isKindOf _x} count _types) == 0 AND !(_x in TBB_Excluded)) then {
           if ((getDammage _x) >= 1 OR (_canMove AND !canMove _x AND ({alive _x} count (crew _x)) == 0) OR (_abandoned AND ({alive _x} count (crew _x)) == 0)) then {
               if (!(_x in _todo)) then {_todo = _todo + [_x]};
           };
       };
   } foreach _allV;

   // run the delete script for todo list.
   {
       if (!(_x in _processed)) then {
           if (_x isKindOf "Man") then {
               _null = [_x,_viewDist,_manTimer,_abandoned,_abaTimer,_canMove] spawn _delete;
           } else {
               _null = [_x,_viewDist,_vehTimer,_abandoned,_abaTimer,_canMove,"veh"] spawn _delete;
           };
           _todo = _todo - [_x]; _processed = _processed + [_x];
       };
   } foreach _todo;

   // delete empty groups.
   if (_groupDel) then {{if ((count (units _x)) == 0) then {deleteGroup _x; _x = grpNull; _x = nil}} foreach allGroups};

   // sleep 10 seconds, then check if there are any changes to dead or vehicles that are not processed.
   sleep 10;
};
 

 



You say this one does the trick, but what in gods name is this? Where am I suppose to put it? How do I attach it? Do I need a macro? Etc etc etc!!! I don't mean to be rude, just upsets me when anybody does not give out everything and only half ass at it.

Share this post


Link to post
Share on other sites
7 hours ago, Booker- said:



You say this one does the trick, but what in gods name is this? Where am I suppose to put it? How do I attach it? Do I need a macro? Etc etc etc!!! I don't mean to be rude, just upsets me when anybody does not give out everything and only half ass at it.

 

Whats the problem? I think u just have to start it from your e.g. InitServer.sqf.

In the first lines of the script there are some options u may set. and they are well described. Just open your eyes and ask questions if you dont understand something.

Nobody knows you and your scripting knowledge. Therefore you have to ask if you need an information.

Share this post


Link to post
Share on other sites
On 4/4/2017 at 0:34 AM, sarogahtyp said:

 

Whats the problem? I think u just have to start it from your e.g. InitServer.sqf.

In the first lines of the script there are some options u may set. and they are well described. Just open your eyes and ask questions if you dont understand something.

Nobody knows you and your scripting knowledge. Therefore you have to ask if you need an information.

I was angry that day and don't remember why. Lol. I will put that into my InitServer.sqf. TY for getting back to me.

Share this post


Link to post
Share on other sites

I wrote this simple little script that I execute on the server through the init.sqf

if(!isServer)exitWith{};

private _baseVs=[
"B_MRAP_01_hmg_F","B_Truck_01_covered_F","B_Heli_Transport_01_F","B_Heli_Transport_03_unarmed_F","B_Heli_Light_01_F","B_MBT_01_TUSK_F","I_APC_tracked_03_cannon_F","B_UAV_02_CAS_F","B_Heli_Light_01_armed_F","B_Plane_CAS_01_F",
"CUP_B_HMMWV_M2_GPK_USA","CUP_RG31_M2","CUP_B_UH60M_US","CUP_B_CH47F_USA","CUP_B_M1A2_TUSK_MG_DES_US_Army","CUP_B_M1126_ICV_M2_Desert_Slat","CUP_B_AH64D_AT_USA","CUP_B_AH6J_ESCORT_USA","CUP_B_MH6J_USA","CUP_B_A10_CAS_USA","CUP_B_USMC_MQ9",
"rhsusf_m1025_d_m2","rhsusf_m1025_d_mk19","RHS_UH60M_d","RHS_CH_47F_light","rhsusf_m1a1aimd_usarmy","RHS_M2A2","RHS_AH64D_CS","RHS_MELB_AH6M_L","RHS_MELB_MH6M","RHS_A10"
];
while{true}do{sleep 300;
{if(count units _x==0)then{deleteGroup _x;};}forEach allGroups;//Empty Groups

{if(typeOf _x in _baseVs)exitWith{};if(!canMove _x &&{alive _x}count crew _x==0)then{deleteVehicle _x;};}forEach vehicles;//Empty Immobile Vehicles

{deleteVehicle _x}forEach allMissionObjects "weaponHolder";};//Items on Ground
	


This suits my needs perfectly.  I use this in tandem with the Vehicle Respawn System on Armaholic, which handles the garbage collection of vehicles I execute the respawn code on (vehicles at base). 

Share this post


Link to post
Share on other sites

We are in 2017. The garbage collector of Eden + some commands for it are just working fine!

Share this post


Link to post
Share on other sites
4 hours ago, pierremgi said:

We are in 2017. The garbage collector of Eden + some commands for it are just working fine!

 

2017 by now? Wow!

Time is running faster than thought ;-)

Share this post


Link to post
Share on other sites
7 hours ago, pierremgi said:

We are in 2017. The garbage collector of Eden + some commands for it are just working fine!

 

Hey @pierremgi, care to share what garbage configurations you use? I prefer setting all in description.ext, or do most ppl prefer setting collection in editor?

Share this post


Link to post
Share on other sites
8 hours ago, pierremgi said:

We are in 2017. The garbage collector of Eden + some commands for it are just working fine!

 

unfortunately the BI remains collector has issues ... it leaves behind weaponholders everywhere, you will need to run another script to handle that and other junk, so you might as well use that script to handle bodies and vehicles as well and turn off the BI one.

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, fn_Quiksilver said:

 

unfortunately the BI remains collector has issues ... it leaves behind weaponholders everywhere, you will need to run another script to handle that and other junk, so you might as well use that script to handle bodies and vehicles as well and turn off the BI one.

No, the weapon holders are rubbed in a second time, few seconds later, but it works even if no vehicle garbage activated. (as these WH are vehicles). I guess that when a corpse disappear, the lone WH starts is own delay (some seconds regardless of corpse/vehicle delays).

 

I'm always using Eden editor attributes/performance settings. Check your delays. Sometimes the last modified in Editor is not correctly saved.

 

A simple MP preview can check that. Seems to work also on SP preview, but after a preview in MP...

Share this post


Link to post
Share on other sites

i'm interested in more info on this...for example aircraft canopy gets deleted too?
backpacks ? groundweaponholder ?
thanks!

Share this post


Link to post
Share on other sites

canopy and ejection seat are abandoned on ground? And it's a shame?

So:

{deleteVehicle _x} forEach entities [["Plane_Canopy_Base_F","Ejection_Seat_Base_F"],[]];

 

But... don't do that when player just ejected and still sat...don't!

Share this post


Link to post
Share on other sites

nice Pierre!
you have a good solution to everything !! thanks man !

Share this post


Link to post
Share on other sites

in your opinion will be good (and will it work?) something like this ?

if (isServer) then {
   while {true} do {
        _ALLgarbage = ["Plane_Canopy_Base_F","Ejection_Seat_Base_F"];
        uiSleep 180;       // give some time so you can actually see a pilot ejecting, and his canopy and ejection seat reach the ground and stay there for some time

        waitUntil {sleep 30;{_ALLgarbage distance2D _x > 1500} count allPlayers > 0};        // wait that players are far to not delete canopy and seat under players eyes

        {deleteVehicle _x} forEach entities [["Plane_Canopy_Base_F","Ejection_Seat_Base_F"],[]];
   };
};

thanks man !

Share this post


Link to post
Share on other sites

think bout this condition:

_ALLgarbage distance2D _x > 1500

what is the content off _ALLgarbage and does ur condition make any sense with that content? this is the question u should look for an answer...

Share this post


Link to post
Share on other sites
Quote

 

canopy and ejection seat are abandoned on ground? And it's a shame?

So:

{deleteVehicle _x} forEach entities [["Plane_Canopy_Base_F","Ejection_Seat_Base_F"],[]];

 

But... don't do that when player just ejected and still sat...don't!

 

 

I am sure they fixed that...at least it was in one of the changelogs. Are you sure the vanilla garbage collector still leaves those?

Share this post


Link to post
Share on other sites
4 hours ago, dlegion said:

in your opinion will be good (and will it work?) something like this ?


have you tried it and checked error log already? 

  • Like 1

Share this post


Link to post
Share on other sites

yep i tried and there are obvious errors...i just dont know how correct them !
@R3vo : yes i'm 100% sure that they are not deleted. every evening with some friends my mission is put on test...and every placed explosive, canopy, ejection-seat, weaponHOlders, "ground", and ruins stay exactly where it is even after 3 hous...

Share this post


Link to post
Share on other sites
8 minutes ago, dlegion said:

yep i tried and there are obvious errors...i just dont know how correct them !

 

best practice is to start with the first error which occurs. often errors are inherrited by other errors, therefore if u fix the first one the list of errors will get much smaller

Share this post


Link to post
Share on other sites
14 minutes ago, dlegion said:

.i just dont know how correct them !


The error messages usually contain all the info you need to locate and fix the error, I suggest you start with that

Share this post


Link to post
Share on other sites

heh...you guys are good teachers for sure....i hoped in a more concrete help...but ok i'll try !
 

Share this post


Link to post
Share on other sites

sorry but u r continuous asking for code which does something but u learn nothing if u just get the code and copy/paste it without consulting the wiki and view how the commands work.

therefore it is best way IMO to shove u on the learning way instead of solving ur scripting problems instantly.

My hope is that u r able to solve ur problems on ur own and be able to help others in the forum in future...

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×