aeroson 8 Posted August 31, 2013 (edited) Sorry. For now, iam no longer willing to support this (no time, no money). Though i will gladly accept any pull requests on github.Summary / info Can delete everything that is not really needed: dead bodies, dropped items, smokes, chemlights, explosives, times and classes can be specified Beware: if weapons on ground is intentional e.g. fancy weapons stack, it will delete them too. Beware: if dead bodies are intentional it will delete them too. Beware: if destroyed vehicles intentional it will delete them too. Uses allMissionObjects "" to iterate over all objects. Adds objects for deletion only if players are specified distance away from them. If you want something to withstand the clean up, paste this into it's init: this setVariable["persistent",true]; License, legal stuffYou are free to use Repetitve Cleanup script as you wish. Though it would be nice of you to put my name into credits (thanks to you who already did)Usage paste into init.sqf [] execVM 'repetitive_cleanup.sqf'; then open repetitive_cleanup.sqf and adjust values in CNFIGURATION section For those struggling with file hierarchydownload repetitive_cleanup.sqfChangelog v2.0 - Almost complete rewrite of the script. Uses different method to iterate over all mission objects. Probably performs better. Can now specify time and which classes to delete in this time. v1.9- Fixed: Mobile vehicles or vehicles with alive crew are now removed from cleanup list CreditsDIS gaming community for testing1MSOB for original ideaWilling to participate ? github.com/aeroson/a3-misc Edited November 8, 2015 by aeroson 1 Share this post Link to post Share on other sites
das attorney 858 Posted August 31, 2013 Thanks for this. Much appreciated. I wrote my own one but your's is soooo much better :) Share this post Link to post Share on other sites
Kushluk 21 Posted September 1, 2013 Thanks a bunch Aeroson. This is just as efficient and simple just like your other great functions (gear, map markers etc) Share this post Link to post Share on other sites
mariodu62 5 Posted September 5, 2013 Hello, backpack are not removed from ground... Share this post Link to post Share on other sites
Kushluk 21 Posted September 6, 2013 Just a warning: In the current 0.77 development build, there are serious performance issues using nearObjects on Altis. Share this post Link to post Share on other sites
aeroson 8 Posted September 9, 2013 I know, i've fixed that by using nearObjects for allUnits only with 100m range, and saving those object into array along with timestamp. Share this post Link to post Share on other sites
Hatchet_AS 201 Posted September 9, 2013 Much appreciated. And as mentioned, much better than my current solution. :) Share this post Link to post Share on other sites
SHARPxSHOOTER 1 Posted September 10, 2013 This is great! Thanks! Share this post Link to post Share on other sites
bruhmis 10 Posted October 8, 2013 I've been trying to add a body cleanup script to a mission I'm making for about 6 hours now. I've tried nearly 20 different scripts and none of them had any effect. I know I'm not doing anything wrong, because most of them just require that you add the script to the init file. I don't understand what's going wrong. I know this one is intended for servers but I figured it would work just as well if I used it for my mission but still, nothing. Share this post Link to post Share on other sites
shuko 59 Posted October 8, 2013 I've been trying to add a body cleanup script to a mission I'm making for about 6 hours now. I've tried nearly 20 different scripts and none of them had any effect. I know I'm not doing anything wrong, because most of them just require that you add the script to the init file. I don't understand what's going wrong. I know this one is intended for servers but I figured it would work just as well if I used it for my mission but still, nothing. Did you try the one I made for Arma 2? It's only for bodies and not for everything like the topic's script. SHK_GraveDigger Share this post Link to post Share on other sites
aeroson 8 Posted October 27, 2013 (edited) I've been trying to add a body cleanup script to a mission I'm making for about 6 hours now. I've tried nearly 20 different scripts and none of them had any effect. I know I'm not doing anything wrong, because most of them just require that you add the script to the init file. I don't understand what's going wrong. I know this one is intended for servers but I figured it would work just as well if I used it for my mission but still, nothing. If none of the 20 scripts worked you might have been doing something wrong. In every game there is a "server", it is merely a computer that is in control of everything. So your computer can be called "server" even if you are running singleplayer. You gotta execute the script in init.sqf. But the script has to be present in your mission folder: Use -showScriptErrors to see the actual error. Edited October 27, 2013 by aeroson Share this post Link to post Share on other sites
meatball 25 Posted November 22, 2013 Anyone know if there is a way to 'protect' items from getting removed with this script? Say for example you have some bodies you don't want to disappear, is there a way to protect them? Share this post Link to post Share on other sites
wok 1 Posted November 22, 2013 Nice code, thanks for releasing it. BTW, the minimum delay is 10 seconds right? Since there's a sleep 10 on the top of the while loop. Share this post Link to post Share on other sites
aeroson 8 Posted November 23, 2013 Updated repetitive_cleanup.sqf v1.8 @Meatball: If you want something to withstand the clean up, paste this into it's init: this setVariable["persistent",true]; @wok: Yes if the delay is 3 seconds the time until removal will be between 3 and 10 seconds. Share this post Link to post Share on other sites
PapaReap 5 Posted November 23, 2013 Thank you, aeroson Nice update to a already great script :) Share this post Link to post Share on other sites
rory_pamphilon 16 Posted December 14, 2013 Hi Aeroson, Firstly, great script, using it in my mission and it works wonders on the carrier. Say I wanted to use this on remote airfields that are purely manned by enemy ai and are unlikely to have a human player within 100m, how would i get it to function at that airfield? CHeers Share this post Link to post Share on other sites
aeroson 8 Posted December 27, 2013 Thank you. It eats items which are 100m from all units. All units include both player and AI. Share this post Link to post Share on other sites
meatball 25 Posted December 29, 2013 Random question on this script that I've been finding. I've got things setup to cleanup immobile vehicles after 15 minutes, but what I've found is if a vehicle gets 'wrecked', but you then repair it, it still gets cleaned up after 15 minutes, regardless of whether you're in it and driving :) There a way to reset the 'immobile' timer every time it's repaired or starts moving again? Share this post Link to post Share on other sites
meatball 25 Posted January 3, 2014 Anyone know how the script figures out what vehicles are immobile (_ttdVehiclesImmobile I think)? I believe that's the root of my issue with vehicles that are immobile and then repaired still get deleted after the immobile vehicle timeout even if they're currently functional. Share this post Link to post Share on other sites
iceman77 18 Posted January 3, 2014 Usually the command for checking mobility of a vehicle is canMove. Share this post Link to post Share on other sites
meatball 25 Posted January 3, 2014 Yeah, I'm digging in the code a little bit and it looks like it parses through every vehicle in game looking to see if it's actually a player or if it can move: if (_ttdVehiclesImmobile>0) then { { if(!isPlayer _x && !canMove _x) then { [_x, _ttdVehiclesImmobile] call _delete; }; } forEach vehicles; }; So, it looks like it looks at every vehicle every so often and if it's immobile/!player it throws it in an array called _objects. I'm just having trouble following the actual deletion of the object. If I can't figure out how to reset the flag on a vehicle once it's repaired, maybe I can at least figure out how to set immobile vehicles to blow up (setdamage 1) after a really short period of time so they're not lying around forever for people to repair. ---------- Post added at 04:03 ---------- Previous post was at 03:56 ---------- Think I'll try that, I'm going to set immobile vehicles to get 'deleted' after a relatively short period of time (120 seconds) and then change the actual delete block in the script to this: { if(isNull(_x)) then { _objects set[_forEachIndex, 0]; _times set[_forEachIndex, 0]; } else { if(_times select _forEachIndex < time) then { if(!isPlayer _x && !canMove _x) then { _x setDamage 1; } else { deleteVehicle _x; }; _objects set[_forEachIndex, 0]; _times set[_forEachIndex, 0]; }; }; } forEach _objects; Assuming I'm doing this right, what should happen is every 2 minutes, any immobile vehicles around blow up. Which hopefully will keep players from finding them. Of course...if they do find them and happen to be in them... <BOOM> Wish I could think of a better way to do it, but it's really goofy when players are driving a repaired vehicle around and then suddenly it disappears out from under them and the drop to the ground. Share this post Link to post Share on other sites
iceman77 18 Posted January 3, 2014 I would simply run a canMove & crew count check after the timer but right before the vehicle is to be deleted. If the vehicle still can't move and has no crew, then delete it. I haven't taken a look at repetitive cleanup, but just throwing some ideas out there. Share this post Link to post Share on other sites
meatball 25 Posted January 3, 2014 (edited) Yeah, I'm finding the setDamage doesn't work well. Often as soon as you wreck a vehicle enough to make canMove true it blows up. I'll test with the crew count. Only downside I can think of doing the crew count is the vehicle will still probably get nuked as soon as everyone gets out. Edited January 3, 2014 by Meatball Share this post Link to post Share on other sites
aeroson 8 Posted January 3, 2014 Updated repetitive_cleanup.sqf v1.9 v1.9 - Fixed: Mobile vehicles or vehicles with alive crew are now removed from cleanup list Thank you all for excellent collaboration and ideas. Share this post Link to post Share on other sites
meatball 25 Posted January 3, 2014 Aeroson, that's awesome, thanks! Really appreciate this awesome script! Quick question, is there any way that it's possible for vehicles that are repaired to be removed from the list awaiting cleanup? That crew check definitely fixes the problem of repaired vehicles disappearing with people in them, but what about a repaired vehicle that you drive somewhere and then get out? Really don't want that to get deleted as soon as everyone hops out either. I also noticed that the 100m check doesn't seem to apply to the vehicle/body checks. That by design? Share this post Link to post Share on other sites